/* ══════════════════════════════════════════════════════════════════════
   FOOTBALL — HIGH-CONVICTION SPORTS INTELLIGENCE TERMINAL
   Global Design Tokens & Component Styling (Haute Sports Intelligence)
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* neutrals (cool architectural obsidian ramp — never pure flat black) */
  --void: #06080B;
  --pitch: #090D13;
  --dugout: #0F151F;
  --raise: #161E2C;
  --raised: #1D2738;
  --chalk: rgba(255, 255, 255, 0.08);
  --chalk-strong: rgba(255, 255, 255, 0.16);
  --chalk-subtle: rgba(255, 255, 255, 0.04);
  --ink-1: #F8FAFC;
  --ink-2: #94A3B8;
  --ink-3: #64748B;
  
  /* signature accents & calibrated telemetry */
  --accent: #E2B86E;
  --accent-glow: rgba(226, 184, 110, 0.22);
  --live: #10B981;
  --live-glow: rgba(16, 185, 129, 0.28);
  --form: #10B981;
  --amber: #F59E0B;
  --foul: #EF4444;
  --info: #38BDF8;
  
  /* spacing scale (4/8 base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-8: 48px;
  --space-10: 64px;
  --space-12: 96px;
  
  /* typography stacks */
  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  
  /* motion & easing */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  
  /* radius & elevations */
  --radius-4: 6px;
  --radius-8: 10px;
  --radius-12: 14px;
  --radius-full: 999px;
  --shadow-1: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-2: 0 12px 36px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 24px var(--accent-glow);
}

/* ── Self-hosted fonts (offline-capable; no runtime hotlinks) ── */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/spacegrotesk-500.woff2") format('woff2');
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/spacegrotesk-700.woff2") format('woff2');
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/manrope-500.woff2") format('woff2');
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/manrope-700.woff2") format('woff2');
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/jetbrainsmono-500.woff2") format('woff2');
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/jetbrainsmono-700.woff2") format('woff2');
}

/* ── Universal Reset & Base Styles ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  background: var(--pitch);
  color: var(--ink-1);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

#app {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ══════════════════════════════════════════════════════════════════════
   App Shell Layout — 2-Column Grid (Sidebar Command Rail + Main Column)
   ══════════════════════════════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100dvh;
  align-items: stretch;
  background: transparent;
}

/* Sidebar rail */
.app-sidebar {
  position: relative;
  background: var(--dugout);
  border-right: 1px solid var(--chalk);
  display: flex;
  flex-direction: column;
  min-width: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  flex: 1 1 auto;
  margin: 0;
  padding: var(--space-4) var(--space-3);
  min-height: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  padding: 8px 12px 14px;
  border-bottom: 1px solid var(--chalk);
  margin-bottom: 10px;
  cursor: pointer;
  letter-spacing: 1.5px;
  transition: opacity 0.15s;
}
.nav-logo:hover {
  opacity: 0.9;
}

.nl-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}

.nl-text {
  letter-spacing: 2px;
}

.nav-divider {
  height: 1px;
  background: var(--chalk);
  margin: 6px 10px 12px;
}

.nav-section-label {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  padding: 6px 12px 6px;
  font-weight: 700;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  color: var(--ink-2);
  padding: 10px 12px;
  margin: 2px 0;
  font-family: var(--font-body);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-4);
  font-weight: 500;
}

.nav-btn:hover {
  color: var(--ink-1);
  background: var(--raise);
  border-color: var(--chalk);
}

.nav-btn.active {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--raise));
  color: var(--ink-1);
  border-top-color: var(--chalk);
  border-right-color: var(--chalk);
  border-bottom-color: var(--chalk);
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.nb-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  flex-shrink: 0;
  min-width: 32px;
  padding: 2px 6px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: var(--radius-4);
  text-align: center;
}

.nav-btn.active .nb-badge {
  color: var(--void);
  background: var(--accent);
  font-weight: 700;
}

.nb-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.nav-btn.disabled {
  opacity: 0.35;
  cursor: default;
}
.nav-btn.disabled:hover {
  color: var(--ink-3);
  background: transparent;
  border-color: transparent;
}

/* ── Main Column Layout ── */
.app-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 100dvh;
}

.app-main > .topbar { grid-row: 1; }
.app-main > #contentArea { grid-row: 2; }
.app-main > .lower-third { grid-row: 3; }

/* ── Topbar (Universal Executive Header) ── */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 54px;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--chalk);
  background: color-mix(in srgb, var(--pitch) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 15;
}

.topbar .brand, .topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink-1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--chalk);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mode-pill.live {
  color: var(--live);
  border-color: color-mix(in srgb, var(--live) 50%, transparent);
  background: color-mix(in srgb, var(--live) 12%, transparent);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

.mode-pill.snapshot {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 50%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
}

.mode-pill.offline {
  color: var(--ink-2);
  border-color: var(--chalk);
  background: var(--raise);
}

.topbar .refresh-slot {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.season-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.season-select {
  background: var(--raise);
  color: var(--ink-1);
  border: 1px solid var(--chalk);
  border-radius: var(--radius-4);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.season-select:focus {
  border-color: var(--accent);
}

/* ── Content Area & Primary Tabs ── */
#contentArea {
  flex: 1;
  min-width: 0;
  padding: var(--space-5) var(--space-6);
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--chalk);
  margin-bottom: var(--space-5);
  margin-top: 0;
  flex-wrap: wrap;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--ink-3);
  padding: 10px 18px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--ink-1);
  background: color-mix(in srgb, var(--raise) 50%, transparent);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.tab-content {
  display: none;
  padding-top: 0;
  animation: fadeIn 0.25s var(--ease) forwards;
}

.tab-content.active {
  display: block;
}

/* ── Broadcast Lower-Third Ticker (Status Bar) ── */
.lower-third {
  border-top: 1px solid var(--chalk);
  background: color-mix(in srgb, var(--void) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 var(--space-6);
}

.lower-third .status-bar {
  border-top: none;
  margin-top: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.status-bar .live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 8px var(--live);
  animation: live-pulse 2s var(--ease-smooth) infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

/* ── Drawer Toggle (Mobile Navigation) ── */
.drawer-toggle {
  display: none;
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 50;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-4);
  background: var(--raise);
  color: var(--ink-1);
  font-size: 18px;
  line-height: 1;
  border: 1px solid var(--chalk);
  cursor: pointer;
  box-shadow: var(--shadow-1);
}

/* ══════════════════════════════════════════════════════════════════════
   LANDING PAGE — THE GLOBAL COMMAND HORIZON
   ══════════════════════════════════════════════════════════════════════ */
body.landing .app-shell {
  grid-template-columns: 1fr;
}
body.landing .app-sidebar {
  display: none;
}

.landing-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  display: none;
}

.landing-backdrop.show {
  display: block;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(226, 184, 110, 0.08) 0%, transparent 60%),
    linear-gradient(rgba(6, 8, 11, 0.88) 0%, rgba(6, 8, 11, 0.94) 50%, rgba(6, 8, 11, 0.98) 100%),
    url("images/stadium.webp");
  background-size: cover;
  background-position: center;
}

.landing-backdrop.show .bd-sky,
.landing-backdrop.show .bd-mid,
.landing-backdrop.show .bd-pitch {
  display: none;
}

/* Fallback vector stadium structure */
.bd-sky { position: absolute; top: 0; left: 0; width: 100%; height: 40%; background: linear-gradient(180deg, #050a0f 0%, #071018 30%, #0a1628 60%, #0d1f30 100%); overflow: hidden; }
.bd-sky-glow { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 80%; height: 55%; background: radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 70%); }
.bd-cloud { position: absolute; border-radius: 50%; background: rgba(13,31,48,0.4); filter: blur(30px); pointer-events: none; }
.bd-cloud-1 { top: 18%; left: -5%; width: 55%; height: 35%; }
.bd-cloud-2 { top: 8%; right: -8%; width: 60%; height: 40%; background: rgba(10,22,40,0.5); }
.bd-mid { position: absolute; top: 40%; left: 0; width: 100%; height: 25%; }
.bd-stand { position: absolute; top: 0; height: 100%; background: linear-gradient(90deg, #050a0f 0%, #0a1628 60%, #0d1f30 100%); }
.bd-stand::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: repeating-linear-gradient(0deg, transparent 0px, transparent 3px, rgba(255,255,255,0.015) 3px, rgba(255,255,255,0.015) 4px); pointer-events: none; }
.bd-stand-left { left: 0; width: 100%; clip-path: polygon(0% 0%, 42% 0%, 5% 100%, 0% 100%); }
.bd-stand-right { right: 0; width: 100%; clip-path: polygon(58% 0%, 100% 0%, 100% 100%, 95% 100%); }
.bd-floodlight-bar { position: absolute; top: 0; left: 12%; width: 76%; height: 2px; background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%); filter: blur(1px); z-index: 3; }
.bd-floodlight-bloom { position: absolute; top: -12px; left: 8%; width: 84%; height: 40px; background: radial-gradient(ellipse at 50% 30%, var(--accent-glow) 0%, transparent 70%); filter: blur(14px); z-index: 2; }
.bd-goal { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 55px; z-index: 2; }
.bd-goal svg { display: block; width: 100%; height: auto; }
.bd-circle-wrap { position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%); z-index: 2; }
.bd-circle { width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.1); opacity: 0.6; }
.bd-pitch { position: absolute; bottom: 0; left: 0; width: 100%; height: 35%; background: linear-gradient(180deg, #0a281e 0%, #061a10 100%); overflow: hidden; }
.bd-pitch-field { position: absolute; top: -60%; left: -5%; width: 110%; height: 180%; transform-origin: 50% 25%; transform: perspective(700px) rotateX(40deg); background: repeating-linear-gradient(90deg, rgba(10,42,26,0.35) 0px, rgba(10,42,26,0.35) 12px, rgba(13,59,42,0.12) 12px, rgba(13,59,42,0.12) 24px); }
.bd-vignette { position: absolute; bottom: 0; left: 0; width: 100%; height: 35%; background: linear-gradient(to top, #000 0%, transparent 40%, transparent 100%); z-index: 3; pointer-events: none; }

/* ── Landing Hero ── */
.landing-hero {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  gap: var(--space-6);
  padding: var(--space-12) var(--space-4) var(--space-10);
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.lh-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lh-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: var(--radius-full);
  padding: 6px 18px;
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  box-shadow: 0 0 16px var(--accent-glow);
}

.lh-title {
  font-family: var(--font-display);
  font-size: 58px;
  font-weight: 700;
  color: var(--ink-1);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.05;
  margin-bottom: var(--space-2);
  background: linear-gradient(180deg, #FFFFFF 0%, #CBD5E1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lh-sub {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.lh-tagline {
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 620px;
  margin-bottom: var(--space-6);
  font-weight: 400;
}

.lh-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.lh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-4);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.2s var(--ease);
  border: 1px solid var(--chalk);
}

.lh-btn-primary {
  background: var(--accent);
  color: var(--void);
  border-color: var(--accent);
  box-shadow: 0 4px 18px var(--accent-glow);
}
.lh-btn-primary:hover {
  background: #E8C382;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(226, 184, 110, 0.35);
}

.lh-btn-secondary {
  background: var(--dugout);
  color: var(--ink-1);
  border-color: var(--chalk-strong);
}
.lh-btn-secondary:hover {
  background: var(--raise);
  border-color: var(--ink-2);
  transform: translateY(-2px);
}

/* ── Landing Sections & Grid ── */
.landing-section {
  margin-top: var(--space-10);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.ls-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-1);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--chalk);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Competition Command Cards ── */
.landing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  align-items: stretch;
}

.lc-card {
  border: 1px solid var(--chalk);
  border-radius: var(--radius-8);
  padding: var(--space-5);
  background: var(--dugout);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: all 0.22s var(--ease);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.lc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  opacity: 0.4;
  transition: opacity 0.25s, height 0.25s;
}

.lc-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
}
.lc-card:hover::before {
  opacity: 1;
  height: 4px;
}

.lc-card.worldcup {
  background: linear-gradient(135deg, rgba(6,8,11,0.7), rgba(6,8,11,0.85)), url("images/wc.webp") center / cover no-repeat;
  border-color: rgba(226, 184, 110, 0.25);
}
.lc-card.worldcup::before { background: #10B981; }
.lc-card.worldcup .lcc-badge { color: #10B981; }

.lc-card.ucl {
  background: linear-gradient(135deg, rgba(6,8,11,0.7), rgba(6,8,11,0.85)), url("images/ucl.webp") center / cover no-repeat;
  border-color: rgba(56, 189, 248, 0.25);
}
.lc-card.ucl::before { background: #38BDF8; }
.lc-card.ucl .lcc-badge { color: #38BDF8; }

.lc-card.laliga {
  background: linear-gradient(135deg, rgba(16,8,12,0.6), rgba(16,8,12,0.8)), url("images/laliga.webp") center / cover no-repeat;
  border-color: rgba(249, 115, 22, 0.25);
}
.lc-card.laliga::before { background: #F97316; }
.lc-card.laliga .lcc-badge { color: #F97316; }

.lcc-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.lcc-badge {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.lcc-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-1);
}

.lcc-meta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
  font-size: 11.5px;
  min-height: 24px;
}

.lcc-stat {
  color: var(--ink-3);
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: var(--radius-4);
  border: 1px solid var(--chalk-subtle);
}

.lcc-stat strong {
  color: var(--ink-1);
  font-weight: 700;
}

.lcc-chevron {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s;
}
.lc-card:hover .lcc-chevron {
  transform: translateX(4px);
}

/* ── Prediction Engine Feature Activator Cards ── */
.lf-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.lf-card {
  border: 1px solid var(--chalk);
  border-radius: var(--radius-8);
  padding: var(--space-5);
  background: var(--dugout);
  transition: all 0.2s var(--ease);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.lf-card:hover {
  border-color: var(--accent);
  background: var(--raise);
  transform: translateY(-3px);
  box-shadow: var(--shadow-1);
}

.lfc-icon {
  display: flex;
  gap: 5px;
  margin-bottom: var(--space-3);
}

.lfc-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.lfc-name {
  font-family: var(--font-display);
  font-size: 14.5px;
  color: var(--ink-1);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.lfc-desc {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
}

.lfc-cta {
  margin-top: auto;
  padding-top: var(--space-4);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.lf-card:hover .lfc-cta {
  color: #FFF;
}

/* ══════════════════════════════════════════════════════════════════════
   COMPETITION INTERFACE ARCHETYPES & TELEMETRY
   ══════════════════════════════════════════════════════════════════════ */

/* ── Primary KPI Ribbon (Stats Row) ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.stat-card {
  border: 1px solid var(--chalk);
  border-radius: var(--radius-8);
  padding: 14px 16px;
  background: var(--dugout);
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 0.18s;
}
.stat-card:hover {
  border-color: var(--chalk-strong);
}

.stat-card .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 4px;
}

.stat-card .val {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card .sub {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 4px;
}

/* ── Phase & Availability Cards ── */
.phase-card {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  border: 1px solid var(--chalk);
  border-radius: var(--radius-8);
  padding: var(--space-4) var(--space-5);
  background: var(--dugout);
  box-shadow: var(--shadow-1);
  margin-bottom: var(--space-5);
}

.phase-card > div {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.phase-card .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.phase-card .val {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent);
  font-weight: 700;
}

/* ── Precision Data Tables ── */
.eval-table, .league-table, .odds-table, .group-table,
.bubble-table, .wi-table, .modal table.insight-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font-body);
  background: var(--dugout);
  border: 1px solid var(--chalk);
  border-radius: var(--radius-8);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.eval-table th, .league-table th, .odds-table th, .group-table th,
.bubble-table th, .wi-table th, .modal table.insight-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--raise);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 10px 14px;
  border-bottom: 1px solid var(--chalk);
  text-align: left;
}

.eval-table td, .league-table td, .odds-table td, .group-table td,
.bubble-table td, .wi-table td, .modal table.insight-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--chalk-subtle);
  font-size: 12px;
  color: var(--ink-1);
  transition: background 0.12s;
}

.eval-table tr:last-child td,
.league-table tr:last-child td,
.odds-table tr:last-child td {
  border-bottom: none;
}

.eval-table tbody tr:hover td,
.league-table tbody tr:hover td,
.odds-table tbody tr:hover td {
  background: color-mix(in srgb, var(--raise) 70%, transparent);
}

.eval-table .num, .league-table .num, .odds-table .num,
.group-table .num, .wi-table .num, .modal table.insight-table .num {
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Standings qualification zones */
.league-table .zone-top8, .group-table .advancing {
  border-left: 3px solid var(--form);
  background: color-mix(in srgb, var(--form) 8%, transparent);
}
.league-table .zone-playoff, .group-table .bubble {
  border-left: 3px solid var(--info);
  background: color-mix(in srgb, var(--info) 7%, transparent);
}
.league-table .zone-relegation, .group-table .eliminated {
  border-left: 3px solid var(--foul);
  background: color-mix(in srgb, var(--foul) 8%, transparent);
}

.zone-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--radius-4);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.zone-badge.top8 { background: rgba(16, 185, 129, 0.2); color: #10B981; }
.zone-badge.playoff { background: rgba(56, 189, 248, 0.18); color: #38BDF8; }
.zone-badge.eliminated { background: rgba(239, 68, 68, 0.18); color: #EF4444; }

/* ── Bar Wrappers & Visual Proportions ── */
.bar-wrap, .cbar-wrap, .champ-bar-row .cbar-wrap,
.prob-bar-wrap, .progress-bar-wrap, .odds-bar-wrap {
  background: var(--raise);
  border-radius: var(--radius-4);
  overflow: hidden;
  height: 8px;
}

.bar, .cbar, .champ-bar-row .cbar, .prob-bar-fill, .progress-bar-fill, .odds-bar {
  background: linear-gradient(90deg, var(--raise), var(--accent));
  border-radius: var(--radius-4);
  transition: width 0.6s var(--ease);
}

.champ-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
}
.champ-bar-row .cname {
  width: 140px;
  text-align: right;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.champ-bar-row .cpct {
  width: 55px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 11.5px;
}

/* ── Prediction Cells ── */
.pred-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.pred-cell {
  border: 1px solid var(--chalk);
  border-radius: var(--radius-8);
  padding: 12px 14px;
  background: var(--raise);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pred-cell .lbl {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pred-cell .val {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--accent);
  font-weight: 700;
}

/* ── Simulation Provenance Banners ── */
.sim-provenance {
  border: 1px solid color-mix(in srgb, var(--info) 40%, transparent);
  border-radius: var(--radius-8);
  background: color-mix(in srgb, var(--dugout) 92%, transparent);
  padding: 12px 16px;
  margin: var(--space-4) 0;
  box-shadow: var(--shadow-1);
}
.sim-provenance .title {
  color: var(--info);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.sim-provenance .body {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.6;
}
.sim-provenance.failed {
  border-color: rgba(239, 68, 68, 0.4);
}
.sim-provenance.failed .title {
  color: var(--foul);
}

/* ── Tournament Knockout Bracket ── */
.bracket-wrap {
  position: relative;
  overflow-x: auto;
  padding: var(--space-6) 0;
  min-height: 520px;
}

.bracket-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#bracketSvg path {
  stroke: var(--info);
  stroke-width: 1.5;
  opacity: 0.45;
  fill: none;
}

.bracket-grid {
  display: flex;
  gap: 0;
  position: relative;
  z-index: 2;
  min-width: 800px;
}

.bracket-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-width: 150px;
  padding: 0 4px;
}
.bracket-col:not(:last-child) {
  margin-right: var(--space-6);
}

.bracket-col .col-head {
  text-align: center;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
}

.match-slot {
  display: flex;
  align-items: center;
  margin: 6px 0;
}

.match-card {
  width: 100%;
  border: 1px solid var(--chalk);
  border-radius: var(--radius-4);
  padding: 8px 10px;
  background: var(--dugout);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  font-size: 11.5px;
  position: relative;
  transition: all 0.16s var(--ease);
}
.match-card:hover {
  border-color: var(--accent);
  background: var(--raise);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.match-card.played, .match-card.mc-played {
  border-left: 3px solid var(--form);
}
.match-card.upcoming, .match-card.mc-upcoming {
  border-left: 3px solid var(--ink-3);
}
.match-card.tbd, .match-card.mc-tbd {
  border-left: 3px solid var(--chalk);
  opacity: 0.55;
}

.match-card .m-teams {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.match-card .m-team {
  color: var(--ink-1);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-card .m-team.winner {
  color: var(--accent);
  font-weight: 700;
}
.match-card .m-score {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  padding: 0 4px;
}

.match-card .badge-sim,
.match-card .badge-retired,
.match-card .badge-manual {
  position: absolute;
  top: 3px;
  right: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.8px;
  padding: 1px 5px;
  border-radius: var(--radius-4);
}
.match-card .badge-sim {
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 45%, transparent);
  background: color-mix(in srgb, var(--info) 12%, transparent);
}
.match-card .badge-retired {
  color: var(--ink-3);
  border: 1px solid color-mix(in srgb, var(--ink-3) 45%, transparent);
  background: color-mix(in srgb, var(--ink-3) 12%, transparent);
  text-decoration: line-through;
}
.match-card .badge-manual {
  color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, transparent);
}

.m-sim-line {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--info);
  text-align: center;
  margin-top: 2px;
}
.match-card.mc-retired .m-sim-line {
  text-decoration: line-through;
  opacity: 0.65;
}

/* ── Modals & Drawers ── */
.modal-overlay, .sim-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: var(--space-4);
}
.modal-overlay.show, .sim-popup-overlay.show {
  display: flex;
}

.modal, .sim-popup {
  background: var(--dugout);
  border: 1px solid var(--chalk-strong);
  border-radius: var(--radius-12);
  box-shadow: var(--shadow-2);
  max-width: 680px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: var(--space-6);
  position: relative;
  animation: modalScale 0.22s var(--ease) forwards;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover {
  color: var(--ink-1);
}

.modal h2 {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.modal .m-sub {
  color: var(--ink-3);
  font-size: 12px;
  margin-bottom: var(--space-4);
}


.m-sub { color: var(--ink-3); font-size: 11px; margin-bottom: 6px; }

.dim { color: var(--ink-2); font-size: 11px; }

.vs-sep {
  color: var(--ink-3);
  font-weight: normal;
  padding: 0 4px;
}

.m-score-big {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
}

.form-line {
  font-family: var(--font-mono);
  letter-spacing: 2px;
  color: var(--accent);
}

.insight-text {
  font-style: italic;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.65;
}

/* Form field primitives */
.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  flex: 1;
  min-width: 140px;
}

.form-field .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-field input, .form-field select {
  background: var(--void);
  border: 1px solid var(--chalk);
  border-radius: var(--radius-4);
  padding: 8px 10px;
  color: var(--ink-1);
  font-family: inherit;
  font-size: 12px;
  outline: none;
}
.form-field input:focus, .form-field select:focus {
  border-color: var(--accent);
}

/* ── Buttons & Presets ── */
.refresh-btn {
  min-height: 34px;
  min-width: 96px;
  background: var(--accent);
  color: var(--void);
  border: 1px solid var(--accent);
  border-radius: var(--radius-4);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.16s var(--ease);
  box-shadow: 0 2px 8px var(--accent-glow);
}
.refresh-btn:hover {
  background: #E8C382;
  transform: translateY(-1px);
}
.refresh-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.status-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  border-radius: var(--radius-4);
  transition: all 0.15s;
}
.status-btn:hover {
  background: var(--accent);
  color: var(--void);
}
.status-btn.sim-preset.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--void);
  font-weight: 700;
}

.sim-presets {
  display: flex;
  gap: 6px;
  margin-bottom: var(--space-4);
}

.sim-presets button {
  flex: 1;
  background: var(--raise);
  border: 1px solid var(--chalk);
  border-radius: var(--radius-4);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.sim-presets button:hover {
  color: var(--ink-1);
  border-color: var(--ink-3);
}
.sim-presets button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--void);
  font-weight: 700;
}

.sim-popup input[type="number"] {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--chalk);
  border-radius: var(--radius-4);
  padding: 8px 12px;
  color: var(--ink-1);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  margin-bottom: var(--space-4);
}
.sim-popup input[type="number"]:focus {
  border-color: var(--accent);
}

.sim-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.sim-actions button {
  padding: 8px 18px;
  border-radius: var(--radius-4);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.15s;
}
#simCancelBtn {
  background: transparent;
  border: 1px solid var(--chalk-strong);
  color: var(--ink-2);
}
#simCancelBtn:hover {
  color: var(--ink-1);
  border-color: var(--ink-1);
}
#simStartBtn {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--void);
}
#simStartBtn:hover {
  background: #E8C382;
  box-shadow: 0 0 16px var(--accent-glow);
}
#simStartBtn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Group & Playoff Cards ── */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.group-card {
  border: 1px solid var(--chalk);
  border-radius: var(--radius-8);
  padding: var(--space-4);
  background: var(--dugout);
  box-shadow: var(--shadow-1);
}
.group-card .g-title {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* ── Matchday & Group Stage Accordions (World Cup / UCL / LaLiga) ── */
.md-accordion {
  margin-bottom: var(--space-4);
}
.md-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color var(--trans-fast);
}
.md-card:hover {
  border-color: var(--border-bold);
}
.md-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink-1);
  font-weight: 600;
  gap: 10px;
  transition: background var(--trans-fast);
}
.md-header:hover {
  background: var(--surface-3);
}
.md-count {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-left: auto;
}
.md-arrow {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  width: 14px;
  text-align: center;
}
.md-body {
  display: none;
  padding: 4px 14px 10px;
  border-top: 1px solid var(--border-subtle);
}
.md-body.open {
  display: block;
}

.md-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  transition: background var(--trans-fast);
}
.md-row:last-child {
  border-bottom: none;
}
.md-row.match-clickable {
  cursor: pointer;
}
.md-row.match-clickable:hover {
  background: var(--surface-3);
}
.md-row .md-team {
  color: var(--ink-1);
  font-weight: 500;
}
.md-row .md-team:first-child {
  flex: 1;
  text-align: right;
}
.md-row .md-score {
  margin: 0 14px;
  font-family: var(--font-mono);
  font-weight: 700;
  min-width: 46px;
  text-align: center;
  color: var(--ink-1);
  letter-spacing: 0.05em;
}
.md-row .md-team:nth-of-type(2) {
  flex: 1;
  text-align: left;
}

.dot-green { color: var(--live); }
.dot-orange { color: var(--amber); }
.dot-red { color: var(--foul); }

/* ── Acquisition & Availability Diagnostics Panels ── */
.acq-panel, .avail-panel {
  border: 1px solid var(--chalk);
  border-radius: var(--radius-8);
  padding: var(--space-4);
  background: var(--dugout);
  font-size: 12px;
  box-shadow: var(--shadow-1);
}

.acq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.acq-comp {
  color: var(--ink-1);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.acq-src {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: var(--radius-4);
  border: 1px solid;
}
.acq-src-live { color: var(--live); border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.1); }
.acq-src-snap { color: var(--amber); border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.1); }
.acq-src-stale { border-style: dashed; }
.acq-stage {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--chalk-subtle);
}
.acq-glyph {
  font-family: var(--font-mono);
  font-weight: 700;
  width: 28px;
}
.acq-ok .acq-glyph { color: var(--live); }
.acq-pend .acq-glyph { color: var(--amber); }
.acq-err .acq-glyph { color: var(--foul); }

/* ── Skeleton Loading ── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 16px;
  min-height: 100px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
}
.skeleton {
  position: relative;
  min-height: 12px;
  border-radius: var(--radius-4);
  background: linear-gradient(
    90deg,
    var(--raise) 0%,
    color-mix(in srgb, var(--raise) 55%, var(--chalk-strong)) 40%,
    var(--raise) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s var(--ease) infinite;
}
.skeleton-line { height: 10px; width: 60px; margin-bottom: 4px; border-radius: var(--radius-4); }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════
   COMPETITION THEMATIC OVERRIDES (Preserved Static Contracts)
   ══════════════════════════════════════════════════════════════════════ */

/* ── LaLiga EA Sports Thematic Palette (Minimalist Red Poster) ── */
.competition-laliga {
  background: linear-gradient(rgba(16,8,12,0.65), rgba(16,8,12,0.85)), url("images/laliga.webp") center / cover fixed no-repeat;
}
.competition-laliga .tab-btn.active { color: #D90429; border-bottom-color: #D90429; }
.competition-laliga .nav-btn.active { border-left-color: #D90429; }
.competition-laliga .nb-badge { color: #D90429; }
.competition-laliga .nav-btn.active .nb-badge { background: #D90429; color: #FFFFFF; }
.competition-laliga .stat-card .val { color: #D90429; }
.competition-laliga .phase-card .val { color: #D90429; }
.competition-laliga .phase-card { border-color: rgba(217, 4, 41, 0.25); }
.competition-laliga .sim-provenance { border-color: rgba(217, 4, 41, 0.35); }
.competition-laliga .sim-provenance .title { color: #D90429; }
.competition-laliga .pred-cell .val { color: #D90429; }
.competition-laliga .status-btn.sim-preset.active { background: #D90429; border-color: #D90429; color: #FFFFFF; }
.competition-laliga #simStartBtn, .competition-laliga .refresh-btn { background: #D90429; border-color: #D90429; color: #FFFFFF; }
.competition-laliga #simStartBtn:hover, .competition-laliga .refresh-btn:hover { background: #EF233C; border-color: #EF233C; }
.competition-laliga .chart-row .cbar { background: linear-gradient(90deg, var(--raise), #D90429); }
.competition-laliga .champ-bar-row .cbar { background: linear-gradient(90deg, var(--raise), #D90429); }
.competition-laliga .champ-bar-row .cpct { color: #D90429; }

/* ── World Cup 2026 Thematic Palette (Minimalist Orange Poster) ── */
.competition-worldcup {
  background: linear-gradient(rgba(10,12,20,0.65), rgba(10,12,20,0.85)), url("images/wc.webp") center / cover fixed no-repeat;
  color: #FFF2DF;
}
.competition-worldcup .tab-btn.active { color: #EA580C; border-bottom-color: #EA580C; }
.competition-worldcup .nav-btn.active { border-left-color: #EA580C; }
.competition-worldcup .nb-badge { color: #EA580C; }
.competition-worldcup .nav-btn.active .nb-badge { background: #EA580C; color: #FFFFFF; }
.competition-worldcup .stat-card .val { color: #EA580C; }
.competition-worldcup .phase-card .val { color: #EA580C; }
.competition-worldcup .phase-card { border-color: rgba(234, 88, 12, 0.25); }
.competition-worldcup .sim-provenance { border-color: rgba(234, 88, 12, 0.35); }
.competition-worldcup .sim-provenance .title { color: #EA580C; }
.competition-worldcup .status-btn.sim-preset.active { background: #EA580C; border-color: #EA580C; color: #FFFFFF; }
.competition-worldcup #simStartBtn, .competition-worldcup .refresh-btn { background: #EA580C; border-color: #EA580C; color: #FFFFFF; }
.competition-worldcup #simStartBtn:hover, .competition-worldcup .refresh-btn:hover { background: #F97316; border-color: #F97316; }
.competition-worldcup .champ-bar-row .cbar { background: linear-gradient(90deg, var(--raise), #EA580C); }
.competition-worldcup .champ-bar-row .cpct { color: #EA580C; }

/* ── UEFA Champions League Thematic Palette (Minimalist Blue Poster) ── */
.competition-ucl {
  background: linear-gradient(rgba(10,12,20,0.65), rgba(10,12,20,0.85)), url("images/ucl.webp") center / cover fixed no-repeat;
}
.competition-ucl .tab-btn.active { color: #0252CD; border-bottom-color: #0252CD; }
.competition-ucl .nav-btn.active { border-left-color: #0252CD; }
.competition-ucl .nb-badge { color: #0252CD; }
.competition-ucl .nav-btn.active .nb-badge { background: #0252CD; color: #FFFFFF; }
.competition-ucl .stat-card .val { color: #0252CD; }
.competition-ucl .phase-card .val { color: #0252CD; }
.competition-ucl .phase-card { border-color: rgba(2, 82, 205, 0.25); }
.competition-ucl .sim-provenance { border-color: rgba(2, 82, 205, 0.35); }
.competition-ucl .sim-provenance .title { color: #0252CD; }
.competition-ucl .status-btn.sim-preset.active { background: #0252CD; border-color: #0252CD; color: #FFFFFF; }
.competition-ucl #simStartBtn, .competition-ucl .refresh-btn { background: #0252CD; border-color: #0252CD; color: #FFFFFF; }
.competition-ucl #simStartBtn:hover, .competition-ucl .refresh-btn:hover { background: #2563EB; border-color: #2563EB; }
.competition-ucl .champ-bar-row .cbar { background: linear-gradient(90deg, var(--raise), #0252CD); }
.competition-ucl .champ-bar-row .cpct { color: #0252CD; }

/* ── SWISS MINIMALIST POSTER // LIGHT / DARK THEME SYSTEM ── */
.theme-toggle-btn {
  position: fixed;
  top: 14px;
  right: 20px;
  z-index: 1000;
  background: var(--dugout);
  color: var(--ink-1);
  border: 1px solid var(--chalk-strong);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-1);
}
.theme-toggle-btn:hover {
  background: var(--raise);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.theme-toggle-btn .tt-icon {
  font-size: 13px;
}

body.theme-light {
  --void: #F0EAE1;
  --pitch: #F8F5F0;
  --dugout: #FFFFFF;
  --raise: #F2ECE4;
  --raised: #E8E0D5;
  --chalk: rgba(28, 25, 23, 0.10);
  --chalk-strong: rgba(28, 25, 23, 0.22);
  --chalk-subtle: rgba(28, 25, 23, 0.04);
  --ink-1: #1C1917;
  --ink-2: #544A3F;
  --ink-3: #73695E;
  background-color: #F8F5F0 !important;
  color: #1C1917 !important;
}
body.theme-light .app-sidebar,
body.theme-light .topbar,
body.theme-light .lower-third,
body.theme-light .tab-bar,
body.theme-light .card,
body.theme-light .md-card,
body.theme-light .phase-card,
body.theme-light .stat-card,
body.theme-light .modal,
body.theme-light .sim-provenance,
body.theme-light .lc-card,
body.theme-light .lf-card {
  background-color: #FFFFFF !important;
  color: #1C1917 !important;
  border-color: #D8CEBE !important;
}
body.theme-light .landing-hero,
body.theme-light .landing-section,
body.theme-light .lh-title,
body.theme-light .ls-title,
body.theme-light .lfc-name,
body.theme-light .lcc-name {
  color: #1C1917 !important;
}
body.theme-light .lh-tagline,
body.theme-light .lh-sub,
body.theme-light .lfc-desc,
body.theme-light .lcc-meta {
  color: #544A3F !important;
}
body.theme-light .table tr:hover td {
  background-color: #F0EAE1 !important;
}
body.theme-light input,
body.theme-light select {
  background: #F8F5F0 !important;
  color: #1C1917 !important;
  border-color: #D8CEBE !important;
}
body.theme-light.competition-worldcup {
  background: #F8F5F0 !important;
  color: #1C1917 !important;
}
body.theme-light.competition-ucl {
  background: #F4F7FB !important;
  color: #0B192C !important;
}
body.theme-light.competition-laliga {
  background: #FBF7F7 !important;
  color: #1E1213 !important;
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN (Desktop, Tablet, Mobile)
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 72px 1fr;
  }
  .app-sidebar .nb-label,
  .app-sidebar .nav-section-label,
  .app-sidebar .nav-divider {
    display: none;
  }
  .app-sidebar .nav-btn {
    justify-content: center;
    padding: 10px 0;
  }
  .landing-cards {
    grid-template-columns: 1fr 1fr;
  }
  .lc-featured {
    grid-column: 1 / -1;
  }
  .lf-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform var(--ease) 250ms;
    box-shadow: var(--shadow-2);
  }
  .app-shell.drawer-open .app-sidebar {
    transform: translateX(0);
  }
  .app-shell.drawer-open .app-sidebar .nb-label,
  .app-shell.drawer-open .app-sidebar .nav-section-label,
  .app-shell.drawer-open .app-sidebar .nav-divider {
    display: block;
  }
  .drawer-toggle {
    display: block;
  }
  #contentArea {
    padding: var(--space-4) var(--space-3);
  }
  .topbar {
    padding: 0 var(--space-3);
    min-height: 48px;
  }
  .landing-hero {
    padding: var(--space-8) var(--space-3) var(--space-6);
  }
  .lh-title {
    font-size: 34px;
  }
  .lh-sub {
    font-size: 15px;
  }
  .landing-cards {
    display: flex;
    overflow-x: auto;
    gap: var(--space-3);
    scroll-snap-type: x mandatory;
    padding-bottom: var(--space-3);
  }
  .landing-cards .lc-card {
    flex: 0 0 85%;
    scroll-snap-align: start;
  }
  .lf-grid {
    grid-template-columns: 1fr;
  }
  .standings-grid {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
  }
  .lower-third .status-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .status-bar .live-dot {
    animation: none;
  }
}

/* ── Render Free-Tier Cold-Start Status Banner (Non-Blocking) ── */
.wake-banner,
#render-wake-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.wake-banner.active,
#render-wake-banner.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.wake-content {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 21, 31, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 8px 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.wake-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--poster-accent, #EA580C);
  border-radius: 50%;
  animation: wake-spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes wake-spin {
  100% {
    transform: rotate(360deg);
  }
}

.wake-text {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  color: #F8FAFC;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

