/* ═══════════════════════════════════════════════════════════════════════════
   PLOFA STATS HUB — DESIGN SYSTEM
   Premium dark glassmorphism · Sofascore-inspired
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  color-scheme: dark;

  /* Colors */
  --c-bg:           hsl(220, 22%, 7%);
  --c-bg-2:         hsl(220, 20%, 10%);
  --c-surface:      hsl(220, 18%, 13%);
  --c-surface-2:    hsl(220, 16%, 17%);
  --c-surface-3:    hsl(220, 14%, 22%);
  --c-border:       hsl(220, 18%, 22%);
  --c-border-light: hsl(220, 15%, 28%);

  /* Accent */
  --c-accent:       hsl(145, 68%, 42%);
  --c-accent-glow:  hsl(145, 68%, 42%, 0.25);
  --c-accent-dark:  hsl(145, 68%, 30%);
  --c-gold:         hsl(43, 100%, 55%);
  --c-gold-dim:     hsl(43, 80%, 45%);
  --c-blue:         hsl(210, 85%, 58%);
  --c-purple:       hsl(270, 70%, 65%);
  --c-red:          hsl(0, 75%, 58%);
  --c-orange:       hsl(28, 90%, 58%);

  /* Rating colors */
  --r-elite:        hsl(145, 80%, 40%);
  --r-good:         hsl(145, 60%, 45%);
  --r-avg-high:     hsl(60, 80%, 50%);
  --r-avg:          hsl(35, 85%, 55%);
  --r-poor:         hsl(0, 70%, 52%);

  /* Text */
  --t-primary:      hsl(220, 10%, 95%);
  --t-secondary:    hsl(220, 8%, 62%);
  --t-muted:        hsl(220, 6%, 45%);
  --t-accent:       var(--c-accent);

  /* Typography */
  --font-display:  'Consolas', monospace;
  --font-body:     'Consolas', monospace;
  --font-mono:     'Consolas', monospace;

  /* Spacing */
  --gap-xs:   4px;
  --gap-sm:   8px;
  --gap-md:   16px;
  --gap-lg:   24px;
  --gap-xl:   40px;
  --gap-2xl:  64px;

  /* Radius */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 24px var(--c-accent-glow);

  /* Theme-aware surfaces */
  --c-nav-bg:     hsla(220, 22%, 7%, 0.85);
  --c-card-glass: hsla(220, 18%, 13%, 0.7);
  --c-row-border: hsla(220, 18%, 22%, 0.45);

  /* Transitions */
  --tr-fast: 120ms ease;
  --tr-med:  240ms ease;
  --tr-slow: 400ms ease;

  /* Layout */
  --nav-h:     60px;
  --max-w:     1400px;
  --sidebar-w: 280px;
}

/* ── Light Theme ── */
html[data-theme="light"] {
  color-scheme: light;

  --c-bg:           hsl(220, 25%, 97%);
  --c-bg-2:         hsl(220, 20%, 94%);
  --c-surface:      hsl(0, 0%, 100%);
  --c-surface-2:    hsl(220, 18%, 95%);
  --c-surface-3:    hsl(220, 14%, 89%);
  --c-border:       hsl(220, 15%, 88%);
  --c-border-light: hsl(220, 13%, 78%);

  --c-accent:       hsl(145, 62%, 33%);
  --c-accent-glow:  hsla(145, 62%, 36%, 0.2);
  --c-accent-dark:  hsl(145, 62%, 24%);
  --c-gold:         hsl(38, 92%, 38%);
  --c-gold-dim:     hsl(38, 85%, 32%);
  --c-blue:         hsl(212, 82%, 45%);
  --c-purple:       hsl(270, 60%, 50%);
  --c-red:          hsl(2, 72%, 46%);
  --c-orange:       hsl(26, 90%, 40%);

  --r-elite:        hsl(145, 65%, 31%);
  --r-good:         hsl(145, 55%, 36%);
  --r-avg-high:     hsl(58, 75%, 34%);
  --r-avg:          hsl(33, 80%, 42%);
  --r-poor:         hsl(0, 68%, 45%);

  --t-primary:      hsl(222, 20%, 12%);
  --t-secondary:    hsl(220, 10%, 36%);
  --t-muted:        hsl(220, 8%, 50%);

  --shadow-sm: 0 1px 3px rgba(23, 30, 48, 0.08);
  --shadow-md: 0 4px 16px rgba(23, 30, 48, 0.12);
  --shadow-lg: 0 8px 32px rgba(23, 30, 48, 0.16);

  --c-nav-bg:     hsla(220, 25%, 98%, 0.85);
  --c-card-glass: hsla(0, 0%, 100%, 0.72);
  --c-row-border: hsla(220, 15%, 55%, 0.28);
}
html[data-theme="light"] .topnav.scrolled { box-shadow: 0 4px 20px rgba(23, 30, 48, 0.08); }
html[data-theme="light"] .hero-banner {
  background: linear-gradient(135deg,
    hsl(220, 35%, 96%) 0%,
    hsl(212, 40%, 93%) 50%,
    hsl(160, 30%, 94%) 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--t-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg-2); }
::-webkit-scrollbar-thumb { background: var(--c-surface-3); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--c-border-light); }

/* ════════════════════════════════════════════════════════════════════════════
   TOP NAV
   ════════════════════════════════════════════════════════════════════════════ */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--c-nav-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow var(--tr-med);
}
.topnav.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.5); }

.topnav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--gap-lg);
  display: flex;
  align-items: center;
  gap: var(--gap-xl);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-shrink: 0;
}
.brand-badge {
  width: 34px; height: 34px;
  background: var(--c-accent);
  border-radius: var(--r-md);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--c-bg);
  box-shadow: 0 0 12px var(--c-accent-glow);
}
.brand-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--t-primary);
}
.brand-text em {
  font-style: normal;
  color: var(--c-accent);
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--t-secondary);
  transition: all var(--tr-fast);
  white-space: nowrap;
}
.nav-link svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-link:hover {
  color: var(--t-primary);
  background: var(--c-surface);
}
.nav-link.active {
  color: var(--c-accent);
  background: hsla(145, 68%, 42%, 0.12);
}

/* Nav right */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  margin-left: auto;
}
.season-badge {
  padding: 4px 10px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--c-gold);
}

/* Data freshness indicator (true file mtimes) */
.data-freshness { position: relative; }
.freshness-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t-secondary);
  white-space: nowrap;
  transition: color var(--tr-fast), border-color var(--tr-fast);
}
.freshness-badge:hover { color: var(--t-primary); border-color: var(--c-border-light); }
.freshness-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--t-muted);
  flex-shrink: 0;
  transition: background var(--tr-fast), box-shadow var(--tr-fast);
}
.freshness-dot.fresh {
  background: var(--c-accent);
  box-shadow: 0 0 6px var(--c-accent-glow);
}
.freshness-dot.stale { background: var(--c-gold); }
.freshness-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 10px 12px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--tr-fast), transform var(--tr-fast);
}
.freshness-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.freshness-panel-title {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--t-muted);
  margin-bottom: 6px;
}
.freshness-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 0;
  color: var(--t-secondary);
}
.freshness-row + .freshness-row { border-top: 1px solid var(--c-row-border); }
.freshness-row .fr-time { color: var(--t-primary); }
.freshness-row.is-latest .fr-time { color: var(--c-accent); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  border-radius: var(--r-sm);
}
.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--t-secondary);
  border-radius: 1px;
  transition: transform var(--tr-fast);
}

/* Theme toggle (light / dark / system) */
.theme-toggle {
  position: relative;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--t-secondary);
  transition: color var(--tr-fast), background var(--tr-fast);
}
.theme-toggle:hover { color: var(--t-primary); background: var(--c-surface-2); }
.theme-toggle svg {
  grid-area: 1 / 1;
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5) rotate(-40deg);
  transition: opacity var(--tr-fast), transform var(--tr-med);
}
.theme-toggle.is-light svg.icon-light,
.theme-toggle.is-dark svg.icon-dark,
.theme-toggle.is-system svg.icon-system {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ════════════════════════════════════════════════════════════════════════════
   HERO BANNER
   ════════════════════════════════════════════════════════════════════════════ */
.hero-banner {
  position: relative;
  overflow: hidden;
  padding: 60px var(--gap-lg) 50px;
  background: linear-gradient(135deg,
    hsl(220, 30%, 9%) 0%,
    hsl(220, 25%, 11%) 50%,
    hsl(180, 20%, 10%) 100%);
  border-bottom: 1px solid var(--c-border);
}
.hero-banner.hidden { display: none; }
.hero-content {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.hero-tagline {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--gap-md);
  padding: 4px 12px;
  background: hsla(145, 68%, 42%, 0.1);
  border: 1px solid hsla(145, 68%, 42%, 0.3);
  border-radius: var(--r-full);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: var(--gap-md);
}
.hero-title span {
  background: linear-gradient(135deg, var(--c-accent), var(--c-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 16px;
  color: var(--t-secondary);
  max-width: 520px;
  line-height: 1.6;
}
.hero-bg-orbs { position: absolute; inset: 0; pointer-events: none; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}
.orb-1 { width: 400px; height: 400px; background: var(--c-accent); top: -100px; right: -100px; }
.orb-2 { width: 300px; height: 300px; background: var(--c-gold); bottom: -100px; left: 30%; opacity: 0.08; }
.orb-3 { width: 200px; height: 200px; background: var(--c-blue); top: 50%; left: 10%; }

/* ════════════════════════════════════════════════════════════════════════════
   MAIN CONTENT & PAGES
   ════════════════════════════════════════════════════════════════════════════ */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--gap-xl) var(--gap-lg);
}
.page { display: none; }
.page.active { display: block; animation: pageIn var(--tr-slow) ease; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Page Headers ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-md);
  margin-bottom: var(--gap-xl);
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.page-title .sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--t-secondary);
  margin-left: var(--gap-sm);
}
.page-controls {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  align-items: center;
}

/* Expected-points table header (mirrors .page-header) */
.league-table-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap-md);
  margin-bottom: var(--gap-md);
  flex-wrap: wrap;
  padding: var(--gap-lg) var(--gap-lg) 0;
}
.page-subtitle {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

/* ════════════════════════════════════════════════════════════════════════════
   CARDS & GLASS
   ════════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-glass {
  background: var(--c-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.card-header {
  padding: var(--gap-md) var(--gap-lg);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}
.card-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--t-secondary);
}
.card-body { padding: var(--gap-lg); }

/* ════════════════════════════════════════════════════════════════════════════
   LEAGUE TABLE
   ════════════════════════════════════════════════════════════════════════════ */
.league-table-wrap { overflow-x: auto; }
.league-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.league-table th {
  text-align: center;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--t-muted);
  background: var(--c-bg-2);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--tr-fast);
}
.league-table th:first-child,
.league-table th:nth-child(2) { text-align: left; }
.league-table th:hover { color: var(--t-primary); }
.league-table th.sorted { color: var(--c-accent); }
.league-table th .sort-icon { margin-left: 4px; opacity: 0.5; }
.league-table th.sorted .sort-icon { opacity: 1; }

.league-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-row-border);
  white-space: nowrap;
  text-align: center;
}
.league-table td:first-child,
.league-table td:nth-child(2) { text-align: left; }
.league-table tr:last-child td { border-bottom: none; }
.league-table tr:hover td { background: var(--c-surface-2); cursor: pointer; }
.league-table tr.transition-row td { animation: rowFadeIn 0.3s ease; }
@keyframes rowFadeIn {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Position markers */
.pos-num {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.pos-champion  { background: hsla(43, 100%, 55%, 0.12); color: var(--c-gold); }
.pos-europa    { background: hsla(210, 85%, 58%, 0.1); color: var(--c-blue); }
.pos-relegation { background: hsla(0, 75%, 58%, 0.1); color: var(--c-red); }
.pos-normal    { background: var(--c-surface-2); color: var(--t-muted); }

/* Team name cell */
.team-name-cell {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-weight: 600;
  color: var(--t-primary);
}
.team-crest {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}

/* Form pills */
.form-pills {
  display: flex;
  justify-content: center;
  gap: 3px;
}
.form-pill {
  width: 22px; height: 22px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 700;
}
.form-W { background: hsla(145, 68%, 42%, 0.2); color: var(--c-accent); }
.form-D { background: hsla(210, 85%, 58%, 0.15); color: var(--c-blue); }
.form-L { background: hsla(0, 75%, 58%, 0.15); color: var(--c-red); }

/* Stat number cells */
.stat-num {
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  color: var(--t-secondary);
}
.stat-pts {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--t-primary);
  text-align: center;
}
.stat-gd.positive { color: var(--c-accent); }
.stat-gd.negative { color: var(--c-red); }

/* Table zone dividers */
.zone-champion .pos-num { background: hsla(43, 100%, 55%, 0.12); color: var(--c-gold); }
.zone-champion td:first-child { border-left: 3px solid var(--c-gold); }
.zone-europa td:first-child { border-left: 3px solid var(--c-blue); }
.zone-relegation td:first-child { border-left: 3px solid var(--c-red); }

/* ════════════════════════════════════════════════════════════════════════════
   MATCHES
   ════════════════════════════════════════════════════════════════════════════ */
.matches-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}
.match-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--gap-md) var(--gap-lg);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--gap-md);
  cursor: pointer;
  transition: all var(--tr-fast);
  position: relative;
  overflow: hidden;
}
.match-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, hsla(145, 68%, 42%, 0.02));
  pointer-events: none;
}
.match-card:hover {
  border-color: var(--c-border-light);
  background: var(--c-surface-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.match-card.derby { border-left: 3px solid var(--c-gold); }

.match-team {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  font-weight: 600;
  font-size: 15px;
}
/* row-reversed: flex-start packs the name+crest against the centre score */
.match-team.home { justify-content: flex-start; flex-direction: row-reverse; }
.match-team.away { justify-content: flex-start; }

.match-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.match-score {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--t-primary);
  line-height: 1;
}
.match-xg-row {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--t-muted);
}
.match-meta {
  display: flex;
  gap: var(--gap-sm);
  align-items: center;
}
.matchday-badge {
  padding: 2px 8px;
  background: var(--c-surface-3);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  color: var(--t-muted);
  font-family: var(--font-mono);
}
.derby-badge {
  padding: 2px 8px;
  background: hsla(43, 100%, 55%, 0.12);
  border: 1px solid hsla(43, 100%, 55%, 0.25);
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 700;
  color: var(--c-gold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.match-date {
  font-size: 12px;
  color: var(--t-muted);
  font-family: var(--font-mono);
}

/* Match filter bar */
.matches-filter {
  display: flex;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-lg);
  flex-wrap: wrap;
  align-items: center;
}
.filter-input {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 8px 14px;
  color: var(--t-primary);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--tr-fast);
  min-width: 200px;
}
.filter-input:focus { border-color: var(--c-accent); }
.filter-input::placeholder { color: var(--t-muted); }

/* ════════════════════════════════════════════════════════════════════════════
   MATCH DETAIL
   ════════════════════════════════════════════════════════════════════════════ */
.match-detail-header {
  background: linear-gradient(135deg, var(--c-surface), var(--c-surface-2));
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--gap-xl);
  margin-bottom: var(--gap-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.match-detail-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, hsla(145,68%,42%,0.05), transparent 70%);
  pointer-events: none;
}
.detail-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--gap-xl);
  margin-bottom: var(--gap-md);
}
.detail-team-name {
  font-family: var(--font-display);
  font-size: clamp(18px, 3vw, 28px);
  font-weight: 900;
}
.detail-team-name.home { text-align: right; }
.detail-team-name.away { text-align: left; }
.detail-score-block { flex-shrink: 0; text-align: center; }
.detail-score {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1;
  color: var(--t-primary);
}
.detail-xg {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--t-muted);
  margin-top: 6px;
}
.detail-meta {
  display: flex;
  justify-content: center;
  gap: var(--gap-md);
  flex-wrap: wrap;
}
.detail-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--t-secondary);
}

/* ════════════════════════════════════════════════════════════════════════════
   MATCH CENTRE — one hero card, one switcher, three panels
   ════════════════════════════════════════════════════════════════════════════ */

.mc-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--c-surface), var(--c-surface-2));
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: 26px 30px 22px;
}
/* team-coloured wash in the top corners */
.mc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(720px 240px at 6% -20%, var(--mc-hc-dim, transparent), transparent 68%),
    radial-gradient(720px 240px at 94% -20%, var(--mc-ac-dim, transparent), transparent 68%);
  pointer-events: none;
}
.mc-hero > * { position: relative; }

.mc-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.mc-meta-t { font-size: 12px; font-weight: 600; color: var(--t-muted); }
.mc-meta-t + .mc-meta-t::before {
  content: '·';
  margin-right: 10px;
  opacity: 0.55;
}

.mc-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin-top: 16px;
}
.mc-side { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mc-side.is-home { justify-content: flex-end; }
.mc-side.is-away { justify-content: flex-start; }
.mc-name {
  font-family: var(--font-display);
  font-size: clamp(17px, 2.4vw, 27px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-crest { flex-shrink: 0; display: flex; }
.mc-mid { text-align: center; flex-shrink: 0; }
.mc-num {
  font-family: var(--font-display);
  font-size: clamp(38px, 5.4vw, 58px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--t-primary);
  font-variant-numeric: tabular-nums;
}
.mc-xg {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--t-muted);
}

/* ── six team duels ── */
.mc-duels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px 28px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}
.mc-duel { min-width: 0; width: 100%; max-width: 330px; justify-self: center; }
.mc-duel-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 8px;
}
.mc-duel-top b {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.mc-duel-top b:first-child { text-align: left; }
.mc-duel-top b:last-child { text-align: right; }
.mc-duel-top span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--t-muted);
  white-space: nowrap;
}
.mc-duel-track {
  display: flex;
  height: 4px;
  margin-top: 7px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--c-border);
}
.mc-duel-track i { display: block; height: 100%; }
.mc-duel-track i + i { opacity: 0.85; }

.mc-goals {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--c-border);
}

/* ── switcher ── */
.mc-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  margin-bottom: var(--gap-lg);
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.mc-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--t-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 0 18px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.mc-tab:hover { color: var(--t-primary); }
.mc-tab.is-on {
  color: hsl(150, 26%, 8%);
  background: var(--c-accent);
  box-shadow: 0 3px 12px -3px var(--c-accent);
}
html[data-theme="light"] .mc-tab.is-on { color: #ffffff; }

/* ── panels ── */
.mc-panel[hidden] { display: none; }
.mc-panel { animation: mc-fade 0.22s ease both; }
@keyframes mc-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.mc-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mc-panel-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-muted);
}

.mc-block + .mc-block { margin-top: var(--gap-xl); }
.mc-block-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.mc-block-h h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.mc-block-h span { font-size: 12px; color: var(--t-muted); }
.mc-hint { font-size: 13px; color: var(--t-muted); padding: 18px 2px; }

/* ── engine figures: thumbnail rail + lightbox ── */
.mc-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}
.mc-thumb {
  position: relative;
  display: block;
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--c-surface-2);
  cursor: zoom-in;
  aspect-ratio: 16 / 10;
  transition: border-color 0.16s ease, transform 0.16s ease;
}
.mc-thumb:hover {
  border-color: var(--c-border-light);
  transform: translateY(-2px);
}
.mc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.mc-thumb span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 10px 7px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, hsla(220, 40%, 4%, 0.88));
}

.mc-lightbox {
  width: min(1100px, 96vw);
  padding: 14px;
  background: var(--c-surface);
}
.mc-lightbox img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #0b0f14;
}
.mc-lightbox-l {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--t-muted);
}

@media (max-width: 900px) {
  .mc-duels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .mc-hero { padding: 20px 14px 18px; }
  .mc-score { gap: 8px; }
  .mc-side { gap: 8px; }
  /* let a long club name wrap instead of turning into "Red Wo…" */
  .mc-name {
    font-size: 13px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15;
  }
  .mc-crest svg { width: 30px !important; height: 30px !important; }
  .mc-num { font-size: 34px; }
  .mc-xg { font-size: 10px; }
  .mc-duels { grid-template-columns: 1fr; gap: 12px; }
  .mc-switch { display: flex; width: 100%; }
  .mc-tab { flex: 1; padding: 0 6px; font-size: 11.5px; }
  .mc-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mc-panel-title { display: none; }
  /* the separators dangle when the meta row wraps */
  .mc-meta-t + .mc-meta-t::before { content: none; }
}

/* On a phone the engine figures are the point — at two-up they are ~180px
   wide and the shot map is cropped to a sliver. One per row, nearer the
   source aspect ratio, and the whole figure is legible without tapping. */
@media (max-width: 560px) {
  .mc-rail { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mc-thumb { aspect-ratio: 3 / 2; }
}


/* Goal timeline — centred spine, home left / away right */
.gtl {
  position: relative;
  max-width: 760px;
  margin: 6px auto 0;
  text-align: left;
}
.gtl::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 16px;
  bottom: 16px;
  width: 1px;
  background: var(--c-border-light);
  transform: translateX(-0.5px);
}
.gtl-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 78px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.gtl-row:hover { background: color-mix(in srgb, var(--c-accent) 7%, transparent); }
.gtl-row:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: -2px;
}
.gtl-side {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.gtl-row.is-home .gtl-side { justify-content: flex-end; }
.gtl-row.is-away .gtl-side { justify-content: flex-start; }
.gtl-crest {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.gtl-crest img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gtl-crest .team-crest { width: 100%; height: 100%; }
.gtl-txt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.gtl-row.is-home .gtl-txt { align-items: flex-end; text-align: right; }
.gtl-row.is-away .gtl-txt { align-items: flex-start; text-align: left; }
.gtl-scorer {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--t-primary);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gtl-sub {
  font-size: 11px;
  color: var(--t-muted);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gtl-sub i { font-style: normal; opacity: 0.55; letter-spacing: 0.04em; text-transform: uppercase; font-size: 9.5px; }
.gtl-sub.is-solo { font-style: italic; opacity: 0.6; }
.gtl-sub.is-og { color: var(--c-red); font-weight: 600; }
/* inline "OG" tag — the red ball is the visual cue, this is the word */
.gtl-og {
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-left: 5px;
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--c-red);
  background: color-mix(in srgb, var(--c-red) 15%, transparent);
  vertical-align: 1px;
}
.gtl-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.gtl-min {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--c-accent);
  font-variant-numeric: tabular-nums;
}
.gtl-node {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-light);
}
.gtl-row:hover .gtl-node { border-color: var(--t-muted); }
.gtl-ball { display: block; }
.gtl-ball-body { fill: var(--t-primary); }
.gtl-ball-patch { fill: var(--c-surface); opacity: 0.55; }
/* own goal: same ball, red shell — the one cue that survives 15 px */
.gtl-node.is-og { border-color: color-mix(in srgb, var(--c-red) 50%, var(--c-border)); }
.gtl-node.is-og .gtl-ball-body,
.gs-ball.is-og .gtl-ball-body { fill: var(--c-red); }
.gtl-node.is-og .gtl-ball-patch,
.gs-ball.is-og .gtl-ball-patch { fill: #fff; opacity: 0.82; }
.gtl-row:hover .gtl-node.is-og {
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-red) 14%, transparent);
}
.gtl-empty {
  margin: 18px 0 4px;
  text-align: center;
  font-size: 13px;
  color: var(--t-muted);
}

/* Score header with crests */
.detail-team {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.detail-team.home { justify-content: flex-end; }
.detail-team.away { justify-content: flex-start; }
.detail-crest {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.detail-crest img { width: 100%; height: 100%; object-fit: contain; display: block; }
.detail-crest .team-crest { width: 100%; height: 100%; }

/* Goal detail sheet */
.gs-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 10, 0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.14s ease;
}
.gs-backdrop.is-open { opacity: 1; }
.gs-backdrop.is-closing { opacity: 0; }
.gs-sheet {
  position: relative;
  width: min(440px, 100%);
  background: var(--c-surface);
  border: 1px solid var(--c-border-light);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: translateY(8px) scale(0.985);
  transition: transform 0.16s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.gs-backdrop.is-open .gs-sheet { transform: none; }
.gs-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--t-secondary);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gs-close:hover { color: var(--t-primary); border-color: var(--c-border-light); }
.gs-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.gs-crest {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.gs-crest img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gs-crest .team-crest { width: 100%; height: 100%; }
.gs-id { min-width: 0; flex: 1; }
.gs-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--t-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.gs-dot { opacity: 0.5; }
.gs-name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 3px 0 2px;
  color: var(--t-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-min { font-size: 12px; color: var(--t-secondary); }
.gs-min.is-og { color: var(--c-red); font-weight: 600; }
.gs-ball {
  display: inline-flex;
  vertical-align: -3px;
}
.gs-score { text-align: right; flex-shrink: 0; padding-right: 30px; }
.gs-score-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--t-primary);
  letter-spacing: -0.02em;
}
.gs-score-lab {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--t-muted);
  margin-top: 1px;
}
.gs-rows { padding: 6px 20px 16px; }
.gs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
}
.gs-row:last-child { border-bottom: 0; }
.gs-row > span { color: var(--t-muted); font-size: 12px; }
.gs-row > b {
  color: var(--t-primary);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.gs-row i { color: var(--t-muted); font-style: italic; font-weight: 500; }
.gs-rating {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--c-accent) 16%, transparent);
  color: var(--c-accent);
  font-size: 11px;
  font-weight: 800;
  margin-left: 4px;
}
.gs-rating.is-big { font-size: 13px; padding: 2px 8px; }

/* ── Player match-stat sheet (opens from the formation board) ────── */
.ps-sheet {
  /* the season event-map pitch needs real width to stay legible */
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.ps-sheet .gs-top { padding-bottom: 14px; }
.ps-rating {
  margin-left: auto;
  padding-right: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.ps-rating .rating-orb { font-variant-numeric: tabular-nums; }

.ps-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0 0;
}
.ps-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--t-secondary);
}
.ps-badge.is-mvp {
  color: hsl(42, 92%, 62%);
  border-color: color-mix(in srgb, hsl(42, 92%, 55%) 45%, transparent);
  background: color-mix(in srgb, hsl(42, 92%, 55%) 14%, transparent);
}
.ps-badge.is-goal {
  color: var(--c-accent);
  border-color: color-mix(in srgb, var(--c-accent) 45%, transparent);
  background: color-mix(in srgb, var(--c-accent) 13%, transparent);
}
.ps-badge.is-assist {
  color: hsl(198, 85%, 60%);
  border-color: color-mix(in srgb, hsl(198, 85%, 55%) 45%, transparent);
  background: color-mix(in srgb, hsl(198, 85%, 55%) 13%, transparent);
}
.ps-badge.is-yellow {
  color: hsl(48, 90%, 55%);
  border-color: color-mix(in srgb, hsl(48, 90%, 52%) 50%, transparent);
  background: color-mix(in srgb, hsl(48, 90%, 52%) 16%, transparent);
}
.ps-badge.is-red {
  color: hsl(4, 78%, 60%);
  border-color: color-mix(in srgb, hsl(4, 78%, 55%) 50%, transparent);
  background: color-mix(in srgb, hsl(4, 78%, 55%) 15%, transparent);
}
/* light theme needs darker chip ink to stay legible on white */
html[data-theme="light"] .ps-badge.is-mvp { color: hsl(36, 88%, 30%); }
html[data-theme="light"] .ps-badge.is-goal { color: hsl(148, 72%, 24%); }
html[data-theme="light"] .ps-badge.is-assist { color: hsl(200, 88%, 30%); }
html[data-theme="light"] .ps-badge.is-yellow { color: hsl(42, 92%, 27%); }
html[data-theme="light"] .ps-badge.is-red { color: hsl(4, 72%, 38%); }

.ps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0 0;
  padding: 1px;
  border-radius: 12px;
  background: var(--c-border);
  overflow: hidden;
}
.ps-tile {
  background: var(--c-surface-2);
  padding: 11px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.ps-tile.is-pad { background: var(--c-surface); }
.ps-val {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--t-primary);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
.ps-val i {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--t-muted);
  letter-spacing: 0;
}
.ps-lab {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ps-foot {
  display: flex;
  justify-content: flex-end;
  padding: 14px 20px 18px;
}
.ps-link {
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--t-secondary);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.ps-link:hover {
  color: var(--t-primary);
  border-color: var(--c-accent);
  background: color-mix(in srgb, var(--c-accent) 12%, var(--c-surface-2));
}

/* ── tab bar ─────────────────────────────────────────────────────── */
.ps-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 20px 10px;
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.ps-tabs::-webkit-scrollbar { display: none; }
.ps-tab {
  flex: 1 0 auto;
  padding: 0 12px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--t-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.ps-tab:hover { color: var(--t-secondary); background: var(--c-surface-2); }
.ps-tab.is-on {
  color: var(--c-accent);
  background: color-mix(in srgb, var(--c-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--c-accent) 38%, transparent);
}

.ps-body { padding: 0 20px; }

/* ── shot summary strip ──────────────────────────────────────────── */
.ps-sum {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 14px 0 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--c-border);
}
.ps-sum-i {
  background: var(--c-surface-2);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ps-sum-i b {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: var(--t-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.ps-sum-i span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── minute chips ────────────────────────────────────────────────── */
.ps-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0;
}
.ps-chip {
  position: relative;
  min-width: 34px;
  height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--t-secondary);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.ps-chip:hover { color: var(--t-primary); border-color: var(--c-border-light); }
.ps-chip.is-on {
  color: var(--t-primary);
  background: color-mix(in srgb, var(--c-accent) 20%, var(--c-surface-2));
  border-color: var(--c-accent);
}
.ps-chip.is-goal i {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-accent);
  border: 1.5px solid var(--c-surface);
}

/* ── map + key/value detail ──────────────────────────────────────── */
.ps-shotmap {
  display: grid;
  grid-template-columns: 1.22fr 0.78fr;
  gap: 14px;
  align-items: start;
}
.ps-map {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  line-height: 0;
}
.ep { display: block; width: 100%; height: auto; }

/* map + its legend stacked as one column */
.ps-mapcol { display: flex; flex-direction: column; min-width: 0; }
.ps-mapcol .ps-legend { padding: 10px 2px 0; }
.ps-mapcol .ps-note { font-size: 9px; }

.ps-kv { display: flex; flex-direction: column; }
.ps-kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--c-border);
}
.ps-kv-row:last-child { border-bottom: 0; }
.ps-kv-row > span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-muted);
  white-space: nowrap;
}
.ps-kv-row > b {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--t-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── legends ─────────────────────────────────────────────────────── */
.ps-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--t-muted);
}
.ps-legend > span { display: inline-flex; align-items: center; gap: 5px; }
/* attacking direction sits at the far end of the legend row */
.ps-legend > .ps-attack {
  margin-left: auto;
  gap: 6px;
  color: var(--t-muted);
}
.ps-legend > .ps-attack svg { color: var(--t-secondary); }
.ps-legend.is-col {
  flex-direction: column;
  gap: 8px;
  padding: 0;
}
.ps-note { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: 0.8; }
.ps-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--t-muted);
  flex-shrink: 0;
}
.ps-dot.is-goal { background: var(--c-accent); }
.ps-dot.is-on { background: hsl(198, 85%, 55%); }
.ps-dot.is-off { border: 1.5px solid var(--t-muted); background: transparent; }
.ps-dot.is-wood { background: hsl(42, 92%, 55%); }
.ps-line {
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: hsl(145, 60%, 50%);
  flex-shrink: 0;
}
.ps-line.is-off { background: hsl(4, 72%, 56%); }

.ps-passmap { padding: 14px 0 4px; }
.ps-map--pass { background: var(--c-surface-2); }
.ps-map--pass .ep { max-height: 260px; }
.ps-legend.is-spread { justify-content: flex-start; gap: 16px; padding-top: 10px; }

/* ── filter chips (event map filters) ────────────────────────────── */
.ps-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0 12px;
}
.ps-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--t-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}
.ps-filter:hover { color: var(--t-primary); border-color: var(--c-border-light); }
.ps-filter.is-on {
  color: var(--t-primary);
  background: color-mix(in srgb, var(--c-accent) 18%, var(--c-surface-2));
  border-color: var(--c-accent);
}
.ps-dot.is-saved { background: hsl(198, 85%, 55%); }

/* ── map + column duo ────────────────────────────────────────────── */
.ps-duo {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 0.68fr);
  gap: 18px;
  align-items: start;
  padding-bottom: 4px;
}
.ps-side { display: flex; flex-direction: column; min-width: 0; }
.ps-duo .ps-map { background: var(--c-surface-2); }

/* per-shot detail block */
.ps-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--c-border);
  margin-bottom: 12px;
}
.ps-info-i {
  background: var(--c-surface-2);
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ps-info-i span {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ps-info-i b {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--t-primary);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* label / value rows */
.ps-lrows { display: flex; flex-direction: column; }
.ps-lrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 5.5px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 11.5px;
}
.ps-lrow:last-child { border-bottom: 0; }
.ps-lrow > span {
  color: var(--t-secondary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-lrow > b {
  color: var(--t-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Statistics tab groups */
.ps-groups {
  padding: 14px 0 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
  align-items: start;
}
.ps-group-t {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--c-accent);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--c-border);
}
/* the keeper panel has exactly three groups, so they share one row */
.ps-groups.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── run-type bars ───────────────────────────────────────────────── */
.ps-bars {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--c-border);
}
.ps-bar-row {
  display: grid;
  grid-template-columns: 62px 1fr 26px;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: var(--t-secondary);
}
.ps-bar-row > span { font-weight: 700; letter-spacing: 0.02em; }
.ps-bar-row > i {
  height: 5px;
  border-radius: 3px;
  background: var(--c-surface-3);
  overflow: hidden;
  display: block;
}
.ps-bar-row > i > b { display: block; height: 100%; border-radius: 3px; }
.ps-bar-row > em {
  font-style: normal;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--t-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ── Overview hero: attribute bars + generated read of the match ─── */
.ps-hero {
  margin-top: 14px;
  padding: 13px 14px 12px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-surface-2);
}
.ps-hero-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.ps-hero-t {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--c-accent);
}
.ps-hero-s {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--t-muted);
}
.ps-hero .ps-bars {
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
}
.ps-hero .ps-bar-row { grid-template-columns: 86px 1fr 24px; }
.ps-hero .ps-bar-row > i { height: 6px; }

.ps-summary {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.62;
  color: var(--t-secondary);
}

/* Goalkeeping tab: the three numbers a keeper is judged on */
.ps-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 14px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  overflow: hidden;
}
.ps-kpi {
  background: var(--c-surface);
  padding: 12px 14px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ps-kpi > b {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--t-primary);
  font-variant-numeric: tabular-nums;
}
.ps-kpi > b.is-pos { color: var(--c-accent); }
.ps-kpi > b.is-neg { color: var(--c-red); }
.ps-kpi > span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--t-muted);
}

/* ── states ──────────────────────────────────────────────────────── */
.ps-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 34px 16px;
  font-size: 12px;
  color: var(--t-muted);
  text-align: center;
}
.ps-spin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--c-border-light);
  border-top-color: var(--c-accent);
  animation: ps-spin 0.7s linear infinite;
}
@keyframes ps-spin { to { transform: rotate(360deg); } }

/* Team stat bars */
.team-stat-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stat-bar-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--gap-sm);
}
.stat-bar-home, .stat-bar-away {
  height: 6px;
  border-radius: var(--r-full);
  background: var(--c-surface-3);
  overflow: hidden;
}
.stat-bar-home { direction: rtl; }
.stat-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.home .stat-bar-fill { background: linear-gradient(90deg, var(--c-accent), var(--c-blue)); }
.away .stat-bar-fill { background: linear-gradient(90deg, var(--c-purple), var(--c-red)); }
.stat-bar-label {
  text-align: center;
  font-size: 11px;
  color: var(--t-muted);
  white-space: nowrap;
}
.stat-bar-vals {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════════════════
   RATING BADGE (Sofascore orb style)
   ════════════════════════════════════════════════════════════════════════════ */
.rating-orb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-weight: 700;
  flex-shrink: 0;
}
.rating-orb.size-sm  { width: 36px; height: 28px; font-size: 12px; border-radius: var(--r-sm); }
.rating-orb.size-md  { width: 48px; height: 36px; font-size: 15px; }
.rating-orb.size-lg  { width: 64px; height: 52px; font-size: 22px; border-radius: var(--r-md); }
.rating-orb.size-xl  { width: 88px; height: 72px; font-size: 32px; border-radius: var(--r-lg); }
.rating-orb.size-xxl { width: 120px; height: 96px; font-size: 44px; border-radius: var(--r-xl); }

.rating-elite  { background: hsla(145, 80%, 40%, 0.2); color: var(--r-elite); border: 1px solid hsla(145,80%,40%,0.4); }
.rating-good   { background: hsla(145, 60%, 45%, 0.15); color: var(--r-good); border: 1px solid hsla(145,60%,45%,0.3); }
.rating-avgh   { background: hsla(60, 80%, 50%, 0.15); color: var(--r-avg-high); border: 1px solid hsla(60,80%,50%,0.3); }
.rating-avg    { background: hsla(35, 85%, 55%, 0.15); color: var(--r-avg); border: 1px solid hsla(35,85%,55%,0.3); }
.rating-poor   { background: hsla(0, 70%, 52%, 0.15); color: var(--r-poor); border: 1px solid hsla(0,70%,52%,0.3); }

/* ════════════════════════════════════════════════════════════════════════════
   PLAYER CARDS & TABLES
   ════════════════════════════════════════════════════════════════════════════ */
.player-table-wrap { overflow-x: auto; }
.player-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.th-player { min-width: 215px; }
.player-table th {
  text-align: center;
  padding: 10px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--t-muted);
  background: var(--c-bg-2);
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--tr-fast);
}
.player-table th:first-child { text-align: left; }
.player-table th:hover { color: var(--t-primary); }
.player-table th.sorted { color: var(--c-accent); }
.player-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--c-row-border);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--t-secondary);
}
.player-table td:first-child { text-align: left; font-family: var(--font-body); color: var(--t-primary); }
.player-table tr:hover td { background: var(--c-surface-2); cursor: pointer; }
.player-table tr:last-child td { border-bottom: none; }

/* ── Player list on a phone ────────────────────────────────────────────────
   Each players tab now owns one stat family and carries at most 15 columns.
   Below 720px the table keeps only the columns the tab nominates as core
   (_MOBILE_CORE in players.js: four or five numbers) and drops Team and Age,
   so it reads down the page. The name cell is the only flexible column left,
   so it truncates instead of pushing the numbers off-screen. */
@media (max-width: 720px) {
  .player-table .col-sec,
  .player-table .col-team,
  .player-table .col-age { display: none; }

  /* Eleven stat families do not fit on one phone-width line. Wrap the strip
     so every tab is visible without a sideways gesture. */
  .tabs { flex-wrap: wrap; overflow-x: visible; }
  .tab-btn { padding: 8px 11px; font-size: 11.5px; }

  .th-player { min-width: 96px; }

  .player-table th { padding: 9px 2px; font-size: 9px; letter-spacing: 0.2px; }
  .player-table td { padding: 9px 2px; font-size: 11.5px; }

  .player-table .player-avatar { width: 24px; height: 24px; }
  .player-fullname { font-size: 12.5px; }
  /* the archetype is prose; the INJ badge beside it is information — keep it */
  .player-sub-info .player-arch { display: none; }
}

/* Player name cell */
.player-name-cell {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  min-width: 0;
}
.player-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  line-height: 0;
}
.player-avatar img { width: 100%; height: 100%; object-fit: contain; display: block; }
.player-avatar .team-crest { width: 100%; height: 100%; }
/* crest variant: no plate, the badge itself is the identity */
.player-avatar--crest {
  border-radius: 0;
  background: none;
  font-size: 0;
}
.player-info-mini { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.player-fullname {
  font-weight: 600; font-size: 14px; font-family: var(--font-body);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* archetype + INJ sit on one line; the archetype truncates first */
.player-sub-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  color: var(--t-muted);
  font-family: var(--font-body);
  white-space: nowrap;
}
.player-arch {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Position badge */
.pos-badge {
  padding: 2px 7px;
  border-radius: var(--r-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.pos-GK  { background: hsla(43,100%,55%,0.12); color: var(--c-gold); }
.pos-CB  { background: hsla(210,85%,58%,0.12); color: var(--c-blue); }
.pos-LB, .pos-RB { background: hsla(210,85%,58%,0.1); color: hsl(200,70%,60%); }
.pos-CDM { background: hsla(145,68%,42%,0.12); color: var(--c-accent); }
.pos-CM  { background: hsla(145,68%,42%,0.1); color: hsl(160,60%,50%); }
.pos-CAM, .pos-LM, .pos-RM { background: hsla(270,70%,65%,0.12); color: var(--c-purple); }
.pos-LW, .pos-RW { background: hsla(28,90%,58%,0.12); color: var(--c-orange); }
.pos-CF, .pos-ST { background: hsla(0,75%,58%,0.12); color: var(--c-red); }

/* ════════════════════════════════════════════════════════════════════════════
   PLAYER PROFILE
   ════════════════════════════════════════════════════════════════════════════ */
.player-profile-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: var(--gap-lg);
  align-items: start;
}
/* The main column holds a nowrap tab strip; without min-width:0 the `1fr`
   track floors at the strip's min-content width and blows the page out. */
.player-profile-grid > * { min-width: 0; }
.profile-sidebar { display: flex; flex-direction: column; gap: var(--gap-md); }

/* ── Availability projection (player profile sidebar) ────────────────────
   The sidebar is 320px, so this is deliberately a vertical list: status
   banner → next fixtures with a per-match verdict → injury history with
   return dates. Chips carry the verdict, the muted line under each fixture
   carries the reasoning. */
.av-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: var(--gap-md);
  padding: 9px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
}
.av-banner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 4px;
  flex: none;
  background: var(--t-muted);
}
.av-banner--out {
  border-color: color-mix(in srgb, var(--c-red) 38%, var(--c-border));
  background: color-mix(in srgb, var(--c-red) 9%, var(--c-surface-2));
}
.av-banner--out .av-banner-dot {
  background: var(--c-red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-red) 18%, transparent);
}
.av-banner--ok .av-banner-dot {
  background: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-glow);
}
.av-banner-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.av-banner-txt b {
  font-size: 12px;
  font-weight: 700;
  color: var(--t-primary);
  text-transform: capitalize;
}
.av-banner-txt span { font-size: 11.5px; color: var(--t-secondary); line-height: 1.4; }
.av-banner-txt strong { color: var(--t-primary); font-weight: 700; }

.av-block { margin-top: var(--gap-md); }
.av-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--t-muted);
  margin-bottom: 6px;
}

.av-fx { padding: 6px 0; border-bottom: 1px solid var(--c-border); }
.av-fx:last-of-type { border-bottom: 0; }
.av-fx-row { display: flex; align-items: center; gap: 7px; }
.av-fx-md {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--t-muted);
  flex: none;
}
.av-fx-op {
  font-size: 11.5px;
  color: var(--t-secondary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.av-fx-why { font-size: 10.5px; color: var(--t-muted); margin-top: 2px; line-height: 1.35; }

.av-chip {
  flex: none;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}
.av-chip--available { color: var(--c-accent); background: color-mix(in srgb, var(--c-accent) 14%, transparent); }
.av-chip--doubtful  { color: var(--c-gold);   background: color-mix(in srgb, var(--c-gold) 16%, transparent); }
.av-chip--out       { color: var(--c-red);    background: color-mix(in srgb, var(--c-red) 14%, transparent); }
.av-chip--suspended { color: var(--c-purple); background: color-mix(in srgb, var(--c-purple) 16%, transparent); }

.av-next {
  margin-top: 7px;
  font-size: 11px;
  color: var(--t-secondary);
  padding-top: 7px;
  border-top: 1px dashed var(--c-border);
}
.av-next b { color: var(--t-primary); }

.av-inj { padding: 7px 0; border-bottom: 1px solid var(--c-border); }
.av-inj:last-child { border-bottom: 0; }
.av-inj-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.av-inj-h b {
  font-size: 12px;
  font-weight: 600;
  color: var(--t-secondary);
  text-transform: capitalize;
}
.av-inj-h span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--t-muted);
  flex: none;
}
.av-inj-r { font-size: 10.5px; color: var(--t-muted); margin-top: 1px; }
.av-inj.is-active .av-inj-h b { color: var(--c-red); }
.av-inj.is-active .av-inj-r { color: var(--t-secondary); }
.profile-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--gap-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--gap-md);
}
.profile-avatar-large {
  width: 80px; height: 80px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  font-weight: 900;
  font-family: var(--font-display);
}
.profile-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
}
.profile-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-sm);
  width: 100%;
}
.profile-detail-item {
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  padding: 10px;
  text-align: center;
}
.profile-detail-label { font-size: 10px; color: var(--t-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.profile-detail-value { font-size: 14px; font-weight: 600; margin-top: 4px; }

/* Stats tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--gap-lg);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--tr-fast);
  border-radius: var(--r-sm) var(--r-sm) 0 0;
}
.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); }

/* ════════════════════════════════════════════════════════════════════════════
   RADAR CHART
   ════════════════════════════════════════════════════════════════════════════ */
.radar-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--gap-md);
}
.radar-canvas { width: 100% !important; max-width: 280px; }
.radar-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}
.radar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--t-secondary);
}
.radar-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════════════════
   FORM SPARKLINE
   ════════════════════════════════════════════════════════════════════════════ */
.sparkline-wrap { overflow-x: auto; }
.match-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.match-log-table th {
  padding: 8px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--t-muted);
  border-bottom: 1px solid var(--c-border);
}
.match-log-table th:first-child { text-align: left; }
.match-log-table td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--c-row-border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--t-secondary);
}
.match-log-table td:first-child { text-align: left; font-family: var(--font-body); font-size: 13px; }
.result-w { color: var(--c-accent); font-weight: 700; }
.result-d { color: var(--c-blue); font-weight: 700; }
.result-l { color: var(--c-red); font-weight: 700; }
.mvp-star { color: var(--c-gold); }

/* ════════════════════════════════════════════════════════════════════════════
   COMPARE PAGE
   ════════════════════════════════════════════════════════════════════════════ */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  gap: var(--gap-lg);
  align-items: start;
}
.compare-selector {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--gap-lg);
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
}
.compare-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--t-muted);
}
.compare-stat-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--gap-sm);
  padding: 8px 0;
  border-bottom: 1px solid var(--c-row-border);
}
.compare-stat-label {
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--t-muted);
}
.compare-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}
.compare-val.home { text-align: right; }
.compare-val.away { text-align: left; }
.compare-val.winner { color: var(--c-accent); }
.compare-section { display: flex; flex-direction: column; gap: var(--gap-sm); margin-bottom: var(--gap-lg); }
.compare-section:last-child { margin-bottom: 0; }
.compare-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--c-border);
  user-select: none;
}
.compare-section-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.compare-section-chevron { color: var(--t-muted); flex-shrink: 0; transition: transform 0.2s ease; }
.compare-section.collapsed .compare-section-chevron { transform: rotate(-90deg); }
.compare-section.collapsed .compare-section-body { display: none; }
.compare-section-body { display: flex; flex-direction: column; gap: 4px; }

/* ════════════════════════════════════════════════════════════════════════════
   SEARCH / FILTER CONTROLS
   ════════════════════════════════════════════════════════════════════════════ */
.search-box {
  position: relative;
}
.search-box svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--t-muted);
  pointer-events: none;
}
.search-input {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 9px 14px 9px 38px;
  color: var(--t-primary);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
  width: 100%;
  min-width: 220px;
}
.search-input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-glow);
}
.search-input::placeholder { color: var(--t-muted); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-primary { background: var(--c-accent); color: var(--c-bg); }
.btn-primary:hover { background: var(--c-accent-dark); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-ghost { background: var(--c-surface-2); color: var(--t-secondary); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-surface-3); color: var(--t-primary); }
.btn-ghost.active { background: hsla(145,68%,42%,0.15); color: var(--c-accent); border-color: hsla(145,68%,42%,0.4); }
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--t-secondary);
  margin-bottom: var(--gap-lg);
  padding: 6px 0;
  transition: color var(--tr-fast);
}
.btn-back:hover { color: var(--t-primary); }
.btn-back svg { width: 18px; height: 18px; }

/* Select dropdown */
.select-input {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  color: var(--t-primary);
  font-size: 13px;
  font-family: var(--font-body);
  outline: none;
  cursor: pointer;
  transition: border-color var(--tr-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.select-input:focus { border-color: var(--c-accent); }

/* Toggle pill */
.toggle-group {
  display: flex;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.toggle-btn {
  padding: 5px 14px;
  border-radius: calc(var(--r-md) - 2px);
  font-size: 12px;
  font-weight: 600;
  color: var(--t-secondary);
  transition: all var(--tr-fast);
}
.toggle-btn.active {
  background: var(--c-surface-3);
  color: var(--t-primary);
  box-shadow: var(--shadow-sm);
}

/* ════════════════════════════════════════════════════════════════════════════
   LEAGUE VIEW SWITCHER (table tabs × venue filter)
   ════════════════════════════════════════════════════════════════════════════ */
.league-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  flex-wrap: wrap;
  margin-bottom: var(--gap-md);
}
.view-pills {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}
.view-pill {
  padding: 7px 20px;
  border-radius: var(--r-full);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--t-secondary);
  transition: all var(--tr-fast);
}
.view-pill:hover {
  color: var(--t-primary);
  border-color: var(--c-border-light);
}
.view-pill.active {
  background: var(--c-accent-glow);
  border-color: var(--c-accent);
  color: var(--c-accent);
}
.venue-tabs {
  display: flex;
  gap: var(--gap-lg);
}
.venue-tab {
  padding: 6px 2px;
  background: none;
  border-bottom: 2px solid transparent;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--t-secondary);
  transition: all var(--tr-fast);
}
.venue-tab:hover { color: var(--t-primary); }
.venue-tab.active {
  color: var(--t-primary);
  border-bottom-color: var(--c-accent);
}

/* ════════════════════════════════════════════════════════════════════════════
   STAT GRID (key numbers)
   ════════════════════════════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: var(--gap-sm);
}
.stat-tile {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--gap-md);
  text-align: center;
  transition: all var(--tr-fast);
}
.stat-tile:hover { background: var(--c-surface-3); border-color: var(--c-border-light); }
.stat-tile-val {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--t-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-tile-label {
  font-size: 11px;
  color: var(--t-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stat-tile.highlight .stat-tile-val { color: var(--c-accent); }
.stat-tile.gold .stat-tile-val { color: var(--c-gold); }

/* ════════════════════════════════════════════════════════════════════════════
   DNA ATTRIBUTES
   ════════════════════════════════════════════════════════════════════════════ */
.dna-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dna-bar-row {
  display: grid;
  grid-template-columns: 80px 1fr 40px;
  align-items: center;
  gap: var(--gap-sm);
}
.dna-label {
  font-size: 12px;
  color: var(--t-secondary);
  text-align: right;
}
.dna-track {
  height: 8px;
  background: var(--c-surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.dna-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.dna-value { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--t-primary); }

/* ════════════════════════════════════════════════════════════════════════════
   IMAGE ASSETS (pass network etc.)
   ════════════════════════════════════════════════════════════════════════════ */
.match-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap-md);
}
.match-image-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.match-image-card img { width: 100%; }
.match-image-label {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--t-secondary);
  border-top: 1px solid var(--c-border);
}

/* ════════════════════════════════════════════════════════════════════════════
   LOADING & TOAST
   ════════════════════════════════════════════════════════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--gap-lg);
  z-index: 1000;
  transition: opacity 0.4s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-spinner {
  position: relative;
  width: 60px; height: 60px;
}
.spinner-ring {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.ring-2 { inset: 8px; border-top-color: var(--c-gold); animation-delay: -0.3s; animation-duration: 1.5s; }
.ring-3 { inset: 16px; border-top-color: var(--c-blue); animation-delay: -0.6s; animation-duration: 2s; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-spin { animation: spin 1s linear infinite; }
.loading-text {
  font-size: 14px;
  color: var(--t-secondary);
  letter-spacing: 0.5px;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
  z-index: 500;
}
.toast {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ════════════════════════════════════════════════════════════════════════════
   PERCENTILE PIZZA CHART
   ════════════════════════════════════════════════════════════════════════════ */
.pizza-chart-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--gap-md) var(--gap-lg) var(--gap-lg);
  overflow: hidden;
}
.pizza-chart-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--t-primary);
}
.pizza-chart-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--t-muted);
  margin-top: 4px;
  margin-bottom: var(--gap-sm);
}
.pizza-chart-stage { position: relative; }
.pizza-slice {
  transition: fill-opacity var(--tr-fast), filter var(--tr-fast);
}
.pizza-slice:hover {
  fill-opacity: 1;
  filter: brightness(1.15);
  cursor: pointer;
}
.pizza-slice-label {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  fill: var(--t-secondary);
}
.pizza-slice-value {
  font-family: var(--font-display);
  font-weight: 800;
  fill: var(--t-primary);
  pointer-events: none;
}
.pizza-legend {
  display: flex;
  gap: var(--gap-md);
  flex-wrap: wrap;
  margin-top: var(--gap-sm);
}
.pizza-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--t-secondary);
}
.pizza-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pizza-tooltip {
  position: absolute;
  z-index: 10;
  padding: 5px 10px;
  background: var(--c-surface-3);
  border: 1px solid var(--c-border-light);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--t-primary);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity var(--tr-fast);
}
.pizza-tooltip.show { opacity: 1; }

/* ════════════════════════════════════════════════════════════════════════════
   CONTRIBUTION CARDS — FBref/Opta-style composite percentile cards
   ════════════════════════════════════════════════════════════════════════════ */
.contrib-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.contrib-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--t-primary);
}
.contrib-sub {
  font-size: 12px;
  color: var(--t-muted);
  margin-top: 2px;
}
.contrib-legend {
  display: flex;
  align-items: center;
}
.contrib-legend-scale {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--t-muted);
  font-family: var(--font-mono);
}
.contrib-legend-gradient {
  width: 80px;
  height: 6px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, hsl(0,72%,58%), hsl(43,72%,51%), hsl(145,72%,44%));
}
.contrib-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
}
@media (max-width: 700px) {
  .contrib-grid { grid-template-columns: 1fr; }
}

/* ── Single category section ── */
.contrib-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--gap-md);
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}
.contrib-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.contrib-section-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.contrib-section-info {
  flex: 1;
  min-width: 0;
}
.contrib-section-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--t-primary);
  line-height: 1.2;
}
.contrib-section-short {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--t-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.contrib-section-score {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  line-height: 1;
  flex-shrink: 0;
}
.contrib-section-score-unit {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.7;
}

/* ── Composite percentile bar ── */
.contrib-bar-track {
  position: relative;
  height: 10px;
  border-radius: var(--r-full);
  background: var(--c-surface-3);
  overflow: visible;
}
.contrib-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.contrib-bar-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--c-bg);
  display: grid;
  place-items: center;
  transition: left 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 2;
}
.contrib-bar-marker-val {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--c-bg);
  pointer-events: none;
}

/* ── Sub-stat list ── */
.contrib-substats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.contrib-substat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  transition: background var(--tr-fast);
}
.contrib-substat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.contrib-substat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--t-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contrib-substat-values {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
}
.contrib-substat-raw {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--t-primary);
}
.contrib-substat-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}
.contrib-substat-bar {
  position: relative;
  height: 5px;
  border-radius: var(--r-full);
  background: var(--c-surface-3);
}
.contrib-substat-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.contrib-substat-avg {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 2px;
  background: var(--t-muted);
  opacity: 0.4;
  border-radius: 1px;
  transform: translateX(-1px);
}

/* ════════════════════════════════════════════════════════════════════════════
   STRENGTHS & WEAKNESSES — SofaScore-style player attribute tags
   ════════════════════════════════════════════════════════════════════════════ */
.sw-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.sw-header { margin-bottom: var(--gap-md); }
.sw-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--t-primary);
}
.sw-sub {
  font-size: 12px;
  color: var(--t-muted);
  margin-top: 2px;
}

/* ── Attribute overview pills ── */
.sw-attr-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: var(--gap-md);
  padding-bottom: var(--gap-md);
  border-bottom: 1px solid var(--c-border);
}
.sw-attr-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 48px;
  padding: 8px 10px;
  background: var(--c-surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}
.sw-attr-score {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}
.sw-attr-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--t-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Strengths / Weaknesses columns ── */
.sw-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
}
@media (max-width: 600px) {
  .sw-columns { grid-template-columns: 1fr; }
}
.sw-col { display: flex; flex-direction: column; gap: var(--gap-sm); }
.sw-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.sw-col-strength { color: hsl(145, 68%, 42%); }
.sw-col-weakness { color: hsl(0, 72%, 58%); }

/* ── Tag pills ── */
.sw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sw-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 600;
  transition: transform var(--tr-fast);
}
.sw-tag:hover { transform: scale(1.04); }
.sw-tag-strength {
  background: hsla(145, 68%, 42%, 0.12);
  border: 1px solid hsla(145, 68%, 42%, 0.3);
  color: hsl(145, 68%, 55%);
}
.sw-tag-weakness {
  background: hsla(0, 72%, 58%, 0.12);
  border: 1px solid hsla(0, 72%, 58%, 0.3);
  color: hsl(0, 72%, 65%);
}
.sw-tag-label { white-space: nowrap; }
.sw-tag-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  opacity: 0.9;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .topnav-inner { gap: var(--gap-md); }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    flex-direction: column;
    padding: var(--gap-md);
    gap: var(--gap-xs);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-link { justify-content: flex-start; width: 100%; padding: 12px; }
  .hamburger { display: flex; }
  .player-profile-grid { grid-template-columns: minmax(0, 1fr); }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-vs { display: none; }
  .detail-teams { grid-template-columns: 1fr; gap: var(--gap-sm); }
  .detail-team.home, .detail-team.away { justify-content: center; }
  .detail-team.home .detail-crest { order: -1; }
  .detail-crest { width: 36px; height: 36px; }
  .gtl { max-width: 100%; }
  .gtl-row { grid-template-columns: 1fr 62px 1fr; gap: 7px; padding: 7px 4px; }
  .gtl-crest { width: 17px; height: 17px; }
  .gtl-scorer { font-size: 12.5px; }
  .gs-top { padding: 16px 16px 14px; gap: 12px; }
  .gs-score { padding-right: 26px; }
  .gs-rows { padding: 4px 16px 14px; }
  .ps-rating { padding-right: 26px; }
  .ps-badges { padding: 10px 0 0; }
  .ps-grid { margin: 12px 0 0; }
  .ps-tabs { padding: 10px 16px 8px; gap: 3px; }
  .ps-tab { font-size: 10.5px; height: 26px; }
  .ps-body { padding: 0 16px; }
  .ps-tile { padding: 9px 10px 8px; }
  .ps-val { font-size: 16px; }
  .ps-groups.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-hero { padding: 11px 12px 10px; }
  .ps-hero .ps-bar-row { grid-template-columns: 88px 1fr 22px; }
  .ps-kpi { padding: 10px 11px 9px; }
  .ps-kpi > b { font-size: 19px; }
  .ps-foot { padding: 12px 16px 16px; }
  .main-content { padding: var(--gap-lg) var(--gap-md); }
  /* The match-card grid itself is set in theme.css (it loads later, so its
     base `1fr 132px 1fr` beats anything declared here). These two only stop
     a long club name from pushing the row wider than the screen. */
  .match-team { min-width: 0; }
  .match-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 600px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .match-images-grid { grid-template-columns: 1fr; }
  .tabs { gap: 2px; }
  .tab-btn { padding: 8px 12px; font-size: 12px; }
  .freshness-label { display: none; }
  .ps-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-name, .ps-sheet .gs-name { font-size: 17px; }
  .ps-shotmap, .ps-duo, .ps-groups, .ps-groups.is-3 { grid-template-columns: 1fr; }
  .ps-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ps-map--pass .ep { max-height: 210px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   PERCENTILE BARS (Fotmob/Sofascore-style)
   ════════════════════════════════════════════════════════════════════════════ */
.pbar-card { display: flex; flex-direction: column; gap: var(--gap-lg); }
.pbar-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--t-primary);
}
.pbar-sub { font-size: 12px; color: var(--t-muted); margin-top: -8px; }
.pbar-section { display: flex; flex-direction: column; gap: var(--gap-sm); }
.pbar-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.pbar-section-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.pbar-list { display: flex; flex-direction: column; gap: var(--gap-md); }
.pbar-row { display: flex; flex-direction: column; gap: 6px; }
.pbar-row-top { display: flex; align-items: baseline; justify-content: space-between; }
.pbar-label { font-size: 13px; font-weight: 600; color: var(--t-secondary); }
.pbar-raw { font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--t-primary); }
.pbar-track {
  position: relative;
  height: 10px;
  border-radius: var(--r-full);
  background: var(--c-surface-3);
  overflow: visible;
}
.pbar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.pbar-avg-tick {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--t-muted);
  opacity: 0.55;
  border-radius: 1px;
  z-index: 2;
}
.pbar-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--c-bg);
  display: grid;
  place-items: center;
  transition: left 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 3;
  cursor: default;
}
.pbar-marker-val {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--c-bg);
  pointer-events: none;
}
.pbar-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  padding-top: var(--gap-sm);
  border-top: 1px solid var(--c-border);
  flex-wrap: wrap;
}
.pbar-legend-scale { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--t-muted); font-family: var(--font-mono); }
.pbar-legend-gradient {
  width: 100px;
  height: 6px;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, hsl(0,72%,58%), hsl(43,72%,51%), hsl(145,72%,44%));
}
.pbar-legend-avg { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--t-muted); }
.pbar-legend-avg-tick { width: 2px; height: 12px; background: var(--t-muted); opacity: 0.7; display: inline-block; border-radius: 1px; }
.pbar-empty { padding: 24px; text-align: center; color: var(--t-muted); font-size: 13px; }

/* ── Utility ── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-sm { gap: var(--gap-sm); }
.gap-md { gap: var(--gap-md); }
.mt-lg { margin-top: var(--gap-lg); }
.mt-xl { margin-top: var(--gap-xl); }
.mb-md { margin-bottom: var(--gap-md); }
.mb-lg { margin-bottom: var(--gap-lg); }
.font-mono { font-family: var(--font-mono); }
.text-accent { color: var(--c-accent); }
.text-gold { color: var(--c-gold); }
.text-muted { color: var(--t-muted); }
.text-secondary { color: var(--t-secondary); }
.fw-700 { font-weight: 700; }
.fw-900 { font-weight: 900; }
.section-gap { margin-bottom: var(--gap-xl); }
.divider { height: 1px; background: var(--c-border); margin: var(--gap-md) 0; }
/* minmax(0,1fr) so a wide child (pitch card, chart) cannot floor the track
   at its own min-content width and push the page sideways */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap-md); }
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--gap-md); }
.injury-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 5px;
  background: hsla(0,75%,58%,0.1);
  border: 1px solid hsla(0,75%,58%,0.3);
  border-radius: var(--r-full);
  font-size: 9px;
  line-height: 15px;
  letter-spacing: 0.06em;
  color: var(--c-red);
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Predictions Page ─────────────────────────────────────────────── */
.pred-info { margin-bottom: 18px; }
.pred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: 14px;
  margin-top: 4px;
}
.pred-card {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 13px 16px 14px 19px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow: hidden;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.pred-card:hover {
  transform: translateY(-1px);
  border-color: var(--c-border-light);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6);
}
.pred-edge {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
}

/* top strip: matchday · kick-off · confidence */
.pred-top { display: flex; align-items: center; gap: 8px; }
.pred-mdchip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--t-secondary);
  background: var(--c-surface-2);
  border-radius: 4px;
  padding: 2px 6px;
}
.pred-when { font-size: 11.5px; color: var(--t-muted); }

/* crests either side, projected score in the middle */
.pred-face {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.pred-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pred-side.away { justify-content: flex-end; text-align: right; }
.pred-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--t-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pred-mid { text-align: center; min-width: 74px; }
.pred-score {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .5px;
  color: var(--t-primary);
}
.pred-score-cap {
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--t-muted);
  white-space: nowrap;
}
.pred-score-cap b { color: var(--t-secondary); }

.pred-bar {
  display: flex;
  height: 20px;
  border-radius: var(--r-full);
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 800;
  background: var(--c-surface-2);
}
.pred-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.pred-seg.draw { background: var(--c-blue); }
.pred-seg + .pred-seg { box-shadow: inset 1px 0 0 rgba(0, 0, 0, .22); }

.pred-wdl {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: -3px;
  font-size: 11px;
  color: var(--t-muted);
}
.pred-wdl span {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pred-wdl i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.pred-wdl b { color: var(--t-secondary); font-weight: 700; }

.pred-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pred-stats > div {
  background: var(--c-surface-2);
  border-radius: var(--r-sm);
  padding: 7px 6px;
  text-align: center;
}
.pred-stats span {
  display: block;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--t-muted);
}
.pred-stats b { font-family: var(--font-mono); font-size: 12.5px; color: var(--t-primary); }

.pred-scores { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.pred-scores-lab {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--t-muted);
  margin-right: 1px;
}
.pred-chip {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  padding: 2px 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--t-secondary);
}
.pred-chip b { color: var(--t-muted); font-weight: 700; margin-left: 2px; }
.pred-chip.is-top {
  border-color: color-mix(in srgb, var(--c-accent) 48%, transparent);
  color: var(--t-primary);
}
.pred-chip.is-top b { color: var(--c-accent); }

.pred-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid var(--c-border);
}
.pred-factor {
  background: var(--c-surface-2);
  color: var(--t-muted);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 10.5px;
}

/* ── Prediction confidence ───────────────────────────────────────── */
.pred-conf {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
}
.pred-conf.conf-high { background: hsla(145,68%,42%,0.16); color: var(--c-accent); }
.pred-conf.conf-medium { background: hsla(43,100%,55%,0.18); color: hsl(38,92%,45%); }
.pred-conf.conf-low { background: var(--c-surface-2); color: var(--t-muted); }

@media (max-width: 560px) {
  .pred-grid { grid-template-columns: 1fr; }
  .pred-name { font-size: 12.5px; }
  .pred-score { font-size: 22px; }
}

/* ── Strength leaderboard ────────────────────────────────────────── */
.str-list { display: flex; flex-direction: column; gap: 10px; }
.str-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
}
.str-rank {
  width: 26px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--t-muted);
  text-align: center;
  flex: 0 0 auto;
}
.str-team {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--t-primary);
  width: 160px;
  flex: 0 0 auto;
  min-width: 0;
}
.str-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.str-bars { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.str-bar-line { display: flex; align-items: center; gap: 10px; }
.str-bar-label {
  width: 62px;
  font-size: 11px;
  color: var(--t-muted);
  flex: 0 0 auto;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.str-track {
  flex: 1;
  height: 8px;
  background: var(--c-surface-2);
  border-radius: var(--r-full);
  overflow: hidden;
}
.str-fill { height: 100%; border-radius: var(--r-full); background: var(--c-accent); }
.str-fill.str-atk { background: hsl(145,68%,42%); }
.str-fill.str-def { background: hsl(210,85%,58%); }
.str-meta {
  display: flex;
  gap: 18px;
  flex: 0 0 auto;
}
.str-meta > div { text-align: center; }
.str-meta span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--t-muted);
}
  .str-meta b { font-size: 15px; color: var(--t-primary); }
@media (max-width: 720px) {
  .str-row { flex-wrap: wrap; }
  .str-team { width: 100%; }
  .str-bars { width: 100%; }
  .str-meta { width: 100%; justify-content: space-between; }
}

/* ── UPDATE GUIDE PANEL ─────────────────────────────────────────────── */
.guide-fab {
  /* 22px sat exactly under Netlify's "Powered by Netlify" badge on the
     deployed site, which hid most of the button — clear it. */
  position: fixed; right: 22px; bottom: 78px; z-index: 600;
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-dark));
  color: #fff; border: none; cursor: pointer;
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 24px var(--c-accent-glow), 0 2px 8px rgba(0,0,0,0.4);
  transition: transform .2s, box-shadow .2s;
  animation: guidePulse 2.4s ease-in-out infinite;
}
@keyframes guidePulse {
  0%, 100% { box-shadow: 0 6px 24px var(--c-accent-glow), 0 2px 8px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 6px 32px var(--c-accent-glow), 0 2px 12px rgba(0,0,0,0.5), 0 0 0 6px hsl(145,68%,42%,0.18); }
}
.guide-fab:hover { transform: scale(1.08); box-shadow: 0 8px 32px var(--c-accent-glow), 0 2px 8px rgba(0,0,0,0.5); }
.guide-fab:active { transform: scale(0.96); }

.guide-overlay {
  position: fixed; inset: 0; z-index: 699;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.guide-overlay.open { opacity: 1; pointer-events: auto; }

/* Clipping shell: fixed + inset:0 adds nothing to the document's scrollable
   width, and overflow:hidden keeps the parked panel from painting (or, on
   iOS, turning into a horizontal rubber-band) outside the viewport. */
.guide-shell {
  position: fixed; inset: 0; z-index: 700;
  overflow: hidden; pointer-events: none;
}
.guide-panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(540px, 92vw);
  z-index: 700; background: var(--c-surface);
  border-left: 1px solid var(--c-border);
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
  transform: translateX(105%);
  pointer-events: auto;
  /* hidden until opened, so the parked panel is neither painted, focusable,
     nor counted in the document's scrollable width (it used to stretch
     full-page captures by its own width) */
  visibility: hidden;
  transition: transform .3s cubic-bezier(.4,0,.2,1), visibility 0s .3s;
  display: flex; flex-direction: column;
}
.guide-panel.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .3s cubic-bezier(.4,0,.2,1), visibility 0s 0s;
}

.guide-head {
  padding: var(--gap-lg) var(--gap-xl);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: var(--gap-md);
  background: var(--c-surface-2); flex-shrink: 0;
}
.guide-head h2 { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--t-primary); margin: 0; }
.guide-head .guide-emoji { font-size: 24px; }
.guide-close {
  margin-left: auto; background: none; border: 1px solid var(--c-border);
  color: var(--t-secondary); width: 34px; height: 34px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.guide-close:hover { background: var(--c-surface-3); color: var(--t-primary); }

.guide-body { padding: var(--gap-lg) var(--gap-xl); overflow-y: auto; flex: 1; }

.guide-intro {
  font-size: 13px; color: var(--t-secondary); line-height: 1.5;
  margin-bottom: var(--gap-lg); padding: var(--gap-md);
  background: var(--c-surface-2); border-radius: var(--r-md);
  border-left: 3px solid var(--c-accent);
}

.guide-step {
  margin-bottom: var(--gap-lg); padding-bottom: var(--gap-lg);
  border-bottom: 1px solid var(--c-border);
}
.guide-step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.guide-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.guide-step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--c-accent); color: #fff; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.guide-step-num.warn { background: var(--c-orange); }
.guide-step-title { font-weight: 700; font-size: 14px; color: var(--t-primary); }
.guide-step-desc { font-size: 12.5px; color: var(--t-secondary); line-height: 1.5; margin-bottom: 8px; }
.guide-step-desc b { color: var(--t-primary); }

.guide-cmd {
  display: block; background: var(--c-bg-2); border: 1px solid var(--c-border);
  border-radius: var(--r-sm); padding: 9px 12px; font-family: var(--font-mono);
  font-size: 12px; color: var(--c-accent); margin: 8px 0; word-break: break-all;
  cursor: pointer; transition: background .15s, border-color .15s; user-select: all;
  white-space: pre-wrap;
}
.guide-cmd:hover { background: var(--c-surface-3); border-color: var(--c-accent); }
.guide-cmd.copied { color: var(--c-accent); border-color: var(--c-accent); }

.guide-io { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.guide-chip {
  font-size: 10.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--c-surface-3); color: var(--t-muted); border: 1px solid var(--c-border);
  font-family: var(--font-mono); white-space: nowrap;
}
.guide-chip.out { color: var(--c-accent); border-color: var(--c-accent-dark); background: hsl(145,68%,42%,0.1); }
.guide-chip.in { color: var(--c-blue); border-color: hsl(210,85%,58%,0.3); background: hsl(210,85%,58%,0.08); }

.guide-warn {
  margin-top: 8px; padding: 8px 12px; border-radius: var(--r-sm);
  background: hsl(28,90%,58%,0.1); border: 1px solid hsl(28,90%,58%,0.3);
  font-size: 12px; color: var(--c-orange); line-height: 1.4;
}
.guide-warn b { color: var(--c-orange); }

.guide-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.guide-table th, .guide-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--c-border); }
.guide-table th { color: var(--t-muted); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; }
.guide-table td { color: var(--t-secondary); font-family: var(--font-mono); font-size: 11.5px; }
.guide-table tr:last-child td { border-bottom: none; }
.guide-table .gt-name { color: var(--t-primary); font-family: var(--font-body); }

.guide-foot {
  padding: var(--gap-md) var(--gap-xl); border-top: 1px solid var(--c-border);
  font-size: 11px; color: var(--t-muted); background: var(--c-surface-2); flex-shrink: 0;
  line-height: 1.5;
}
.guide-foot b { color: var(--t-secondary); }

/* ════════════════════════════════════════════════════════════════════════
   NEWS DESK
   ════════════════════════════════════════════════════════════════════════ */
.news-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.news-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--t-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr-fast);
}
.news-tab:hover {
  color: var(--t-primary);
  border-color: var(--c-accent-dark);
}
.news-tab.active {
  background: hsla(145, 68%, 42%, 0.14);
  color: var(--c-accent);
  border-color: hsla(145, 68%, 42%, 0.4);
}
.news-tab-count {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--c-surface-3);
  color: var(--t-muted);
}
.news-tab.active .news-tab-count {
  background: hsla(145, 68%, 42%, 0.2);
  color: var(--c-accent);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
@media (max-width: 600px) {
  .news-grid { grid-template-columns: 1fr; }
}

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition: all var(--tr-fast);
  overflow: hidden;
}
.news-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: .8;
}
.news-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px hsla(0, 0%, 0%, 0.08);
}
.news-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  background: linear-gradient(135deg, var(--c-surface-2), color-mix(in srgb, var(--accent) 8%, var(--c-surface-2)));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--c-border));
  padding: 28px;
}
@media (max-width: 800px) {
  .news-hero { grid-template-columns: 1fr; }
}
.news-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.news-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--cat, #666) 16%, transparent);
  color: var(--cat, #666);
  border: 1px solid color-mix(in srgb, var(--cat, #666) 35%, transparent);
}
.news-meta {
  font-size: 12px;
  color: var(--t-muted);
}
.news-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--t-primary);
}
.news-hero .news-title {
  font-size: 26px;
}
.news-excerpt {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--t-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.news-hero .news-excerpt {
  -webkit-line-clamp: 3;
  max-width: 72ch;
}
.news-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
}
.news-read {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.news-hero-ornament {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
@media (max-width: 800px) {
  .news-hero-ornament { display: none; }
}

/* Article detail */
.news-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--t-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--tr-fast);
}
.news-back:hover {
  color: var(--t-primary);
  border-color: var(--c-accent-dark);
  background: var(--c-surface-2);
}
.news-article {
  max-width: 780px;
  padding: 32px;
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-top: 3px solid var(--accent);
}
.news-art-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.news-art-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--t-primary);
}
.news-deck {
  font-size: 16px;
  line-height: 1.65;
  color: var(--t-secondary);
  margin-top: 12px;
  margin-bottom: 8px;
}
.news-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.news-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  text-decoration: none;
  transition: all var(--tr-fast);
}
.news-link:hover {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
}
.news-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.news-para {
  font-size: 15px;
  line-height: 1.75;
  color: var(--t-primary);
  margin: 0;
}
.news-facts {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--c-border);
}
.news-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}
.news-fact span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--t-muted);
}
.news-fact b {
  font-size: 16px;
  color: var(--t-primary);
}
.news-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.news-tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--c-surface-3);
  color: var(--t-secondary);
  border: 1px solid var(--c-border);
}
.news-credit {
  margin-top: 24px;
  font-size: 12px;
  color: var(--t-muted);
  font-style: italic;
}

/* ════════════════════════════════════════════════════════════════════════
   HOME PAGE
   ════════════════════════════════════════════════════════════════════════ */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
}
.home-main { min-width: 0; }

.home-hero {
  position: relative;
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 16px;
  background:
    radial-gradient(900px 300px at 85% -20%, color-mix(in srgb, var(--accent) 20%, transparent), transparent),
    var(--c-surface-2);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--c-border));
  border-left: 4px solid var(--accent);
  cursor: pointer;
  transition: all var(--tr-fast);
  overflow: hidden;
}
.home-hero:hover { transform: translateY(-2px); }
.home-hero-inner { max-width: 720px; }
.home-hero .news-cat { margin-bottom: 12px; }
.home-hero-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--t-primary);
  margin: 10px 0;
}
.home-hero-deck {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--t-secondary);
  margin: 0 0 16px;
  max-width: 68ch;
}
.home-hero-cta {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.home-stories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) {
  .home-stories { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .home-stories { grid-template-columns: 1fr; }
}

.home-story {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-top: 3px solid var(--accent);
  cursor: pointer;
  transition: all var(--tr-fast);
}
.home-story:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--c-border));
}
.home-story-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--t-primary);
  margin: 0;
}
.home-story-deck {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--t-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-story-meta {
  margin-top: auto;
  font-size: 11.5px;
  color: var(--t-muted);
}

.home-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.home-panel {
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
}
.home-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
}
.home-panel-head b { color: var(--t-primary); }
.home-panel-head a {
  font-size: 12px;
  color: var(--c-accent);
  text-decoration: none;
}

.home-table-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
  color: var(--t-secondary);
}
.home-table-row:last-child { border-bottom: none; }
.home-table-pos {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--c-surface-3);
  color: var(--t-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.home-table-form {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--t-muted);
}
.home-table-row b { color: var(--t-primary); }

.home-pred-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--c-surface-3);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--t-primary);
}
.home-pred-score {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--c-accent);
}
.home-pred-bar {
  display: flex;
  height: 22px;
  margin-top: 10px;
  border-radius: 8px;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  gap: 2px;
}
.home-pred-bar div {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  min-width: 20px;
  white-space: nowrap;
  overflow: hidden;
}

.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.home-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  text-decoration: none;
  transition: all var(--tr-fast);
}
.home-tile:hover {
  border-color: var(--c-accent-dark);
  transform: translateY(-2px);
}
.home-tile-ic {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: hsla(145, 68%, 42%, 0.14);
  border: 1px solid hsla(145, 68%, 42%, 0.3);
  position: relative;
  flex-shrink: 0;
}
.home-tile-ic::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--c-accent);
}
.home-tile-ic.ic-trophy::after {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c-accent) 40%, transparent 42%);
}
.home-tile-ic.ic-player::after {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 12px 0 -3px var(--c-accent);
}
.home-tile-ic.ic-trend::after {
  width: 16px; height: 2px;
  border-radius: 2px;
  background: var(--c-accent);
  transform: rotate(-30deg);
  box-shadow: -4px 6px 0 -1px var(--c-accent), 4px -6px 0 -1px var(--c-accent);
}
.home-tile-ic.ic-paper::after {
  width: 14px; height: 2px;
  border-radius: 2px;
  background: var(--c-accent);
  box-shadow: 0 4px 0 -0.5px var(--c-accent), 0 8px 0 -0.5px var(--c-accent);
}
.home-tile-ic.ic-bolt::after {
  width: 4px; height: 16px;
  border-radius: 2px;
  background: var(--c-accent);
  transform: rotate(20deg);
}
.home-tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.home-tile-body b {
  color: var(--t-primary);
  font-size: 14px;
}
.home-tile-body span {
  color: var(--t-muted);
  font-size: 12px;
}

/* ════════════════════════════════════════════════════════════════════════
   TEAM OF THE WEEK
   ════════════════════════════════════════════════════════════════════════ */
.totw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) {
  /* minmax(0, 1fr), not 1fr: a bare 1fr floors at the pitch's min-content
     width, which pushed the card 10px past a 390px phone. */
  .totw-layout { grid-template-columns: minmax(0, 1fr); }
}
.totw-toggle {
  margin-bottom: 20px;
}
.totw-toggle .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
}
.totw-toggle-note {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--t-muted);
  text-transform: none;
  letter-spacing: 0;
}
.totw-md-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 16px;
}
.totw-md-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--t-secondary);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}
.totw-md-chip:hover {
  border-color: color-mix(in srgb, var(--t-accent, hsl(145,62%,33%)) 45%, transparent);
  transform: translateY(-1px);
}
.totw-md-chip.active {
  background: color-mix(in srgb, var(--t-accent, hsl(145,62%,33%)) 14%, var(--c-surface));
  border-color: var(--t-accent, hsl(145,62%,33%));
  color: var(--t-accent, hsl(145,62%,33%));
  font-weight: 700;
}
.totw-md-chip-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  opacity: .75;
}
.totw-md-chip-num {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}
.totw-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.totw-team-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--tcol);
  padding: 3px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tcol) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tcol) 35%, transparent);
}
.totw-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--t-muted);
}
.totw-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.totw-legend i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.totw-roster-row,
.totw-bench-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background var(--tr-fast);
  font-size: 13px;
}
.totw-roster-row:last-child, .totw-bench-row:last-child { border-bottom: none; }
.totw-roster-row:hover, .totw-bench-row:hover { background: var(--c-surface); }
.totw-rank {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--c-surface-3);
  color: var(--t-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.totw-pos {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--pcol);
  background: color-mix(in srgb, var(--pcol) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--pcol) 35%, transparent);
  padding: 2px 8px;
  border-radius: 6px;
  width: 42px;
  text-align: center;
  flex-shrink: 0;
}
.totw-roster-name {
  font-weight: 600;
  color: var(--t-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.totw-roster-team {
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.totw-roster-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.totw-roster-rating { flex-shrink: 0; }
.totw-bench-pos {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--pcol);
  width: 42px;
  text-align: center;
  flex-shrink: 0;
}
.totw-bench-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--t-muted);
}

/* ── match centre: goal timeline on narrow screens ──────────────────
   Declared last so it wins over the base .gtl-* rules above. */
@media (max-width: 600px) {
  .gtl-row { grid-template-columns: 1fr 56px 1fr; gap: 6px; padding: 8px 2px; }
  .gtl-scorer {
    font-size: 12px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
  }
  .gtl-sub {
    font-size: 10px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .gtl-crest { width: 18px; height: 18px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   TEAM PROFILE — sticky identity rail + one panel at a time
   The page used to be a 3,700px scroll of stacked cards. Now the club's
   identity holds still in a rail on the left and the right column swaps a
   single short panel, so no view is longer than about one screen.
   ════════════════════════════════════════════════════════════════════════════ */

.td-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: var(--gap-xl);
  align-items: start;
}

/* ── the rail ── */
.td-rail {
  position: sticky;
  top: calc(var(--nav-h) + 18px);
  overflow: hidden;
  padding: 20px 20px 18px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  background: linear-gradient(158deg, var(--c-surface), var(--c-surface-2));
}
.td-rail::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(360px 190px at 50% -12%, var(--td-dim, transparent), transparent 72%);
  pointer-events: none;
}
.td-rail > * { position: relative; }

.td-id { display: flex; align-items: center; gap: 13px; }
.td-crest {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.td-names { min-width: 0; }
.td-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--t-primary);
}
.td-sub {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* rank + points, side by side with a hairline between */
.td-rank {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--c-border);
}
.td-rank > div:last-child {
  padding-left: 15px;
  border-left: 1px solid var(--c-border);
}
.td-rank b {
  display: block;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--t-primary);
  font-variant-numeric: tabular-nums;
}
.td-rank b i {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--t-muted);
  letter-spacing: 0;
}
.td-rank span {
  display: block;
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--t-muted);
}

/* one stacked bar for the whole season: win / draw / loss */
.td-wdl {
  display: flex;
  height: 7px;
  margin-top: 14px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--c-surface-3);
}
.td-wdl i { display: block; height: 100%; }
.td-wdl-key {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  font-size: 11px;
  color: var(--t-muted);
  font-variant-numeric: tabular-nums;
}
.td-wdl-key b { color: var(--t-primary); font-weight: 800; }

/* key metrics */
.td-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--c-border);
  font-size: 12.5px;
}
.td-kv dt { color: var(--t-secondary); }
.td-kv dd {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--t-primary);
  font-variant-numeric: tabular-nums;
}

/* strongest / weakest, read straight off the percentile table */
.td-cap {
  margin-bottom: 8px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-muted);
}
.td-str { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--c-border); }
.td-srow {
  display: grid;
  grid-template-columns: 1fr 30px;
  align-items: center;
  gap: 7px 8px;
  padding: 5px 0 6px;
  font-size: 12px;
}
.td-srow span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--t-secondary);
}
.td-srow b {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.td-srow em {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  /* the track has to be visible on both surfaces, or the fill reads as
     an underline rather than a bar */
  background: color-mix(in srgb, var(--t-muted) 34%, transparent);
  overflow: hidden;
}
.td-srow em i { display: block; height: 100%; border-radius: 2px; }

/* ── right column ── */
.td-main { min-width: 0; }

.td-tabs {
  position: sticky;
  top: calc(var(--nav-h) + 6px);
  z-index: 20;
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 3px;
  margin-bottom: 6px;
  padding: 4px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-surface-2);
  box-shadow: 0 8px 22px -14px rgba(0, 0, 0, 0.55);
  overflow-x: auto;
  scrollbar-width: none;
}
.td-tabs::-webkit-scrollbar { display: none; }
.td-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--t-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.td-tab:hover { color: var(--t-primary); }
.td-tab.is-on {
  color: hsl(150, 26%, 8%);
  background: var(--c-accent);
  box-shadow: 0 3px 12px -3px var(--c-accent);
}
html[data-theme="light"] .td-tab.is-on { color: #fff; }

/* second tier: quiet underline, clearly subordinate to the pills above */
.td-sub {
  display: flex;
  gap: 2px;
  margin-bottom: var(--gap-lg);
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.td-sub::-webkit-scrollbar { display: none; }
.td-sub[hidden] { display: none; }
.td-sub button {
  appearance: none;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--t-muted);
  padding: 10px 13px 9px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.td-sub button:hover { color: var(--t-primary); }
.td-sub button.is-on { color: var(--t-primary); border-bottom-color: var(--c-accent); }
.td-sub button i {
  font-style: normal;
  margin-left: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--t-muted);
  font-variant-numeric: tabular-nums;
}
.td-sub button.is-on i { color: var(--c-accent); }

.td-panel[hidden] { display: none; }
.td-panel { animation: td-fade 0.2s ease both; }
@keyframes td-fade {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

/* a panel heading, so a bare table still says what it is */
.td-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.td-h h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--t-primary);
}
.td-h span { font-size: 11.5px; color: var(--t-muted); }

/* two-up card rows inside a panel */
.td-2up {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap-lg);
  align-items: start;
}
.td-2up + .td-2up { margin-top: var(--gap-lg); }

@media (max-width: 1080px) {
  .td-shell { grid-template-columns: 1fr; gap: var(--gap-lg); }
  .td-rail { position: static; }
  .td-tabs { top: calc(var(--nav-h) + 4px); }
}

@media (max-width: 620px) {
  .td-rail { padding: 15px 16px 14px; }
  .td-crest { width: 44px; height: 44px; border-radius: 12px; font-size: 17px; }
  .td-name { font-size: 18px; }
  .td-rank b { font-size: 22px; }
  .td-kv { font-size: 12px; }
  .td-tab { padding: 0 13px; font-size: 12px; }
  .td-sub button { padding: 9px 10px 8px; font-size: 12px; }
}

/* tiles inside a deck: fixed rows, quieter than the standalone grid */
.td-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: var(--gap-lg);
}
.td-tiles .stat-tile { padding: 11px 8px 10px; }
.td-tiles .stat-tile-val { font-size: 21px; letter-spacing: -0.02em; }
.td-tiles .stat-tile-label { font-size: 9.5px; letter-spacing: 0.06em; }
@media (max-width: 620px) {
  .td-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-tiles .stat-tile-val { font-size: 19px; }
  .td-str { display: none; }
}

/* ── Player finishing (Opta shot model) ───────────────────────────────
   Three rows on one scale: attempts, attempts on frame, goals.  The gaps
   between the bars are the story, so the track is quiet and the fills are
   the only saturated colour in the block. */
.pf-wrap {
  margin-top: var(--gap-lg);
  padding-top: var(--gap-lg);
  border-top: 1px solid var(--c-border);
}
.pf-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.pf-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--t-secondary);
}
.pf-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--t-muted);
}
.pf-tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}
.pf-funnel { display: flex; flex-direction: column; gap: 9px; }
.pf-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
}
.pf-lab {
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--t-muted);
}
.pf-track {
  height: 10px;
  border-radius: var(--r-full);
  background: color-mix(in srgb, var(--t-muted) 16%, transparent);
  overflow: hidden;
}
.pf-fill { height: 100%; border-radius: var(--r-full); }
.pf-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-align: right;
  color: var(--t-muted);
}
.pf-val b { color: var(--t-primary); font-size: 12.5px; font-weight: 700; }
.pf-val i { font-style: normal; margin-left: 4px; }
.pf-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 11px;
}
.pf-ref { font-size: 11px; color: var(--t-muted); }
.pf-ref.up { color: var(--c-accent); }
.pf-ref.down { color: var(--c-red); }
@media (max-width: 620px) {
  .pf-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-row { grid-template-columns: 66px minmax(0, 1fr) 78px; gap: 9px; }
  .pf-note { display: none; }
}
.pf-ref b { color: var(--t-secondary); font-weight: 700; }

/* ════════════════════════════════════════════════════════════════════════════
   SCROLL AFFORDANCE
   Tabs and wide tables scroll sideways. `app.js:_markScrollers()` adds
   .is-scroll / .is-start / .is-end so the edge that still has content behind
   it fades out, instead of a word being sliced in half.
   ════════════════════════════════════════════════════════════════════════════ */
.tabs.is-scroll:not(.is-end),
.league-table-wrap.is-scroll:not(.is-end),
.player-table-wrap.is-scroll:not(.is-end) {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent 100%);
  mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent 100%);
}
.tabs.is-scroll.is-start,
.league-table-wrap.is-scroll.is-start,
.player-table-wrap.is-scroll.is-start {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 26px);
  mask-image: linear-gradient(to right, transparent 0, #000 26px);
}
.tabs.is-scroll.is-start:not(.is-end),
.league-table-wrap.is-scroll.is-start:not(.is-end),
.player-table-wrap.is-scroll.is-start:not(.is-end) {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 26px, #000 calc(100% - 30px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 26px, #000 calc(100% - 30px), transparent 100%);
}

/* ════════════════════════════════════════════════════════════════════════════
   PITCH CARD HEADER (components/pitch.js)
   The subtitle is long ("CORNER MAP · MATCHDAY 1 · SEASON 2026/27"). On a
   phone it wraps, and a vertically centred wordmark ended up sitting between
   the two lines. Align it to the name instead, and let the text column shrink.
   ════════════════════════════════════════════════════════════════════════════ */
.pc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px 8px;
}
.pc-head-l {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.pc-head-txt { min-width: 0; }
.pc-head-r {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 2px;
}
.pc-sub {
  font-size: 11px;
  color: var(--t-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .pc-head { padding: 13px 14px 6px; }
  .pc-sub { font-size: 10px; letter-spacing: 0.3px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   COMPARISON MATRIX (pages/compare.js)
   Squawka-shaped: up to three subject cards side by side, each a
   self-contained stat panel with a crest-washed header and a proportional
   bar per row. Bars are normalised across the whole matrix, so a row reads
   the same whichever card you look at.
   ════════════════════════════════════════════════════════════════════════════ */

/* ── header ─────────────────────────────────────────────────────────────── */
.cm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.cm-head-l { min-width: 0; }
.cm-sub {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--t-muted);
  line-height: 1.4;
}
.cm-sub b { color: var(--t-secondary); font-weight: 700; }
.cm-head-r {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cm-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--t-secondary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--tr-fast), border-color var(--tr-fast), background var(--tr-fast);
}
.cm-btn svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.cm-btn:hover { color: var(--t-primary); border-color: var(--c-border-light); background: var(--c-surface-2); }
.cm-btn--primary { background: var(--c-accent); border-color: transparent; color: #04140c; }
.cm-btn--primary:hover { background: var(--c-accent); color: #04140c; filter: brightness(1.06); }
.cm-btn--ghost { background: transparent; }

/* ── segmented controls ─────────────────────────────────────────────────── */
.cm-mode, .cm-seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
}
.cm-mode button, .cm-seg button {
  height: 28px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--t-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--tr-fast), background var(--tr-fast);
}
.cm-mode button:hover, .cm-seg button:hover { color: var(--t-primary); }
.cm-mode button.is-on, .cm-seg button.is-on {
  background: var(--c-surface);
  color: var(--t-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28), inset 0 0 0 1px var(--c-border-light);
}

/* the Total / Per 90 switch sits centred above the matrix, like the reference */
.cm-scope { display: flex; justify-content: center; margin: 2px 0 18px; }
.cm-seg { width: min(440px, 100%); }
.cm-seg button { flex: 1; height: 32px; font-size: 12.5px; }
.cm-seg button.is-on {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--c-accent) 88%, #000),
    color-mix(in srgb, var(--c-accent) 62%, #0a5));
  color: #04140c;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--c-accent) 28%, transparent);
}

/* ── grid ───────────────────────────────────────────────────────────────── */
.cm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  align-items: stretch;
}

/* ── subject card ───────────────────────────────────────────────────────── */
.cmc {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.2));
}

.cmc-head {
  position: relative;
  padding: 13px 15px 15px;
  overflow: hidden;
  border-bottom: 1px solid var(--c-border);
}
.cmc-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(125% 95% at 105% -10%,
      color-mix(in srgb, var(--tint) 30%, transparent), transparent 62%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--tint) 10%, transparent), transparent 78%);
  pointer-events: none;
}
.cmc-crest {
  position: absolute;
  right: -26px;
  bottom: -46px;
  opacity: 0.14;
  transform: rotate(-7deg);
  pointer-events: none;
  filter: saturate(0.8);
  /* fade the lower edge so it reads as a watermark, not a pasted logo */
  -webkit-mask-image: linear-gradient(200deg, #000 45%, transparent 88%);
  mask-image: linear-gradient(200deg, #000 45%, transparent 88%);
}
.cmc-crest .team-crest { display: block; }

.cmc-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cmc-team {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--tint) 62%, var(--t-secondary));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmc-x {
  flex-shrink: 0;
  width: 25px; height: 25px;
  display: grid; place-items: center;
  border-radius: 7px;
  border: 1px solid var(--c-border);
  background: color-mix(in srgb, var(--c-surface) 65%, transparent);
  color: var(--t-muted);
  cursor: pointer;
  transition: color var(--tr-fast), border-color var(--tr-fast);
}
.cmc-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cmc-x:hover {
  color: var(--c-red);
  border-color: color-mix(in srgb, var(--c-red) 45%, transparent);
}

.cmc-name {
  position: relative;
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.15;
  color: var(--t-primary);
}
.cmc-pos {
  position: relative;
  margin-top: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cmc-mark {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--t-muted);
  opacity: 0.75;
}

/* metadata rows — real values, not fake dropdowns */
.cmc-meta {
  display: flex;
  flex-direction: column;
  padding: 4px 15px;
  border-bottom: 1px solid var(--c-border);
  background: color-mix(in srgb, var(--c-surface-2) 55%, transparent);
}
.cmc-mrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 11.5px;
}
.cmc-mrow + .cmc-mrow { border-top: 1px solid color-mix(in srgb, var(--c-border) 60%, transparent); }
.cmc-mrow span { color: var(--t-muted); }
.cmc-mrow b {
  font-weight: 600;
  color: var(--t-secondary);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── stat rows ──────────────────────────────────────────────────────────── */
.cmc-body {
  display: flex;
  flex-direction: column;
  padding: 4px 15px 12px;
  flex: 1;
}
.cm-row {
  padding: 9px 0 9px;
  border-bottom: 1px solid color-mix(in srgb, var(--c-border) 45%, transparent);
}
.cm-row:last-child { border-bottom: 0; }
.cm-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.cm-lab {
  font-size: 11.5px;
  color: var(--t-muted);
  line-height: 1.3;
  min-width: 0;
}
.cm-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--t-primary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cm-bar {
  height: 5px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--t-muted) 15%, transparent);
  overflow: hidden;
}
.cm-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: color-mix(in srgb, var(--c-red) 52%, transparent);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
}
.cm-row.is-best .cm-bar i { background: var(--c-accent); }
.cm-row.is-best .cm-val { color: var(--c-accent); }
.cm-row.is-solo .cm-bar i { background: color-mix(in srgb, var(--tint) 60%, transparent); }

/* ── empty slot ─────────────────────────────────────────────────────────── */
.cmc-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 300px;
  padding: 22px;
  border-radius: 16px;
  border: 1.5px dashed color-mix(in srgb, var(--t-muted) 34%, transparent);
  background: color-mix(in srgb, var(--c-surface) 50%, transparent);
  color: var(--t-muted);
  font-family: inherit;
  cursor: pointer;
  transition: border-color var(--tr-fast), color var(--tr-fast), background var(--tr-fast);
}
.cmc-add:hover {
  border-color: color-mix(in srgb, var(--c-accent) 55%, transparent);
  color: var(--c-accent);
  background: color-mix(in srgb, var(--c-accent) 5%, transparent);
}
.cmc-add-ico {
  position: relative;
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, currentColor 55%, transparent);
}
.cmc-add-ico svg {
  width: 30px; height: 30px;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.cmc-add-plus {
  position: absolute;
  right: -3px; bottom: -1px;
  width: 23px; height: 23px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--c-accent);
  color: #04140c;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  border: 2px solid var(--c-surface);
}
.cmc-add-t { font-size: 12.5px; font-weight: 600; }

/* ── footer ─────────────────────────────────────────────────────────────── */
.cm-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--t-muted);
  opacity: 0.85;
}
.cm-foot-sep { opacity: 0.5; }

/* The radar card is deliberately narrower than the matrix above it: a
   hexagon sized for the full 1384px content width leaves the chart floating
   in a sea of empty card. Constrain the card, centre it, let it read as a
   panel rather than a half-empty section. */
.cm-radar-card {
  margin-top: 14px;
  max-width: 620px;
  margin-inline: auto;
}

/* Legend under the radar. Three translucent polygons are hard to tell apart
   without one; the swatch is a short bar, not a dot, so it matches the thing
   that actually distinguishes the shapes — the stroke colour. */
.cm-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px 18px;
  margin-top: 4px;
}
.cm-lg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--t-secondary);
  white-space: nowrap;
}
.cm-lg i {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  flex: none;
}

/* ── modals ─────────────────────────────────────────────────────────────── */
.cm-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.16s ease;
}
.cm-modal.is-open { opacity: 1; }
.cm-modal-card {
  width: min(560px, 100%);
  max-height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transform: translateY(10px) scale(0.99);
  transition: transform 0.16s ease;
}
.cm-modal.is-open .cm-modal-card { transform: none; }

.cm-modal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 8px;
  flex-shrink: 0;
}
.cm-modal-h h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--t-primary);
}
.cm-modal-x {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--c-border);
  background: transparent;
  color: var(--t-muted);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
}
.cm-modal-x:hover { color: var(--t-primary); background: var(--c-surface-2); }
.cm-modal-sub {
  margin: 0;
  padding: 0 16px 10px;
  font-size: 12px;
  color: var(--t-muted);
  flex-shrink: 0;
}
.cm-modal-sub b { color: var(--t-primary); }
.cm-modal-f {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  flex-shrink: 0;
}

/* search + picker list */
.cm-search-wrap { position: relative; padding: 0 16px 10px; flex-shrink: 0; }
.cm-search-wrap > svg {
  position: absolute;
  left: 28px; top: 19px;
  width: 15px; height: 15px;
  fill: none; stroke: var(--t-muted); stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
.cm-search {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 34px;
  border-radius: 9px;
  border: 1px solid var(--c-border);
  background: var(--c-surface-2);
  color: var(--t-primary);
  font-family: inherit;
  font-size: 13px;
}
.cm-search:focus { outline: none; border-color: var(--c-accent); }
.cm-search::-webkit-search-cancel-button { filter: invert(0.5); }

.cm-list { overflow-y: auto; padding: 0 8px 10px; }
.cm-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background var(--tr-fast);
}
.cm-pick:hover { background: var(--c-surface-2); }
.cm-pick[hidden] { display: none; }
.cm-pick-crest { width: 26px; height: 26px; display: grid; place-items: center; flex-shrink: 0; }
.cm-pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cm-pick-main b {
  font-size: 13px;
  font-weight: 600;
  color: var(--t-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cm-pick-main i { font-style: normal; font-size: 11px; color: var(--t-muted); }
.cm-pick-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--t-secondary);
  flex-shrink: 0;
}
.cm-pick-val em { font-style: normal; font-size: 9.5px; opacity: 0.6; margin-left: 2px; }

/* stat editor */
.cm-grps {
  overflow-y: auto;
  padding: 2px 16px 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 2px 20px;
  align-content: start;
}
.cm-grp { break-inside: avoid; padding-bottom: 10px; }
.cm-grp-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 4px;
}
.cm-grp-h span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cm-grp-all {
  border: 0;
  background: transparent;
  color: var(--t-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 5px;
}
.cm-grp-all:hover { color: var(--c-accent); background: var(--c-surface-2); }

.cm-chk {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 2px;
  font-size: 12px;
  color: var(--t-secondary);
  cursor: pointer;
  border-radius: 6px;
}
.cm-chk:hover { color: var(--t-primary); }
.cm-chk input {
  appearance: none;
  -webkit-appearance: none;
  width: 15px; height: 15px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid var(--c-border-light);
  background: var(--c-surface-2);
  cursor: pointer;
  position: relative;
  transition: background var(--tr-fast), border-color var(--tr-fast);
}
.cm-chk input:checked {
  background: var(--c-accent);
  border-color: var(--c-accent);
}
.cm-chk input:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 4px; height: 8px;
  border: 2px solid #04140c;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

/* ── narrow screens ─────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .cm-head { gap: 12px; }
  .cm-head-r { width: 100%; justify-content: space-between; }
  .cm-head .page-title { font-size: 22px; }
  .cm-grid { gap: 12px; }
  .cmc-add { min-height: 150px; gap: 10px; }
  .cmc-add-ico { width: 52px; height: 52px; }
  .cmc-add-ico svg { width: 25px; height: 25px; }
  .cmc-name { font-size: 17px; }
  .cm-grps { grid-template-columns: 1fr; }
  .cm-modal { padding: 0; align-items: flex-end; }
  .cm-modal-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }
  .cm-modal.is-open .cm-modal-card { transform: none; }
}
