/* ═══════════════════════════════════════════════════════════════════════════
   PLOFA HUB — DESIGN LAYER v2
   Loaded AFTER index.css. Overrides tokens + refines components.
   Direction: broadcast-grade football intelligence — editorial type, dense
   data tables, hairline surfaces, team-colour identity.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 0. FONTS ────────────────────────────────────────────────────────────────
   Consolas is the season's house face and ships with Windows — no webfont
   request, no render blocking. The stack falls back to the platform's own
   monospace on other systems.
   ─────────────────────────────────────────────────────────────────────────── */

/* ── 1. TOKENS ───────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  /* Consolas is the house face for the 26/27 season — kept as the default
     across display, body and numerals. */
  --font-display: Consolas, 'Cascadia Mono', ui-monospace, monospace;
  --font-body:    Consolas, 'Cascadia Mono', ui-monospace, monospace;
  --font-mono:    Consolas, 'Cascadia Mono', ui-monospace, monospace;

  /* Ink & surfaces */
  --c-bg:           #080A0F;
  --c-bg-2:         #0C0F16;
  --c-surface:      #10141C;
  --c-surface-2:    #161B25;
  --c-surface-3:    #1D232F;
  --c-border:       rgba(255, 255, 255, 0.075);
  --c-border-light: rgba(255, 255, 255, 0.16);

  /* Brand */
  --c-accent:       #2FD07C;
  --c-accent-glow:  rgba(47, 208, 124, 0.22);
  --c-accent-dark:  #1FA763;
  --c-gold:         #F5C24B;
  --c-gold-dim:     #C9992F;
  --c-blue:         #5AA2F7;
  --c-purple:       #A78BFA;
  --c-red:          #F2606B;
  --c-orange:       #F79A4B;

  /* Ratings */
  --r-elite:    #2FD07C;
  --r-good:     #6FD8A4;
  --r-avg-high: #D9D264;
  --r-avg:      #F0A65C;
  --r-poor:     #F2606B;

  /* Text */
  --t-primary:   #EDF1F7;
  --t-secondary: #9AA5B6;
  --t-muted:     #66707F;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 32px var(--c-accent-glow);
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.045);

  /* Chrome */
  --c-nav-bg:     rgba(8, 10, 15, 0.72);
  --c-card-glass: rgba(16, 20, 28, 0.72);
  --c-row-border: rgba(255, 255, 255, 0.05);

  /* Geometry */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  --nav-h: 62px;
  --max-w: 1460px;
}

html[data-theme="light"] {
  color-scheme: light;

  --c-bg:           #F6F7F9;
  --c-bg-2:         #EEF0F4;
  --c-surface:      #FFFFFF;
  --c-surface-2:    #F3F5F8;
  --c-surface-3:    #E7EAF0;
  --c-border:       rgba(12, 20, 34, 0.09);
  --c-border-light: rgba(12, 20, 34, 0.18);

  --c-accent:       #128C51;
  --c-accent-glow:  rgba(18, 140, 81, 0.16);
  --c-accent-dark:  #0B6B3D;
  --c-gold:         #A97400;
  --c-gold-dim:     #8A5E00;
  --c-blue:         #1E63C8;
  --c-purple:       #6D46D6;
  --c-red:          #C8333F;
  --c-orange:       #C2621A;

  --r-elite:    #128C51;
  --r-good:     #2F9A63;
  --r-avg-high: #8A7C10;
  --r-avg:      #B26612;
  --r-poor:     #C8333F;

  --t-primary:   #0D1219;
  --t-secondary: #4A5568;
  --t-muted:     #7A8699;

  --shadow-sm: 0 1px 2px rgba(13, 18, 25, 0.06);
  --shadow-md: 0 6px 20px rgba(13, 18, 25, 0.08);
  --shadow-lg: 0 18px 40px rgba(13, 18, 25, 0.12);
  --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  --c-nav-bg:     rgba(246, 247, 249, 0.78);
  --c-card-glass: rgba(255, 255, 255, 0.82);
  --c-row-border: rgba(12, 20, 34, 0.06);
}

/* ── 2. BASE ─────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  letter-spacing: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(1200px 620px at 78% -10%, rgba(47, 208, 124, 0.07), transparent 62%),
    radial-gradient(900px 520px at 8% 4%, rgba(90, 162, 247, 0.055), transparent 60%),
    var(--c-bg);
  background-attachment: fixed;
  color: var(--t-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[data-theme="light"] body {
  background:
    radial-gradient(1200px 620px at 78% -10%, rgba(18, 140, 81, 0.055), transparent 62%),
    radial-gradient(900px 520px at 8% 4%, rgba(30, 99, 200, 0.045), transparent 60%),
    var(--c-bg);
}

/* Numbers always align */
.stat-num, .stat-pts, .pos-num, .match-score, .pred-score,
.league-table td, .kpi-val, .lg-num, .tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
}

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.015em; }

::selection { background: var(--c-accent); color: #05130C; }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--c-surface-3);
  border-radius: var(--r-full);
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-clip: content-box; background-color: var(--c-border-light); }

/* ── 3. TOP NAV ──────────────────────────────────────────────────────────── */
.topnav {
  height: var(--nav-h);
  background: var(--c-nav-bg);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--c-border);
}
.topnav.scrolled { box-shadow: 0 8px 32px rgba(0, 0, 0, 0.42); }
html[data-theme="light"] .topnav.scrolled { box-shadow: 0 8px 28px rgba(13, 18, 25, 0.07); }

.topnav-inner { gap: 28px; padding: 0 28px; }

.brand { gap: 10px; }
.brand-badge {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--c-accent), var(--c-accent-dark));
  color: #04140B;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 6px 18px var(--c-accent-glow);
}
.brand-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-text em { font-style: normal; color: var(--t-muted); font-weight: 600; }

.nav-links { gap: 2px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t-secondary);
  letter-spacing: -0.005em;
  transition: background var(--tr-fast), color var(--tr-fast);
  position: relative;
}
.nav-link svg {
  width: 15px; height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  opacity: 0.75;
}
.nav-link:hover { background: var(--c-surface-2); color: var(--t-primary); }
.nav-link.active {
  color: var(--t-primary);
  background: var(--c-surface-2);
  box-shadow: var(--hairline);
}
.nav-link.active svg { color: var(--c-accent); opacity: 1; }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 11px; right: 11px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--c-accent);
}

.season-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: var(--r-full);
  border: 1px solid var(--c-border);
  color: var(--t-secondary);
  background: var(--c-surface-2);
}

.freshness-badge {
  border-radius: var(--r-full);
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  padding: 5px 11px;
  font-size: 11.5px;
  color: var(--t-secondary);
}
.freshness-badge:hover { border-color: var(--c-border-light); color: var(--t-primary); }
.freshness-dot { width: 6px; height: 6px; }

.theme-toggle {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--t-secondary);
}
.theme-toggle:hover { color: var(--t-primary); border-color: var(--c-border-light); }
.theme-toggle svg { width: 15px; height: 15px; }

/* Command palette trigger */
.cmd-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px 0 9px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--t-muted);
  font-size: 12px;
  transition: all var(--tr-fast);
}
.cmd-trigger:hover { border-color: var(--c-border-light); color: var(--t-secondary); }
.cmd-trigger svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.cmd-trigger kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--c-border);
  background: var(--c-bg-2);
  color: var(--t-muted);
}

/* ── 4. LAYOUT ───────────────────────────────────────────────────────────── */
.main-content {
  max-width: var(--max-w);
  width: 100%;
  padding: 30px 28px 72px;
  flex: 1 0 auto;
}

.page.active { animation: pageIn 340ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── 5. PAGE HEAD ────────────────────────────────────────────────────────── */
.page-header {
  align-items: flex-end;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title .sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--t-muted);
  letter-spacing: 0;
  margin-left: 0;
  padding: 3px 9px;
  border-radius: var(--r-full);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  white-space: nowrap;
}
.page-subtitle { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.eyebrow::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

/* ── 6. BUTTONS / INPUTS ─────────────────────────────────────────────────── */
.btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--t-secondary);
  transition: all var(--tr-fast);
}
.btn:hover { background: var(--c-surface-3); color: var(--t-primary); border-color: var(--c-border-light); }
.btn-primary {
  background: linear-gradient(180deg, var(--c-accent), var(--c-accent-dark));
  border-color: transparent;
  color: #04140B;
  box-shadow: 0 6px 18px var(--c-accent-glow);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn-ghost { background: transparent; }
.btn-ghost.active { background: var(--c-accent-glow); color: var(--c-accent); border-color: var(--c-accent); }

.search-box {
  height: 36px;
  border-radius: 9px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
}
.search-box:focus-within { border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-glow); }
.search-input { font-size: 13px; }
.select-input {
  height: 36px;
  border-radius: 9px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  font-size: 12.5px;
  color: var(--t-secondary);
  padding: 0 30px 0 12px;
}

/* Tabs */
.tabs {
  border-bottom: 1px solid var(--c-border);
  gap: 2px;
  background: none;
  padding: 0;
}
.tab-btn {
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--t-muted);
  border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  letter-spacing: -0.005em;
}
.tab-btn:hover { color: var(--t-primary); background: var(--c-surface-2); }
.tab-btn.active { color: var(--c-accent); border-bottom-color: var(--c-accent); background: none; }
/* Loaded after index.css, so the phone tab rules live here too. */
@media (max-width: 720px) {
  .tabs { flex-wrap: wrap; overflow-x: visible; }
  .tab-btn { padding: 8px 11px; font-size: 11.5px; }
}

/* ── 7. CARDS ────────────────────────────────────────────────────────────── */
.card, .card-glass {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--hairline);
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
}
.card-title {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--t-secondary);
}

/* ── 8. LEAGUE TABLE ─────────────────────────────────────────────────────── */
.league-table { font-size: 13px; }
/* On wide screens let the page be the scroll container so the header can
   stick under the nav. Narrow screens keep the horizontal scroller. */
.card:has(> .league-table-wrap) { overflow: visible; }
@media (min-width: 980px) {
  .league-table-wrap { overflow: visible; }
}
.league-table thead th {
  position: sticky;
  top: var(--nav-h);
  z-index: 2;
  background: var(--c-bg-2);
  backdrop-filter: blur(12px);
  padding: 11px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--t-muted);
  border-bottom: 1px solid var(--c-border);
}
/* Narrow screens keep the horizontal scroller, and a sticky header inside a
   scroller lands on top of the first row (it looked like row 1 was missing).
   Placed after the base rule on purpose: same specificity, later wins. */
@media (max-width: 979px) {
  .league-table thead th { position: static; }
}
.league-table thead th .sort-icon { opacity: 0.35; }
.league-table thead th.sorted .sort-icon { opacity: 1; }
.league-table tbody td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--c-row-border);
  color: var(--t-secondary);
}
.league-table tbody tr { transition: background var(--tr-fast); }
.league-table tbody tr:hover td { background: var(--c-surface-2); }
.league-table tbody tr:hover .team-name-cell { color: var(--t-primary); }

.pos-num {
  width: 24px; height: 24px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: transparent;
  color: var(--t-muted);
}
.zone-champion .pos-num { background: rgba(245, 194, 75, 0.14); color: var(--c-gold); }
.zone-europa .pos-num   { background: rgba(90, 162, 247, 0.13); color: var(--c-blue); }
.zone-relegation .pos-num { background: rgba(242, 96, 107, 0.13); color: var(--c-red); }
.zone-champion td:first-child { border-left: 2px solid var(--c-gold); }
.zone-europa td:first-child { border-left: 2px solid var(--c-blue); }
.zone-relegation td:first-child { border-left: 2px solid var(--c-red); }

.team-name-cell { font-size: 13.5px; font-weight: 600; gap: 10px; color: var(--t-primary); }

/* Crests: transparent PNGs, never a white box */
.team-crest { border-radius: 0; flex-shrink: 0; line-height: 0; }
.team-crest img { display: block; }
.team-crest--fb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  background: color-mix(in srgb, currentColor 16%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 32%, transparent);
}

.stat-num { font-family: var(--font-mono); font-size: 12px; color: var(--t-secondary); }
.stat-pts { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--t-primary); }
.stat-gd.positive { color: var(--c-accent); }
.stat-gd.negative { color: var(--c-red); }

.form-pills { gap: 4px; }
.form-pill {
  width: 20px; height: 20px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
}
.form-W { background: rgba(47, 208, 124, 0.16); color: var(--c-accent); }
.form-D { background: rgba(90, 162, 247, 0.14); color: var(--c-blue); }
.form-L { background: rgba(242, 96, 107, 0.14); color: var(--c-red); }

/* Phone: a league table is read for position, goal difference and points.
   W / D / L / GF / GA are all derivable from those, so they go — that turns
   a 723px table into something that fits 390px without a sideways scroll.
   The expected / projected tables keep xG / xGA / xGD / xPTS and only lose
   W / D / L, which sit in the same column slots in all three tables. */
@media (max-width: 620px) {
  .league-table th:nth-child(4), .league-table td:nth-child(4),
  .league-table th:nth-child(5), .league-table td:nth-child(5),
  .league-table th:nth-child(6), .league-table td:nth-child(6) { display: none; }
  #league-table-el th:nth-child(7), #league-table-el td:nth-child(7),
  #league-table-el th:nth-child(8), #league-table-el td:nth-child(8) { display: none; }

  .league-table { font-size: 12.5px; }
  /* `thead th` on purpose: the base rule is `.league-table thead th`, so a
     plain `.league-table th` here would lose on specificity. */
  .league-table thead th { padding: 9px 5px; font-size: 9px; letter-spacing: 0.06em; }
  .league-table tbody td { padding: 9px 5px; }
  .league-table .pos-num { width: 20px; height: 20px; font-size: 10px; border-radius: 6px; }
  .league-table th:nth-child(2), .league-table td:nth-child(2) { min-width: 0; }
  .league-table th:nth-child(2) { min-width: 0 !important; }
  .team-name-cell { gap: 6px; font-size: 12.5px; }
  .league-table .form-pill { width: 14px; height: 14px; font-size: 8px; border-radius: 4px; }
  .league-table .form-pills { gap: 2px; }
  .league-table .sort-icon { display: none; }
  .league-table th.sorted::after { content: ' ▾'; }
}

/* ── 9. MATCH LIST ───────────────────────────────────────────────────────── */
.matches-grid { gap: 6px; }
.matches-grid > .btn { align-self: center; }

.match-card {
  padding: 0 18px;
  min-height: 62px;
  border-radius: 11px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  grid-template-columns: 1fr 132px 1fr;
  transition: background var(--tr-fast), border-color var(--tr-fast), transform var(--tr-fast);
}
.match-card::before { display: none; }
.match-card::after {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: background var(--tr-fast);
}
.match-card:hover {
  background: var(--c-surface-2);
  border-color: var(--c-border-light);
  transform: none;
  box-shadow: none;
}
.match-card:hover::after { background: var(--c-accent); }
.match-card.derby { border-left: none; }
.match-card.derby::after { background: var(--c-gold); }

.match-team { font-size: 14px; font-weight: 600; gap: 10px; }
.match-team.home { flex-direction: row; justify-content: flex-end; }
.match-team.away { flex-direction: row; justify-content: flex-start; }
.match-team.home span { text-align: right; }
.match-center { gap: 2px; width: 132px; }
.match-score {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.match-meta { font-size: 11px; color: var(--t-muted); font-family: var(--font-mono); }
.match-date { color: var(--t-muted); }
.match-xg-row { font-size: 10.5px; gap: 6px; color: var(--t-muted); font-family: var(--font-mono); }
.match-kickoff {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--c-accent);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.derby-badge {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-gold);
  background: rgba(245, 194, 75, 0.14);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ── 10. PREDICTION CARDS ────────────────────────────────────────────────── */
.pred-grid { display: flex; flex-direction: column; gap: 26px; align-items: stretch; }
.pred-md { display: flex; flex-direction: column; gap: 12px; }
.pred-md-head { display: flex; align-items: center; gap: 12px; }
.pred-md-count { font-family: var(--font-mono); font-size: 10.5px; color: var(--t-muted); }
.pred-md-rule { flex: 1; height: 1px; background: var(--c-border); }
.pred-md-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: 14px;
  align-items: stretch;
}
.pred-toggle-wrap { display: flex; justify-content: center; padding: 6px 0 8px; }

/* model explainer */
.pred-info {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--hairline);
  margin-bottom: 24px;
  overflow: hidden;
}
.pred-info > summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  user-select: none;
}
.pred-info > summary::-webkit-details-marker { display: none; }
.pred-info > summary::after {
  content: '+';
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--t-muted);
}
.pred-info[open] > summary::after { content: '−'; }
.pred-info-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pred-info-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--t-muted); }
.pred-info-body {
  padding: 0 18px 16px;
  font-size: 12.5px;
  line-height: 1.68;
  color: var(--t-secondary);
  border-top: 1px solid var(--c-border);
  padding-top: 14px;
}
.pred-info-body b { color: var(--t-primary); font-weight: 600; }
.pred-info-note { margin-top: 10px; color: var(--t-muted); font-size: 11.5px; }

.pred-card {
  border-radius: var(--r-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--hairline);
  padding: 13px 15px 13px 18px;
  gap: 11px;
  transition: border-color var(--tr-fast), transform var(--tr-fast), box-shadow var(--tr-fast);
}
.pred-card:hover {
  border-color: var(--c-border-light);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -16px rgba(0, 0, 0, .7);
}

/* top strip */
.pred-mdchip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--t-secondary);
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  border-radius: 5px;
  padding: 2px 6px;
}
.pred-when { font-size: 11px; color: var(--t-muted); }

/* crests + projected score */
.pred-name { font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.pred-score {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.pred-score-cap {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--t-muted);
}
.pred-score-cap b { color: var(--t-secondary); font-weight: 700; }

/* probability bar — the numbers live inside the segments */
.pred-bar {
  height: 20px;
  gap: 0;
  background: var(--c-bg-2);
  font-size: 10px;
  font-weight: 800;
}
.pred-seg { font-size: 10px; font-family: var(--font-mono); }
.pred-seg + .pred-seg { box-shadow: inset 1px 0 0 rgba(0, 0, 0, .25); }

.pred-wdl { font-size: 10.5px; }
.pred-wdl i { width: 6px; height: 6px; }
.pred-wdl b { font-family: var(--font-mono); font-size: 10.5px; }

.pred-stats > div {
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  border-radius: 9px;
  padding: 7px 6px;
}
.pred-stats span { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--t-muted); }
.pred-stats b { font-family: var(--font-mono); font-size: 12.5px; }

.pred-scores-lab { font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; }
.pred-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 3px 8px;
}
.pred-chip b { color: var(--t-muted); }
.pred-chip.is-top { border-color: color-mix(in srgb, var(--c-accent) 55%, transparent); }
.pred-chip.is-top b { color: var(--c-accent); }

.pred-factors { padding-top: 9px; border-top: 1px solid var(--c-border); }
.pred-factor {
  font-size: 10px;
  color: var(--t-muted);
  background: var(--c-bg-2);
  border-radius: 6px;
  padding: 3px 7px;
  border: 1px solid var(--c-border);
}

.pred-conf {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 5px;
}
.matchday-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  background: var(--c-accent-glow);
  border: 1px solid rgba(47, 208, 124, 0.28);
  border-radius: var(--r-full);
  padding: 4px 10px;
}
.pred-info { border-radius: var(--r-lg); }
.pred-info .card-body { font-size: 12.5px; }

/* ── 11. HOME / DASHBOARD ────────────────────────────────────────────────── */
.dash { display: flex; flex-direction: column; gap: 22px; }

.dash-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 1px solid var(--c-border);
  background:
    radial-gradient(720px 320px at 88% -30%, rgba(47, 208, 124, 0.16), transparent 70%),
    radial-gradient(560px 280px at 4% 120%, rgba(90, 162, 247, 0.1), transparent 70%),
    linear-gradient(160deg, #10151F 0%, #0C1017 60%, #0A0E14 100%);
  box-shadow: var(--hairline), 0 24px 60px rgba(0, 0, 0, 0.34);
}
html[data-theme="light"] .dash-hero {
  background:
    radial-gradient(720px 320px at 88% -30%, rgba(18, 140, 81, 0.12), transparent 70%),
    radial-gradient(560px 280px at 4% 120%, rgba(30, 99, 200, 0.08), transparent 70%),
    linear-gradient(160deg, #FFFFFF 0%, #F4F7F5 60%, #EFF3F6 100%);
  box-shadow: var(--hairline), 0 18px 44px rgba(13, 18, 25, 0.07);
}
/* pitch motif */
.dash-hero::before {
  content: '';
  position: absolute;
  right: -80px; top: -60px;
  width: 460px; height: 460px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 40px rgba(255, 255, 255, 0.018), 0 0 0 96px rgba(255, 255, 255, 0.012);
  pointer-events: none;
}
html[data-theme="light"] .dash-hero::before { border-color: rgba(12, 20, 34, 0.05); box-shadow: 0 0 0 40px rgba(12, 20, 34, 0.015), 0 0 0 96px rgba(12, 20, 34, 0.01); }

.dash-hero-inner { position: relative; padding: 30px 32px 22px; }

.dash-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.1vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 12px 0 10px;
}
.dash-title .accent { color: var(--c-accent); }
.dash-sub {
  font-size: 13.5px;
  color: var(--t-secondary);
  max-width: 620px;
  line-height: 1.62;
}
.dash-sub b { color: var(--t-primary); font-weight: 600; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 26px;
  border-top: 1px solid var(--c-border);
}
.kpi {
  background: none;
  padding: 16px 20px 18px;
  position: relative;
  min-width: 0;
  border-left: 1px solid var(--c-border);
}
.kpi:first-child { border-left: none; padding-left: 0; }
.kpi-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--t-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
}
.kpi-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--t-primary);
}
.kpi-val small {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--t-muted);
  letter-spacing: 0;
}
.kpi-meta { font-size: 11.5px; color: var(--t-muted); margin-top: 5px; }
.kpi-meta b { color: var(--t-secondary); font-weight: 600; }

/* dashboard grid */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--hairline);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
}
.panel-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.panel-title::before {
  content: '';
  width: 3px; height: 13px;
  border-radius: 2px;
  background: var(--c-accent);
}
.panel-link {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--tr-fast);
}
.panel-link:hover { color: var(--c-accent); }
.panel-body { padding: 6px 0; }

/* headline story */
.story-lead {
  position: relative;
  padding: 24px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background var(--tr-fast);
  overflow: hidden;
}
.story-lead:hover { background: var(--c-surface-2); }
.story-lead::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--story-accent, var(--c-accent));
  opacity: 0.85;
}
.story-lead .news-cat { margin-bottom: 12px; }
.story-lead-title {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.16;
  margin-bottom: 10px;
}
.story-lead-deck {
  font-size: 13px;
  color: var(--t-secondary);
  line-height: 1.6;
  max-width: 60ch;
}
.story-lead-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-accent);
}

.story-list { display: flex; flex-direction: column; }
.story-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-row-border);
  cursor: pointer;
  transition: background var(--tr-fast);
}
.story-item:last-child { border-bottom: none; }
.story-item:hover { background: var(--c-surface-2); }
.story-item-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-top: 6px;
}
.story-item-deck {
  font-size: 12px;
  color: var(--t-muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-item-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--t-muted);
  white-space: nowrap;
  text-align: right;
}

/* results rows */
.res-row {
  display: grid;
  grid-template-columns: 1fr 64px 1fr 54px;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--c-row-border);
  cursor: pointer;
  transition: background var(--tr-fast);
}
.res-row:last-child { border-bottom: none; }
.res-row:hover { background: var(--c-surface-2); }
.res-team { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 550; min-width: 0; }
.res-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-team.home { justify-content: flex-end; text-align: right; }
.res-score {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  padding: 3px 0;
  border-radius: 6px;
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
}
.res-xg { font-family: var(--font-mono); font-size: 10px; color: var(--t-muted); text-align: right; }

/* mini table */
.mini-row {
  display: grid;
  grid-template-columns: 22px 1fr auto 74px;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--c-row-border);
  cursor: pointer;
  transition: background var(--tr-fast);
}
.mini-row:last-child { border-bottom: none; }
.mini-row:hover { background: var(--c-surface-2); }
.mini-pos {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--t-muted);
  text-align: center;
}
.mini-pos.top { color: var(--c-gold); }
.mini-team { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 550; min-width: 0; }
.mini-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-form { display: flex; gap: 3px; justify-content: flex-end; }
.mini-form i {
  width: 15px; height: 15px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
}
.mini-pts {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  text-align: right;
  color: var(--t-primary);
}

/* scorer leaderboard */
.scorer-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--c-row-border);
  cursor: pointer;
  transition: background var(--tr-fast);
}
.scorer-row:last-child { border-bottom: none; }
.scorer-row:hover { background: var(--c-surface-2); }
.scorer-rank { font-family: var(--font-mono); font-size: 10.5px; color: var(--t-muted); font-weight: 700; }
.scorer-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.scorer-team { font-size: 10.5px; color: var(--t-muted); display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.scorer-goals {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--t-primary);
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.scorer-goals small { font-size: 9.5px; font-weight: 500; color: var(--t-muted); }

/* next fixture */
.next-fix { padding: 18px; }
.next-fix-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.next-fix-team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.next-fix-team span { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.next-fix-mid { text-align: center; }
.next-fix-score {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.next-fix-when { font-family: var(--font-mono); font-size: 10px; color: var(--t-muted); margin-top: 3px; }

/* quick links */
.dash-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.dash-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 11px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  transition: all var(--tr-fast);
}
.dash-link:hover {
  border-color: var(--c-border-light);
  background: var(--c-surface-2);
  transform: translateY(-1px);
}
.dash-link-ic {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-accent);
  flex-shrink: 0;
}
.dash-link-ic svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.dash-link-body b { display: block; font-size: 12.5px; font-weight: 600; }
.dash-link-body span { font-size: 11px; color: var(--t-muted); }

/* ── 11b. TEAM CARDS ─────────────────────────────────────────────────────── */
.team-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--c-border);
  min-width: 0;
}
.tc-scorer {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}
.tc-scorer span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-muted);
}
.tc-scorer b {
  font-size: 12px;
  font-weight: 600;
  color: var(--t-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-rating { flex-shrink: 0; }

/* ── 11c. STRENGTH BARS ──────────────────────────────────────────────────── */
.str-track {
  height: 7px;
  border-radius: var(--r-full);
  background: var(--c-surface-2);
  overflow: hidden;
}
.str-fill { height: 100%; border-radius: var(--r-full); }
.str-fill.str-str { background: linear-gradient(90deg, var(--c-accent-dark), var(--c-accent)); }
.str-fill.str-atk { background: linear-gradient(90deg, #24559C, var(--c-blue)); }
.str-fill.str-def { background: linear-gradient(90deg, #5B3AA8, var(--c-purple)); }
.str-bar-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-muted);
}
.str-meta span { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-muted); }
.str-meta b { font-family: var(--font-mono); font-size: 12.5px; }

/* ── 12. NEWS CATEGORY CHIPS ─────────────────────────────────────────────── */.news-cat {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  display: inline-block;
  background: color-mix(in srgb, var(--cat, var(--c-accent)) 16%, transparent);
  color: var(--cat, var(--c-accent));
  border: 1px solid color-mix(in srgb, var(--cat, var(--c-accent)) 28%, transparent);
}

/* ── 13. FOOTER ──────────────────────────────────────────────────────────── */
.app-footer {
  border-top: 1px solid var(--c-border);
  background: var(--c-bg-2);
  margin-top: 40px;
}
.app-footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 26px 28px 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .brand-badge { width: 24px; height: 24px; font-size: 12px; border-radius: 7px; box-shadow: none; }
.footer-brand b { font-family: var(--font-display); font-size: 13px; letter-spacing: -0.02em; }
.footer-brand span { font-size: 11.5px; color: var(--t-muted); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-size: 11.5px; color: var(--t-muted); transition: color var(--tr-fast); }
.footer-links a:hover { color: var(--t-primary); }
.footer-note { font-family: var(--font-mono); font-size: 10.5px; color: var(--t-muted); }

/* ── 14. COMMAND PALETTE ─────────────────────────────────────────────────── */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 6, 10, 0.62);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.cmd-overlay.open { display: flex; animation: fadeIn 140ms ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.cmd-box {
  width: min(560px, calc(100vw - 40px));
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-lg);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: cmdIn 180ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cmdIn { from { opacity: 0; transform: translateY(-8px) scale(0.99); } to { opacity: 1; transform: none; } }

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--c-border);
}
.cmd-input-wrap svg { width: 16px; height: 16px; stroke: var(--t-muted); fill: none; stroke-width: 2; flex-shrink: 0; }
.cmd-input {
  flex: 1;
  height: 50px;
  border: none;
  background: none;
  color: var(--t-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.cmd-input::placeholder { color: var(--t-muted); }
.cmd-esc {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid var(--c-border);
  color: var(--t-muted);
}
.cmd-results { max-height: 46vh; overflow-y: auto; padding: 6px; }
.cmd-group-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--t-muted);
  padding: 10px 10px 6px;
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.cmd-item.active, .cmd-item:hover { background: var(--c-surface-2); }
.cmd-item .cmd-kind {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t-muted);
  margin-left: auto;
  border: 1px solid var(--c-border);
  padding: 2px 6px;
  border-radius: 4px;
}
.cmd-empty { padding: 28px 16px; text-align: center; font-size: 12.5px; color: var(--t-muted); }

/* ── 15. SKELETON / LOADING ──────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--c-surface) 25%, var(--c-surface-2) 37%, var(--c-surface) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
@keyframes shimmer { from { background-position: 100% 50%; } to { background-position: 0 50%; } }

.loading-overlay { background: var(--c-bg); }
.loading-text {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t-muted);
}

/* ── 16. MISC POLISH ─────────────────────────────────────────────────────── */
.card-body { font-size: 13px; }
.stat-grid { gap: 10px; }
.badge, .pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  border-radius: 5px;
}
.guide-fab {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--t-secondary);
  font-size: 16px;
  box-shadow: var(--shadow-md);
}
.guide-fab:hover { border-color: var(--c-accent); color: var(--c-accent); }

.toast {
  border-radius: 10px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-light);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
}

/* ── 17. RESPONSIVE ──────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-links { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .main-content { padding: 22px 16px 60px; }
  .topnav-inner { padding: 0 16px; gap: 14px; }
  /* Keep the desktop row shape: home · time/score · away. Collapsing to one
     column turned a 62px row into a ~150px block (name / time / date / name). */
  .match-card {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    min-height: 54px;
    padding: 0 14px;
  }
  .match-center { width: auto; min-width: 0; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 14px 16px; }
  .kpi:first-child { padding-left: 16px; }
  .kpi:nth-child(3) { border-left: none; padding-left: 0; }
  .dash-hero-inner { padding: 22px 20px 18px; }
  .dash-links { grid-template-columns: repeat(2, 1fr); }
  .cmd-trigger span { display: none; }

  /* mobile drawer */
  .nav-links { box-shadow: var(--shadow-lg); }
  .nav-link { border-radius: 8px; }
  .nav-link.active::after { display: none; }
  .hamburger {
    border: 1px solid var(--c-border);
    background: var(--c-surface-2);
    width: 32px; height: 32px;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }
  .hamburger span { width: 15px; }
}
@media (max-width: 640px) {
  .dash-links { grid-template-columns: 1fr; }
  .page-title { font-size: 22px; }
  .story-lead-title { font-size: 20px; }
  .match-card { min-height: 48px; padding: 0 12px; gap: 8px; }
  .match-team { font-size: 12.5px; gap: 7px; }
  .match-center { width: auto; min-width: 0; align-items: center; gap: 1px; }
  .match-xg-row { font-size: 10px; }
  .res-row { grid-template-columns: 1fr 52px 1fr; }
  .res-xg { display: none; }
  .data-freshness { display: none; }
  .kpi-val { font-size: 20px; }
}

/* Narrow phones (360–430px): the nav has to fit brand + season badge + search
   + theme + menu in ~350px. The ⌘K hint is pointless on touch, and the
   paddings can come in a notch without the bar looking cramped. */
@media (max-width: 430px) {
  .topnav-inner { padding: 0 14px; gap: 12px; }
  .brand-text { font-size: 18px; }
  .brand-badge { width: 30px; height: 30px; font-size: 16px; }
  .nav-right { gap: 8px; }
  .cmd-trigger kbd { display: none; }
  .cmd-trigger { padding: 0 8px; gap: 0; }
  /* the floating update-guide button sits over the content on a phone —
     shrink it and lift it clear of the home-indicator area */
  .guide-fab {
    width: 44px; height: 44px; right: 14px; font-size: 18px;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── 18. MOTION ──────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── 19. FORMATION BOARD ─────────────────────────────────────────────────────
   Match-centre lineup board: one full vertical pitch per team, GK at the
   bottom, attacking up. The SVG palette comes from Pitch._T (theme-aware),
   passed in as --lu-* custom properties, so the turf follows the theme.
   ────────────────────────────────────────────────────────────────────────── */

.lu {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm), var(--hairline);
  color: var(--t-primary);
}

/* header strip: score + match meta */
.lu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 13px 18px;
  border-bottom: 1px solid var(--c-border);
  background: linear-gradient(180deg, var(--c-surface-2), var(--c-surface));
}
.lu-score {
  display: flex;
  align-items: baseline;
  gap: 11px;
  min-width: 0;
}
.lu-score-team {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lu-score-num {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border-light);
  color: var(--t-primary);
  flex-shrink: 0;
}
.lu-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--lu-muted, var(--t-muted));
  flex-wrap: wrap;
}
.lu-meta-chip {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border);
  color: var(--lu-soft, var(--t-secondary));
  font-variant-numeric: tabular-nums;
}
.lu-meta-venue {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* two pitches side by side */
.lu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
  align-items: start;
}

.lu-side {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 13px;
  border-radius: var(--r-md);
  background: var(--c-bg-2);
  border: 1px solid var(--c-border);
}

/* team header */
.lu-side-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lu-crest {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lu-crest .team-crest { width: 100%; height: 100%; }
.lu-crest img { width: 100%; height: 100%; object-fit: contain; display: block; }
.lu-side-id {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.lu-side-id b {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--t-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lu-side-id span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lu-muted, var(--t-muted));
}
.lu-side-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.lu-form-chip {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border-light);
  color: var(--t-primary);
}
.lu-avg {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--lu-muted, var(--t-muted));
  white-space: nowrap;
}
.lu-avg b {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--t-primary);
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}

/* pitch canvas */
.lu-pitch {
  border-radius: var(--r-md);
  overflow: hidden;
  line-height: 0;
  background: var(--lu-surface, var(--c-surface-2));
  max-width: 460px;
  width: 100%;
  margin-inline: auto;
}
.lu-pitch svg { display: block; width: 100%; height: auto; }

/* player tokens */
.lu-token {
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.lu-grid:hover .lu-token { opacity: 0.86; }
.lu-token:hover {
  opacity: 1 !important;
  filter: brightness(1.16);
}
.lu-token:focus-visible { outline: none; }

/* substitutes */
.lu-subs {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px dashed var(--c-border);
}
.lu-subs-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lu-muted, var(--t-muted));
}
.lu-subs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lu-sub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 3px;
  border-radius: var(--r-full);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.lu-sub:hover {
  background: var(--c-surface-3);
  border-color: var(--c-border-light);
}
.lu-sub-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid;
  background: var(--c-surface-3);
  font-size: 8.5px;
  font-weight: 800;
  color: var(--t-primary);
}
.lu-sub-dot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lu-sub-name {
  font-weight: 600;
  color: var(--t-primary);
  white-space: nowrap;
}
.lu-sub-min {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--lu-muted, var(--t-muted));
}

/* legend */
.lu-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 18px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--lu-muted, var(--t-muted));
}
.lu-lg-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid var(--r-elite);
  margin-right: 6px;
  vertical-align: -1px;
}
.lu-lg-mvp {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px dashed var(--c-gold);
  margin-right: 6px;
  vertical-align: -1px;
}
.lu-lg-brand {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--c-accent);
  opacity: 0.65;
}

/* responsive */
@media (max-width: 1024px) {
  .lu-grid { grid-template-columns: 1fr; gap: 14px; padding: 14px; }
  .lu-pitch { max-width: 420px; }
}
@media (max-width: 640px) {
  .lu-head { padding: 11px 13px; gap: 9px; }
  .lu-score { width: 100%; }
  .lu-score-team { font-size: 13.5px; }
  .lu-meta { width: 100%; font-size: 10px; gap: 7px; }
  .lu-meta-venue { display: none; }
  .lu-grid { padding: 11px; gap: 11px; }
  .lu-side { padding: 11px; }
  .lu-pitch { max-width: 340px; }
  .lu-legend { gap: 12px; font-size: 10px; padding: 9px 13px; }
  .lu-lg-brand { display: none; }
}
