@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Dark theme (default) ───────────────────────── */
:root {
  --bg-base:       #070b14;
  --bg-surface:    #0d1526;
  --bg-card:       #111827;
  --bg-card-hover: #161f32;
  --border:        rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.15);
  --gold:          #f5c842;
  --gold-dim:      rgba(245,200,66,0.15);
  --red:           #e84040;
  --red-dim:       rgba(232,64,64,0.15);
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --nav-bg:        rgba(7,11,20,0.88);
  --shadow:        0 12px 40px rgba(0,0,0,0.45);
  --input-bg:      rgba(255,255,255,0.06);
}

/* ── Light theme ────────────────────────────────── */
[data-theme="light"] {
  --bg-base:       #f0f4fa;
  --bg-surface:    #e4eaf4;
  --bg-card:       #ffffff;
  --bg-card-hover: #f7f9fc;
  --border:        rgba(0,0,0,0.08);
  --border-bright: rgba(0,0,0,0.18);
  --gold:          #b45309;
  --gold-dim:      rgba(180,83,9,0.1);
  --red:           #dc2626;
  --red-dim:       rgba(220,38,38,0.1);
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --nav-bg:        rgba(240,244,250,0.92);
  --shadow:        0 8px 30px rgba(0,0,0,0.12);
  --input-bg:      rgba(0,0,0,0.04);
}

/* ── Base ───────────────────────────────────────── */
html { scroll-behavior: auto; overflow-x: hidden; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(128,128,128,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128,128,128,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -1;
}

/* ── Aurora Background ──────────────────────────── */
.aurora-root {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}
.aurora-inner {
  position: absolute;
  inset: -10px;
  background-image:
    repeating-linear-gradient(100deg, #000 0%, #000 7%, transparent 10%, transparent 12%, #000 16%),
    repeating-linear-gradient(100deg, #3b82f6 10%, #a5b4fc 15%, #93c5fd 20%, #ddd6fe 25%, #60a5fa 30%);
  background-size: 300% 300%, 200% 200%;
  background-position: 50% 50%, 50% 50%;
  filter: blur(10px);
  opacity: 0.4;
  will-change: background-position;
  -webkit-mask-image: radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%);
  mask-image: radial-gradient(ellipse at 100% 0%, black 10%, transparent 70%);
  animation: auroraAnim 60s linear infinite;
}
.aurora-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(100deg, #000 0%, #000 7%, transparent 10%, transparent 12%, #000 16%),
    repeating-linear-gradient(100deg, #3b82f6 10%, #a5b4fc 15%, #93c5fd 20%, #ddd6fe 25%, #60a5fa 30%);
  background-size: 200% 100%;
  background-attachment: fixed;
  mix-blend-mode: difference;
  animation: auroraAnim 60s linear infinite;
}
@keyframes auroraAnim {
  from { background-position: 50% 50%, 50% 50%; }
  to   { background-position: 350% 50%, 350% 50%; }
}
[data-theme="light"] .aurora-inner {
  filter: blur(10px) invert(1);
  opacity: 0.35;
}
[data-theme="light"] .aurora-inner::after {
  filter: invert(1);
}

/* ── Navigation ─────────────────────────────────── */
nav {
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav > a.logo {
  justify-self: start;
}

nav ul {
  justify-content: center;
}

.nav-right {
  justify-self: end;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  nav {
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
  }
}

.logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo span { color: var(--gold); }

nav ul {
  list-style: none;
  display: flex;
  gap: 0.15rem;
  align-items: center;
  flex-wrap: nowrap;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}
nav a:hover  { color: var(--text-primary); background: var(--input-bg); }
nav a.active { color: var(--text-primary); background: var(--border); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.clerk-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.auth-nav-btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.45rem 0.65rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.auth-nav-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.auth-nav-btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #111827;
}

.auth-nav-btn.primary:hover {
  filter: brightness(1.05);
}

.clerk-auth.signed-in .auth-nav-btn,
.clerk-auth.signed-out #userButton {
  display: none;
}

#userButton {
  display: flex;
  align-items: center;
}

/* Theme toggle */
.theme-btn {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: var(--text-primary);
  flex-shrink: 0;
}
.theme-btn:hover { background: var(--border); }

/* Hamburger */
.hamburger {
  display: none;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* ── Shared pop-up keyframes ─────────────────────── */
@keyframes backdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalSpringIn {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
@keyframes mobileMenuIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.82); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1);    }
}
@keyframes calPopIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)     scale(1);    }
}

/* ── Mobile Nav Modal ────────────────────────────── */
.mobile-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  pointer-events: none;
}

.mobile-menu-backdrop.open {
  display: block;
  pointer-events: auto;
  animation: backdropIn 0.25s ease forwards;
}

.mobile-menu-modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 2rem;
  width: 90%;
  max-width: 300px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.mobile-menu-modal.open {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  pointer-events: auto;
  animation: mobileMenuIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.mobile-menu-modal a {
  padding: 1rem;
  text-align: center;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
  background: var(--input-bg);
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
}

.mobile-menu-modal a:hover,
.mobile-menu-modal a.active {
  background: var(--gold);
  color: #0a0a0a;
}

@media (max-width: 700px) {
  nav {
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0 0.75rem;
  }

  .logo {
    font-size: clamp(0.9rem, 4.2vw, 1.05rem);
    gap: 0.25rem;
    min-width: 0;
  }

  .logo-tail {
    display: none;
  }

  .nav-right {
    gap: 0.35rem;
    margin-left: auto;
  }

  .clerk-auth {
    gap: 0.3rem;
  }

  .auth-nav-btn {
    border-radius: 8px;
    font-size: clamp(0.62rem, 2.8vw, 0.72rem);
    padding: 0.4rem 0.5rem;
  }

  .theme-btn,
  .hamburger {
    width: 34px;
    height: 34px;
  }

  .hamburger { display: flex; }

  nav ul {
    display: none;
  }
}

@media (max-width: 420px) {
  nav {
    padding: 0 0.55rem;
  }

  .logo {
    font-size: 0.9rem;
  }

  .nav-right {
    gap: 0.25rem;
  }

  .auth-nav-btn {
    padding: 0.36rem 0.42rem;
  }

  .theme-btn,
  .hamburger {
    width: 32px;
    height: 32px;
  }
}

/* ── Container ──────────────────────────────────── */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  position: relative;
  z-index: 1;
}

/* ── Hero ───────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 4.5rem 1.5rem 3.5rem;
  position: relative;
  margin-bottom: 2.5rem;
}


.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold-dim);
  border: 1px solid rgba(245,200,66,0.3);
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--gold) 0%, #ffaa00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-flags { font-size: 2rem; letter-spacing: 0.4rem; margin-bottom: 2rem; }

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  background: var(--gold);
  color: #0a0a0a;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.btn:hover { background: #ffe066; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,200,66,0.3); }

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
}
.btn-outline:hover { background: var(--input-bg); transform: translateY(-2px); box-shadow: none; }

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
}

/* ── Stats ──────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 3.5rem;
  border: 1px solid var(--border);
}
.stat-card {
  background: var(--bg-card);
  padding: 1.75rem 1rem;
  text-align: center;
  transition: background 0.2s;
}
.stat-card:hover { background: var(--bg-card-hover); }
.stat-number {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── Section Header ─────────────────────────────── */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-title { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; }
.section-sub { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.2rem; }

/* ── Game Card ──────────────────────────────────── */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  transition: all 0.25s;
}
.game-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.game-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.game-type {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(232,64,64,0.2);
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.game-type.knockout,
.game-type.final {
  background: var(--gold-dim);
  color: var(--gold);
  border-color: rgba(245,200,66,0.25);
}

.game-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.team { display: flex; align-items: center; gap: 0.6rem; }
.team:last-child { justify-content: flex-end; flex-direction: row-reverse; }
.team-flag { font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1; }
.team-name { font-size: clamp(0.82rem, 2.5vw, 1rem); font-weight: 700; letter-spacing: -0.01em; }

.vs {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--input-bg);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.game-footer {
  display: flex;
  gap: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.detail { display: flex; align-items: center; gap: 0.35rem; }

/* ── Games Container ────────────────────────────── */
.games-container { display: grid; grid-template-columns: 1fr; gap: 0.85rem; }

/* ── Filters ────────────────────────────────────── */
.filters {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-input,
.filter-select {
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.filter-input { flex: 1; min-width: 200px; }
.filter-input:focus, .filter-select:focus {
  border-color: rgba(245,200,66,0.4);
  box-shadow: 0 0 0 3px rgba(245,200,66,0.08);
}
.filter-input::placeholder { color: var(--text-muted); }
.filter-select option { background: var(--bg-surface); color: var(--text-primary); }

/* Date button */
.date-btn {
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.date-btn:hover, .date-btn.active { border-color: var(--gold); color: var(--gold); }

/* ── Calendar Popup ─────────────────────────────── */
.cal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
}
.cal-backdrop.open {
  display: flex;
  animation: backdropIn 0.2s ease forwards;
}
.cal-backdrop.open .cal-popup {
  animation: calPopIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.cal-popup {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  padding: 1.5rem;
  width: 320px;
  max-width: 95vw;
  box-shadow: var(--shadow);
}

.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.cal-title { font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.cal-nav {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.2s;
}
.cal-nav:hover { background: var(--border); color: var(--text-primary); }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 0.5rem;
}
.cal-weekday {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0;
}

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: default;
  color: var(--text-muted);
  gap: 2px;
  position: relative;
  transition: all 0.15s;
}
.cal-day.empty { background: none; }
.cal-day.has-game {
  color: var(--text-primary);
  background: var(--input-bg);
  cursor: pointer;
  font-weight: 600;
}
.cal-day.has-game:hover { background: var(--gold-dim); color: var(--gold); }
.cal-day.selected { background: var(--gold) !important; color: #0a0a0a !important; font-weight: 800; }

.cal-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
}
.cal-day.selected .cal-dot { background: #0a0a0a; }

.cal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.cal-clear {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s;
}
.cal-clear:hover { color: var(--red); }

/* ── Info Grid ──────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  transition: background 0.2s;
}
.info-card:hover { background: var(--bg-card-hover); }
.info-icon { font-size: 1.6rem; margin-bottom: 0.75rem; }
.info-title { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.info-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }

/* ── No Results ─────────────────────────────────── */
#noResults {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  display: none;
}

/* ── Leaflet ────────────────────────────────────── */
.leaflet-container { font-family: 'Inter', sans-serif !important; }

[data-theme="dark"] .leaflet-tile {
  filter: brightness(0.88) saturate(0.7) !important;
}

.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-bright) !important;
}
.leaflet-control-zoom a:hover { background: var(--bg-card-hover) !important; }

.leaflet-popup-content-wrapper {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-bright);
  border-radius: 12px !important;
  box-shadow: var(--shadow) !important;
  color: var(--text-primary) !important;
  min-width: 250px;
}
.leaflet-popup-tip { background: var(--bg-surface) !important; }
.leaflet-popup-content { margin: 14px 16px !important; }
.leaflet-popup-close-button { color: var(--text-muted) !important; }

.popup-stadium-name { font-size:0.95rem; font-weight:800; color:var(--gold); margin-bottom:0.3rem; }
.popup-city { font-size:0.78rem; color:var(--text-secondary); margin-bottom:0.75rem; }
.popup-stats { display:flex; gap:1rem; padding:0.6rem 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); margin-bottom:0.75rem; }
.popup-stat { flex:1; text-align:center; }
.popup-stat-num { font-size:1rem; font-weight:800; color:var(--text-primary); }
.popup-stat-label { font-size:0.65rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; }
.popup-games-title { font-size:0.68rem; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-muted); margin-bottom:0.5rem; }
.popup-game { background:var(--input-bg); border-radius:7px; padding:0.45rem 0.6rem; margin-bottom:0.4rem; }
.popup-game-date { font-size:0.68rem; color:var(--gold); font-weight:600; margin-bottom:0.2rem; }
.popup-game-teams { font-size:0.8rem; color:var(--text-primary); font-weight:500; }
.popup-more { font-size:0.72rem; color:var(--text-muted); text-align:center; padding-top:0.35rem; }

/* Marker animations */
@keyframes pulse {
  0%   { transform: scale(1); opacity: 1; }
  70%  { transform: scale(2.5); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}
.marker-pin {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  position: relative;
  cursor: pointer;
}
.marker-pin::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: pulse 2.2s ease-out infinite;
}
.marker-usa { background:rgba(232,64,64,0.88); border:2px solid #ff6b6b; box-shadow:0 0 14px rgba(232,64,64,0.55); }
.marker-usa::after { background:rgba(232,64,64,0.35); }
.marker-mex { background:rgba(34,197,94,0.88); border:2px solid #4ade80; box-shadow:0 0 14px rgba(34,197,94,0.55); }
.marker-mex::after { background:rgba(34,197,94,0.35); }
.marker-can { background:rgba(245,200,66,0.88); border:2px solid #fde047; box-shadow:0 0 14px rgba(245,200,66,0.55); }
.marker-can::after { background:rgba(245,200,66,0.35); }

/* ── Stadium Grid ───────────────────────────────── */
.stadium-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(270px,1fr)); gap:1rem; margin-top:1.5rem; }
.stadium-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  cursor: pointer;
  transition: all 0.25s;
}
.stadium-card:hover { background:var(--bg-card-hover); border-color:rgba(245,200,66,0.35); transform:translateY(-3px); box-shadow:0 0 30px var(--gold-dim); }
.stadium-card-name { font-size:0.95rem; font-weight:700; letter-spacing:-0.02em; margin-bottom:0.35rem; }
.stadium-card-city { font-size:0.8rem; color:var(--text-secondary); margin-bottom:1rem; }
.stadium-card-meta { display:flex; gap:1rem; }
.stadium-meta-item { flex:1; }
.stadium-meta-label { font-size:0.65rem; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-muted); margin-bottom:0.2rem; }
.stadium-meta-value { font-size:0.9rem; font-weight:700; color:var(--gold); }

/* ── Map Legend ─────────────────────────────────── */
.map-legend { display:flex; gap:1.5rem; margin-top:1rem; flex-wrap:wrap; }
.legend-item { display:flex; align-items:center; gap:0.5rem; font-size:0.8rem; color:var(--text-secondary); }
.legend-dot { width:10px; height:10px; border-radius:50%; }

/* ── Calendar Page ──────────────────────────────── */
.cal-page-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  margin-top: 1.5rem;
}
@media (max-width: 900px) { .cal-page-grid { grid-template-columns: 1fr; } }

.cal-page-filters {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.game-select-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s;
  cursor: pointer;
}
.game-select-card:hover { border-color: var(--gold); background: var(--bg-card-hover); }
.game-select-card.selected { border-color: var(--gold); background: var(--gold-dim); }

.game-checkbox {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-bright);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  font-size: 0.7rem;
}
.game-select-card.selected .game-checkbox {
  background: var(--gold);
  border-color: var(--gold);
  color: #0a0a0a;
}

.game-select-info { flex: 1; min-width: 0; }
.game-select-teams { font-size: 0.9rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-select-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.2rem; }

.cal-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}
.cal-summary-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}
.cal-summary-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.cal-count { font-size: 2.5rem; font-weight: 900; color: var(--gold); letter-spacing: -0.04em; }
.cal-count-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1.5rem; }
.cal-actions { display: flex; flex-direction: column; gap: 0.65rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Teams Page ─────────────────────────────────── */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}
.team-card:hover { background: var(--bg-card-hover); border-color: var(--border-bright); transform: translateY(-3px); box-shadow: var(--shadow); }
.team-card-flag { font-size: 2.8rem; margin-bottom: 0.75rem; line-height: 1; }
.team-card-name { font-size: 0.88rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 0.4rem; }
.team-card-group {
  display: inline-block;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  border: 1px solid rgba(245,200,66,0.2);
}

/* API Panel */
.api-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.api-panel-text h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.3rem; }
.api-panel-text p { font-size: 0.8rem; color: var(--text-secondary); }
.api-input-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.api-key-input {
  padding: 0.55rem 0.9rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  width: 240px;
  max-width: 100%;
  transition: border-color 0.2s;
}
.api-key-input:focus { border-color: var(--gold); }
.api-status { font-size: 0.78rem; color: var(--text-muted); }
.api-status.ok { color: #22c55e; }
.api-status.err { color: var(--red); }

/* Squad Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open {
  display: flex;
  animation: backdropIn 0.2s ease forwards;
}
.modal-backdrop.open .modal {
  animation: modalSpringIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.75rem 0;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.03em; display: flex; align-items: center; gap: 0.5rem; }
.modal-close {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--red-dim); color: var(--red); }
.modal-body { padding: 1.5rem 1.75rem; }

/* Player table */
.player-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.player-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 0 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.player-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}
.player-table tr:last-child td { border-bottom: none; }
.player-table tr:hover td { background: var(--input-bg); }
.pos-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pos-gk  { background: rgba(245,200,66,0.15); color: var(--gold); }
.pos-def { background: rgba(34,197,94,0.15);  color: #22c55e; }
.pos-mid { background: rgba(59,130,246,0.15); color: #60a5fa; }
.pos-fwd { background: rgba(232,64,64,0.15);  color: var(--red); }

.team-games-section { margin-top: 1.5rem; }
.team-games-title { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 1rem; }

/* ── Countdown ──────────────────────────────────── */
.countdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  margin-bottom: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.countdown::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 50%, var(--gold-dim) 0%, transparent 70%);
  pointer-events: none;
}
.countdown-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.countdown-units {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  max-width: 600px;
  margin: 0 auto;
}
.countdown-unit {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  text-align: center;
  min-width: 0;
}
.countdown-num {
  font-size: clamp(1.6rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown-unit-label {
  font-size: clamp(0.55rem, 1.5vw, 0.65rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0.4rem;
  white-space: nowrap;
}
.countdown-sep {
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--text-muted);
  padding-bottom: 1.2rem;
  text-align: center;
}
.countdown-started {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gold);
}

/* ── Demo Calendar ──────────────────────────────── */
.demo-cal-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.demo-cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.demo-cal-month-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.demo-cal-nav-btns { display: flex; gap: 0.4rem; }
.demo-cal-nav {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: all 0.2s;
}
.demo-cal-nav:hover { background: var(--border); color: var(--text-primary); }

.demo-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.demo-cal-weekday {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.4rem 0;
}

.demo-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.demo-cal-cell {
  min-height: 80px;
  background: var(--bg-base);
  border-radius: 8px;
  padding: 0.4rem 0.35rem;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color 0.2s;
}
.demo-cal-cell.has-games { border-color: rgba(245,200,66,0.15); }
.demo-cal-cell.has-games:hover { border-color: rgba(245,200,66,0.35); }
.demo-cal-cell.empty { background: transparent; border-color: transparent; }
.demo-cal-day-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.demo-cal-cell.has-games .demo-cal-day-num { color: var(--text-secondary); }
.demo-cal-cell.today .demo-cal-day-num {
  color: var(--gold);
  font-weight: 800;
}

.game-chip {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--input-bg);
  border-radius: 4px;
  padding: 0.2rem 0.3rem;
  margin-bottom: 2px;
  font-size: 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  transition: background 0.15s;
  line-height: 1.2;
  color: var(--text-primary);
}
.game-chip:hover { background: var(--border); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.game-chip.chip-group { border-left: 2px solid var(--text-muted); }
.game-chip.chip-knockout { border-left: 2px solid var(--gold); background: var(--gold-dim); color: var(--gold); }
.game-chip.chip-final { border-left: 2px solid var(--red); background: var(--red-dim); color: var(--red); }

.chip-more {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.1rem 0.3rem;
  cursor: pointer;
  text-decoration: underline;
}
.chip-more:hover { color: var(--gold); }

@media (max-width: 700px) {
  .demo-cal-cell { min-height: 54px; padding: 0.3rem 0.2rem; }
  .demo-cal-day-num { font-size: 0.62rem; }
  .game-chip { font-size: 0.52rem; padding: 0.15rem 0.2rem; }
  .chip-more { font-size: 0.5rem; }
}

/* ── Footer ─────────────────────────────────────── */
footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 1.75rem 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}
.footer-inner { max-width: 1300px; margin: 0 auto; }
footer p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }
footer a { color: var(--gold); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(245,200,66,0.4); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 1.25rem 0.9rem 2.5rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .game-match { gap: 0.4rem; }
  .game-footer { gap: 0.75rem; font-size: 0.75rem; }
  .info-grid { grid-template-columns: 1fr; }
  .stadium-grid { grid-template-columns: 1fr; }
  .teams-grid { grid-template-columns: repeat(2, 1fr); }
  .api-panel { flex-direction: column; align-items: flex-start; }
  .modal-header { padding: 1.25rem 1.25rem 0.75rem; }
  .modal-body { padding: 1.25rem; }
  .player-table th, .player-table td { padding: 0.5rem 0.5rem; }
}
