/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --bg:             #050a14;
  --bg-deep:        #020609;
  --surface:        #0d1b2a;
  --surface-raised: #122338;
  --border:         #1e3a5f;
  --border-light:   #2a5280;

  --accent-usa:     #4a90d9;
  --accent-mex:     #27ae60;
  --accent-can:     #e74c3c;
  --accent-gold:    #f0c040;

  --text-primary:   #e8f4fd;
  --text-muted:     #7fb3d3;
  --text-dim:       #4a7a9b;

  --glow:           #4a90d9;
  --glow-soft:      rgba(74, 144, 217, 0.15);

  --panel-width:    50vw;
  --nav-height:     56px;

  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Rajdhani', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

a {
  color: var(--accent-usa);
  text-decoration: none;
}

.mono {
  font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
}

/* ============================================================
   Loading Screen
   ============================================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.6s var(--ease-out-cubic), visibility 0.6s;
}

#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px;
}

.loading-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.loading-trophy {
  font-size: 48px;
  filter: drop-shadow(0 0 24px rgba(240, 192, 64, 0.6));
  animation: trophy-pulse 2s ease-in-out infinite;
}

@keyframes trophy-pulse {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(240, 192, 64, 0.6)); }
  50%       { filter: drop-shadow(0 0 40px rgba(240, 192, 64, 0.9)); }
}

.loading-logo h1 {
  font-size: clamp(20px, 4vw, 28px);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.loading-bar-track {
  width: min(320px, 80vw);
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-usa), var(--accent-gold));
  border-radius: 2px;
  transition: width 0.3s var(--ease-out-cubic);
  box-shadow: 0 0 8px rgba(74, 144, 217, 0.6);
}

.loading-label {
  color: var(--text-muted);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============================================================
   Navigation
   ============================================================ */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-trophy {
  font-size: 20px;
}

.nav-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--glow-soft);
}

.nav-link.active {
  color: var(--accent-usa);
}

.nav-credit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #0a1628;
  background: #00c2ff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}

.nav-credit:hover {
  background: #00aadd;
  transform: translateY(-1px);
}

.about-credit {
  margin-top: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.about-credit-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  white-space: nowrap;
}

.portfolio-link {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: #0a1628;
  background: #00c2ff;
  text-decoration: none;
  padding: 8px 20px;
  border-radius: 4px;
  transition: background 0.2s, transform 0.15s;
}

.portfolio-link:hover {
  background: #00aadd;
  transform: translateY(-1px);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  min-height: 100vh;
}

.section-header {
  text-align: center;
  padding: 80px 24px 40px;
}

.section-header h2 {
  font-size: clamp(28px, 5vw, 48px);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.section-sub {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 0.04em;
  margin-top: 8px;
}

/* ============================================================
   Globe Section
   ============================================================ */
.section--globe {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #0a1628 0%, var(--bg-deep) 70%);
}

#globe-container {
  position: absolute;
  inset: 0;
  transition: transform 0.35s var(--ease-out-cubic);
}

#globe-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Globe UI overlays */
.globe-ui {
  position: relative;
  z-index: 10;
  pointer-events: none;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 32px 40px;
}

.globe-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  opacity: 1;
  transition: opacity 0.6s;
}

.globe-hint.hidden {
  opacity: 0;
}

.hint-icon {
  font-size: 16px;
  animation: spin-slow 4s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.globe-stats {
  display: flex;
  gap: 32px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1;
  text-shadow: 0 0 20px rgba(74, 144, 217, 0.4);
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================================
   Tooltip
   ============================================================ */
.tooltip {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -120%);
  white-space: nowrap;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  transition: opacity 0.15s;
}

.tooltip.hidden {
  opacity: 0;
  visibility: hidden;
}

.tooltip-name {
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.tooltip-city {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   Detail Panel
   ============================================================ */
.detail-panel {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  bottom: 0;
  width: var(--panel-width);
  min-width: 460px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 90;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out-cubic);
  display: flex;
  flex-direction: column;
}

/* Shift globe into the visible left half when panel is open */
body.panel-is-open #globe-container {
  transform: translateX(-25vw);
}

.detail-panel--open {
  transform: translateX(0);
}

.panel-close {
  position: sticky;
  top: 0;
  right: 0;
  align-self: flex-end;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 16px 20px;
  line-height: 1;
  z-index: 1;
  transition: color 0.2s;
}

.panel-close:hover {
  color: var(--text-primary);
}

.panel-content {
  padding: 0 24px 32px;
  flex: 1;
}

/* ============================================================
   Detail Panel — content styles
   ============================================================ */

/* Visuals row: wireframe + photo side by side */
.panel-visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

/* Photo sits alongside the wireframe, same height */
.panel-photo-wrap {
  height: 220px;
  border-radius: 8px;
  overflow: hidden;
  background: #070d1a;
}

.panel-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}

.panel-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.special-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
  margin-right: 6px;
}

.special-badge--opening {
  background: rgba(74, 144, 217, 0.12);
  border: 1px solid rgba(74, 144, 217, 0.4);
  color: #4a90d9;
}

.special-badge--final {
  background: rgba(240, 192, 64, 0.12);
  border: 1px solid rgba(240, 192, 64, 0.5);
  color: #f0c040;
}

.match-card--opening {
  border-color: rgba(74, 144, 217, 0.3);
}

.panel-country-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.panel-stadium-name {
  font-size: clamp(20px, 4vw, 26px);
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 4px;
}

.panel-location {
  font-size: 13px;
  color: var(--text-muted);
}

/* Stats grid — 3 columns in the wider panel */
.panel-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.pstat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.pstat-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.pstat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
}

.pstat-sep {
  color: var(--text-dim);
}

.pstat-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2px;
}

.cap-bar-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.cap-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s var(--ease-out-cubic);
}

/* Fact box */
.panel-fact {
  background: rgba(74, 144, 217, 0.06);
  border: 1px solid rgba(74, 144, 217, 0.2);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.fact-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Stage badges */
.panel-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.stage-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--c, #888);
  color: var(--c, #888);
  background: transparent;
}

/* Match list */
.panel-matches {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.match-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.match-cards-grid .match-card {
  margin-bottom: 0;
}

.matches-heading {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.matches-count {
  background: var(--border);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
}

.no-matches {
  font-size: 13px;
  color: var(--text-dim);
}

.match-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.match-card:hover {
  border-color: var(--border-light);
}

.match-card--final {
  border-color: rgba(240, 192, 64, 0.4);
  background: rgba(240, 192, 64, 0.04);
}

.match-card--highlighted {
  border-color: #f0c040 !important;
  background: rgba(240, 192, 64, 0.12) !important;
  box-shadow: 0 0 0 1px rgba(240, 192, 64, 0.35), 0 2px 12px rgba(240, 192, 64, 0.15);
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.match-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  flex-wrap: wrap;
}

.match-stage {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.match-date {
  color: var(--text-muted);
}

.match-times {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-left: auto;
  flex-shrink: 0;
}

.match-time {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

.match-time--local {
  color: var(--text-muted);
  font-size: 11px;
}

.match-time--et {
  font-size: 10px;
  opacity: 0.6;
}

.match-teams {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.match-vs {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}

.match-score {
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-gold);
}

.match-score--live {
  color: #4caf50;
}

.match-score-live {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: #e53935;
  padding: 1px 5px;
  border-radius: 3px;
  vertical-align: middle;
  margin-right: 4px;
  animation: pulse-live 1.4s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ============================================================
   Timeline Section
   ============================================================ */
.section--timeline {
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* ── Filter bar ── */
.tl-filters {
  position: sticky;
  top: 56px; /* below the nav bar */
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(8px);
}

.tl-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tl-filter-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 36px;
}

.tl-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tl-filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.tl-filter-btn:hover {
  border-color: var(--stage-c, var(--accent-usa));
  color: var(--stage-c, var(--accent-usa));
}

.tl-filter-btn--active {
  background: color-mix(in srgb, var(--stage-c, var(--accent-usa)) 18%, transparent);
  border-color: var(--stage-c, var(--accent-usa));
  color: var(--stage-c, var(--accent-usa));
}

/* Search */
.tl-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  flex: 1;
  max-width: 320px;
  transition: border-color 0.15s;
}

.tl-search-wrap:focus-within {
  border-color: var(--accent-usa);
}

.tl-search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.tl-search {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  width: 100%;
}

.tl-search::placeholder {
  color: var(--text-dim);
}

.tl-match-count {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Content area ── */
.tl-content {
  padding: 32px 32px 64px;
  max-width: 1400px;
  margin: 0 auto;
}

.tl-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 80px 24px;
}

/* ── Highlight blocks (most recent result + next fixture) ── */
.tl-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 48px;
}

.tl-hl-card {
  border-radius: 12px;
  padding: 24px 28px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}

.tl-hl-card:hover {
  transform: translateY(-2px);
}

.tl-hl-card--recent {
  background: rgba(240,192,64,0.06);
  border: 1px solid rgba(240,192,64,0.3);
  border-left: 4px solid var(--accent-gold);
}

.tl-hl-card--next {
  background: rgba(74,144,217,0.06);
  border: 1px solid rgba(74,144,217,0.3);
  border-left: 4px solid var(--accent-usa);
}

.tl-hl-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.tl-hl-card--recent .tl-hl-label { color: var(--accent-gold); }
.tl-hl-card--next   .tl-hl-label { color: var(--accent-usa); }

.tl-hl-teams {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tl-hl-team {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.tl-hl-vs {
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.tl-hl-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 36px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  line-height: 1;
}

.tl-hl-kickoff {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
}

.tl-hl-date {
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.tl-hl-time {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-usa);
  line-height: 1.1;
}

.tl-hl-venue-time {
  font-size: 12px;
  color: var(--text-muted);
}

.tl-hl-venue {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .tl-highlights {
    grid-template-columns: 1fr;
  }
  .tl-hl-team { font-size: 18px; }
  .tl-hl-score { font-size: 28px; }
}

/* ── Day groups ── */
.tl-day-group {
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.tl-day-group--visible {
  opacity: 1;
  transform: translateY(0);
}

.tl-day-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tl-day-weekday {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.tl-day-date {
  font-size: 14px;
  color: var(--text-muted);
}

.tl-day-chip {
  margin-left: auto;
  background: rgba(74,144,217,0.15);
  border: 1px solid rgba(74,144,217,0.3);
  color: var(--accent-usa);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
}

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

/* ── Match card ── */
.tl-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--stage-c, #888);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tl-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--stage-c, var(--border));
  transform: translateY(-1px);
}

.tl-card:focus-visible {
  outline: 2px solid var(--accent-usa);
  outline-offset: 2px;
}

/* Special cards */
.tl-card--final {
  background: rgba(240,192,64,0.06);
  border-color: rgba(240,192,64,0.4);
  border-left-color: #f0c040;
}

.tl-card--final:hover {
  background: rgba(240,192,64,0.1);
}

.tl-card--opening {
  background: rgba(240,192,64,0.04);
  border-color: rgba(240,192,64,0.25);
  border-left-color: #f0c040;
}

/* Badges (Final / Opening) — inline at bottom of card */
.tl-card-badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
}

.tl-card-badge--final {
  background: rgba(240,192,64,0.2);
  color: #f0c040;
  border: 1px solid rgba(240,192,64,0.4);
}

.tl-card-badge--opening {
  background: rgba(240,192,64,0.12);
  color: #f0c040;
  border: 1px solid rgba(240,192,64,0.25);
}

/* Card sections */
.tl-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tl-card-stage {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Times block — stacks local on top of ET when both are shown */
.tl-card-times {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  margin-left: auto;
  flex-shrink: 0;
}

.tl-card-time {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}

.tl-card-time--local {
  color: var(--text-muted);
  font-size: 12px;
}

.tl-card-time--et {
  font-size: 10px;
  opacity: 0.6;
}

.tl-card-teams {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl-card-team {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.tl-card-team--home {
  text-align: left;
}

.tl-card-team--away {
  text-align: right;
}

.tl-card-vs {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.tl-card-score {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-gold);
}

.tl-card-venue {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.tl-venue-icon {
  width: 11px;
  height: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.tl-card-stadium-name {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-card-city {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .tl-filters {
    padding: 10px 16px;
    top: 50px;
  }

  .tl-filter-row {
    gap: 8px;
  }

  .tl-filter-btn {
    padding: 4px 10px;
    font-size: 11px;
  }

  .tl-search-wrap {
    max-width: 100%;
  }

  .tl-content {
    padding: 20px 16px 48px;
  }

  .tl-cards-grid {
    grid-template-columns: 1fr;
  }

  .tl-day-weekday {
    font-size: 15px;
  }
}

/* ============================================================
   About Section
   ============================================================ */
.section--about {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.about-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--text-muted);
  line-height: 1.8;
}

.about-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tech-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-usa);
  letter-spacing: 0.04em;
}

/* ============================================================
   City Labels  (CSS2DRenderer overlay)
   ============================================================ */

/* Zero-size anchor — CSS2DRenderer centres this on the 3D point */
.city-label-anchor {
  width: 0;
  height: 0;
  position: relative;
}

/* Actual label — positioned from the anchor's left edge, extending right */
.city-label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.15s;
}

/* Host-city labels have no dot — shift right to clear the stadium marker pin */
.city-label--host {
  left: 12px;
}

/* ── Dot — medium tier default ─────────────────────────────── */
.city-dot {
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(120, 180, 255, 0.95);
  /* inner glow + soft outer halo */
  box-shadow:
    0 0 0 1.5px rgba(80, 150, 255, 0.25),
    0 0 5px  2px rgba(80, 160, 255, 0.35),
    0 0 10px 3px rgba(60, 130, 255, 0.15);
}

.city-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(150, 200, 255, 0.6);
}

/* ── Large tier — world capitals / major metros ─────────────── */
.city-label--lg .city-dot {
  width: 6px;
  height: 6px;
  background: rgba(150, 205, 255, 1);
  box-shadow:
    0 0 0 1.5px rgba(100, 170, 255, 0.3),
    0 0 6px  3px rgba(100, 180, 255, 0.45),
    0 0 14px 4px rgba(80,  150, 255, 0.2);
}
.city-label--lg .city-name {
  font-size: 9px;
  color: rgba(170, 215, 255, 0.75);
}

/* ── Small tier — secondary cities ─────────────────────────── */
.city-label--sm .city-dot {
  width: 3.5px;
  height: 3.5px;
  background: rgba(100, 160, 230, 0.8);
  box-shadow:
    0 0 0 1px   rgba(80, 140, 220, 0.2),
    0 0 4px 1px rgba(80, 140, 220, 0.25);
}
.city-label--sm .city-name {
  font-size: 7px;
  color: rgba(130, 180, 240, 0.48);
}

/* ============================================================
   Scrollbar
   ============================================================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --panel-width: 100vw;
  }

  .detail-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-width: unset;
    height: 70vh;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
  }

  .detail-panel--open {
    transform: translateY(0);
  }

  /* No globe shift on mobile — panel slides up from bottom */
  body.panel-is-open #globe-container {
    transform: none;
  }

  /* Stack visuals into a single column on narrow screens */
  .panel-visuals {
    grid-template-columns: 1fr;
  }

  .panel-model-wrap,
  .panel-photo-wrap {
    height: 180px;
  }

  /* Stats back to 2 columns on mobile */
  .panel-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Matches back to single column on mobile */
  .match-cards-grid {
    grid-template-columns: 1fr;
  }

  .globe-stats {
    gap: 20px;
  }

  .stat-value {
    font-size: 22px;
  }

  .nav-links {
    gap: 4px;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 12px;
  }

  .nav-credit {
    display: none;
  }
}

/* ============================================================
   Stadium 3D Model Viewer
   ============================================================ */
.panel-model-wrap {
  width: 100%;
  height: 220px;
  background: #070d1a;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.stadium-model-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ============================================================
   GROUPS SECTION (Phase 5)
   ============================================================ */

.section--groups {
  padding: 80px 24px 100px;
}

/* ── Grid of 12 group cards ──────────────────────────────────────────────── */

.grp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1200px) {
  .grp-grid { grid-template-columns: repeat(3, 1fr); }
}

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

@media (max-width: 540px) {
  .grp-grid { grid-template-columns: 1fr; }
}

/* ── Individual group card ───────────────────────────────────────────────── */

.grp-card {
  background:    var(--surface);
  border:        1px solid var(--border);
  border-radius: 12px;
  overflow:      hidden;
  display:       flex;
  flex-direction: column;
  transition:    border-color 0.2s;
}

.grp-card:hover {
  border-color: var(--border-light);
}

/* Coloured top accent bar driven by --grp-c */
.grp-card::before {
  content:    '';
  display:    block;
  height:     3px;
  background: var(--grp-c, var(--accent-gold));
}

/* ── Card header ─────────────────────────────────────────────────────────── */

.grp-card-header {
  display:         flex;
  align-items:     baseline;
  justify-content: space-between;
  gap:             8px;
  padding:         14px 16px 10px;
  border-bottom:   1px solid var(--border);
}

.grp-letter {
  font-family:    'Rajdhani', sans-serif;
  font-size:      18px;
  font-weight:    700;
  color:          var(--grp-c, var(--accent-gold));
  letter-spacing: 0.5px;
  white-space:    nowrap;
}

.grp-qualify-note {
  font-size:  10px;
  color:      var(--text-dim);
  text-align: right;
  line-height: 1.3;
}

/* ── Standings table ─────────────────────────────────────────────────────── */

.grp-table {
  width:           100%;
  border-collapse: collapse;
  font-size:       12px;
}

.grp-th {
  padding:    5px 6px;
  text-align: center;
  color:      var(--text-dim);
  font-weight: 500;
  font-size:  10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.grp-th--team { text-align: left; padding-left: 10px; }
.grp-th--pts  { color: var(--accent-gold); }

.grp-th--hide-sm { /* hidden below 400px card width */ }

.grp-row {
  position: relative;
  transition: background 0.15s;
}

.grp-row:hover { background: var(--surface-raised); }

/* Coloured left strip for qualification status */
.grp-row::before {
  content:  '';
  position: absolute;
  left:     0; top: 2px; bottom: 2px;
  width:    3px;
  border-radius: 0 2px 2px 0;
}

.grp-row--q1::before  { background: #27ae60; }   /* auto qualify */
.grp-row--q3::before  { background: #e67e22; }   /* possible 3rd-place qualifier */
.grp-row--out::before { background: transparent; }

/* Subtle row separator */
.grp-row + .grp-row { border-top: 1px solid rgba(30, 58, 95, 0.6); }

.grp-td {
  padding:    6px 6px;
  text-align: center;
  color:      var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.grp-td--team {
  text-align:  left;
  padding-left: 10px;
  display:     flex;
  align-items: center;
  gap:         6px;
  min-width:   0;
}

.grp-td--pts {
  color:       var(--text-primary);
  font-weight: 600;
}

.grp-pos {
  font-size:  10px;
  color:      var(--text-dim);
  width:      12px;
  flex-shrink: 0;
}

.grp-flag {
  font-size:  15px;
  line-height: 1;
  flex-shrink: 0;
}

.grp-name {
  color:         var(--text-primary);
  font-size:     12px;
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
  min-width:     0;
}

/* ── Fixtures list ───────────────────────────────────────────────────────── */

.grp-fixtures {
  flex: 1;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border);
}

.grp-matchday-label {
  font-size:      10px;
  font-weight:    600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color:          var(--text-dim);
  margin-bottom:  4px;
}

.grp-fixture {
  display:       flex;
  flex-direction: column;
  gap:           3px;
  padding:       6px 8px;
  border-radius: 6px;
  background:    rgba(0,0,0,0.15);
  border:        1px solid transparent;
  transition:    border-color 0.15s;
}

.grp-fixture--played {
  border-color: rgba(30, 58, 95, 0.5);
}

.grp-fx-info {
  display:     flex;
  align-items: center;
  gap:         8px;
}

.grp-fx-date {
  font-size: 10px;
  color:     var(--text-dim);
}

.grp-fx-time {
  font-size: 10px;
  color:     var(--text-dim);
}

.grp-fx-matchup {
  display:     flex;
  align-items: center;
  gap:         6px;
  font-size:   12px;
}

.grp-fx-team {
  flex:          1;
  color:         var(--text-muted);
  white-space:   nowrap;
  overflow:      hidden;
  text-overflow: ellipsis;
  min-width:     0;
}

.grp-fx-team--home { text-align: right; }
.grp-fx-team--away { text-align: left; }

.grp-fx-team--winner {
  color:       var(--text-primary);
  font-weight: 600;
}

.grp-fx-score {
  font-family:      'JetBrains Mono', monospace;
  font-size:        13px;
  font-weight:      600;
  color:            var(--accent-gold);
  white-space:      nowrap;
  flex-shrink:      0;
  min-width:        42px;
  text-align:       center;
  background:       rgba(240, 192, 64, 0.08);
  border:           1px solid rgba(240, 192, 64, 0.2);
  border-radius:    4px;
  padding:          1px 6px;
}

.grp-fx-vs {
  font-size:  11px;
  color:      var(--text-dim);
  flex-shrink: 0;
  min-width:  42px;
  text-align: center;
}
