:root {
  --bg: #050816;
  --card: #0b1020;
  --accent: #22c55e;
  --accent-soft: #4ade80;
  --danger: #ef4444;
  --text: #f9fafb;
  --muted: #9ca3af;
  --muted-color: #9ca3af;
  --border: #1f2933;
  --radius: 16px;
}

* { 
  box-sizing: border-box;
  letter-spacing: 0.25px;
}

body.bg {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #111827 0, #020617 55%);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

/* Centered login */
.center-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 18px 16px;
  max-width: 340px;
  width: 100%;
  box-shadow: 0 20px 45px rgba(0,0,0,.6);
}

.login-card h1 { margin: 0 0 6px; }
.login-card input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  font-size: .85rem;
  margin-bottom: 8px;
}

/* App shell */
.app-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

/* Premium header */
.premium-header {
  text-align: center;
  padding: 30px 0 20px 0;
}

.kobra-heading {
  font-size: 2.4rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 4px;
  background: linear-gradient(90deg,
    #00eaff 0%,
    #6dfbff 25%,
    #ffffff 50%,
    #00caff 75%,
    #008cff 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow:
    0 0 12px rgba(0, 212, 255, 0.75),
    0 0 28px rgba(0, 212, 255, 0.55),
    0 0 55px rgba(0, 212, 255, 0.35);
  /* Simplified animation */
  animation: cobraGlow 4s ease-in-out infinite;
}

@keyframes cobraGlow {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 1; }
}

.kobra-heading-wrapper {
  position: relative;
  display: inline-block;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
  position: relative;
}

.topbar::after {
  content:"";
  position:absolute;
  bottom:-2px;
  left:0;
  width:100%;
  height:3px;
  background: linear-gradient(90deg, transparent, #ff3a3a, transparent);
  animation: strikePulse 3.5s ease-in-out infinite;
}

@keyframes strikePulse {
  0%, 100% { opacity:0.2; }
  50% { opacity:1; }
}

.topbar h1 {
  margin: 0;
  font-size: 1.6rem;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 20px;
  margin-bottom: 22px;
}

.stat-item {
  flex: 1;
  padding: 18px;
  background: rgba(20, 20, 30, 0.8);
  border-radius: 14px;
  border: 1px solid rgba(80, 80, 120, 0.4);
  /* Replaced backdrop-filter with solid color for better performance */
  box-shadow: 0 0 12px rgba(0,255,180,0.05);
  text-align: center;
  transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 20px rgba(0,255,180,0.15);
}

.stat-item label {
  font-size: 12px;
  text-transform: uppercase;
  color: #aaa;
}

.stat-item span {
  font-size: 26px;
  font-weight: 600;
  color: #fff;
}

.stat-item.danger {
  background: rgba(60, 0, 0, 0.8);
  border-color: rgba(255, 40, 40, 0.5);
  box-shadow: 0 0 15px rgba(255,0,0,0.15);
}

.stat-item.danger span {
  color: #ff5c5c;
}

/* Missing filter bar */
.missing-bar {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 26px;
}

.pill-btn {
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.25s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

.pill-btn.red {
  background: linear-gradient(145deg, #8b0000, #b30000);
  color: #fff;
  box-shadow: 0 0 10px rgba(255,40,40,0.3);
}

.pill-btn.red:hover {
  box-shadow: 0 0 18px rgba(255,60,60,0.55);
}

.pill-btn.grey {
  background: linear-gradient(145deg, #555, #777);
  color: #fff;
}

.pill-btn.grey:hover {
  box-shadow: 0 0 16px rgba(200,200,200,0.35);
}

.pill-btn.purple {
  background: linear-gradient(145deg, #7d00a6, #a000d6);
  color: #fff;
  box-shadow: 0 0 12px rgba(140,0,210,0.4);
}

.pill-btn.purple:hover {
  box-shadow: 0 0 22px rgba(170,0,255,0.6);
}

/* Action bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.search-input.wide {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 12px;
  background: #111;
  border: 1px solid #333;
  color: #fff;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.search-input.wide:focus {
  border-color: #00ffc8;
  box-shadow: 0 0 12px rgba(0,255,200,0.35);
}

.actions {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

/* Filter row */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

/* Controls */
.controls {
  background: rgba(8,12,24,0.95);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.stat-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  font-size: .78rem;
}

.filter-group, .sort-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.search-input {
  max-width: 320px;
  width: 100%;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  font-size: .85rem;
}

/* Layout */
/* FULL-WIDTH LAYOUT AFTER MOVING AUDIT PANEL */
.layout {
  width: 100%;
  display: block;  /* remove grid splitting */
  padding: 0;
  margin: 0;
}


.layout.single {
  grid-template-columns: minmax(0, 1fr);
}

.cards-panel {
  width: 100%;
}

.cards-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}


.audit-panel {
  background: rgba(8,12,24,0.95);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 10px 10px 6px;
}

.audit-panel h2 {
  margin: 0 0 4px;
}

.audit-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.audit-item {
  border-bottom: 1px solid rgba(148,163,184,.25);
  padding: 4px 0;
}

.audit-item:last-child {
  border-bottom: none;
}

/* Member Cards */
.member-card {
  margin: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #1b1d23;
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}

/* Lightweight glow effect */
.member-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0,255,255,0.08) 0%,
    rgba(0,120,255,0.05) 100%
  );
  pointer-events: none;
}

.card-item {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.card-name {
  font-weight: 600;
  font-size: .95rem;
}

.card-power {
  font-weight: 700;
  font-size: 1.05rem;
  color: #a5b4fc;
}

.card-stars {
  font-size: .85rem;
  letter-spacing: 2px;
}

.card-meta {
  font-size: .75rem;
  color: var(--muted);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag-pill {
  font-size: .65rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--muted);
}

.card-admin-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

/* Circle Member Cards */
.member-circle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 10px;
  margin: 6px 0;
  width: 130px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
  cursor: grab;
}

.member-circle-card:hover {
  background: rgba(255,255,255,0.10);
  transform: translateY(-3px);
}

.member-circle-card.small {
  width: 115px;
  padding: 8px;
  margin: 4px auto;
}

.circle-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle-avatar.small {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.circle-info {
  text-align: center;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.circle-info.small {
  font-size: 11px;
}

.member-name {
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text);
}

.member-sub {
  opacity: 0.7;
  font-size: 11px;
  color: var(--muted);
}

.member-stars {
  color: gold;
  font-size: 12px;
  margin: 1px 0;
}

.member-power {
  font-size: 11px;
  opacity: 0.85;
  color: var(--muted);
}

.member-meta {
  display:flex;
  gap:0.5rem;
  align-items:center;
  font-size:0.85rem;
  color:var(--muted);
}

.power-type-pill {
  padding:2px 6px;
  border-radius:999px;
  font-size:0.75rem;
  background:rgba(0,0,0,0.06);
  border:1px solid rgba(0,0,0,0.06);
}

/* Buttons */
.btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  padding: 6px 12px;
  font-size: .78rem;
  cursor: pointer;
  transition: all 0.25s;
}

.btn.primary {
  background: linear-gradient(135deg, #0099ff, #00ddff);
  border: none;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 0 14px rgba(0,200,255,0.25);
  border-radius: 14px;
  padding: 10px 18px;
}

.btn.primary:hover {
  transform: scale(1.04);
  box-shadow: 0 0 24px rgba(0,200,255,0.55);
}

.btn.small {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
}

.btn.pill {
  padding: 4px 10px;
  background: #181818;
  border: 1px solid #2d2d2d;
  color: #ddd;
}

.btn.pill:hover {
  background: #292929;
  border-color: #00ffc8;
  color: #00ffc8;
  box-shadow: 0 0 10px rgba(0,255,200,0.2);
}

.btn.full {
  width: 100%;
}

.btn:hover {
  background: #111827;
}

/* Sort buttons active state */
.sort-group .sort-btn {
  background: #141414;
  border: 1px solid #2f2f2f;
  color: #ddd;
}

.sort-group .sort-btn.active {
  background: linear-gradient(135deg,#00ffc8,#00b3ff);
  color: #001;
  box-shadow: 0 0 18px rgba(0,200,255,0.18);
  transform: translateY(-2px);
}

.togglePoolBtn,
.circle-remove {
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 11px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
}

.circle-remove {
  background: var(--danger);
}

/* Utility classes */
.muted {
  color: var(--muted);
}

.muted.xsmall { 
  font-size: 0.8rem; 
  color: var(--muted);
}

.small { font-size: .82rem; }
.xsmall { font-size: .72rem; }

.error {
  color: var(--danger);
}

/* Modal */
.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
}

.modal-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 14px 14px 10px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 18px 40px rgba(0,0,0,.7);
}

.modal-box h2 {
  margin: 0 0 6px;
}

.field-label {
  display: block;
  margin-top: 4px;
  margin-bottom: 2px;
  font-size: .75rem;
  color: var(--muted);
}

.modal-box input {
  width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #020617;
  color: var(--text);
  font-size: .8rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .stats-bar {
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .controls-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .action-bar {
    flex-direction: column;
    gap: 12px;
  }
  
  .missing-bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .kobra-heading {
    font-size: 1.8rem;
    letter-spacing: 2px;
  }
}
/* PAGE TITLE */
.brawl-header h1 {
  text-align: center;
  color: #00ffc8;
  font-size: 34px;
  text-shadow: 0 0 12px rgba(0,255,200,0.35);
  margin: 20px 0 30px 0;
}

/* TEAM CARDS WRAPPER */
.teams-container {
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  gap: 30px;
}

/* TEAM CARD */
.team-card {
  flex: 1;
  background: rgba(20, 20, 30, 0.6);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(80,80,120,0.3);
  box-shadow: 0 0 15px rgba(0,255,180,0.08);
  backdrop-filter: blur(8px);
}

/* TITLES */
.team-title {
  text-align: center;
  font-size: 26px;
  color: #00ffc8;
  margin-bottom: 10px;
}
.team-title.teamB {
  color: #00b7ff;
}

.label {
  font-size: 13px;
  color: #ccc;
  margin-top: 10px;
}

.input {
  width: 100%;
  padding: 10px;
  background: #111;
  border: 1px solid #333;
  border-radius: 10px;
  color: #fff;
  margin-bottom: 10px;
}

.power-box {
  margin-top: 10px;
  padding: 12px;
  background: #151515;
  border: 1px solid #333;
  border-radius: 10px;
}

.total-power {
  margin-top: 6px;
  font-size: 18px;
  color: #00ffc8;
  font-weight: bold;
}

.sub-heading {
  margin-top: 20px;
  font-size: 18px;
  color: #fff;
  border-bottom: 1px solid #333;
  padding-bottom: 6px;
}

.player-list {
  margin-top: 10px;
  margin-bottom: 10px;
}

/* BUTTONS */
.btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

.btn.primary {
  background: linear-gradient(135deg, #0099ff, #00ddff);
  color: #fff;
  width: 100%;
  margin-bottom: 14px;
}

.btn.secondary {
  background: linear-gradient(135deg, #444, #666);
  color: #fff;
  width: 100%;
}
#backToAdminBtn {
  margin: 12px 0;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid rgba(0,255,200,0.35);
  background: rgba(5,10,15,0.7);
  color: #00ffc8;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

#backToAdminBtn:hover {
  background: rgba(0,255,200,0.1);
}

#backToAdminBtn {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 9999;
}
.map-spot {
  position: absolute;
  width: 4px;              /* reduced size */
  height: 4px;
  background: rgba(0, 255, 180, 0.75);
  border: 1px solid rgba(0, 255, 180, 0.9);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.map-spot:hover {
  transform: translate(-50%, -50%) scale(1.25);
  background: rgba(0, 255, 180, 1);
}
.player-label {
  position: absolute;
  left: -80px;         /* shift label away from structure */
  color: #8ad7ff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.player-label .player-note {
  display: block;
  font-size: 11px;
  color: #ccc;
}

/* Responsive layout container */
.layout {
  width: 100%;
  display: block; /* important: removes old 2-column layout */
}

/* Cards panel always full width */
.cards-panel {
  width: 100%;
}

/* ================================
   RESPONSIVE CARD GRID SYSTEM
================================ */

/* Default: MOBILE — 1 column */
.cards-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 16px;
}

/* TABLET — 2 columns */
@media (min-width: 600px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* DESKTOP — 4 columns */
@media (min-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.team-switcher {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 16px 0;
}

.switch-btn {
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(0,255,200,0.3);
  color: #00ffc8;
  font-size: 15px;
  transition: 0.2s ease;
}

.switch-btn.active {
  background: rgba(0,255,200,0.15);
  border-color: #00ffc8;
}
.kobra-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.3px;

  color: #eafffb;
  background:
    linear-gradient(180deg, rgba(0,255,200,0.18), rgba(0,255,200,0.05)),
    radial-gradient(circle at top left, rgba(0,255,200,0.25), transparent 60%);
  border: 1px solid rgba(0,255,200,0.35);

  box-shadow:
    0 0 0 1px rgba(0,255,200,0.15) inset,
    0 10px 30px rgba(0,255,200,0.15);

  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}

.kobra-btn-icon {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 6px rgba(0,255,200,0.8));
}

.kobra-btn:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(0,255,200,0.45) inset,
    0 0 18px rgba(0,255,200,0.6),
    0 18px 40px rgba(0,255,200,0.35);
}

.kobra-btn:active {
  transform: scale(0.98);
}
.site-footer {
  background: rgba(10, 16, 24, 0.95);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 14px 10px;
  margin-top: 40px;
}

.footer-inner {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #9fb0b5;
}

.footer-inner nav {
  display: flex;
  gap: 16px;
}

.footer-inner a {
  color: #00ffae;
  text-decoration: none;
  font-weight: 500;
}

.footer-inner a:hover {
  text-decoration: underline;
}

/* Mobile */
@media (max-width: 600px) {
  .footer-inner {
    flex-direction: column;
    gap: 8px;
  }
}
/* =========================
   GLOBAL LAYOUT FIX
========================= */

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

.home {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 20px;
}
/* =========================
   DESKTOP SAFETY OVERRIDE
========================= */

html, body {
  width: 100%;
  min-width: 100%;
}

/* Ensure header never collapses on desktop */
@media (min-width: 768px) {
  .site-header {
    flex-direction: row !important;
    align-items: center;
  }

  .nav {
    flex-wrap: nowrap;
  }
}
