/* ============================================================
   FIFA WORLD CUP 2026 — SCHEDULE
   Apple-Minimal Dark Design System
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:          #000000;
  --bg-card:     #111111;
  --bg-card-h:   #181818;
  --bg-glass:    rgba(17,17,17,0.7);
  --text-1:      #F5F5F7;
  --text-2:      #a1a1a6;
  --text-3:      #555558;
  --gold:        #C9A84C;
  --gold-hi:     #e8c46a;
  --gold-lo:     rgba(201,168,76,0.15);
  --gold-border: rgba(201,168,76,0.3);
  --gold-grad:   linear-gradient(135deg, #C9A84C 0%, #e8c46a 100%);
  --red-live:    #FF3B30;
  --border:      rgba(255,255,255,0.07);
  --border-h:    rgba(255,255,255,0.14);
  --nav-h:       64px;
  --r:           16px;
  --r-sm:        10px;
  --r-pill:      100px;
  --ease:        cubic-bezier(0.4,0,0.2,1);
  --ease-spring: cubic-bezier(0.34,1.56,0.64,1);
  --font-d:      'Cormorant Garamond', serif;
  --font-hero:   'Oswald', sans-serif;
  --font-mono:   'Space Mono', monospace;
  --font-b:      'Inter', sans-serif;
}

.light {
  --bg:          #e5e5ea;
  --bg-card:     #ffffff;
  --bg-card-h:   #f7f7f9;
  --bg-glass:    rgba(240,240,242,0.8);
  --text-1:      #1d1d1f;
  --text-2:      #555;
  --text-3:      #999;
  --border:      rgba(0,0,0,0.07);
  --border-h:    rgba(0,0,0,0.13);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: auto !important;
}

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-b);
  overflow-x: hidden;
  overscroll-behavior-y: auto !important;
  cursor: default;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

a { color: inherit; text-decoration: none; }
button { font-family: var(--font-b); }
img, canvas { display: block; }

/* ── Toast ───────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 2rem));
  background: rgba(28,28,30,0.96);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  color: var(--text-1);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.7rem 1.6rem;
  font-size: 0.875rem;
  white-space: nowrap;
  z-index: 8000;
  transition: transform 0.45s var(--ease-spring);
}
#toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* ── Navigation ─────────────────────────────────────────── */
#main-nav {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top) max(2rem, env(safe-area-inset-right)) 0 max(2rem, env(safe-area-inset-left));
  z-index: 1000;
  transition: background 0.4s var(--ease), backdrop-filter 0.4s;
}

#main-nav.scrolled {
  background: var(--bg-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-d);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: 0.12em;
  color: var(--text-1);
  user-select: none;
}

.trophy { font-size: 1.15rem; }
.gold   { color: var(--gold); }

.nav-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  font-size: 1.1rem;
  color: var(--text-3);
  pointer-events: none;
  line-height: 1;
}

#search-input {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.45rem 1rem 0.45rem 2.2rem;
  color: var(--text-1);
  font-family: var(--font-b);
  font-size: 0.82rem;
  width: 180px;
  outline: none;
  transition: width 0.35s var(--ease),
              border-color 0.25s,
              background 0.25s;
}

#search-input::placeholder { color: var(--text-3); }

#search-input:focus {
  width: 240px;
  border-color: var(--gold);
  background: rgba(201,168,76,0.06);
}

.light #search-input { background: rgba(0,0,0,0.05); }

.nav-btn {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text-1);
  transition: background 0.2s, border-color 0.2s, transform 0.2s var(--ease-spring);
  flex-shrink: 0;
}

.nav-btn:hover {
  background: var(--gold-lo);
  border-color: var(--gold-border);
  transform: scale(1.1);
}

.nav-btn.active {
  background: var(--gold-lo);
  border-color: var(--gold);
  color: var(--gold);
}

.light .nav-btn { background: rgba(0,0,0,0.05); }

body.dark .sun-icon { display: block; }
body.dark .moon-icon { display: none; }
body.light .sun-icon { display: none; }
body.light .moon-icon { display: block; }

/* ── Hero Frame Scrub ────────────────────────────────────── */
#hero-scroll-container {
  height: 500vh;
  position: relative;
}

#hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: default;
}

/* Loading overlay */
#loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 2.5rem;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}
#loading-overlay.hidden { opacity: 0; }

#loading-bar-track {
  width: 180px;
  height: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}

#loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--gold), var(--gold-hi));
  border-radius: 2px;
  transition: width 0.15s;
}

#loading-text {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

/* Hero overlay text */
#hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
  pointer-events: none;
  padding: var(--nav-h) 1rem 0;
  opacity: 0;
}

.hero-eyebrow {
  font-family: var(--font-b);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.55em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

#hero-title {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: clamp(5rem, 19vw, 17rem);
  line-height: 0.88;
  color: #fff;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 80px rgba(0,0,0,0.9);
}

.hero-sub {
  font-family: var(--font-b);
  font-size: clamp(0.6rem, 1.4vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.35em;
  color: var(--gold);
  text-transform: uppercase;
  margin-top: 1.2rem;
}

.hero-dates {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.2em;
  margin-top: 0.45rem;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll hint */
#scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  z-index: 15;
  opacity: 0;
  transition: opacity 0.6s;
  pointer-events: none;
}
#scroll-hint.show { opacity: 1; }

.scroll-label {
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

.chevron-bounce {
  font-size: 1.4rem;
  color: var(--gold);
  animation: bounce 2.2s ease-in-out infinite;
  line-height: 1;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(9px); }
}

/* ── Next Match Section ─────────────────────────────────── */
#next-match-section {
  background: var(--bg);
  padding: 5rem 0 4rem;
  position: relative;
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

#next-match-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent 0%,
    var(--gold) 30%,
    var(--gold) 70%,
    transparent 100%);
  opacity: 0.5;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.45em;
  color: var(--gold);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

/* Next match card */
#next-match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 3rem 2.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

#next-match-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%,
    rgba(201,168,76,0.06), transparent);
  pointer-events: none;
}

.no-match-text {
  color: var(--text-3);
  font-size: 0.9rem;
  text-align: center;
  grid-column: 1 / -1;
  padding: 2rem;
}

.nxt-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.nxt-team:last-child { align-items: center; }

.nxt-flag { font-size: 3.8rem; line-height: 1; }

.nxt-name {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  letter-spacing: 0.08em;
  color: var(--text-1);
  text-align: center;
}

/* Center block */
.nxt-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  min-width: 220px;
}

.nxt-badge {
  display: inline-block;
  border: 1px solid var(--gold-border);
  color: var(--gold);
  border-radius: var(--r-pill);
  padding: 0.2rem 0.9rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nxt-vs {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.3em;
  color: var(--text-3);
}

/* Countdown */
.countdown-grid {
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
}

.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.cd-num {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--gold);
  line-height: 1;
  min-width: 2.4ch;
  text-align: center;
}

.cd-label {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
}

.cd-sep {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 2rem;
  color: var(--text-3);
  line-height: 1;
  align-self: start;
  margin-top: 0.15rem;
}

.nxt-time {
  font-size: 0.78rem;
  color: var(--text-2);
  letter-spacing: 0.1em;
  text-align: center;
}

.nxt-venue {
  font-size: 0.72rem;
  color: var(--text-3);
  text-align: center;
  line-height: 1.5;
}

/* ── Schedule Section ───────────────────────────────────── */
#schedule-section {
  padding: 5rem 0 8rem;
  background: var(--bg);
  content-visibility: auto;
  contain-intrinsic-size: auto 1200px;
}

.schedule-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.92;
  letter-spacing: 0.03em;
  color: var(--text-1);
  margin-bottom: 0.5rem;
}

.section-sub {
  font-size: 0.82rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
}

.schedule-stats {
  display: flex;
  gap: 2rem;
  flex-shrink: 0;
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 2.5rem;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* Date tabs */
#date-tabs-wrapper {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  background: var(--bg);
  padding: 0.75rem 0;
  margin: 0 -2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

#date-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
  padding-inline: 2rem;
}

#date-tabs::-webkit-scrollbar { display: none; }

.date-tab {
  flex-shrink: 0;
  padding: 0.35rem 0.9rem;
  min-height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  font-family: var(--font-b);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  outline: none;
}

.date-tab:hover { border-color: var(--gold-border); color: var(--gold); }

.date-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
  font-weight: 500;
}

/* Group / Stage filter */
#group-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 1rem 0 1.5rem;
}

.grp-tab {
  padding: 0.28rem 0.75rem;
  min-height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  font-family: var(--font-b);
  font-size: 0.73rem;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  outline: none;
}

.grp-tab:hover { border-color: var(--gold-border); color: var(--gold); }

.grp-tab.active {
  background: var(--gold-lo);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 500;
}

/* Day section */
.day-block  { margin-bottom: 3.5rem; }

.day-header {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  color: var(--text-3);
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.day-count {
  font-family: var(--font-b);
  font-size: 0.7rem;
  color: var(--text-3);
  background: rgba(255,255,255,0.05);
  border-radius: var(--r-pill);
  padding: 0.15rem 0.55rem;
  letter-spacing: 0.05em;
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1rem;
}

/* Match card */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.4rem 1.4rem 1.2rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  will-change: transform, opacity;
  /* Entry animation */
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s var(--ease),
              transform 0.45s var(--ease),
              border-color 0.25s,
              background 0.25s,
              box-shadow 0.25s;
}

.match-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.match-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  background: linear-gradient(135deg,
    rgba(201,168,76,0.04) 0%,
    transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.match-card:hover {
  border-color: var(--border-h);
  background: var(--bg-card-h);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}

.match-card:hover::after { opacity: 1; }

.match-card.is-fav { border-color: var(--gold-border); }

/* Card top row */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.grp-pill {
  font-size: 0.63rem;
  letter-spacing: 0.15em;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-pill);
  padding: 0.15rem 0.6rem;
  text-transform: uppercase;
  flex-shrink: 0;
}

.fav-btn {
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  line-height: 1;
  color: var(--text-3);
  transition: transform 0.25s var(--ease-spring), color 0.2s;
  padding: 0.1rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-btn:hover           { transform: scale(1.25); color: var(--text-2); }
.fav-btn.on              { color: var(--gold); }

/* Teams row */
.card-teams {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.c-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.c-flag { font-size: 2rem; line-height: 1; }

.c-name {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-1);
  text-align: center;
  line-height: 1.25;
}

.c-vs {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-3);
  letter-spacing: 0.2em;
  flex-shrink: 0;
}

/* Card bottom */
.card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  gap: 0.5rem;
}

.card-time-block { flex-shrink: 0; }

.card-ist {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--text-1);
  letter-spacing: 0.05em;
  line-height: 1;
}

.card-venue {
  font-size: 0.7rem;
  color: var(--text-3);
  text-align: right;
  line-height: 1.45;
  max-width: 180px;
}

.card-venue strong { color: var(--text-2); }

/* Status badges */
.badge {
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: var(--r-pill);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  margin-top: 0.3rem;
}

.badge-live {
  background: rgba(255,59,48,0.12);
  color: var(--red-live);
  border: 1px solid rgba(255,59,48,0.25);
}

.badge-live::before {
  content: '';
  width: 5px; height: 5px;
  background: var(--red-live);
  border-radius: 50%;
  animation: livepulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes livepulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.badge-ft {
  background: rgba(255,255,255,0.04);
  color: var(--text-3);
  border: 1px solid var(--border);
}

.badge-cd {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-2);
  background: none;
  border: none;
  padding: 0;
  letter-spacing: 0.12em;
  margin-top: 0.2rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  color: var(--text-3);
  padding: 5rem 1rem;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

/* ── Footer ─────────────────────────────────────────────── */
#main-footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}

.footer-trophy {
  font-size: 1rem;
  color: var(--text-2);
  margin-bottom: 0.4rem;
}

.footer-note {
  font-size: 0.75rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  line-height: 1.7;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  #next-match-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 2rem 1.5rem;
    gap: 1.5rem;
  }
  .nxt-team:first-child,
  .nxt-team:last-child { flex-direction: row; justify-content: center; gap: 1rem; }
  .nxt-center { min-width: unset; }
}

@media (max-width: 640px) {
  :root { --nav-h: 56px; }
  #main-nav { padding: env(safe-area-inset-top) max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left)); }
  .container { padding: 0 1rem; }
  #date-tabs-wrapper { margin-inline: -1rem; padding-inline: 0; }
  #date-tabs { padding-inline: 1rem; }
  .view-toggle-wrapper { margin-inline: -1rem; padding-inline: 1rem; }
  .view-toggle { margin: 0; }
  .schedule-header { flex-direction: column; align-items: flex-start; }
  .schedule-stats { gap: 1.5rem; }
  .cards-grid { grid-template-columns: 1fr; }
  #search-input { width: 100px; font-size: 0.75rem; padding-left: 1.8rem; }
  #search-input:focus { width: 140px; }
  .nav-actions { gap: 0.25rem; }
  #hero-title { font-size: clamp(4.5rem, 22vw, 8rem); }
  .section-title { font-size: clamp(2.5rem, 10vw, 4rem); }
  #tournament-progress { 
    justify-content: flex-start; 
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch; 
    padding-left: 1rem; 
    padding-right: 1rem; 
  }
  .tp-stage { scroll-snap-align: center; }
}

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .chevron-bounce { animation: none; }

  .match-card {
    opacity: 1;
    transform: none;
    transition: border-color 0.2s, background 0.2s;
  }

  .badge-live::before { animation: none; }
}

/* ── Confetti Canvas ─────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7000;
  width: 100%;
  height: 100%;
}

/* ── Prime Time Badge ────────────────────────────────────── */
.badge-prime {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, rgba(201,168,76,0.18), rgba(232,196,106,0.08));
  border: 1px solid var(--gold-border);
  color: var(--gold-hi);
  border-radius: var(--r-pill);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  margin-left: 0.4rem;
  vertical-align: middle;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Match Detail Modal ──────────────────────────────────── */
#match-modal,
#notification-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#match-modal[hidden],
#notification-modal[hidden] { display: none; }

#modal-backdrop,
#notif-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(8px) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  animation: fadein 0.25s var(--ease);
}

#modal-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: calc(var(--r) * 1.5);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-border) transparent;
  animation: modalIn 0.35s var(--ease-spring);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,168,76,0.06);
}

@keyframes fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

#modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-spring);
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

#modal-close:hover,
#notif-modal-close:hover {
  background: rgba(255,59,48,0.15);
  color: #FF3B30;
  transform: scale(1.1) rotate(90deg);
}

/* Notification Modal Specific */
.notif-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-h);
  border-radius: calc(var(--r) * 1.5);
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  animation: modalIn 0.35s var(--ease-spring);
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,168,76,0.06);
}

#notif-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}

.notif-title {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--text-1);
  margin-bottom: 0.5rem;
}

.notif-desc {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.notif-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#notif-email-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-1);
  font-family: inherit;
  font-size: 16px; /* 16px explicitly prevents iOS Safari from zooming in */
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

#notif-email-input:focus {
  border-color: var(--gold);
}

#notif-submit-btn {
  padding: 12px;
  border-radius: 8px;
  border: none;
  background: var(--gold);
  color: #000;
  font-family: var(--font-b);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s;
}

#notif-submit-btn:hover {
  transform: translateY(-2px);
  background: var(--gold-hi);
}

.notif-msg {
  margin-top: 1rem;
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2em;
}

.notif-msg.error { color: #FF3B30; }
.notif-msg.success { color: #34C759; }

/* Modal content layout */
.modal-hero {
  position: relative;
  height: 180px;
  overflow: hidden;
  border-radius: calc(var(--r) * 1.5) calc(var(--r) * 1.5) 0 0;
  background: #0a0a0a;
}

.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  filter: saturate(0.7);
}

.modal-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 30%, var(--bg-card) 100%);
}

.modal-hero-badge {
  position: absolute;
  top: 1rem;
  left: 1.4rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.modal-body {
  padding: 1.5rem 1.8rem 2rem;
}

.modal-stage-pill {
  display: inline-block;
  border: 1px solid var(--gold-border);
  color: var(--gold);
  border-radius: var(--r-pill);
  padding: 0.2rem 0.85rem;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

.modal-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.modal-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.modal-flag { font-size: 3.2rem; line-height: 1; }

.modal-team-name {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 0.07em;
  color: var(--text-1);
  text-align: center;
  line-height: 1.1;
}

.modal-vs {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: 0.25em;
  color: var(--text-3);
}

.modal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.modal-detail-item {
  background: var(--bg-card);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.modal-detail-item:hover { background: var(--bg-card-h); }

.modal-detail-label {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
  text-transform: uppercase;
}

.modal-detail-value {
  font-size: 0.9rem;
  color: var(--text-1);
  font-weight: 500;
  line-height: 1.3;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-fav-btn {
  flex: 1;
  padding: 0.75rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--gold-border);
  background: var(--gold-lo);
  color: var(--gold);
  font-family: var(--font-b);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.modal-fav-btn:hover {
  background: rgba(201,168,76,0.25);
  transform: translateY(-1px);
}

.modal-fav-btn.gold-gradient {
  background: var(--gold-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.flag-img {
  width: 1em;
  height: auto;
  max-height: 1em;
  object-fit: contain;
  border-radius: 4px;
  vertical-align: middle;
}

.modal-fav-btn.on {
  background: var(--gold);
  color: #000;
  border-color: var(--gold);
}

.modal-countdown {
  text-align: center;
  padding: 1rem;
  background: rgba(201,168,76,0.05);
  border-radius: var(--r-sm);
  border: 1px solid var(--gold-border);
  margin-bottom: 1.5rem;
}

.modal-cd-label {
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.modal-cd-value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 2rem;
  color: var(--text-1);
  letter-spacing: 0.08em;
}

/* ── Tournament Progress ─────────────────────────────────── */
#progress-section {
  padding: 2rem 0;
  background: var(--bg);
  position: relative;
}

#progress-section::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right,
    transparent, var(--border) 20%, var(--border) 80%, transparent);
}

#tournament-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0.5rem 0;
}

#tournament-progress::-webkit-scrollbar { display: none; }

.tp-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  position: relative;
  padding: 0.2rem 0.6rem;
  transition: transform 0.2s var(--ease-spring);
  flex-shrink: 0;
}

.tp-stage:hover { transform: translateY(-2px); }

.tp-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.3s var(--ease);
  color: var(--text-3);
}

.tp-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
  white-space: nowrap;
}

.tp-line {
  flex: 1;
  min-width: 24px;
  max-width: 60px;
  height: 2px;
  background: var(--border);
  margin-bottom: 1.4rem;
  transition: background 0.3s var(--ease);
  flex-shrink: 1;
}

.tp-stage.active .tp-dot {
  background: var(--gold-lo);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201,168,76,0.35);
}

.tp-stage.active .tp-label { color: var(--gold); font-weight: 500; }

.tp-stage.done .tp-dot {
  background: rgba(201,168,76,0.3);
  border-color: var(--gold);
}

.tp-stage.done .tp-label { color: var(--gold-hi); }

.tp-stage.done + .tp-line { background: rgba(201,168,76,0.35); }

/* ── Next-Match stadium background ──────────────────────── */
#next-match-card {
  position: relative;
}

.nxt-stadium-bg {
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  overflow: hidden;
  pointer-events: none;
}

.nxt-stadium-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.07;
  filter: saturate(0.4) blur(1px);
  transition: opacity 0.5s var(--ease);
}

#next-match-card:hover .nxt-stadium-bg img { opacity: 0.11; }

/* ── Match card clickable hint ───────────────────────────── */
.card-expand-hint {
  position: absolute;
  bottom: 0.6rem;
  right: 0.75rem;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--text-3);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.match-card:hover .card-expand-hint { opacity: 1; }

/* ── IST prime time indicator on day header ──────────────── */
.ist-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-b);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-pill);
  padding: 0.15rem 0.5rem;
  vertical-align: middle;
  margin-left: 0.35rem;
}

/* ── Stats counter animation ─────────────────────────────── */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.stat-num { animation: countUp 0.6s var(--ease) both; }

/* ── Back to Top ─────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-hi));
  color: #000;
  border: none;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  z-index: 3000;
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  transition: opacity 0.35s var(--ease),
              transform 0.35s var(--ease-spring),
              box-shadow 0.25s;
  box-shadow: 0 4px 20px rgba(201,168,76,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

#back-to-top:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 28px rgba(201,168,76,0.5);
}

/* ── Keyboard Shortcut Hints ─────────────────────────────── */
#kbd-hints {
  position: fixed;
  bottom: 1.8rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  display: flex;
  gap: 1rem;
  align-items: center;
  background: rgba(17,17,17,0.88);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.45rem 1.2rem;
  z-index: 2500;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}

#kbd-hints.visible { opacity: 1; }

.kbd-hint {
  font-size: 0.68rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

kbd {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-b);
  font-size: 0.62rem;
  color: var(--text-2);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.light #kbd-hints { background: rgba(240,240,242,0.9); }
.light kbd {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.15);
}

/* ── Mobile modal & responsive final touches ─────────────── */
@media (max-width: 640px) {
  #modal-panel {
    max-height: 95vh;
    border-radius: var(--r) var(--r) 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
  }

  #match-modal {
    align-items: flex-end;
    padding: 0;
  }

  @keyframes modalIn {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .modal-hero { height: 140px; }
  .modal-body { padding: 1.2rem 1.2rem 1.6rem; }
  .modal-matchup { gap: 0.6rem; }
  .modal-flag { font-size: 2.4rem; }
  .modal-team-name { font-size: 1.1rem; }
  .modal-details { grid-template-columns: 1fr 1fr; }

  .card-expand-hint { display: none; }

  #back-to-top { bottom: 1.2rem; right: 1rem; }
  #kbd-hints { display: none; }
}

/* ── Light mode modal ────────────────────────────────────── */
.light #modal-panel {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
}

.light .modal-detail-item { background: #fff; }
.light .modal-detail-item:hover { background: #f7f7f9; }

/* View Toggle */
.view-toggle-wrapper {
  display: flex;
  margin-bottom: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.view-toggle-wrapper::-webkit-scrollbar { display: none; }
.view-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 30px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: max-content;
  margin: 0 auto;
}
.view-btn {
  background: transparent;
  border: none;
  color: #888;
  padding: 8px 24px;
  border-radius: 26px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}
.view-btn:hover {
  color: #fff;
}
.view-btn.active {
  background: var(--gold-grad);
  color: #000;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(230, 185, 128, 0.3);
}

/* Standings Grid */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}
.standings-group {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.sg-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  font-weight: 500;
  color: var(--gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.sg-table th {
  text-align: center;
  padding: 8px 4px;
  color: #888;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sg-table th.team-col {
  text-align: left;
  padding-left: 16px;
}
.sg-table td {
  text-align: center;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #ddd;
}
.sg-table tr:last-child td {
  border-bottom: none;
}
.sg-table td.team-col {
  text-align: left;
  padding-left: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-weight: 500;
}
.sg-table .qualify-row td {
  background: rgba(230, 185, 128, 0.05);
}
.sg-table .qualify-row td:first-child {
  border-left: 3px solid var(--gold);
}

/* Knockout Bracket */
.bracket-scroll-wrapper {
  overflow-x: auto;
  padding-bottom: 2rem;
  -webkit-overflow-scrolling: touch;
}
.bracket-layout {
  display: flex;
  gap: 40px;
  min-width: max-content;
  padding: 20px;
}
.bracket-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 20px;
  width: 260px;
}
.bracket-round-title {
  text-align: center;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.bracket-match {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  position: relative;
  backdrop-filter: blur(5px);
  transition: transform 0.2s;
}
.bracket-match:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}
.bm-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px;
  font-size: 0.85rem;
}
.bm-team.winner {
  font-weight: 500;
  color: #fff;
}
.bm-team.loser {
  color: #777;
}
.bm-team-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bm-score {
  font-weight: 500;
  font-family: 'Space Mono', monospace;
}
.bm-date {
  font-size: 0.7rem;
  color: #888;
  text-align: center;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 4px;
}

/* ── Watch Live View ────────────────────────────────────── */
.watch-live-header {
  text-align: center;
  margin-bottom: 2.5rem;
  margin-top: 1rem;
}

.watch-live-title {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.05em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.watch-live-desc {
  font-size: 0.9rem;
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.broadcasters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
}

.broadcaster-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s var(--ease);
}

.broadcaster-card:hover {
  border-color: var(--gold-border);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.card-badge {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  font-size: 0.6rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: var(--r-pill);
  letter-spacing: 0.1em;
}

.free-badge {
  background: rgba(78,205,196,0.12);
  color: #4ECDC4;
  border: 1px solid rgba(78,205,196,0.25);
}

.paid-badge {
  background: rgba(201,168,76,0.15);
  color: var(--gold-hi);
  border: 1px solid var(--gold-border);
}

.b-name {
  font-family: var(--font-hero);
  font-weight: 600;
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 0.03em;
  margin-bottom: 0.25rem;
  margin-top: 0.5rem;
}

.b-region {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 1rem;
}

.b-desc {
  font-size: 0.82rem;
  color: var(--text-3);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.watch-now-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  color: var(--text-1);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  padding: 0.55rem 1rem;
  transition: all 0.2s var(--ease);
}

.broadcaster-card.free .watch-now-btn:hover {
  background: rgba(78,205,196,0.1);
  border-color: #4ECDC4;
  color: #4ECDC4;
}

.broadcaster-card.paid .watch-now-btn:hover {
  background: var(--gold-lo);
  border-color: var(--gold);
  color: var(--gold);
}

/* ── Fan Chat View ──────────────────────────────────────── */
.chat-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  height: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

@media (max-width: 768px) {
  .chat-container {
    grid-template-columns: minmax(0, 1fr);
    height: 700px;
  }
  .chat-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .chat-input-area {
    padding: 0.75rem 1rem;
  }
}

.chat-sidebar {
  padding: 1.5rem;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: rgba(0,0,0,0.1);
}

.chat-lbl {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  display: block;
  margin-bottom: 0.5rem;
}

.username-edit-wrapper {
  display: flex;
  gap: 0.5rem;
}

#chat-username-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.45rem 0.75rem;
  color: var(--text-1);
  font-size: 0.8rem;
  flex: 1;
  min-width: 0;
  outline: none;
}

#chat-username-input:focus {
  border-color: var(--gold);
}

#save-username-btn {
  background: var(--gold-grad);
  border: none;
  color: #000;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.8rem;
}

#save-username-btn:hover {
  transform: translateY(-1px);
}

.chat-status-panel {
  border: 1px solid rgba(201,168,76,0.15);
  background: rgba(201,168,76,0.03);
  padding: 1rem;
  border-radius: var(--r-sm);
}

.chat-status-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gold-hi);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#chat-match-status-desc {
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.4;
}

.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-messages-box {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-border) transparent;
  max-height: 420px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  align-self: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-sm);
}

.chat-msg.mine {
  align-self: flex-end;
  background: rgba(0,255,136,0.1);
  border-color: rgba(0,255,136,0.2);
}

.chat-flag {
  display: inline-block !important;
  width: 18px;
  height: 13px;
  margin-left: 6px;
  margin-right: 0;
  vertical-align: baseline;
  border-radius: 2px;
  object-fit: cover;
}

.chat-msg.system-warning {
  align-self: center;
  background: rgba(255, 60, 60, 0.1);
  border: 1px solid rgba(255, 60, 60, 0.3);
  text-align: center;
}

.chat-msg.system-warning .system-text {
  color: #ff6b6b;
  font-weight: 500;
  font-size: 0.85rem;
}

.chat-msg.bot {
  align-self: center;
  background: rgba(201,168,76,0.05);
  border: 1px solid rgba(201,168,76,0.2);
  border-left: 4px solid var(--gold);
  max-width: 90%;
  width: 100%;
}

.chat-msg-sender {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--gold-hi);
  margin-bottom: 0.2rem;
}

.chat-msg.mine .chat-msg-sender {
  color: var(--gold);
}

.chat-msg-text {
  font-size: 0.82rem;
  color: var(--text-1);
  word-break: break-word;
}

.chat-system-msg {
  font-size: 0.75rem;
  color: var(--text-3);
  text-align: center;
  align-self: center;
  background: rgba(0,0,0,0.2);
  padding: 0.3rem 0.8rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
}

.chat-input-area {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}

#chat-msg-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 0.55rem 1.2rem;
  color: var(--text-1);
  font-size: 0.85rem;
  outline: none;
  min-width: 0;
}

#chat-msg-input:focus {
  border-color: var(--gold);
  background: rgba(255,255,255,0.08);
}

#chat-msg-input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

#send-chat-btn {
  background: var(--gold-grad);
  border: none;
  color: #000;
  font-weight: 500;
  padding: 0 1.5rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.2s;
}

#send-chat-btn:hover:not(:disabled) {
  transform: scale(1.03);
}

#send-chat-btn:disabled {
  background: var(--border);
  color: var(--text-3);
  cursor: not-allowed;
  transform: none;
}

/* Simulation toggle button in Chat sidebar */
.sim-chat-btn {
  display: none; /* Hidden by default for dev-only access */
  background: transparent;
  border: 1px dashed var(--gold-border);
  color: var(--gold-hi);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.5rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  margin-top: auto;
}

.sim-chat-btn:hover {
  background: var(--gold-lo);
  border-color: var(--gold);
}

/* ── Sync Console View ──────────────────────────────────────── */
.sync-dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.sync-header h3 {
  font-family: var(--font-b);
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  color: var(--gold-hi);
  margin-bottom: 0.3rem;
}

.sync-header p {
  font-size: 0.85rem;
  color: var(--text-2);
}

.sync-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.sync-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.25rem;
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: border-color 0.2s var(--ease);
}

.sync-stat-card:hover {
  border-color: rgba(201,168,76,0.3);
}

.ssc-title {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.ssc-val {
  font-family: var(--font-b);
  font-size: 1.8rem;
  color: var(--text-1);
}

.sync-main-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .sync-main-layout {
    grid-template-columns: 1fr;
  }
}

.sync-controls-panel, .sync-logs-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sync-controls-panel h4, .sync-logs-panel h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gold-hi);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.6rem;
  margin: 0;
}

.panel-subtitle {
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: -0.8rem;
}

.api-control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  transition: all 0.2s var(--ease);
}

.api-control-row:hover {
  background: rgba(255,255,255,0.04);
}

.api-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.api-info strong {
  font-size: 0.85rem;
  color: var(--text-1);
}

.api-badge {
  font-size: 0.55rem;
  font-weight: 500;
  padding: 0.15rem 0.4rem;
  border-radius: var(--r-pill);
  width: fit-content;
  letter-spacing: 0.05em;
}

.primary-badge {
  background: rgba(201,168,76,0.15);
  color: var(--gold-hi);
  border: 1px solid rgba(201,168,76,0.3);
}

.secondary-badge {
  background: rgba(78,205,196,0.15);
  color: #4ECDC4;
  border: 1px solid rgba(78,205,196,0.3);
}

.backup-badge {
  background: rgba(255,107,107,0.15);
  color: #FF6B6B;
  border: 1px solid rgba(255,107,107,0.3);
}

.api-confidence {
  font-size: 0.7rem;
  color: var(--text-3);
}

.toggle-api-btn {
  border: none;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.toggle-api-btn.active-state {
  background: rgba(46,204,113,0.15);
  color: #2ecc71;
  border: 1px solid rgba(46,204,113,0.3);
}

.toggle-api-btn.disabled-state {
  background: rgba(231,76,60,0.15);
  color: #e74c3c;
  border: 1px solid rgba(231,76,60,0.3);
}

.toggle-api-btn:hover {
  transform: translateY(-1px);
}

.sync-actions-row {
  margin-top: auto;
  padding-top: 0.5rem;
}

.sync-now-btn {
  width: 100%;
  background: var(--gold-grad);
  border: none;
  color: #000;
  font-weight: 500;
  padding: 0.65rem 1rem;
  border-radius: var(--r-pill);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s var(--ease);
}

.sync-now-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,168,76,0.25);
}

.sync-now-btn:active {
  transform: translateY(0);
}

.logs-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-border) transparent;
  padding-right: 0.5rem;
}

.log-entry {
  background: rgba(0,0,0,0.15);
  border: 1px solid var(--border);
  padding: 0.65rem 0.85rem;
  border-radius: var(--r-sm);
  font-family: monospace;
  font-size: 0.72rem;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.log-entry.log-success {
  border-left: 3px solid #2ecc71;
}

.log-entry.log-partial_success {
  border-left: 3px solid #f1c40f;
}

.log-entry.log-failure {
  border-left: 3px solid #e74c3c;
}

.log-entry.system-log {
  border-left: 3px solid var(--border);
  color: var(--text-3);
  text-align: center;
  justify-content: center;
  padding: 2rem;
}

.log-time {
  color: var(--text-3);
  font-size: 0.65rem;
  font-weight: 500;
}

.log-summary {
  font-weight: 500;
  color: var(--text-1);
}

.log-details {
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
}


/* ── Locations Section — Premium FIFA 2026 Host Nation Experience ── */
#locations-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000;
}

/* ── Location Page Container ── */
.location-page {
  width: 100%;
  position: relative;
  overflow: hidden;
  line-height: 0; /* collapse inline-block gap */
}

/* ── Scene Wrapper (handles mouse parallax + scroll zoom) ── */
.loc-scene {
  position: relative;
  width: 100%;
  will-change: transform;
}

/* ── Base Image ── */
.loc-img {
  width: 100%;
  height: auto;
  display: block;
  transform-origin: center center;
  /* scroll zoom handled via JS: scale(1) → scale(1.05) */
  transition: transform 0.1s linear;
  will-change: transform;
}

/* ── Ambient Glow behind artwork ── */
.loc-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  animation: locAmbientPulse 8s ease-in-out infinite;
}

#loc-usa-ambient {
  background: radial-gradient(ellipse 55% 50% at 50% 50%,
    rgba(30, 80, 200, 0.12) 0%,
    transparent 70%);
}

#loc-canada-ambient {
  background: radial-gradient(ellipse 55% 50% at 50% 50%,
    rgba(210, 30, 50, 0.12) 0%,
    transparent 70%);
}

#loc-mexico-ambient {
  background: radial-gradient(ellipse 55% 50% at 50% 50%,
    rgba(30, 160, 40, 0.12) 0%,
    transparent 70%);
}

@keyframes locAmbientPulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1;   }
}

/* ── Overlay (sits above image) ── */
.loc-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  padding: clamp(1.5rem, 4vw, 4rem) clamp(1.5rem, 4.5vw, 5rem);
  /* Reset line-height: 0 inherited from .location-page so overlay text renders correctly */
  line-height: normal;
}

/* ── TOP LEFT — Host Nation + Title + Subtitle ── */
.loc-top-left {
  position: absolute;
  top: clamp(1.5rem, 4vw, 4rem);
  left: clamp(1.5rem, 4.5vw, 5rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  max-width: 30%;
}

.loc-label {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: clamp(0.55rem, 1.1vw, 0.8rem);
  letter-spacing: 0.35em;
  color: rgba(255, 255, 255, 0.85);
  text-transform: uppercase;
  /* entrance animation state */
  opacity: 0;
  transition: opacity 0.6s ease;
  margin-bottom: clamp(0.3rem, 0.8vw, 0.7rem);
}

.loc-title {
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.88;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 80px rgba(255, 255, 255, 0.15),
    0 4px 40px rgba(0, 0, 0, 0.5);
  /* entrance animation state */
  opacity: 0;
  filter: blur(15px);
  transform: translateY(50px);
  transition:
    opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1),
    filter  1.2s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  margin-bottom: clamp(0.4rem, 1vw, 0.9rem);
}

.loc-subtitle {
  font-family: var(--font-b);
  font-weight: 400;
  font-size: clamp(0.6rem, 1.3vw, 0.95rem);
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  /* entrance animation state */
  opacity: 0;
  transition: opacity 0.8s ease;
}

/* ── BOTTOM RIGHT — FIFA info panel ── */
.loc-bottom-right {
  position: absolute;
  bottom: clamp(1.5rem, 4vw, 4rem);
  right: clamp(1.5rem, 4.5vw, 5rem);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: clamp(0.8rem, 1.8vw, 1.6rem);
  pointer-events: auto;
}

.loc-info-block {
  text-align: right;
  /* entrance animation — slide from right */
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.loc-info-heading {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: clamp(0.62rem, 1.2vw, 0.9rem);
  letter-spacing: 0.25em;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  display: block;
}

.loc-info-label {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: clamp(0.5rem, 0.9vw, 0.72rem);
  letter-spacing: 0.3em;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.35em;
}

/* Cities list */
.loc-cities-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1em;
}

.loc-city {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: clamp(0.7rem, 1.3vw, 1rem);
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.08em;
  cursor: default;
  transition:
    color 0.3s ease,
    letter-spacing 0.3s ease;
}

.loc-city:hover {
  color: #ffffff;
  letter-spacing: 0.14em;
}

/* Match counter */
.loc-match-count {
  font-family: var(--font-b);
  font-weight: 500;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  color: #ffffff;
  line-height: 1;
  display: block;
  text-align: right;
  letter-spacing: -0.01em;
}

/* ── Animation: REVEALED state (JS adds .loc-revealed to .location-page) ── */

/* Label: fade in */
.location-page.loc-revealed .loc-label {
  opacity: 1;
}

/* Title: blur + translateY resolved, delayed 0.1s */
.location-page.loc-revealed .loc-title {
  opacity: 1;
  filter: blur(0px);
  transform: translateY(0px);
  transition-delay: 0.1s;
}

/* Subtitle: fade in after title */
.location-page.loc-revealed .loc-subtitle {
  opacity: 1;
  transition-delay: 0.5s;
}

/* Right info blocks staggered */
.location-page.loc-revealed .loc-info-block:nth-child(3) { /* HOST CITIES */
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.2s;
}

.location-page.loc-revealed .loc-info-block:nth-child(2) { /* MATCHES */
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.4s;
}

.location-page.loc-revealed .loc-info-block:nth-child(1) { /* FIFA WC 2026 */
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.6s;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .loc-title {
    filter: none;
    transform: none;
    transition: opacity 0.4s ease;
  }
  .loc-info-block,
  .loc-label,
  .loc-subtitle {
    transition: opacity 0.4s ease;
    transform: none;
  }
  .loc-ambient { animation: none; }
  .loc-img     { transition: none; }
}

/* ── Mobile Adjustments ── */
@media (max-width: 640px) {
  .loc-img {
    height: 480px;
    object-fit: cover;
    object-position: center;
  }
  .loc-overlay {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .loc-top-left {
    position: relative;
    top: auto; left: auto;
    max-width: 90%;
  }
  .loc-bottom-right {
    position: relative;
    bottom: auto; right: auto;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1.25rem;
    border-radius: 16px;
    width: 100%;
    margin-top: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
  }
  .loc-info-block { text-align: left; }
  .loc-cities-list  { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .loc-match-count  { text-align: left; }
  .loc-info-heading,
  .loc-info-label   { text-align: left; }
  .loc-city         { text-align: left; font-size: 0.8rem; border: 1px solid rgba(255,255,255,0.2); padding: 0.2rem 0.6rem; border-radius: 20px;}
}

/* ── Apple-Inspired Premium Hero Typography ── */
#hero-typography {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 5vw;
  z-index: 10;
  pointer-events: none;
  font-family: 'Neue Montreal', 'SF Pro Display', 'Inter Tight', 'Helvetica Now', sans-serif;
  overflow: hidden;
}

/* Gradient metallic text */
.hero-fifa, .hero-wc, .hero-2026 {
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 25%, #d9d9d9 60%, #bdbdbd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 0.85;
}

.hero-left, .hero-right {
  display: flex;
  flex-direction: column;
}

.hero-left {
  text-align: left;
}

.hero-right {
  text-align: right;
  justify-content: center;
}

.hero-fifa {
  font-weight: 900;
  letter-spacing: -0.05em;
  font-size: clamp(5rem, 12vw, 15rem);
}

.hero-wc {
  font-weight: 300;
  letter-spacing: 0.18em;
  font-size: clamp(2.5rem, 6vw, 7.5rem);
  margin-top: 0.5rem;
  line-height: 1;
}

.hero-2026 {
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: clamp(7rem, 16vw, 20rem);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #hero-typography {
    flex-direction: column;
    justify-content: space-between;
    padding: 15vh 2rem 10vh;
  }
  .hero-left {
    align-self: flex-start;
  }
  .hero-right {
    align-self: flex-end;
  }
}
