/* ============================================
   FOOTY BETS 2026 — Design Tokens & Components
   Dark-first sports betting aesthetic
   ============================================ */

/* --- Type Scale --- */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* --- Spacing (4px base) --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Content widths --- */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;

  /* --- Radius --- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* --- Transition --- */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Fonts --- */
  --font-display: 'Cabinet Grotesk', 'Arial Black', sans-serif;
  --font-body: 'General Sans', 'Helvetica Neue', sans-serif;
}

/* ============================================
   DARK MODE (Default — Footy Bets is dark-first)
   ============================================ */
:root, [data-theme="dark"] {
  --color-bg:             #0a0e17;
  --color-surface:        #111827;
  --color-surface-2:      #1a2332;
  --color-surface-offset: #0f1520;
  --color-surface-offset-2: #162033;
  --color-surface-dynamic: #1e293b;
  --color-divider:        #1e293b;
  --color-border:         #2d3a4f;

  --color-text:           #e2e8f0;
  --color-text-muted:     #94a3b8;
  --color-text-faint:     #64748b;
  --color-text-inverse:   #0a0e17;

  /* AFL Green-Gold accent */
  --color-primary:        #22c55e;
  --color-primary-hover:  #16a34a;
  --color-primary-active: #15803d;
  --color-primary-highlight: #16301f;

  /* Odds Gold */
  --color-gold:           #f59e0b;
  --color-gold-hover:     #d97706;

  /* Win/Loss */
  --color-success:        #22c55e;
  --color-error:          #ef4444;
  --color-warning:        #f59e0b;

  /* Blues for accent */
  --color-blue:           #3b82f6;
  --color-blue-hover:     #2563eb;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px oklch(0 0 0 / 0.4);
  --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.5);
}

/* ============================================
   LIGHT MODE
   ============================================ */
[data-theme="light"] {
  --color-bg:             #f1f5f9;
  --color-surface:        #ffffff;
  --color-surface-2:      #f8fafc;
  --color-surface-offset: #e2e8f0;
  --color-surface-offset-2: #cbd5e1;
  --color-surface-dynamic: #e2e8f0;
  --color-divider:        #e2e8f0;
  --color-border:         #cbd5e1;

  --color-text:           #0f172a;
  --color-text-muted:     #475569;
  --color-text-faint:     #94a3b8;
  --color-text-inverse:   #f8fafc;

  --color-primary:        #16a34a;
  --color-primary-hover:  #15803d;
  --color-primary-active: #166534;
  --color-primary-highlight: #dcfce7;

  --color-gold:           #d97706;
  --color-gold-hover:     #b45309;

  --color-success:        #16a34a;
  --color-error:          #dc2626;
  --color-warning:        #d97706;

  --color-blue:           #2563eb;
  --color-blue-hover:     #1d4ed8;

  --shadow-sm: 0 1px 2px oklch(0.2 0.01 250 / 0.06);
  --shadow-md: 0 4px 12px oklch(0.2 0.01 250 / 0.08);
  --shadow-lg: 0 12px 32px oklch(0.2 0.01 250 / 0.12);
}


/* Header background per theme */
[data-theme="light"] .header { background: rgba(241, 245, 249, 0.95); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --color-bg:             #f1f5f9;
    --color-surface:        #ffffff;
    --color-surface-2:      #f8fafc;
    --color-surface-offset: #e2e8f0;
    --color-surface-offset-2: #cbd5e1;
    --color-surface-dynamic: #e2e8f0;
    --color-divider:        #e2e8f0;
    --color-border:         #cbd5e1;
    --color-text:           #0f172a;
    --color-text-muted:     #475569;
    --color-text-faint:     #94a3b8;
    --color-text-inverse:   #f8fafc;
    --color-primary:        #16a34a;
    --color-primary-hover:  #15803d;
    --color-primary-active: #166534;
    --color-primary-highlight: #dcfce7;
    --color-gold:           #d97706;
    --color-gold-hover:     #b45309;
    --color-success:        #16a34a;
    --color-error:          #dc2626;
    --color-warning:        #d97706;
    --color-blue:           #2563eb;
    --color-blue-hover:     #1d4ed8;
    --shadow-sm: 0 1px 2px oklch(0.2 0.01 250 / 0.06);
    --shadow-md: 0 4px 12px oklch(0.2 0.01 250 / 0.08);
    --shadow-lg: 0 12px 32px oklch(0.2 0.01 250 / 0.12);
  }
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

/* ============================================
   HEADER / NAV
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) 0;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--color-text);
  text-decoration: none;
}
.logo:hover { color: var(--color-text); }
.logo .afl { color: var(--color-primary); }
.logo .bet { color: var(--color-gold); }

.nav { display: flex; align-items: center; gap: var(--space-1); }

.nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover, .nav a.active {
  color: var(--color-text);
  background: var(--color-surface-dynamic);
}

.nav-toggle {
  display: none;
  color: var(--color-text);
  padding: var(--space-2);
}

.theme-toggle {
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-md);
}
.theme-toggle:hover { color: var(--color-text); background: var(--color-surface-dynamic); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4);
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
  }
  .nav.open { display: flex; }
  .nav a { padding: var(--space-3) var(--space-4); }
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  padding: clamp(var(--space-10), 6vw, var(--space-20)) 0;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, oklch(0.4 0.15 145 / 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 30%, oklch(0.5 0.12 45 / 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, oklch(0.3 0.1 250 / 0.08) 0%, transparent 60%);
  z-index: 0;
}

.hero .container { position: relative; z-index: 1; }

.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: var(--space-4);
  letter-spacing: -0.03em;
}
.hero h1 .green { color: var(--color-primary); }
.hero h1 .gold { color: var(--color-gold); }

.hero p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 60ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.hero-cta {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  text-decoration: none;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-hover); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-outline:hover { background: var(--color-surface-dynamic); color: var(--color-text); }

.btn-gold {
  background: var(--color-gold);
  color: #000;
}
.btn-gold:hover { background: var(--color-gold-hover); color: #000; }

.btn-sm {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-4);
}

/* ============================================
   SECTION STYLES
   ============================================ */
.section {
  padding: clamp(var(--space-8), 4vw, var(--space-16)) 0;
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.section-header p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

.section-header .overline {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--transition-interactive), border-color var(--transition-interactive);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-6);
}

.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-4);
}

/* ============================================
   LADDER TABLE
   ============================================ */
.ladder-table {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.ladder-table table {
  min-width: 700px;
}

.ladder-table th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.ladder-table td {
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
}

.ladder-table tr:hover td {
  background: var(--color-surface-dynamic);
}

.ladder-table .pos { font-weight: 700; width: 40px; text-align: center; }
.ladder-table .team-name { font-weight: 600; }

.top-8 td:first-child {
  border-left: 3px solid var(--color-primary);
}

.form-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  margin-right: 2px;
}
.form-w { background: var(--color-success); color: #fff; }
.form-l { background: var(--color-error); color: #fff; }

/* ============================================
   ODDS DISPLAY
   ============================================ */
.odds-value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-gold);
  font-variant-numeric: tabular-nums;
}

.odds-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: var(--color-surface-dynamic);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* ============================================
   TEAM CARDS
   ============================================ */
.team-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-interactive), transform var(--transition-interactive);
}
.team-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.team-card-header {
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-divider);
}

.team-card-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
}

.team-card-body {
  padding: var(--space-4) var(--space-6);
}

.team-card-body p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.team-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-divider);
  font-size: var(--text-sm);
}
.team-stat-row:last-child { border-bottom: none; }
.team-stat-row .label { color: var(--color-text-muted); }
.team-stat-row .value { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================
   FIXTURE CARDS
   ============================================ */
.fixture-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  transition: border-color var(--transition-interactive);
}
.fixture-card:hover { border-color: var(--color-primary); }

.fixture-team {
  display: flex;
  flex-direction: column;
}
.fixture-team.away { text-align: right; }
.fixture-team-name {
  font-weight: 600;
  font-size: var(--text-sm);
}
.fixture-team-record {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.fixture-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}
.fixture-vs .vs-text {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-faint);
  text-transform: uppercase;
}
.fixture-vs .odds-display {
  display: flex;
  gap: var(--space-2);
}

.fixture-result {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fixture-score {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
}
.fixture-score .winner { color: var(--color-primary); }

/* ============================================
   STRATEGY / TIPS CONTENT
   ============================================ */
.strategy-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.strategy-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.strategy-card p, .strategy-card li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-2);
}

.strategy-card ul {
  list-style: none;
  padding: 0;
}
.strategy-card ul li {
  padding-left: var(--space-5);
  position: relative;
}
.strategy-card ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-weight: 600;
}

/* ============================================
   TIPS / PREDICTIONS
   ============================================ */
.prediction-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.prediction-card .matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.prediction-card .team-info {
  text-align: center;
}
.prediction-card .team-info.right { text-align: right; }

.prediction-card .team-name-lg {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
}

.prediction-card .tip-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.prediction-card .confidence-bar {
  height: 6px;
  background: var(--color-surface-dynamic);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-3);
}

.prediction-card .confidence-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

/* ============================================
   STAT BADGES / TAGS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge-green { background: oklch(from var(--color-success) l c h / 0.15); color: var(--color-success); }
.badge-red { background: oklch(from var(--color-error) l c h / 0.15); color: var(--color-error); }
.badge-gold { background: oklch(from var(--color-gold) l c h / 0.15); color: var(--color-gold); }
.badge-blue { background: oklch(from var(--color-blue) l c h / 0.15); color: var(--color-blue); }

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}
.tab {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--color-text); }
.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-12) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer h4 {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.footer ul { list-style: none; padding: 0; }
.footer ul li { margin-bottom: var(--space-2); }
.footer ul a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.footer ul a:hover { color: var(--color-primary); }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

.gambling-disclaimer {
  background: var(--color-surface-offset);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}
.gambling-disclaimer strong { color: var(--color-warning); }

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-gold { color: var(--color-gold); }
.text-muted { color: var(--color-text-muted); }
.text-faint { color: var(--color-text-faint); }
.fw-700 { font-weight: 700; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(480px, 100%), 1fr));
  gap: var(--space-8);
}

/* Page title area */
.page-hero {
  padding: var(--space-12) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-2);
}
.page-hero p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* Animate in */
.animate-in {
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.5s ease forwards;
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Scroll reveal */
/* Featured banner */
.featured-banner {
  background: linear-gradient(135deg, var(--color-surface-2), var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-6);
}
@media (max-width: 600px) {
  .featured-banner { grid-template-columns: 1fr; text-align: center; }
}

.featured-banner h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.featured-banner p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Quick stats row */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr));
  gap: var(--space-4);
}

.quick-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
}
.quick-stat .stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}
.quick-stat .stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Team color accents (via inline style or class) */
.team-accent { border-left: 4px solid var(--team-color, var(--color-primary)); }

/* Rating stars */
.rating { color: var(--color-gold); font-size: var(--text-sm); letter-spacing: 2px; }

/* Responsive odds grid */
.odds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: var(--space-3);
}

.odds-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color var(--transition-interactive);
}
.odds-card:hover { border-color: var(--color-gold); }
.odds-card .team { font-weight: 600; font-size: var(--text-sm); }
.odds-card .price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-gold);
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: oklch(from var(--color-bg) l c h / 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.search-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.search-overlay input {
  width: min(90%, 600px);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--color-primary);
  color: var(--color-text);
  padding: var(--space-4) 0;
  outline: none;
}
.search-overlay input::placeholder { color: var(--color-text-faint); }
.search-overlay .search-results {
  width: min(90%, 600px);
  margin-top: var(--space-6);
  max-height: 50vh;
  overflow-y: auto;
}
.search-result-item {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.15s ease;
}
.search-result-item:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.search-result-item .result-title { font-weight: 600; }
.search-result-item .result-desc { font-size: var(--text-xs); color: var(--color-text-muted); }
.search-close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  color: var(--color-text-muted);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: none;
  border: none;
}
.search-close:hover { color: var(--color-text); background: var(--color-surface-dynamic); }

/* ============================================
   SEARCH TOGGLE (NAV BAR)
   ============================================ */
.search-toggle {
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  background: none;
  border: none;
  cursor: pointer;
}
.search-toggle:hover { color: var(--color-text); background: var(--color-surface-dynamic); }

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
  padding: var(--space-4) 0 var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: var(--shadow-md);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover { background: var(--color-primary-hover); }

/* ============================================
   READING PROGRESS BAR
   ============================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-primary);
  z-index: 101;
  transition: width 50ms linear;
  width: 0%;
}

/* ============================================
   CALCULATOR INPUTS (shared)
   ============================================ */
.calc-input, .calc-select {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  width: 100%;
  transition: border-color var(--transition-interactive), box-shadow var(--transition-interactive);
}
.calc-input:focus, .calc-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}
.calc-input::placeholder { color: var(--color-text-faint); }

.input-group { margin-bottom: var(--space-4); }
.input-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.calc-result {
  background: var(--color-primary-highlight);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-align: center;
}
.calc-result .result-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-primary);
}
.calc-result .result-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ============================================
   QUIZ COMPONENTS
   ============================================ */
.quiz-progress {
  height: 6px;
  background: var(--color-surface-dynamic);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-6);
}
.quiz-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-bottom: var(--space-3);
  font-family: var(--font-body);
}
.quiz-option:hover { border-color: var(--color-primary); background: var(--color-surface-2); }
.quiz-option.correct {
  border-color: var(--color-success);
  background: oklch(from var(--color-success) l c h / 0.1);
}
.quiz-option.incorrect {
  border-color: var(--color-error);
  background: oklch(from var(--color-error) l c h / 0.1);
}
.quiz-option.disabled { pointer-events: none; opacity: 0.7; }

.quiz-timer {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  border: 3px solid var(--color-primary);
  color: var(--color-primary);
}
.quiz-timer.warning { border-color: var(--color-gold); color: var(--color-gold); }
.quiz-timer.danger { border-color: var(--color-error); color: var(--color-error); }

/* ============================================
   GLOSSARY COMPONENTS
   ============================================ */
.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-6);
  position: sticky;
  top: 56px;
  background: var(--color-bg);
  z-index: 10;
}
.letter-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}
.letter-nav a:hover { background: var(--color-surface-dynamic); color: var(--color-text); }
.letter-nav a.active { background: var(--color-primary); color: #fff; }
.letter-nav a.disabled { opacity: 0.3; pointer-events: none; }

.glossary-term {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-3);
}
.glossary-term h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.glossary-term .definition {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: var(--space-3);
}
.glossary-term .example {
  background: var(--color-surface-2);
  border-left: 3px solid var(--color-gold);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}
.glossary-term .related {
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.glossary-term .related a { color: var(--color-primary); }

.letter-section h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  padding-top: var(--space-6);
}

/* ============================================
   EXPANDED NAV FOR 9 ITEMS (MORE/DROPDOWN on mobile)
   ============================================ */
@media (max-width: 1100px) and (min-width: 901px) {
  .nav a { font-size: var(--text-xs); padding: var(--space-2); }
}

/* ============================================
   CONFETTI (quiz results)
   ============================================ */
@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  z-index: 300;
  animation: confetti-fall 3s ease-in forwards;
}

/* ============================================
   GLOSSARY SEARCH
   ============================================ */
.glossary-search {
  position: relative;
  margin-bottom: var(--space-4);
}
.glossary-search input {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-12);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  width: 100%;
}
.glossary-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px oklch(from var(--color-primary) l c h / 0.15);
}
.glossary-search svg {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
}
.glossary-count {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  margin-bottom: var(--space-4);
}

/* ============================================
   TEAM LOGOS
   ============================================ */
.team-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  flex-shrink: 0;
  vertical-align: middle;
}
.team-logo-lg {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
}
.team-logo-xl {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
}

/* ============================================
   SPACING FIXES — Tighter category pages
   ============================================ */
.breadcrumbs + .page-hero,
.breadcrumbs + .section {
  padding-top: var(--space-4);
}
.page-hero {
  padding: var(--space-8) 0 var(--space-6);
  margin-bottom: var(--space-6);
}
/* Reduce gap between breadcrumbs and content */
.breadcrumbs {
  padding: var(--space-3) 0 0;
  margin-bottom: 0;
}

/* ============================================
   DROPDOWN NAV — Cleaner navigation
   ============================================ */
.nav-item {
  position: relative;
}
.nav-item > a,
.nav-item > button {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
}
.nav-item > a:hover, .nav-item > button:hover,
.nav-item > a.active, .nav-item > button.active,
.nav-item.open > button {
  color: var(--color-text);
  background: var(--color-surface-dynamic);
}
.nav-item .caret {
  transition: transform 0.2s ease;
}
.nav-item.open .caret {
  transform: rotate(180deg);
}
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  box-shadow: var(--shadow-lg);
  z-index: 110;
}
.nav-item.open .nav-dropdown {
  display: block;
}
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown a:hover {
  color: var(--color-text);
  background: var(--color-surface-dynamic);
}
.nav-dropdown a.active {
  color: var(--color-primary);
  background: var(--color-primary-highlight);
}
.nav-dropdown .dd-icon {
  width: 18px;
  height: 18px;
  color: var(--color-text-faint);
  flex-shrink: 0;
}
.nav-dropdown .dd-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.nav-dropdown .dd-divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-2) var(--space-2);
}

/* Mobile: flatten dropdowns */
@media (max-width: 900px) {
  .nav-item { width: 100%; }
  .nav-item > button { width: 100%; justify-content: space-between; padding: var(--space-3) var(--space-4); }
  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 0 var(--space-4);
    background: transparent;
    min-width: 0;
  }
  .nav-dropdown a { padding: var(--space-2) var(--space-4); }
}

/* ============================================
   TABLE MOBILE FIX — No overlap, no truncation
   ============================================ */
.ladder-table table { min-width: 0; width: 100%; }
.ladder-table th, .ladder-table td { padding: var(--space-2) var(--space-3); }
.ladder-table .team-name { white-space: normal; word-break: normal; }

/* Mobile: stack or hide less important columns */
@media (max-width: 640px) {
  .ladder-table th, .ladder-table td { padding: var(--space-2); font-size: 12px; }
  .ladder-table .hide-mobile { display: none; }
  .ladder-table .team-name { font-size: 13px; }
  .team-logo { width: 20px; height: 20px; }
}

/* Homepage tips table — card layout on mobile */
.tips-table-card { display: none; }
@media (max-width: 900px) {
  .tips-table-desktop { display: none; }
  .tips-table-card { display: block; }
}

/* Fixture cards mobile fix */
@media (max-width: 600px) {
  .fixture-card {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-2);
  }
  .fixture-team, .fixture-team.away { text-align: center; }
  .fixture-vs { padding: var(--space-1) 0; }
}

/* ============================================
   ACCORDION / CONCERTINA
   ============================================ */
details.accordion {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  overflow: hidden;
}
details.accordion summary {
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  list-style: none;
  user-select: none;
  color: var(--color-text);
}
details.accordion summary::-webkit-details-marker { display: none; }
details.accordion summary::after {
  content: '+';
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--color-text-faint);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
details.accordion[open] summary::after {
  content: '\2212';
}
details.accordion .accordion-body {
  padding: 0 var(--space-5) var(--space-5);
}

/* Verdict box — prominent, green header */
.verdict-box {
  background: var(--color-primary-highlight);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
}
.verdict-header {
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.verdict-body {
  padding: var(--space-5);
}

/* Stat bars — remove orange, use blue for away */
.stat-bar-away {
  background: #d97706 !important;
  color: #fff !important;
}

/* ============================================
   HOMEPAGE TIP CARDS — MOBILE STACK
   ============================================ */
@media (max-width: 768px) {
  .card[style*="grid-template-columns: auto 1fr auto"],
  .card[style*="grid-template-columns:auto 1fr auto"] {
    grid-template-columns: 1fr !important;
    gap: var(--space-3) !important;
    padding: var(--space-4) !important;
  }
}

/* ============================================
   MENU & THEME FIXES
   ============================================ */
/* Ensure header works in both modes */
.header {
  background: rgba(10, 14, 23, 0.97) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.97) !important;
}

/* Nav items — cleaner styling */
.nav > a, .nav-item > button {
  font-size: 14px !important;
  padding: 8px 14px !important;
  border-radius: 8px;
  color: var(--color-text-muted);
  transition: color 0.15s, background 0.15s;
}
.nav > a:hover, .nav > a.active,
.nav-item > button:hover, .nav-item.open > button {
  color: var(--color-text) !important;
  background: var(--color-surface-dynamic) !important;
}
.nav > a.active {
  color: #fff !important;
  background: var(--color-primary) !important;
}

/* Dropdown — better contrast */
.nav-dropdown {
  background: var(--color-surface) !important;
  border: 1px solid var(--color-border) !important;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3) !important;
}
[data-theme="light"] .nav-dropdown {
  box-shadow: 0 8px 30px rgba(0,0,0,0.1) !important;
}

/* Theme toggle — ensure visibility */
.theme-toggle {
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-dynamic) !important;
}

/* ============================================
   STAT BAR CONTRAST FIX
   ============================================ */
.stat-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--space-3);
}
.stat-bar-label {
  font-weight: 700 !important;
  font-size: 11px !important;
  color: var(--color-text-muted) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.stat-bar-home {
  background: #16a34a !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  min-height: 32px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  justify-content: flex-end;
}
.stat-bar-away {
  background: #d97706 !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  min-height: 32px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  justify-content: flex-end;
}

/* ============================================
   COMPREHENSIVE MOBILE UX FIX
   ============================================ */

/* Stat bars — stack on mobile */
@media (max-width: 640px) {
  .stat-bar-row {
    flex-direction: column;
    gap: 4px;
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-divider);
  }
  .stat-bar-label {
    width: 100%;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    margin-bottom: 2px;
  }
  .stat-bar-row > div[style*="flex:1"] {
    width: 100%;
  }
  .stat-bar-home, .stat-bar-away {
    min-height: 28px;
    font-size: 12px !important;
  }
  
  /* Team logos smaller on mobile */
  .team-logo-xl { width: 64px !important; height: 64px !important; }
  
  /* Tip card teams tighter */
  .tip-card-teams img { width: 36px !important; height: 36px !important; }
  .tip-card-team-name { font-size: 13px !important; }
  .tip-card-score { font-size: var(--text-lg) !important; }
  
  /* Tables — wrap text, smaller font */
  .ladder-table th, .ladder-table td { 
    padding: 6px 8px; 
    font-size: 12px; 
  }
  
  /* Predictions compact */
  .prediction-card .matchup { flex-direction: column; gap: var(--space-2); }
  
  /* Player props table scroll */
  .player-props-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .player-props-table table { min-width: 500px; }
  
  /* Section spacing tighter */
  .section { padding: var(--space-6) 0 !important; }
  .section-header { margin-bottom: var(--space-4); }
  .section-header h2 { font-size: var(--text-lg); }
  
  /* Container padding */
  .container { padding-inline: var(--space-3); }
  
  /* Cards tighter */
  .card { padding: var(--space-4); }
  
  /* Footer compact */
  .footer-grid { gap: var(--space-4); }
  
  /* Hide non-essential columns */
  .hide-mobile { display: none !important; }
}

/* Player props — make scrollable on all screens */
.player-props-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}
.player-props-wrap table {
  min-width: 500px;
  width: 100%;
}

/* General table improvement */
table { border-collapse: collapse; width: 100%; }
th { position: sticky; top: 0; }

/* Tighter section spacing globally */
.section-header h2 { margin-bottom: var(--space-1); }
.section-header p { margin-bottom: 0; }

/* ============================================
   EXPANDED FOOTER — Publication quality
   ============================================ */
@media (max-width: 768px) {
  .footer-top-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-4) !important;
  }
  .footer-top-grid > div:last-child {
    justify-content: flex-start !important;
  }
}
.footer h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}
.footer ul li {
  margin-bottom: var(--space-1);
}
.footer ul a {
  font-size: 13px;
  line-height: 1.6;
}

/* ============================================
   TIP CARDS — EQUAL HEIGHT
   ============================================ */
.tips-grid {
  align-items: stretch;
}
.tip-card {
  display: flex !important;
  flex-direction: column;
  height: 100%;
}
.tip-card-header {
  flex-shrink: 0;
}
.tip-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.tip-card-summary {
  flex: 1;
}
.tip-card-cta {
  flex-shrink: 0;
  margin-top: auto;
}

/* ============================================
   NWG DESIGN SYSTEM — Applied to Footy Bets
   ============================================ */

/* Callout boxes for founder quotes */
.callout {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
}
.callout-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.callout-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.callout-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
}
.callout-role {
  font-size: 11px;
  color: var(--color-text-faint);
}
.callout-body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  font-style: italic;
}

/* Prose content — for long-form articles */
.prose { max-width: 720px; }
.prose h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin: var(--space-8) 0 var(--space-4);
}
.prose h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin: var(--space-6) 0 var(--space-3);
}
.prose p {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.prose ul, .prose ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-4);
}
.prose li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  margin-bottom: var(--space-2);
}
.prose strong { color: var(--color-text); }

/* Worked example boxes */
.worked-example {
  background: var(--color-surface-2, var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin: var(--space-5) 0;
}
.worked-example-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.worked-example-header svg { flex-shrink: 0; }

/* Content layout with sidebar */
.content-layout--sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}
@media (min-width: 900px) {
  .content-layout--sidebar {
    grid-template-columns: 1fr 320px;
  }
}
.content-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}

/* Alt section background rhythm */
.section-alt { background: var(--color-surface-offset, var(--color-surface-2, #0f1520)); }
[data-theme="light"] .section-alt { background: #f0f2f5; }

/* Improved card hover — NWG style */
.card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

/* Pill buttons */
.btn--pill {
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* TOC sidebar */
.toc {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.toc h4 {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}
.toc a {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-1) 0;
  text-decoration: none;
}
.toc a:hover { color: var(--color-primary); }

/* ============================================
   PLAYED MATCHES — Fade and deprioritize
   ============================================ */
.tip-card.played {
  opacity: 0.5;
  order: 99;
}
.tip-card.played:hover {
  opacity: 0.75;
}
.tip-card.played .tip-card-cta {
  background: var(--color-text-faint);
}
.played-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Fix horizontal overflow in tip page content boxes */
.card table, .card pre, .card code {
  max-width: 100%;
  overflow-x: auto;
  word-wrap: break-word;
}
.card table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* card table cells - mobile override handles this */

/* Stats Dashboard - shared baseline bars */
.stats-dashboard {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.stat-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px;
  align-items: center;
  gap: var(--space-3);
}
.stat-row .stat-label {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stat-row .stat-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
}
.stat-row .stat-val-home {
  text-align: right;
  color: #16a34a;
}
.stat-row .stat-val-away {
  text-align: left;
  color: #d97706;
}
.stat-bars-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat-bar-track {
  height: 22px;
  background: var(--color-surface-alt);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.stat-bar-fill-home {
  height: 100%;
  background: #16a34a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  min-width: 20%;
  transition: width 0.4s ease;
}
.stat-bar-fill-away {
  height: 100%;
  background: #d97706;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  min-width: 20%;
  transition: width 0.4s ease;
}
@media (max-width: 640px) {
  .stat-row {
    grid-template-columns: 60px 1fr 60px;
    gap: var(--space-2);
  }
  .stat-row .stat-val { font-size: var(--text-xs); }
  .stat-row .stat-label { font-size: 10px; }
}

/* Mobile fixes for tip page sections */
@media (max-width: 768px) {
  /* Tables: undo the forced fixed layout that breaks on mobile */
  .card table {
    display: table;
    table-layout: auto;
    font-size: 12px;
  }
  .card td, .card th {
    white-space: nowrap;
    word-break: normal;
    padding: 4px 6px;
    font-size: 11px;
  }
  
  /* Force all grid layouts inside sections to single column */
  section .container > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Section headers with side-by-side layout */
  .section-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  /* Stats dashboard responsive */
  .stat-row {
    grid-template-columns: 50px 1fr 50px;
    gap: 6px;
  }
  .stat-val { font-size: 12px !important; }
  .stat-label { font-size: 10px !important; }
  
  /* Player props table */
  table[style*="border-collapse"] {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Related articles grid */
  .related-grid,
  div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .responsive-grid {
    grid-template-columns: 1fr !important;
  }
}

/* H2H table scroll on mobile */
@media (max-width: 768px) {
  .card > table,
  .card > div > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 12px;
  }
  .card > table td,
  .card > table th,
  .card > div > table td,
  .card > div > table th {
    white-space: nowrap;
    padding: 6px 8px;
  }
}

/* ============================================
   UX SWEEP — PART A: MOBILE FIXES
   ============================================ */

/* A1. Fix horizontal page scroll on betting-sites.html */
@media (max-width: 900px) {
  .content-layout--sidebar { overflow-x: hidden; }
  .content-sidebar, .content-sidebar * { max-width: 100%; overflow-wrap: break-word; word-break: break-word; }
  .content-sidebar .card li, .content-sidebar .card p { max-width: 100%; overflow-wrap: break-word; }
}

/* A2. Fix horizontal scroll on tips.html match cards */
@media (max-width: 640px) {
  .card { max-width: 100%; }
  .tip-card-teams, .tip-card-header,
  [style*="display:flex"][style*="align-items:center"][style*="justify-content:space-between"] {
    flex-wrap: wrap;
  }
  .tip-card-teams img, .badge, [style*="flex-shrink:0"] { flex-shrink: 0; max-width: 100%; }
}

/* A3. Fix horizontal scroll on ladder.html .two-col */
@media (max-width: 520px) {
  .two-col { grid-template-columns: 1fr !important; }
}

/* A4. Header icon tap targets — CRITICAL */
.search-toggle, .theme-toggle, .nav-toggle {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* A5. Fixtures page tab buttons tap targets + visual affordance */
.tab-btn, .fixtures-tab, [role="tab"] {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
}
.tab-btn.active, [role="tab"][aria-selected="true"] { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* A6. Fixtures venue column hidden on small mobile + Tip button tap target */
@media (max-width: 600px) {
  .fixtures-table .col-venue,
  .fixtures-table th:nth-child(4),
  .fixtures-table td:nth-child(4) { display: none; }
  .fixtures-table .btn-sm,
  table.fixtures-table a { min-height: 44px; display: inline-flex; align-items: center; padding-left: var(--space-3); padding-right: var(--space-3); }
}

/* A7. Mobile font size floor */
@media (max-width: 640px) {
  .card td, .card th,
  table.h2h-table td, table.h2h-table th,
  .ladder-table td, .ladder-table th,
  table.props-table td, table.props-table th { font-size: 13px !important; }
  .stat-label, .stat-bar-label, .overline { font-size: 12px !important; }
  .footer a { font-size: 14px !important; }
}

/* A8. Place This Bet CTA full-width on mobile */
@media (max-width: 640px) {
  .match-hero .btn-primary, .match-hero a.btn { width: 100%; justify-content: center; }
}

/* A9. Horizontal-scroll wrapper right-edge fade hint */
.card[style*="overflow-x"]:after, .h2h-scroll-wrapper:after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 24px;
  background: linear-gradient(to left, var(--color-surface), transparent);
  pointer-events: none;
}

/* A10. Search overlay reliable color fallback */
.search-overlay {
  background: rgba(10, 14, 23, 0.97);
  background: color-mix(in srgb, var(--color-bg) 97%, transparent);
}
[data-theme="light"] .search-overlay {
  background: rgba(255, 255, 255, 0.97);
  background: color-mix(in srgb, var(--color-bg) 97%, transparent);
}

/* ============================================
   UX SWEEP — PART B: SKIP LINK + FOCUS STYLES
   ============================================ */

/* B1. Skip to content link */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 9999;
  padding: 10px 16px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 12px; outline: 2px solid var(--color-gold); outline-offset: 2px; }

/* B2. Global focus-visible outlines */
:where(a, button, [role="button"], [tabindex]):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

/* ============================================================
   CINEMATIC v4 COMPONENTS
   Appended for team pages, redesigned tip heroes, homepage + tips hub
   ============================================================ */

/* ---- .cine-hero ---- */
.cine-hero {
  position: relative;
  min-height: clamp(420px, 55vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0a0c14;
}

.cine-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  z-index: 0;
  /* Parallax-ready — transform applied via CSS custom property */
  will-change: transform;
}

/* Dark gradient overlay */
.cine-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.20) 0%,
    rgba(0, 0, 0, 0.55) 45%,
    rgba(0, 0, 0, 0.85) 100%
  );
  z-index: 1;
}

/* Subtle radial team-color glow */
.cine-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 15% 80%,
    color-mix(in srgb, var(--team-primary, var(--color-primary)) 28%, transparent) 0%,
    transparent 65%
  );
  z-index: 1;
  pointer-events: none;
}

.cine-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: clamp(40px, 6vw, 80px);
}

.cine-hero__inner .container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Eyebrow */
.cine-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 14px;
}

.cine-eyebrow::before {
  content: '';
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--team-primary, var(--color-primary));
  flex-shrink: 0;
}

/* Headline */
.cine-headline {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 88px);
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: #fff;
  margin: 0 0 16px;
  max-width: 14ch;
}

/* Subtitle */
.cine-subtitle {
  font-size: clamp(15px, 2vw, 18px);
  color: rgba(255, 255, 255, 0.80);
  line-height: 1.5;
  margin: 0;
}

/* Predicted score in hero */
.cine-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.03em;
  color: #fff;
  margin: 14px 0 10px;
  line-height: 1;
}

.cine-score__sep {
  color: rgba(255, 255, 255, 0.40);
  margin: 0 10px;
}

/* Edge pill in hero */
.cine-edge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: color-mix(in srgb, var(--color-gold) 22%, transparent);
  border: 1.5px solid var(--color-gold);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  color: var(--color-gold);
  margin-bottom: 10px;
}

/* CTA row in hero */
.cine-cta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ---- .team-band ---- */
.team-band {
  height: 6px;
  background: var(--team-primary, var(--color-primary));
  width: 100%;
  display: block;
}

/* ---- .stat-hero ---- */
.stat-hero-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

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

.stat-hero {
  padding: clamp(20px, 3vw, 36px) clamp(16px, 2.5vw, 32px);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-hero:last-child {
  border-right: none;
}

@media (max-width: 600px) {
  .stat-hero:nth-child(2) {
    border-right: none;
  }
  .stat-hero:nth-child(3) {
    border-right: 1px solid var(--color-border);
  }
  .stat-hero {
    border-bottom: 1px solid var(--color-border);
  }
}

.stat-hero__number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 7vw, 80px);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--color-text);
}

.stat-hero__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-text-faint);
}

/* ---- .roster-card ---- */
.roster-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: var(--space-4);
}

.roster-card {
  padding: 16px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.roster-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.roster-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--team-primary, var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.roster-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.roster-card__role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
}

.roster-card__stats {
  display: flex;
  gap: 16px;
}

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

.roster-card__stat-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
  line-height: 1;
}

.roster-card__stat-lbl {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-faint);
}

.roster-card__note {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid var(--color-divider);
}

/* ---- .form-sparkline ---- */
.form-sparkline {
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-sparkline__dot {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.form-sparkline__dot--W {
  background: var(--team-primary, var(--color-primary));
}

.form-sparkline__dot--L {
  background: var(--color-error, #ef4444);
}

.form-sparkline__dot--D {
  background: var(--color-text-faint);
}

/* Margin bar chart */
.form-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
}

.form-bars__bar {
  width: 20px;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  position: relative;
}

.form-bars__bar--pos {
  background: var(--team-primary, var(--color-primary));
  opacity: 0.8;
}

.form-bars__bar--neg {
  background: var(--color-error, #ef4444);
  opacity: 0.8;
  border-radius: 0 0 2px 2px;
}

/* ---- .matchup-card ---- */
.matchup-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.matchup-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.matchup-card__img-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.matchup-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.matchup-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.60) 100%
  );
}

.matchup-card__teams {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.matchup-card__team-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  letter-spacing: -0.01em;
}

.matchup-card__vs {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
}

.matchup-card__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.matchup-card__score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.matchup-card__edge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
}

.matchup-card__meta {
  font-size: 11px;
  color: var(--color-text-faint);
}

/* ---- Squad Identity Band ---- */
.squad-band {
  padding: var(--space-3) 0;
  background: color-mix(in srgb, var(--team-primary, var(--color-primary)) 10%, var(--color-surface));
  border-top: 3px solid var(--team-primary, var(--color-primary));
  border-bottom: 3px solid var(--team-primary, var(--color-primary));
  font-size: var(--text-sm);
}

.squad-band a {
  font-weight: 700;
  color: var(--team-primary, var(--color-primary));
  text-decoration: none;
}

.squad-band a:hover {
  text-decoration: underline;
}

/* ---- Mini Ladder ---- */
.mini-ladder {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.mini-ladder th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.mini-ladder td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text-muted);
}

.mini-ladder tr.highlight td {
  background: color-mix(in srgb, var(--team-primary, var(--color-primary)) 12%, transparent);
  color: var(--color-text);
  font-weight: 700;
}

/* ---- Upcoming Fixture Card ---- */
.fixture-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease;
  flex-wrap: wrap;
}

.fixture-card:hover {
  box-shadow: var(--shadow-md);
}

.fixture-card__logos {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.fixture-card__vs {
  font-size: 11px;
  color: var(--color-text-faint);
  font-weight: 700;
}

.fixture-card__info {
  flex: 1;
  min-width: 140px;
}

.fixture-card__matchup {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: 4px;
}

.fixture-card__meta {
  font-size: 12px;
  color: var(--color-text-muted);
}

.fixture-card__score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--color-gold);
  flex-shrink: 0;
  text-align: right;
}

.fixture-card__label {
  font-size: 10px;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- Results Table ---- */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.results-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.results-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text-muted);
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.result-badge--W {
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
  color: var(--color-primary);
}

.result-badge--L {
  background: color-mix(in srgb, #ef4444 18%, transparent);
  color: #ef4444;
}

.result-badge--D {
  background: color-mix(in srgb, var(--color-text-faint) 18%, transparent);
  color: var(--color-text-faint);
}

/* ---- Round Power Cards ---- */
.power-card {
  position: relative;
  padding: clamp(20px, 3vw, 32px);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.power-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--team-primary, var(--color-primary));
}

.power-card__edge {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.04em;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 6px;
}

.power-card__bet {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: 4px;
}

.power-card__meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ---- Responsive: tip cine-hero mobile ---- */
@media (max-width: 640px) {
  .cine-hero {
    min-height: 380px;
    align-items: flex-end;
  }
  .cine-headline {
    font-size: clamp(28px, 9vw, 44px);
  }
  .cine-score {
    font-size: clamp(28px, 8vw, 42px);
  }
  .stat-hero__number {
    font-size: clamp(32px, 9vw, 52px);
  }
  .cine-cta-row .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============ Stats Dashboard v2 (proportional, no overlap) ============ */
.stats-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.stats-grid__head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.stats-grid__head-team {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  letter-spacing: -0.01em;
}
.stats-grid__head-team img { width: 28px; height: 28px; flex-shrink: 0; }
.stats-grid__head-team--home { justify-content: flex-start; }
.stats-grid__head-team--away { justify-content: flex-end; }
.stats-grid__head-vs {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--color-text-faint);
}

.stat-row-v2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: var(--space-3) 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--color-border) 60%, transparent);
}
.stat-row-v2:last-child { border-bottom: none; }
.stat-row-v2__top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: var(--space-3);
}
.stat-row-v2__val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-base);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.stat-row-v2__val--home { text-align: left; color: var(--color-stat-home, #3b82f6); }
.stat-row-v2__val--away { text-align: right; color: var(--color-stat-away, #d97706); }
.stat-row-v2__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: center;
  white-space: nowrap;
}
.stat-row-v2__bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 10px;
  background: var(--color-surface-dynamic, color-mix(in srgb, var(--color-border) 40%, transparent));
  border-radius: 999px;
  overflow: hidden;
}
.stat-row-v2__bar-home,
.stat-row-v2__bar-away {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.stat-row-v2__bar-home {
  left: 50%;
  background: var(--color-stat-home, #3b82f6);
  transform: translateX(-100%);
  transform-origin: right center;
}
.stat-row-v2__bar-away {
  left: 50%;
  background: var(--color-stat-away, #d97706);
}
.stat-row-v2__bar::after {
  content: '';
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: var(--color-text-faint);
  opacity: 0.5;
  transform: translateX(-50%);
}
.stat-row-v2__advantage {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  margin-top: 2px;
  color: var(--color-text-muted);
}
.stat-row-v2__advantage strong {
  color: var(--color-gold);
  font-weight: 800;
}
.stats-key-callout {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-left: 3px solid var(--color-gold);
  background: color-mix(in srgb, var(--color-gold) 6%, transparent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.stats-key-callout__label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 4px;
}
.stats-key-callout__text {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text);
  margin: 0;
}

@media (max-width: 480px) {
  .stat-row-v2__top { grid-template-columns: auto 1fr auto; }
  .stat-row-v2__label { font-size: 10px; }
  .stat-row-v2__val { font-size: var(--text-sm); }
  .stats-grid__head-team { font-size: 12px; }
  .stats-grid__head-team img { width: 22px; height: 22px; }
}

/* ============================================================
   MOBILE IMPROVEMENTS
   Addresses all 10 known mobile issues identified in audit.
   Appended as overrides — desktop styles are unchanged.
   ============================================================ */


/* ----------------------------------------------------------
   MI-0: iOS zoom prevention + font-size floor
   Prevents iOS auto-zoom on form inputs (16px = no-zoom).
   Sets html font-size floor so rem-based values never shrink
   below readable threshold on tiny viewports.
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  html {
    font-size: 16px; /* Prevents iOS zoom on input focus */
  }
}


/* ----------------------------------------------------------
   MI-1: Cinematic hero text legibility
   Issue: overlay gradient too light; headline can crowd image
   at 375px; cine-hero h1 needs text-shadow for legibility.
   ---------------------------------------------------------- */

/* Strengthen the dark gradient so bottom-left text area is
   90% black — hero background images remain visible at top */
.cine-hero::before {
  background: linear-gradient(
    160deg,
    rgba(0, 0, 0, 0.30) 0%,
    rgba(0, 0, 0, 0.60) 40%,
    rgba(0, 0, 0, 0.90) 100%
  ) !important;
}

/* Text-shadow on the headline for legibility over any image */
.cine-headline {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* Eyebrow also needs shadow at small sizes */
.cine-eyebrow {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* Clamp: ensure 375px gets at least 8vw = 30px (≥28px floor) */
@media (max-width: 640px) {
  .cine-headline {
    font-size: clamp(28px, 8vw, 88px);
  }
}


/* ----------------------------------------------------------
   MI-2: Stat hero 2×2 grid — label wrapping at 375px
   Issue: "LADDER POSITION" wraps to two lines
   Fix: reduce letter-spacing + truncate with ellipsis on mobile
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  .stat-hero__label {
    letter-spacing: 0.06em;       /* was 0.18em — very tight on mobile */
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Give the stat-hero cells slightly less padding to fit 2 cols */
  .stat-hero {
    padding: 14px 10px;
  }

  /* Ensure stat-hero numbers don't overflow their cell */
  .stat-hero__number {
    font-size: clamp(28px, 9vw, 56px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/* ----------------------------------------------------------
   MI-3: Tips hub H1 font size floor
   Issue: clamp(32px, 5vw, 64px) yields ~18.75px at 375px
   Fix: explicit floor for the cine-headline on tips hub
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  /* Any .cine-headline with the inline font-size style on tips hub
     gets overridden to our clamp with a higher floor */
  .cine-hero .cine-headline[style*="font-size"] {
    font-size: clamp(32px, 8vw, 64px) !important;
  }
}


/* ----------------------------------------------------------
   MI-4: Match cards horizontal scroll on tips hub
   Issue: .matchup-card grid can push wider than viewport
   Fix: constrain image-wrap + ensure cards never exceed 100vw
   ---------------------------------------------------------- */
.matchup-card {
  max-width: 100%;
  box-sizing: border-box;
}

.matchup-card__img-wrap {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

@media (max-width: 480px) {
  /* Match card image height — fixed so cards don't stretch unevenly */
  .matchup-card__img-wrap {
    aspect-ratio: unset;
    height: 170px;
  }
}

/* Grid of matchup cards — single col at 480px */
@media (max-width: 480px) {
  /* Any auto-fill grid that contains matchup cards collapses cleanly */
  .card-grid,
  .card-grid-3 {
    grid-template-columns: 1fr;
  }
}


/* ----------------------------------------------------------
   MI-5: Tip page predicted score readability at 375px
   Issue: score font-size clamp(36px, 5vw, 64px) ≈ 18.75px at 375px
   which is too small and crowds the team identity bar.
   Fix: override to clamp(48px, 12vw, 96px) as spec requires.
   ---------------------------------------------------------- */
.cine-score {
  font-size: clamp(48px, 12vw, 96px);
  /* No forced font-size change at mobile since 12vw @ 375 = 45px */
}

@media (max-width: 640px) {
  .cine-score {
    font-size: clamp(36px, 10vw, 64px); /* 10vw@375 = 37.5px — readable */
    margin: 8px 0 6px;
    line-height: 1;
  }
}


/* ----------------------------------------------------------
   MI-6: Roster cards — column count on mobile
   Issue: auto-fill minmax(260px) creates 1 col at 320–520px
   but the task specifies explicit 1-col at ≤640px, 2-col at
   480px–640px, and auto-fill above 640px.
   ---------------------------------------------------------- */
.roster-cards {
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
}

@media (min-width: 481px) and (max-width: 640px) {
  .roster-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .roster-cards {
    grid-template-columns: 1fr;
  }
}


/* ----------------------------------------------------------
   MI-7: Team page mini-ladder — mobile scroll
   Issue: table may overflow horizontally on narrow viewports
   Fix: wrap in a scrollable container (the table itself already
   sits inside a .card — we target the parent wrapper pattern)
   ---------------------------------------------------------- */
.mini-ladder {
  display: block;    /* allows overflow-x on the table element */
}

/* Wrap pattern used in team pages is a div.card > table.mini-ladder */
.card > table.mini-ladder,
div > table.mini-ladder {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
  /* Reduce padding in mini-ladder to fit more columns */
  .mini-ladder th,
  .mini-ladder td {
    padding: 6px 6px;
    font-size: 12px;
    white-space: nowrap;
  }
}


/* ----------------------------------------------------------
   MI-8: Form sparkline & margin bar chart — small viewport
   Issue: dots/bars may overflow at 320–375px
   Fix: constrain dot/bar size, allow sparkline to wrap
   ---------------------------------------------------------- */
.form-sparkline {
  flex-wrap: wrap; /* allow two rows at very small widths */
  gap: 5px;
}

.form-sparkline__dot {
  width: 16px;   /* explicitly size — matches spec (14-18px) */
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 375px) {
  .form-sparkline__dot {
    width: 14px;
    height: 14px;
  }
  .form-sparkline {
    gap: 4px;
  }
}

/* Margin bar chart — each bar 16px wide, gap 4-6px */
.form-bars {
  flex-wrap: nowrap;  /* bars should not wrap, they're a chart */
  overflow-x: auto;   /* scroll if too many bars at tiny width */
  -webkit-overflow-scrolling: touch;
  gap: 4px;
}

.form-bars__bar {
  width: 16px;      /* 14-18px per spec; was 20px */
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .form-bars__bar {
    width: 14px;
  }
  .form-bars {
    gap: 3px;
  }
}


/* ----------------------------------------------------------
   MI-9: CTA buttons in cine-hero — full-width on mobile,
   min tap target 48px height. Entire matchup-card is tappable.
   ---------------------------------------------------------- */
@media (max-width: 640px) {
  /* Full-width CTAs in cine hero */
  .cine-cta-row {
    flex-direction: column;
    gap: 10px;
  }

  .cine-cta-row .btn,
  .cine-cta-row a.btn,
  .cine-cta-row button.btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
}

/* Ensure matchup-card itself is a full tap target */
.matchup-card {
  display: block;    /* already block, ensures entire area tappable */
  min-height: 44px;
}

/* General a/button tap target floor */
@media (max-width: 640px) {
  .btn {
    min-height: 44px;
    padding-top: max(var(--space-3), 10px);
    padding-bottom: max(var(--space-3), 10px);
  }

  /* Power cards as links get tap-friendly min-height */
  a.power-card {
    display: block;
    min-height: 44px;
  }
}


/* ----------------------------------------------------------
   MI-10: Stats dashboard v2 (.stat-row-v2) — no overlap
   Issue: .stat-row-v2__top grid at 480px may crush values
   Fix: verified at 480px the grid-template-columns are 1fr auto 1fr
   — that's fine but values need font-size clamping.
   ---------------------------------------------------------- */
.stat-row-v2__val {
  font-size: clamp(13px, 3vw, 16px); /* override var(--text-base) */
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .stat-row-v2__top {
    /* Tighten the gap so values don't push out at 320px */
    gap: var(--space-2);
  }

  .stat-row-v2__label {
    font-size: 9px;
    letter-spacing: 0.08em;
    /* Allow minor wrapping only if absolutely needed */
    white-space: normal;
    word-break: break-word;
  }

  /* Stats header team name — don't overflow */
  .stats-grid__head-team {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stats-grid__head-team img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
  }
}


/* ----------------------------------------------------------
   GLOBAL TEXT & SPACING FLOORS (combined / no-cascade-break)
   Spec: body never below 14px; stat labels ≥11px; eyebrow ≥11px
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  /* Body text floor */
  body,
  .prose p,
  .card p,
  .strategy-card p,
  .strategy-card li {
    font-size: max(14px, var(--text-sm));
  }

  /* Stat label floor — 11px */
  .stat-hero__label,
  .quick-stat .stat-label,
  .stat-row .stat-label,
  .overline,
  .cine-eyebrow,
  .section-header .overline {
    font-size: max(11px, 11px); /* explicit floor */
  }

  /* Section padding: clamp(20px, 5vw, 32px) */
  .section {
    padding-top: clamp(20px, 5vw, 32px) !important;
    padding-bottom: clamp(20px, 5vw, 32px) !important;
  }

  /* Container padding: 16px on mobile */
  .container {
    padding-inline: 16px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  /* Container padding: 24px on tablet */
  .container {
    padding-inline: 24px;
  }
}


/* ----------------------------------------------------------
   CLS PREVENTION — Aspect-ratio wrappers for hero images
   Prevent layout shift while hero background images load.
   The .cine-hero has min-height (clamp) which already provides
   a stable container; we reinforce with explicit ratio hints.
   ---------------------------------------------------------- */
/* aspect-ratio removed - was breaking absolute-positioned bg fill on mobile.
   The parent .cine-hero already has min-height clamp providing a stable
   container, so CLS is bounded by that. */
.cine-hero__bg {
  /* Ensure full fill regardless of any other constraints */
  width: 100%;
  height: 100%;
}

/* matchup card images already have aspect-ratio 16/9 via
   .matchup-card__img-wrap — confirmed OK */

/* Team logos — explicit contain for CLS */
.team-logo,
.team-logo-lg,
.team-logo-xl {
  display: inline-block; /* prevents collapse before image loads */
}


/* ----------------------------------------------------------
   OVERFLOW SAFETY NET
   Prevent any single element from causing horizontal page scroll.
   Applied conservatively so desktop layouts are not affected.
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  /* Only apply overflow hidden to the body scrolling context */
  body {
    overflow-x: hidden;
  }

  /* Any section/container shouldn't overflow viewport */
  .section,
  .container {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Two-col falls back gracefully */
  .two-col {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   END OF MOBILE IMPROVEMENTS
   ============================================================ */

/* ============ THEME REFINEMENTS ============ */
/* Light-mode + dark-mode polish to fix audit findings */

/* Define accent color tokens per theme so stat numbers and badges pass WCAG AA */
:root, [data-theme="dark"] {
  --color-stat-home: #60a5fa;
  --color-stat-away: #fbbf24;
  --color-divider: rgba(148, 163, 184, 0.18);
  --color-card-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] {
  --color-stat-home: #1d4ed8;     /* 5.9:1 on white */
  --color-stat-away: #92400e;     /* 7.5:1 on white */
  --color-divider: rgba(15, 23, 42, 0.10);
  --color-card-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

/* H-01: Cine-hero gradient adapts to light mode (less black, gentler ramp) */
[data-theme="light"] .cine-hero::before {
  background: linear-gradient(
    160deg,
    rgba(0, 0, 0, 0.10) 0%,
    rgba(0, 0, 0, 0.40) 55%,
    rgba(0, 0, 0, 0.70) 100%
  ) !important;
}
[data-theme="light"] .cine-hero {
  border-bottom: 1px solid var(--color-divider);
}
/* Soften the seam where the dark hero meets the light content */
[data-theme="light"] .cine-hero + section,
[data-theme="light"] .cine-hero + main > section:first-child {
  position: relative;
}

/* H-02: Use the new stat color tokens on dashboards. Override hardcoded #d97706 in markup. */
[data-theme="light"] .stat-row-v2__val--home,
[data-theme="light"] [style*="color:#3b82f6"] {
  color: var(--color-stat-home) !important;
}
[data-theme="light"] .stat-row-v2__val--away,
[data-theme="light"] [style*="color:#d97706"] {
  color: var(--color-stat-away) !important;
}
/* Dark mode: lift the away amber slightly */
[data-theme="dark"] .stat-row-v2__val--home,
:root .stat-row-v2__val--home {
  color: var(--color-stat-home);
}
[data-theme="dark"] .stat-row-v2__val--away,
:root .stat-row-v2__val--away {
  color: var(--color-stat-away);
}

/* C-01 + H-03: Richmond + other yellow team accents need darkening on white */
[data-theme="light"] .cine-hero[style*="--team-primary:#ffd200"]::after,
[data-theme="light"] .team-accent[style*="#ffd200"] {
  border-left-color: #b8860b !important;
  border-color: #b8860b !important;
}
/* General team-accent darken on light: shift any yellow/light primaries 30% toward black */
[data-theme="light"] [style*="--team-primary:#ffd200"] .team-band,
[data-theme="light"] [style*="--team-primary:#fbbf24"] .team-band {
  background: #b8860b !important;
}

/* M-02: Ladder zebra striping in both modes for readability */
.ladder-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--color-surface-2) 60%, transparent);
}
[data-theme="light"] .ladder-table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.03);
}

/* M-03: Stat bar track contrast in light mode */
[data-theme="light"] .stat-row-v2__bar {
  background: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .stat-row-v2__bar::after {
  background: rgba(15, 23, 42, 0.25);
}

/* M-04 / overall: Edge pills need theme-aware contrast */
[data-theme="light"] .edge-callout,
[data-theme="light"] .edge-pill {
  background: color-mix(in srgb, var(--color-gold) 12%, white 88%) !important;
  color: #92400e !important;
  border-color: #92400e !important;
}
[data-theme="light"] .edge-num {
  color: #92400e !important;
}
[data-theme="light"] .edge-tag {
  color: #78350f !important;
}

/* M-05: Collingwood black accent on dark surface — give a subtle ring */
[data-theme="dark"] .cine-hero[style*="--team-primary:#000000"] {
  outline: 1px solid rgba(255, 255, 255, 0.10);
  outline-offset: -1px;
}
[data-theme="dark"] .team-accent[style*="border-left-color:#000"],
[data-theme="dark"] [style*="--team-primary:#000000"] .team-band {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
}

/* M-06: Tab borders in light mode — strengthen */
[data-theme="light"] .tab-btn,
[data-theme="light"] [role="tab"] {
  border-color: rgba(15, 23, 42, 0.18) !important;
}

/* H-04: Fixtures tab row scroll on mobile */
@media (max-width: 600px) {
  .tab-row,
  .tabs,
  [role="tablist"] {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: var(--space-2);
    padding-bottom: 4px;
    margin-bottom: var(--space-2);
    scrollbar-width: thin;
  }
  .tab-row .tab-btn,
  .tabs .tab-btn,
  [role="tablist"] [role="tab"] {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* M-07: Define --color-surface-alt that's used in policy pages */
:root, [data-theme="dark"] { --color-surface-alt: #1a2332; }
[data-theme="light"] { --color-surface-alt: #f8fafc; }

/* Theme toggle: smooth color transitions to make switching less jarring */
html { color-scheme: dark; }
[data-theme="light"] html,
html[data-theme="light"] { color-scheme: light; }

body,
.card,
.cine-hero,
.section,
header.header,
footer,
.ladder-table td,
.stat-hero {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Light mode: stat-hero numbers — ensure they don't lose impact on white */
[data-theme="light"] .stat-hero__num {
  color: var(--color-text);
  text-shadow: none;
}
[data-theme="light"] .stat-hero {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
}

/* Light mode card shadow */
[data-theme="light"] .card,
[data-theme="light"] .roster-card,
[data-theme="light"] .matchup-card,
[data-theme="light"] .fixture-card,
[data-theme="light"] .power-card {
  box-shadow: var(--color-card-shadow);
  border: 1px solid var(--color-divider);
}

/* Light mode: theme-color meta hint via JS would be ideal, but this CSS at least sets correct expectation */

/* Light mode: footer copy contrast */
[data-theme="light"] footer,
[data-theme="light"] footer * {
  color: var(--color-text);
}
[data-theme="light"] footer .footer-link,
[data-theme="light"] footer a {
  color: var(--color-text-muted);
}
[data-theme="light"] footer a:hover {
  color: var(--color-primary);
}

/* Form badge contrast on light */
[data-theme="light"] .form-badge.form-w,
[data-theme="light"] .form-w {
  background: #15803d;
  color: white;
}
[data-theme="light"] .form-badge.form-l,
[data-theme="light"] .form-l {
  background: #b91c1c;
  color: white;
}
[data-theme="light"] .form-badge.form-d,
[data-theme="light"] .form-d {
  background: #475569;
  color: white;
}

/* Light mode: BEST EDGE / overlines need stronger contrast */
[data-theme="light"] .overline,
[data-theme="light"] [class*="-eyebrow"] {
  color: #475569;
}

/* Light mode: cine-hero text-shadow stays effective */
[data-theme="light"] .cine-headline,
[data-theme="light"] .cine-hero h1 {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

/* Cine-hero ::after radial glow muted in light mode (was overpowering) */
[data-theme="light"] .cine-hero::after {
  opacity: 0.4 !important;
}


/* ============================================================
   === MOBILE DEEP PASS ===
   320px / 375px / 414px audit and fixes.
   Only appends — no existing rules changed.
   ============================================================ */

/* ----------------------------------------------------------
   MD-1: Global horizontal overflow guard (belt + suspenders)
   Catches any element that overflows into the gutter.
   ---------------------------------------------------------- */
html { max-width: 100vw; overflow-x: hidden; }

* {
  min-width: 0;        /* prevents flex/grid children from overflowing */
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   MD-2: Cine-hero — prevent text from falling below fold on
   narrow phones. Lock min-height to 380px floor at 320px,
   let the padding clamp bring content up.
   ---------------------------------------------------------- */
@media (max-width: 414px) {
  .cine-hero {
    min-height: clamp(380px, 85svh, 520px);
    align-items: flex-end;
  }

  .cine-hero__inner {
    padding-bottom: clamp(28px, 6vw, 48px);
  }

  .cine-headline {
    font-size: clamp(28px, 9vw, 44px);
    max-width: 100%;
    /* Prevent mid-word breaks on long team names */
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .cine-subtitle {
    font-size: 14px;
  }

  .cine-eyebrow {
    font-size: 10px;
    letter-spacing: 0.14em;
    gap: 8px;
    margin-bottom: 10px;
  }

  .cine-score {
    font-size: clamp(28px, 9vw, 42px);
  }

  /* CTA row: stack and full-width on all phones */
  .cine-cta-row {
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
  }
  .cine-cta-row .btn,
  .cine-cta-row a.btn,
  .cine-cta-row button.btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    text-align: center;
  }
}

/* ----------------------------------------------------------
   MD-3: Fixture tab row (fixtures.html) — scrolls at 320px.
   Existing rule handles 600px; push it down to 320px.
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  .tab-row,
  .tabs,
  [role="tablist"] {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 6px;
    scrollbar-width: thin;
    /* Fade edge indicator */
    mask-image: linear-gradient(to right, black 80%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
  }
  .tab-row .tab-btn,
  .tab-row .tab,
  .tabs .tab-btn,
  .tabs .tab,
  [role="tablist"] [role="tab"] {
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;          /* 44px touch target */
    padding-inline: 14px;
  }
}

/* ----------------------------------------------------------
   MD-4: Match cards (matchup-card) — pack cleanly at 320px.
   Guard against image aspect ratio causing excessive height.
   ---------------------------------------------------------- */
@media (max-width: 480px) {
  .matchup-card__img-wrap {
    aspect-ratio: 16 / 7;    /* slightly shorter on very narrow screens */
  }

  .matchup-card__team-name {
    font-size: 11px;
  }

  .matchup-card__score {
    font-size: 16px;
  }

  .matchup-card__body {
    padding: 10px 12px;
  }
}

/* ----------------------------------------------------------
   MD-5: Stats dashboard v2 (proportional bar layout).
   Prevent label + bar from overflowing at 320px.
   ---------------------------------------------------------- */
@media (max-width: 414px) {
  .stat-row-v2 {
    flex-wrap: wrap;
    gap: 4px;
  }

  .stat-row-v2__label {
    font-size: 11px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stat-row-v2__bar-wrap {
    width: 100%;
    order: 3;
  }

  .stat-row-v2__val--home,
  .stat-row-v2__val--away {
    font-size: 12px;
    flex-shrink: 0;
  }
}

/* ----------------------------------------------------------
   MD-6: Roster cards — ensure no internal overflow at 320px.
   ---------------------------------------------------------- */
@media (max-width: 375px) {
  .roster-card {
    padding: 12px;
  }

  .roster-card__stat-val {
    font-size: 15px;
  }

  .roster-card__note {
    font-size: 11px;
  }

  .roster-card__avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* ----------------------------------------------------------
   MD-7: Mini-ladder — explicit mobile layout.
   Constrain column widths to fit 320px viewport.
   ---------------------------------------------------------- */
@media (max-width: 414px) {
  .mini-ladder {
    font-size: 11px;
  }

  .mini-ladder th,
  .mini-ladder td {
    padding: 5px 4px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* Truncate long team names inside mini-ladder */
  .mini-ladder .team-abbr,
  .mini-ladder td:first-child {
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Scroll indicator for any overflowing table */
  .card > table.mini-ladder {
    width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ----------------------------------------------------------
   MD-8: Form sparkline — tighter at 320px
   ---------------------------------------------------------- */
@media (max-width: 320px) {
  .form-sparkline__dot {
    width: 13px;
    height: 13px;
    font-size: 8px;
  }
  .form-sparkline {
    gap: 3px;
  }
}

/* ----------------------------------------------------------
   MD-9: Touch targets audit — all interactive elements >= 44px.
   ---------------------------------------------------------- */
/* Nav links */
.nav a, .nav button, .nav-item > button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Favourite buttons, search toggle, theme toggle */
.back-to-top,
.search-toggle,
.theme-toggle,
[data-fav-id],
.quiz-option,
[role="tab"],
.tab,
.tab-btn {
  min-height: 44px;
  min-width: 44px;
}

/* Skip link — ensure tappable */
.skip-link:focus {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* ----------------------------------------------------------
   MD-10: Tables (ladder, stat tables) — horizontal scroll
   at all mobile widths, not just 640px.
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  .ladder-table,
  .stats-table,
  table.results-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ladder-table th,
  .ladder-table td {
    white-space: nowrap;
    padding-inline: 8px;
  }
}

/* ----------------------------------------------------------
   MD-11: Fixture card on homepage — teams don't wrap oddly.
   ---------------------------------------------------------- */
@media (max-width: 414px) {
  .fixture-card {
    flex-wrap: nowrap;
    gap: var(--space-2);
    padding: var(--space-3);
  }

  .fixture-team-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
  }

  .fixture-card__logos {
    gap: 6px;
  }
}

/* ----------------------------------------------------------
   MD-12: Marquee hero on homepage — content always visible.
   Ensure headline never clips below fold at 320px.
   ---------------------------------------------------------- */
@media (max-width: 375px) {
  /* Homepage-specific hero: tighter padding so content surfaces */
  .cine-hero__inner .container {
    padding-inline: 14px;
  }

  /* Prevent the score + edge pill row from stacking into overflow */
  .cine-score {
    font-size: clamp(26px, 8.5vw, 36px);
  }

  .cine-edge {
    font-size: 11px;
    padding: 5px 12px;
  }
}

/* ----------------------------------------------------------
   MD-13: Section headers — prevent overline from breaking
   mid-word at 320px.
   ---------------------------------------------------------- */
.section-header .overline,
.overline,
.cine-eyebrow {
  word-break: normal;
  overflow-wrap: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
}

/* ----------------------------------------------------------
   MD-14: Betting-site grid / card grids — single column floor
   at very narrow widths.
   ---------------------------------------------------------- */
@media (max-width: 360px) {
  .betting-sites-grid,
  .bookie-grid,
  .odds-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   === UX REFINEMENTS ===
   ============================================================ */

/* ----------------------------------------------------------
   UX-1: Sticky tip CTA bar.
   Default: hidden. JS adds `.tip-sticky-cta--visible` class
   when hero CTA scrolls off screen. Hides when at top.
   ---------------------------------------------------------- */
.tip-sticky-cta {
  display: none;                 /* desktop: never show */
}

@media (max-width: 768px) {
  .tip-sticky-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    transform: translateY(110%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
  }

  .tip-sticky-cta--visible {
    transform: translateY(0);
  }

  .tip-sticky-cta__label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tip-sticky-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
    transition: background 0.18s ease;
    flex-shrink: 0;
  }
  .tip-sticky-cta__btn:hover,
  .tip-sticky-cta__btn:focus-visible {
    background: var(--color-primary-hover);
    color: #fff;
    outline: 2px solid var(--color-gold);
    outline-offset: 2px;
  }
}

/* ----------------------------------------------------------
   UX-2: Smooth scroll for in-page anchors.
   ---------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

/* Offset for sticky header (~64px) plus breathing room */
:where(h1, h2, h3, h4, h5, h6, section, [id]) {
  scroll-margin-top: 80px;
}

/* ----------------------------------------------------------
   UX-3: Hover + focus affordance on clickable cards.
   Pushes the existing subtle lift to a more confident 4px lift,
   gold ring outline on hover, image scale inside.
   ---------------------------------------------------------- */

/* --- .matchup-card --- */
.matchup-card {
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.22s ease,
              outline-color 0.18s ease;
  outline: 2px solid transparent;
  outline-offset: 2px;
}
.matchup-card:hover,
.matchup-card:focus-within {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 36px rgba(0,0,0,0.45), 0 0 0 2px var(--color-gold);
  outline-color: var(--color-gold);
}
.matchup-card:hover .matchup-card__img {
  transform: scale(1.03);
}
.matchup-card__img {
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
}

/* --- .team-card --- */
.team-card {
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: box-shadow 0.22s cubic-bezier(0.16,1,0.3,1),
              transform 0.22s cubic-bezier(0.16,1,0.3,1),
              outline-color 0.18s ease;
}
.team-card:hover,
.team-card:focus-within {
  box-shadow: 0 12px 36px rgba(0,0,0,0.4), 0 0 0 2px var(--color-gold);
  transform: translateY(-4px);
  outline-color: var(--color-gold);
}

/* --- .fixture-card (homepage) --- */
.fixture-card {
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: box-shadow 0.22s ease,
              border-color 0.18s ease,
              transform 0.2s cubic-bezier(0.16,1,0.3,1),
              outline-color 0.18s ease;
}
.fixture-card:hover,
.fixture-card:focus-within {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  outline-color: var(--color-gold);
}

/* --- roster-card --- */
.roster-card {
  cursor: default;
  transition: box-shadow 0.2s ease, transform 0.2s cubic-bezier(0.16,1,0.3,1);
}
.roster-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ----------------------------------------------------------
   UX-4: Card focus accessibility — tab through cards, visible
   focus ring matching hover state.
   ---------------------------------------------------------- */
.matchup-card:focus-visible,
.team-card:focus-visible,
.fixture-card:focus-visible,
.roster-card:focus-visible,
.odds-card:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* ----------------------------------------------------------
   UX-5: Keyboard nav for dropdown — Esc closes,
   Tab moves focus into dropdown, focus-visible styles ring.
   The dropdown CSS ensures focus within opens it visually.
   ---------------------------------------------------------- */
.nav-item > button:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

.nav-dropdown a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------
   UX-6: Active link in nav — add a green underline dot.
   JS in app.js adds aria-current="page" to the matching link.
   ---------------------------------------------------------- */
.nav a[aria-current="page"],
.nav-item > button[aria-current="page"] {
  color: var(--color-primary);
  position: relative;
}
.nav a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
}

/* ----------------------------------------------------------
   UX-7: Visited link subtle differentiation.
   Only on content link blocks, not nav.
   ---------------------------------------------------------- */
.footer ul a:visited,
.toc a:visited,
.search-result-item:visited,
.strategy-card a:visited {
  color: var(--color-text-faint);
}

/* ----------------------------------------------------------
   UX-8: Skip link — lift above fixed header (z-index 9999 and
   top clearance set properly).
   ---------------------------------------------------------- */
.skip-link {
  z-index: 10000;              /* above header z-index: 100 */
  top: -60px;                  /* start further off-screen */
}
.skip-link:focus {
  top: 8px;                    /* sits above the sticky header */
  left: 8px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ----------------------------------------------------------
   UX-9: Better empty/loading state for match cards.
   ---------------------------------------------------------- */
.cine-hero--empty {
  min-height: clamp(280px, 40vh, 400px);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
}

.round-complete-notice {
  text-align: center;
  padding: var(--space-8) var(--space-4);
}
.round-complete-notice__icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}
.round-complete-notice__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.round-complete-notice__body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 40ch;
  margin-inline: auto;
  line-height: 1.6;
}

/* ----------------------------------------------------------
   UX-10: Show-more expansion for long editorial copy on mobile.
   JS adds .is-collapsed to card and reveals via this state.
   ---------------------------------------------------------- */
@media (max-width: 768px) {
  .editorial-expandable {
    position: relative;
  }

  .editorial-expandable.is-collapsed {
    max-height: 240px;
    overflow: hidden;
  }

  .editorial-expandable.is-collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--color-surface));
    pointer-events: none;
  }

  .editorial-show-more {
    display: none;
    margin-top: var(--space-4);
    width: 100%;
    justify-content: center;
  }

  .is-collapsed + .editorial-show-more,
  .is-collapsed ~ .editorial-show-more {
    display: flex;
  }
}

/* ============================================================
   === VISUAL POLISH ===
   ============================================================ */

/* ----------------------------------------------------------
   VP-1: Eyebrow accent bars — more distinctive.
   Width 32px / height 4px / gradient shimmer.
   ---------------------------------------------------------- */
.cine-eyebrow::before {
  width: 32px;
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    var(--team-primary, var(--color-primary)) 0%,
    color-mix(in srgb, var(--team-primary, var(--color-primary)) 60%, white) 100%
  );
  animation: eyebrow-shimmer 2.4s ease-in-out infinite alternate;
}

@keyframes eyebrow-shimmer {
  from { opacity: 0.75; }
  to   { opacity: 1; }
}

/* ----------------------------------------------------------
   VP-2: Card hover — confident lift with gold ring.
   Applied to .card base class to catch editorial cards too.
   ---------------------------------------------------------- */
.card {
  transition: transform 0.22s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.22s ease,
              border-color 0.18s ease;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
  border-color: color-mix(in srgb, var(--color-gold) 40%, var(--color-border));
}

/* ----------------------------------------------------------
   VP-3: Section dividers — subtle SVG diagonal wave between
   homepage and tips hub sections.
   Apply .section--wave-top to inject the wave before a section.
   ---------------------------------------------------------- */
.section--wave-top {
  position: relative;
}
.section--wave-top::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 48px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48 L0 24 Q360 0 720 24 Q1080 48 1440 24 L1440 48 Z' fill='%230a0e17'/%3E%3C/svg%3E") center/cover no-repeat;
  z-index: 1;
  pointer-events: none;
}
[data-theme="light"] .section--wave-top::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48 L0 24 Q360 0 720 24 Q1080 48 1440 24 L1440 48 Z' fill='%23f1f5f9'/%3E%3C/svg%3E") center/cover no-repeat;
}

/* ----------------------------------------------------------
   VP-4: Footer — cinematic top border gradient + wordmark.
   ---------------------------------------------------------- */
.footer {
  border-top: 3px solid transparent;
  background-image: linear-gradient(var(--color-surface), var(--color-surface)),
                    linear-gradient(90deg, var(--color-gold), var(--color-primary) 50%, var(--color-gold));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

/* Wordmark above link grid — JS injects .footer-wordmark via app.js */
.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--color-text);
  margin-bottom: var(--space-8);
  opacity: 0.12;
  user-select: none;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------------------------------------
   VP-5: Parallax hero (homepage marquee only).
   .cine-hero--parallax is added via JS to the first .cine-hero
   on index.html. The translateY is driven by a CSS custom
   property set by the scroll listener in app.js.
   ---------------------------------------------------------- */
.cine-hero--parallax .cine-hero__bg {
  transform: translateY(var(--parallax-offset, 0px));
  will-change: transform;
}

/* Disable parallax entirely on mobile and on touch devices */
@media (max-width: 768px) {
  .cine-hero--parallax .cine-hero__bg {
    transform: none !important;
  }
}

/* ----------------------------------------------------------
   VP-6: Stat hero numbers — accent colour for impact.
   Numbers already animated by JS; add a subtle text shadow.
   ---------------------------------------------------------- */
.stat-hero__number {
  text-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

/* ----------------------------------------------------------
   VP-7: Active nav link state — green dot indicator.
   Dot shown beneath the active top-level nav item.
   ---------------------------------------------------------- */
.nav > .nav-item.active-section > button,
.nav > a.active-section {
  color: var(--color-primary);
  position: relative;
}
.nav > .nav-item.active-section > button::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
}

/* ----------------------------------------------------------
   VP-8: Count-up animation target.
   Numbers that should animate use [data-countup] attribute.
   The JS IntersectionObserver handles the increment; CSS
   provides the initial state and font rendering.
   ---------------------------------------------------------- */
[data-countup] {
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

/* ============================================================
   === PERFORMANCE ===
   ============================================================ */

/* ----------------------------------------------------------
   PERF-1: font-display: swap is already set in the Fontshare
   URL parameter (display=swap). No @font-face override needed.
   ---------------------------------------------------------- */

/* ----------------------------------------------------------
   PERF-2: CLS prevention for images without explicit dimensions.
   Force aspect-ratio on any img lacking explicit height set inline.
   ---------------------------------------------------------- */
img:not([height]):not([style*="height"]) {
  max-width: 100%;
  height: auto;
}

/* Explicit containment hints for known image types */
.matchup-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-logo[width][height] {
  display: inline-block;
}

/* ----------------------------------------------------------
   PERF-3: Contain paint for off-screen cards (reduces GPU layers).
   ---------------------------------------------------------- */
.matchup-card,
.team-card,
.fixture-card,
.roster-card,
.card {
  contain: layout style;
}

/* For cards with overflow (images), use paint + style */
.matchup-card,
.team-card {
  contain: layout style paint;
}

/* ----------------------------------------------------------
   PERF-4: Reduce transition cost — only transition transform
   and opacity (compositor-only properties).
   ---------------------------------------------------------- */
.cine-hero__bg {
  transition: none;            /* background-position transitions are expensive */
}

/* ----------------------------------------------------------
   PERF-5: Intersection-based reveal — fade-in for sections.
   Applied by JS when element enters viewport.
   ---------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   === PREFERS-REDUCED-MOTION ===
   Disable ALL motion, smooth scroll, parallax for users who
   request reduced motion. Must be last.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  /* Disable smooth scroll */
  html {
    scroll-behavior: auto !important;
  }

  /* Disable all CSS transitions and animations */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  /* Disable parallax */
  .cine-hero--parallax .cine-hero__bg {
    transform: none !important;
  }

  /* Disable eyebrow shimmer */
  .cine-eyebrow::before {
    animation: none !important;
  }

  /* Disable reveal fade */
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Disable card lifts */
  .matchup-card:hover,
  .team-card:hover,
  .fixture-card:hover,
  .roster-card:hover,
  .card:hover {
    transform: none !important;
  }
}

/* === FIXTURES TABLE PROPER STYLING === */
.fixtures-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--color-card-shadow, 0 4px 12px rgba(0,0,0,0.08));
}
.fixtures-table thead th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: var(--space-4);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}
.fixtures-table tbody td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-divider, var(--color-border));
  vertical-align: middle;
  font-size: var(--text-base);
}
.fixtures-table tbody tr:last-child td { border-bottom: none; }
.fixtures-table tbody tr:hover td { background: color-mix(in srgb, var(--color-surface-2) 50%, transparent); }
.fixtures-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--color-surface-2) 30%, transparent);
}
[data-theme="light"] .fixtures-table tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.025);
}
.fixtures-table tbody td:first-child,
.fixtures-table tbody td:nth-child(3) {
  font-weight: 600;
}
.fixtures-table .team-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.fixtures-table .team-cell img {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.fixtures-table tbody td a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary) !important;
  font-weight: 700;
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background 0.15s ease;
}
.fixtures-table tbody td a:hover {
  background: color-mix(in srgb, var(--color-primary) 22%, transparent);
}

/* Round panel header spacing */
.round-panel { padding-top: var(--space-2); }
.round-panel + .round-panel { margin-top: var(--space-8); }

/* Mobile fixture table — collapse the venue column and tighten spacing */
@media (max-width: 720px) {
  .fixtures-table thead th,
  .fixtures-table tbody td { padding: var(--space-3); font-size: var(--text-sm); }
  .fixtures-table thead th:nth-child(4),
  .fixtures-table tbody td:nth-child(4) { display: none; }
}
@media (max-width: 480px) {
  .fixtures-table thead th,
  .fixtures-table tbody td { padding: var(--space-2) var(--space-3); }
  /* Hide date label, keep time */
  .fixtures-table tbody td:nth-child(2) { font-size: var(--text-xs); }
}

/* === FIXTURE TICKER (top of every page) === */
.fixture-ticker {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--color-primary) 8%, var(--color-bg)) 0%,
    var(--color-bg) 50%,
    color-mix(in srgb, var(--color-gold) 8%, var(--color-bg)) 100%
  );
  border-bottom: 1px solid var(--color-border);
  overflow: hidden;
  position: relative;
  height: 38px;
}
.fixture-ticker__inner {
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
}
.fixture-ticker__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 var(--space-3);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-bg);
  background: var(--color-primary);
  height: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.fixture-ticker__label::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 0;
  bottom: 0;
  width: 0;
  border-style: solid;
  border-width: 19px 0 19px 10px;
  border-color: transparent transparent transparent var(--color-primary);
}
.fixture-ticker__track {
  display: flex;
  gap: var(--space-6);
  animation: tickerScroll 60s linear infinite;
  padding-left: var(--space-4);
  flex-shrink: 0;
}
.fixture-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.fixture-ticker__item:hover {
  color: var(--color-primary);
}
.fixture-ticker__date {
  font-weight: 700;
  color: var(--color-text-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.fixture-ticker__teams {
  font-weight: 600;
}
.fixture-ticker__edge {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-gold);
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--color-gold) 14%, transparent);
}
.fixture-ticker__sep {
  color: var(--color-text-faint);
  margin: 0 8px;
}
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.fixture-ticker:hover .fixture-ticker__track {
  animation-play-state: paused;
}
@media (max-width: 480px) {
  .fixture-ticker { height: 32px; }
  .fixture-ticker__label { font-size: 10px; padding: 0 10px; }
  .fixture-ticker__label::after { border-width: 16px 0 16px 8px; right: -8px; }
  .fixture-ticker__item { font-size: 12px; }
  .fixture-ticker__date { font-size: 10px; }
  .fixture-ticker__edge { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .fixture-ticker__track { animation: none; }
  .fixture-ticker { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* === VOICES PAGE === */
.voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-4);
}
.voice-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.voice-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  box-shadow: 0 12px 28px rgba(0,0,0,0.18);
}
.voice-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}
.voice-card__logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-surface-2);
  padding: 4px;
  flex-shrink: 0;
}
.voice-card__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: var(--color-bg);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.voice-card__body { min-width: 0; }
.voice-card__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-base);
  line-height: 1.2;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.voice-card__handle {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.01em;
  margin-bottom: 4px;
}
.voice-card__role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}
.voice-card__bio {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.voice-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.voice-card__followers {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-sm);
  color: var(--color-gold);
  letter-spacing: -0.01em;
}
.voice-card__followers::after {
  content: ' followers';
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
  display: block;
  margin-top: 2px;
  text-align: right;
}
@media (max-width: 480px) {
  .voice-card { padding: var(--space-3); gap: var(--space-2); }
  .voice-card__name { font-size: var(--text-sm); }
  .voice-card__bio { font-size: var(--text-xs); }
  .voice-card__followers { font-size: var(--text-xs); }
}

/* === HERO TEXT LEGIBILITY ON MOBILE === */
/* The cinematic match images are richly detailed; on small screens the headline
   and predicted score were getting lost. Strengthen the bottom-up gradient so
   the lower half of the hero is reliably dark, and stack a deeper text shadow
   on the headline/score/subtitle to lift them off any image. */
@media (max-width: 768px) {
  .cine-hero::before {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.15) 0%,
      rgba(0, 0, 0, 0.50) 50%,
      rgba(0, 0, 0, 0.88) 100%
    ) !important;
  }
  /* Deeper text shadow stack, two layers */
  .cine-hero .cine-headline,
  .cine-hero h1 {
    text-shadow:
      0 2px 14px rgba(0, 0, 0, 0.85),
      0 1px 2px rgba(0, 0, 0, 0.95);
    color: #ffffff;
  }
  .cine-hero .cine-subtitle,
  .cine-hero .cine-hero__eyebrow {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
  }
  /* Predicted score on tip pages - black soft halo so the giant number reads
     against any color in the matchup splash */
  .cine-hero .predicted-score,
  .cine-hero .cine-stat__num,
  .cine-hero [class*="predicted"],
  .match-hero .predicted-score {
    text-shadow:
      0 0 24px rgba(0, 0, 0, 0.7),
      0 2px 6px rgba(0, 0, 0, 0.95) !important;
  }
  /* Pills and badges sit on top of dark gradient with their own backgrounds,
     just bump their opacity slightly so the chrome reads. */
  .cine-hero .cine-pill,
  .cine-hero .edge-pill,
  .cine-hero .badge {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  /* Light-mode override (when user has chosen light theme but is still on mobile) */
  [data-theme="light"] .cine-hero::before {
    background: linear-gradient(
      170deg,
      rgba(0, 0, 0, 0.40) 0%,
      rgba(0, 0, 0, 0.62) 40%,
      rgba(0, 0, 0, 0.88) 100%
    ) !important;
  }
}

/* Phones: keep the image visible at the top, only darken bottom-half where
   text sits. Was too opaque before - was making the image disappear entirely. */
@media (max-width: 480px) {
  .cine-hero::before {
    background: linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.20) 0%,
      rgba(0, 0, 0, 0.55) 50%,
      rgba(0, 0, 0, 0.92) 100%
    ) !important;
  }
}

/* On very tall heroes, push content up so it sits in the brightest readable area */
@media (max-width: 768px) {
  .cine-hero__inner {
    padding-bottom: clamp(24px, 6vw, 48px);
  }
}
