@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700;800;900&family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500;1,600&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   EPL 6 FORECAST — design system
   Editorial dark theme: warm black, gold accents, team colors.
   ============================================================ */
:root {
  --font-display: 'Cinzel', serif;
  --font-sub: 'Cormorant Garamond', serif;
  --font-body: 'Inter', sans-serif;

  --bg: #0a0805;
  --bg-raised: #121009;
  --surface: rgba(255, 244, 214, 0.025);
  --surface-2: rgba(255, 244, 214, 0.05);
  --line: rgba(212, 175, 55, 0.14);
  --line-strong: rgba(212, 175, 55, 0.32);

  --ink: #f4ecda;
  --ink-2: #bcab8f;
  --ink-3: #82735e;

  --gold: #d4af37;
  --gold-bright: #f0cf6e;
  --gold-deep: #9a7212;
  --gold-grad: linear-gradient(120deg, #f0cf6e 0%, #d4af37 45%, #aa7c11 100%);

  --up: #74c46c;
  --down: #e06060;

  --color-team-mds: #c93030;
  --color-team-hbb: #4a8ad4;
  --color-team-skg: #f0742c;
  --color-team-cmc: #2cb464;

  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-full: 999px;

  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 18px 50px -24px rgba(0,0,0,0.85);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1140px;

  /* Backward-compat aliases (old token names) so existing inline styles and
     embedded page styles keep working with the redesigned system. */
  --font-heading: var(--font-display);
  --font-subheading: var(--font-sub);
  --color-bg: var(--bg);
  --color-bg-alt: var(--bg-raised);
  --color-surface: var(--surface);
  --color-surface-hover: var(--surface-2);
  --color-surface-solid: #161209;
  --color-border: rgba(212, 175, 55, 0.16);
  --color-border-gold: var(--line-strong);
  --color-gold: var(--gold);
  --color-gold-light: var(--gold-bright);
  --color-gold-dark: var(--gold-deep);
  --color-gold-glow: rgba(212, 175, 55, 0.15);
  --color-text-primary: var(--ink);
  --color-text-secondary: var(--ink-2);
  --color-text-muted: var(--ink-3);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
  --shadow-md: var(--shadow-card);
  --shadow-lg: var(--shadow-card);
  --shadow-gold-glow: 0 0 15px rgba(212,175,55,0.25);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-full: var(--r-full);
  --transition-smooth: all 0.25s var(--ease);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: rgba(212,175,55,0.35); color: #fff8e7; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 500px at 70% -150px, rgba(212,175,55,0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 8%, rgba(74,138,212,0.05), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden; /* decorative art may bleed past the edge by design */
}

a { color: var(--gold-bright); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--ink-3); }
.xs { font-size: 0.75rem; }
.gold { color: var(--gold-bright); font-weight: 700; }
.note { font-size: 0.8rem; margin-top: 0.9rem; color: var(--ink-3); }
.up { color: var(--up); }
.down { color: var(--down); }
strong { color: var(--ink); }

/* ============================================================
   Graphics layer
   ============================================================ */

/* faint marble grain over everything — texture without noise */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1;
  background: url('../marblebg2.webp');
  background-size: 1100px;
  opacity: 0.05;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* hero artwork: floating trophy / crown with gold aura */
.hero { position: relative; }
.hero-art {
  position: absolute;
  right: clamp(0.5rem, 6vw, 5rem);
  top: 50%;
  transform: translateY(-52%);
  pointer-events: none;
  z-index: -1;
}
.hero-art::before {
  content: "";
  position: absolute; inset: -40%;
  background: radial-gradient(closest-side, rgba(212,175,55,0.22), rgba(212,175,55,0.05) 55%, transparent 75%);
  filter: blur(6px);
}
.hero-art img {
  position: relative;
  width: clamp(170px, 24vw, 330px);
  filter: drop-shadow(0 30px 50px rgba(0,0,0,0.7)) drop-shadow(0 0 34px rgba(212,175,55,0.3));
  animation: heroFloat 7s ease-in-out infinite;
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}
@media (max-width: 900px) {
  .hero-art { opacity: 0.16; right: 0; z-index: -1; }
}
@media (prefers-reduced-motion: reduce) { .hero-art img { animation: none; } }

/* gold flourish under section titles */
.section-head h2 { position: relative; padding-bottom: 0.7rem; }
.section-head h2::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 74px; height: 3px; border-radius: 2px;
  background: var(--gold-grad);
  box-shadow: 0 0 12px rgba(212,175,55,0.5);
}

/* how-it-works card icons (brand art) */
.how-card { padding-right: 4.6rem; }
.how-card .how-icon {
  position: absolute; top: 1.1rem; right: 1.1rem;
  width: 52px; height: 52px; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.55));
  opacity: 0.95;
}
.how-card::after {
  content: "";
  position: absolute; right: -36px; bottom: -36px;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(212,175,55,0.1), transparent 70%);
}

/* match cards: team logos + giant watermarks */
.match-logo { width: 26px; height: 26px; object-fit: contain; vertical-align: -6px; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5)); }
.match-card { position: relative; overflow: hidden; }
.match-watermark {
  position: absolute; top: 50%; width: 215px; height: 215px;
  object-fit: contain; opacity: 0.045; pointer-events: none;
  filter: saturate(0.6);
}
.match-watermark.wl { left: -42px; transform: translateY(-50%) rotate(-10deg); }
.match-watermark.wr { right: -42px; transform: translateY(-50%) rotate(10deg); }
.match-head, .series-row, .whatif-row { position: relative; z-index: 2; }

/* grand final rows: logos + trophy accent */
.final-logo { width: 22px; height: 22px; object-fit: contain; vertical-align: -4px; margin: 0 0.15rem; }
.gf-art { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.1rem; }
.gf-art img { width: 56px; filter: drop-shadow(0 8px 18px rgba(0,0,0,0.6)) drop-shadow(0 0 18px rgba(212,175,55,0.35)); }

/* week1: match-block heading logos + per-block card watermarks */
.h3-logo { width: 34px; height: 34px; object-fit: contain; vertical-align: -8px; margin: 0 0.45rem; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.55)); }
.preview-card { position: relative; overflow: hidden; }
.preview-card > * { position: relative; z-index: 2; }
.preview-card::before, .preview-card::after {
  content: ""; position: absolute; top: 50%; width: 190px; height: 190px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  opacity: 0.05; pointer-events: none; z-index: 1;
}
.preview-card::before { left: -48px; transform: translateY(-50%) rotate(-10deg); }
.preview-card::after { right: -48px; transform: translateY(-50%) rotate(10deg); }
#m1 .preview-card::before { background-image: url('../MDS_logo.webp'); }
#m1 .preview-card::after { background-image: url('../HBB_Logo.webp'); }
#m2 .preview-card::before { background-image: url('../SKG_Logo.webp'); }
#m2 .preview-card::after { background-image: url('../CMC_Logo.webp'); }

/* ---------- loading overlay ---------- */
#loading-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.2rem; color: var(--ink-2);
  transition: opacity 0.6s var(--ease);
}
#loading-overlay.fade-out { opacity: 0; pointer-events: none; }
#loading-overlay p { font-family: var(--font-sub); font-size: 1.25rem; letter-spacing: 0.04em; }
.spinner {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2px solid rgba(212,175,55,0.2);
  border-top-color: var(--gold-bright);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.7rem clamp(1rem, 4vw, 2.6rem);
  background: rgba(10, 8, 5, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-logo { height: 38px; display: block; filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5)); }
.header-titles { display: flex; align-items: baseline; gap: 0.7rem; flex: 1; min-width: 0; }
.site-header h1 {
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 800;
  letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.tagline {
  font-size: 0.78rem; color: var(--ink-3); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.header-actions { display: flex; align-items: center; gap: 0.7rem; }
#updated-flash {
  font-size: 0.74rem; color: var(--up); opacity: 0;
  transition: opacity 0.4s ease;
}
#updated-flash.show { opacity: 1; }
#refresh-btn {
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-bright); background: rgba(212,175,55,0.08);
  border: 1px solid var(--line-strong); border-radius: var(--r-full);
  padding: 0.42rem 1rem; cursor: pointer;
  transition: all 0.25s var(--ease);
}
#refresh-btn:hover { background: rgba(212,175,55,0.18); transform: translateY(-1px); }

/* nav */
.section-nav {
  position: sticky; top: 55px; z-index: 99;
  display: flex; gap: 0.3rem; overflow-x: auto;
  padding: 0.55rem clamp(1rem, 4vw, 2.6rem);
  background: rgba(10, 8, 5, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(212,175,55,0.08);
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); text-decoration: none; white-space: nowrap;
  padding: 0.38rem 0.85rem; border-radius: var(--r-full);
  border: 1px solid transparent;
  transition: all 0.25s var(--ease);
}
.section-nav a:hover, .section-nav a.active {
  color: var(--gold-bright);
  border-color: var(--line);
  background: rgba(212,175,55,0.07);
  text-decoration: none;
}

/* ---------- banners ---------- */
.banner {
  max-width: var(--maxw);
  margin: 1rem auto 0;
  padding: 0.75rem 1.1rem; border-radius: var(--r-md);
  font-size: 0.84rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.banner.warn { background: rgba(224, 96, 96, 0.08); border: 1px solid rgba(224, 96, 96, 0.35); color: #f0bcbc; }
.banner.pin { background: rgba(212, 175, 55, 0.07); border: 1px solid var(--line-strong); color: var(--gold-bright); }
.banner button {
  margin-left: auto; cursor: pointer; font-size: 0.78rem; font-weight: 600;
  background: transparent; color: inherit;
  border: 1px solid currentColor; border-radius: var(--r-full); padding: 0.3rem 0.9rem;
}
@media (max-width: 1200px) { .banner { margin-left: 1rem; margin-right: 1rem; } }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 2.6rem) 1rem;
  text-align: left;
}
.kicker {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.kicker::before { content: ""; width: 34px; height: 1px; background: var(--gold); display: inline-block; }
.hero h2 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 800; line-height: 1.04; letter-spacing: 0.01em;
  margin-bottom: 1.1rem;
}
.hero h2 em {
  font-style: normal;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lede {
  font-family: var(--font-sub);
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  color: var(--ink-2); max-width: 56ch; line-height: 1.5;
}
#forecast-callout {
  margin-top: 1.6rem;
  font-size: 1rem; color: var(--ink-2);
  border-left: 2px solid var(--gold);
  padding: 0.25rem 0 0.25rem 1.1rem;
  max-width: 62ch;
}
#forecast-callout strong { color: var(--gold-bright); }
.live-dot {
  display: inline-flex; align-items: center; gap: 0.45rem;
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-top: 1.4rem;
}
.live-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--up); box-shadow: 0 0 0 0 rgba(116,196,108,0.5);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(116,196,108,0.45); }
  70% { box-shadow: 0 0 0 9px rgba(116,196,108,0); }
  100% { box-shadow: 0 0 0 0 rgba(116,196,108,0); }
}

/* ---------- layout / sections ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.6rem) 4rem;
  display: flex; flex-direction: column;
  gap: clamp(3.2rem, 7vw, 5.5rem);
}
.panel { scroll-margin-top: 100px; }
.section-head { margin-bottom: 1.5rem; max-width: 70ch; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 700;
  letter-spacing: 0.02em; margin-bottom: 0.5rem;
}
.section-head .lede {
  font-size: 0.95rem; color: var(--ink-2); line-height: 1.6;
}
#sim-meta { font-size: 0.76rem; color: var(--ink-3); margin-top: 0.6rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(1.1rem, 3vw, 1.8rem);
}

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in-view { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- how it works strip ---------- */
.how-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
}
.how-card {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.4rem 1.4rem 1.5rem;
  position: relative; overflow: hidden;
}
.how-card .step {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 800;
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0.9; line-height: 1;
}
.how-card h3 { font-size: 0.98rem; font-weight: 700; margin: 0.7rem 0 0.4rem; }
.how-card p { font-size: 0.85rem; color: var(--ink-2); line-height: 1.55; }
@media (max-width: 800px) { .how-grid { grid-template-columns: 1fr; } }

/* ---------- forecast bars ---------- */
#forecast-bars { display: flex; flex-direction: column; gap: 0.35rem; }
.forecast-row {
  display: grid; grid-template-columns: 150px 1fr 190px;
  align-items: center; gap: 1.1rem; padding: 0.8rem 0.4rem;
  border-radius: var(--r-md);
  transition: background 0.25s var(--ease);
}
.forecast-row:hover { background: var(--surface); }
.forecast-team { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.team-logo-sm { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5)); }
.team-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: 0.05em; }
.forecast-bar-track {
  height: 30px; background: rgba(255,255,255,0.045);
  border-radius: var(--r-full); overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
}
.forecast-bar {
  height: 100%; border-radius: var(--r-full); min-width: 4px;
  transition: width 0.9s var(--ease);
  background-image: linear-gradient(rgba(255,255,255,0.22), rgba(255,255,255,0) 55%);
}
.forecast-nums { display: flex; align-items: baseline; gap: 0.55rem; white-space: nowrap; justify-content: flex-end; }
.forecast-pct {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; min-width: 3.4rem; text-align: right;
}
.forecast-sub { font-size: 0.74rem; color: var(--ink-3); }
.delta { font-size: 0.74rem; font-weight: 700; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }

/* ---------- timeline ---------- */
#timeline { position: relative; }
.timeline-svg { width: 100%; height: auto; margin-top: 0.5rem; }
.tl-grid { stroke: rgba(212,175,55,0.12); stroke-width: 1; }
.tl-axis { fill: var(--ink-3); font-size: 10px; font-family: var(--font-body); }
.tl-label { font-size: 11px; font-weight: 700; font-family: var(--font-body); }
.tl-dot {
  cursor: pointer;
  transition: r 0.15s ease, stroke-width 0.15s ease;
}
.tl-dot:hover {
  r: 5.5px;
  stroke-width: 2;
}

/* Floating Timeline Tooltip */
.timeline-tooltip {
  background: rgba(18, 16, 9, 0.96);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--ink);
  min-width: 180px;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.tooltip-title {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--gold-bright);
  font-weight: 700;
  margin-bottom: 0.35rem;
  letter-spacing: 0.05em;
}

.tooltip-divider {
  height: 1px;
  background: rgba(212, 175, 55, 0.15);
  margin-bottom: 0.45rem;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.12rem 0;
}

.tooltip-team {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.tooltip-val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-2);
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.pred-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.pred-table th {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
  text-align: left; padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line-strong);
}
.pred-table td { padding: 0.62rem 0.7rem; border-bottom: 1px solid rgba(212,175,55,0.07); }
.pred-table tbody tr { transition: background 0.2s ease; }
.pred-table tbody tr:hover { background: var(--surface-2); }
.pred-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pred-table th.num { text-align: right; }
.team-cell { display: flex; align-items: center; gap: 0.55rem; white-space: nowrap; }
.team-fullname { font-size: 0.74rem; }
.rank-cell {
  text-align: center; font-variant-numeric: tabular-nums; font-weight: 600;
  border-left: 1px solid rgba(0,0,0,0.3);
}
.players-table .is-sub td { opacity: 0.55; }
.spark { width: 90px; height: 24px; display: block; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-block; font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: var(--r-full); padding: 0.14rem 0.55rem; vertical-align: middle;
}
.badge.done { background: rgba(116,196,108,0.12); color: var(--up); border: 1px solid rgba(116,196,108,0.35); }
.badge.live { background: rgba(224,96,96,0.12); color: var(--down); border: 1px solid rgba(224,96,96,0.4); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: 0.55; } }
.badge.pin { background: rgba(212,175,55,0.1); color: var(--gold-bright); border: 1px solid var(--line-strong); }
.badge.sub { background: rgba(130,115,94,0.14); color: var(--ink-3); border: 1px solid var(--line); }
.badge.warn { background: rgba(224,96,96,0.12); color: #f0bcbc; border: 1px solid rgba(224,96,96,0.4); }
.h2h {
  font-size: 0.66rem; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--gold-bright); background: rgba(212,175,55,0.08);
  border: 1px solid var(--line); border-radius: var(--r-full);
  padding: 0.12rem 0.55rem; cursor: help; white-space: nowrap;
}
.h2h.none { color: var(--ink-3); background: transparent; }

/* ---------- match center ---------- */
#matches { display: flex; flex-direction: column; gap: 1.4rem; }
.match-card {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.match-head {
  display: flex; align-items: baseline; gap: 1.1rem; flex-wrap: wrap;
  padding: 1rem 1.3rem;
  background: linear-gradient(rgba(212,175,55,0.06), transparent);
  border-bottom: 1px solid var(--line);
}
.match-week {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold);
}
.match-title {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
  display: flex; gap: 0.7rem; align-items: baseline; letter-spacing: 0.03em;
}
.match-exp { color: var(--ink); font-variant-numeric: tabular-nums; }

.series-row {
  display: grid; grid-template-columns: minmax(230px, 1.2fr) minmax(170px, 1fr) minmax(190px, max-content);
  gap: 0.45rem 1.2rem; align-items: center;
  padding: 0.8rem 1.3rem;
  border-bottom: 1px solid rgba(212,175,55,0.07);
  transition: background 0.2s ease;
}
.series-row:hover { background: var(--surface-2); }
.series-row:last-child { border-bottom: none; }
.series-row.is-final { opacity: 0.6; }
.series-players { display: flex; align-items: baseline; gap: 0.55rem; min-width: 0; flex-wrap: wrap; }
.series-players .p1, .series-players .p2 { font-weight: 650; white-space: nowrap; font-size: 0.95rem; }
.series-players .vs { color: var(--ink-3); font-size: 0.68rem; letter-spacing: 0.08em; }
.series-prob { display: flex; align-items: center; gap: 0.6rem; }
.prob-track {
  flex: 1; height: 9px; border-radius: var(--r-full);
  overflow: hidden; min-width: 70px;
  display: flex;
}
.prob-fill { height: 100%; transition: width 0.7s var(--ease); }
.prob-rest { height: 100%; flex: 1; }
.series-status { display: flex; align-items: center; gap: 0.55rem; justify-content: flex-end; white-space: nowrap; }
.series-score { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.series-score.locked { color: var(--ink); }
.series-score.pinned { color: var(--gold-bright); }

.whatif-row { grid-column: 1 / -1; display: flex; gap: 0.32rem; flex-wrap: wrap; align-items: center; }
.whatif-row::before {
  content: "what if it ends…";
  font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin-right: 0.35rem;
}
.whatif-btn {
  font-size: 0.72rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink-2); background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,55,0.16); border-radius: var(--r-full);
  padding: 0.18rem 0.65rem; cursor: pointer;
  transition: all 0.2s var(--ease);
}
.whatif-btn:hover { color: var(--gold-bright); border-color: var(--line-strong); transform: translateY(-1px); }
.whatif-btn.active { color: #1a1408; background: var(--gold-grad); border-color: transparent; font-weight: 700; }
.whatif-btn.clear { color: var(--down); }

/* ---------- grand final ---------- */
#finals { display: flex; flex-direction: column; gap: 0.4rem; }
.final-row {
  padding: 0.9rem 1.1rem; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
}
.final-prob { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.final-matchup {
  display: flex; gap: 0.75rem; align-items: baseline;
  font-family: var(--font-display); font-size: 1.1rem; margin: 0.25rem 0 0.5rem;
}
.final-split { color: var(--ink); font-family: var(--font-body); font-size: 0.85rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.final-bar-track {
  display: flex; height: 10px; border-radius: var(--r-full); overflow: hidden;
  background: rgba(255,255,255,0.04);
}
.final-bar { height: 100%; transition: width 0.7s var(--ease); }

/* ---------- search / filter controls ---------- */
.control-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1rem; max-width: 620px; }
.control-row input[type="text"], .control-row input[type="search"], .control-row select {
  flex: 1; min-width: 190px;
  padding: 0.55rem 1rem;
  background: rgba(255,255,255,0.035); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-full);
  font-family: var(--font-body); font-size: 0.85rem;
  transition: border-color 0.2s ease;
}
.control-row select { flex: 0 1 auto; }
.control-row input:focus, .control-row select:focus {
  outline: none; border-color: var(--line-strong);
  background: rgba(255,255,255,0.05);
}
.control-row .whatif-btn { padding: 0.5rem 1rem; }
.scroll-table {
  max-height: 480px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg);
}
.scroll-table thead { position: sticky; top: 0; background: #161209; z-index: 5; }

/* ---------- data section ---------- */
.data-split-layout { display: flex; flex-direction: column; gap: 2.2rem; }
.data-column h3 {
  font-family: var(--font-display); font-size: 1.05rem; font-weight: 700;
  letter-spacing: 0.05em; margin-bottom: 0.4rem;
}

/* ---------- settings ---------- */
.settings details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 1.1rem 1.4rem;
}
.settings summary {
  cursor: pointer; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2);
  list-style: none; display: flex; align-items: center; gap: 0.6rem;
}
.settings summary::before { content: "⚙"; color: var(--gold); font-size: 0.95rem; }
.settings summary::-webkit-details-marker { display: none; }
.settings-row { display: flex; gap: 1.4rem 2rem; flex-wrap: wrap; margin-top: 1.2rem; }
.settings-row label {
  font-size: 0.8rem; color: var(--ink-2);
  display: flex; align-items: center; gap: 0.55rem;
}
.settings-row input[type="number"] {
  width: 92px; padding: 0.35rem 0.6rem;
  background: rgba(255,255,255,0.04); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-family: var(--font-body);
}
.settings-row input[type="checkbox"] { width: auto; accent-color: var(--gold); }
.settings-row input[type="range"] { width: 150px; padding: 0; accent-color: var(--gold); background: transparent; border: none; }
.settings-row .slider-label span { min-width: 3.6rem; font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  text-align: center; font-size: 0.76rem; color: var(--ink-3);
  padding: 2.2rem 1.2rem 3rem; line-height: 1.8;
  max-width: var(--maxw); margin: 0 auto;
}

/* ============================================================
   week1.html — analyst preview page
   ============================================================ */
.article {
  max-width: 880px; margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.6rem) 4rem;
}
.article .hero { padding-left: 0; padding-right: 0; max-width: none; }
.match-block { margin-top: 3.4rem; }
.match-block > h3 {
  font-family: var(--font-display); font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700; margin-bottom: 0.3rem;
}
.match-block > .match-sub { color: var(--ink-2); font-size: 0.92rem; margin-bottom: 1.4rem; }

.preview-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
  padding: clamp(1.2rem, 3vw, 1.7rem);
  margin-bottom: 1.3rem;
}
.preview-card.played { border-color: rgba(116,196,108,0.3); }
.pv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.pv-matchup { font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; letter-spacing: 0.02em; }
.pv-time { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.pv-verdict {
  font-family: var(--font-sub); font-size: 1.12rem; color: var(--ink-2);
  font-style: italic; margin: 0.2rem 0 1rem;
}
.pv-bar { display: flex; height: 14px; border-radius: var(--r-full); overflow: hidden; margin: 0.4rem 0 0.45rem; background: rgba(255,255,255,0.04); }
.pv-bar div { height: 100%; }
.pv-bar-labels { display: flex; justify-content: space-between; font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 1rem; }
.pv-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem; margin-bottom: 1rem;
}
.pv-stat {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(212,175,55,0.1);
  border-radius: var(--r-md); padding: 0.6rem 0.8rem;
}
.pv-stat .v { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pv-stat .k { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-top: 0.1rem; }
.pv-body { font-size: 0.9rem; color: var(--ink-2); line-height: 1.65; }
.pv-body p { margin-bottom: 0.7rem; }
.pv-body p:last-child { margin-bottom: 0; }
.pv-nerd { margin-top: 0.9rem; }
.pv-nerd summary {
  cursor: pointer; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold); list-style: none;
}
.pv-nerd summary::-webkit-details-marker { display: none; }
.pv-nerd summary::before { content: "▸ "; }
.pv-nerd[open] summary::before { content: "▾ "; }
.pv-nerd .pv-body { margin-top: 0.6rem; font-size: 0.84rem; }
.pv-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin: 0.6rem 0; }
.pv-table th, .pv-table td { padding: 0.4rem 0.6rem; text-align: left; border-bottom: 1px solid rgba(212,175,55,0.08); }
.pv-table th { font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .forecast-row { grid-template-columns: 105px 1fr; }
  .forecast-nums { grid-column: 1 / -1; justify-content: flex-end; }
  .series-row { grid-template-columns: 1fr; }
  .series-status { justify-content: flex-start; }
  .team-fullname { display: none; }
  .tagline { display: none; }
  .forecast-pct { font-size: 1.25rem; }
}

/* ---------- phones ---------- */
@media (max-width: 640px) {
  html { font-size: 15px; scroll-padding-top: 56px; }

  /* header: stop being sticky, never collide */
  .site-header {
    position: static;
    flex-wrap: wrap;
    gap: 0.45rem 0.7rem;
    padding: 0.6rem 0.9rem;
  }
  .header-logo { height: 30px; }
  .site-header h1 { font-size: 0.84rem; letter-spacing: 0.08em; white-space: normal; line-height: 1.3; }
  .header-titles { flex: 1 1 140px; min-width: 0; }
  .header-actions { margin-left: auto; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
  #updated-flash { display: none; }
  #refresh-btn, .header-actions .whatif-btn, .header-actions .back-link {
    font-size: 0.66rem !important;
    padding: 0.3rem 0.65rem !important;
    white-space: nowrap;
  }
  .section-nav { top: 0; padding: 0.45rem 0.9rem; }
  .section-nav a { font-size: 0.68rem; padding: 0.32rem 0.65rem; }

  /* hero */
  .hero { padding-top: 2.2rem; padding-bottom: 0.5rem; }
  .hero-art { opacity: 0.1; }
  .hero-art img { width: 200px; }
  #forecast-callout { font-size: 0.92rem; }
  .kicker { letter-spacing: 0.22em; }

  main { gap: 2.6rem; }
  .card { padding: 0.85rem; }
  .panel { scroll-margin-top: 58px; }
  .section-head .lede { font-size: 0.88rem; }

  /* tables: scroll, don't squish — give each table its natural width and let
     the wrapper swipe horizontally */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap::-webkit-scrollbar { height: 6px; }
  .table-wrap::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
  .pred-table { font-size: 0.76rem; }
  .pred-table th, .pred-table td { padding: 0.45rem 0.45rem; }
  .pred-table .num, .team-cell { white-space: nowrap; }
  #standings .pred-table { min-width: 560px; }
  #players .pred-table { min-width: 700px; }
  #rankings-table { min-width: 560px; }
  #history-games-table { min-width: 520px; }
  #ratings-raw-table table { min-width: 560px; }
  .scroll-table { max-height: 380px; }
  .spark { width: 64px; height: 20px; }

  /* forecast bars */
  .forecast-row { grid-template-columns: 86px 1fr; gap: 0.55rem; padding: 0.55rem 0.15rem; }
  .team-logo-sm { width: 24px; height: 24px; }
  .team-name { font-size: 0.88rem; }
  .forecast-bar-track { height: 20px; }
  .forecast-pct { font-size: 1.05rem; min-width: 2.8rem; }
  .forecast-sub, .delta { font-size: 0.66rem; }

  /* match cards */
  .match-head { padding: 0.7rem 0.85rem; gap: 0.3rem 0.7rem; }
  .match-week { font-size: 0.6rem; }
  .match-title { font-size: 0.92rem; gap: 0.4rem; flex-wrap: wrap; }
  .match-logo { width: 20px; height: 20px; }
  .match-watermark { width: 140px; height: 140px; opacity: 0.04; }
  .series-row { padding: 0.6rem 0.85rem; }
  .series-players .p1, .series-players .p2 { font-size: 0.86rem; }
  .series-score { font-size: 0.95rem; }
  .h2h { font-size: 0.6rem; padding: 0.1rem 0.45rem; }
  .whatif-row::before { content: "what if…"; }
  .whatif-btn { padding: 0.15rem 0.5rem; font-size: 0.66rem; }

  /* grand final */
  .final-matchup { flex-wrap: wrap; font-size: 0.95rem; gap: 0.4rem; row-gap: 0.15rem; }
  .final-logo { width: 18px; height: 18px; }
  .final-row { padding: 0.75rem 0.85rem; }

  /* timeline */
  .tl-label { font-size: 13px; }
  .tl-axis { font-size: 12px; }

  /* controls & settings */
  .control-row input[type="text"], .control-row input[type="search"] { min-width: 0; flex: 1 1 100%; }
  .settings-row { gap: 0.8rem 1.3rem; }
  .settings-row label { font-size: 0.74rem; }
  .settings-row input[type="number"] { width: 78px; }
  .settings-row input[type="range"] { width: 110px; }

  .site-footer { font-size: 0.68rem; padding-bottom: 2rem; }

  /* week1 page */
  .pv-stats { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .pv-stat { padding: 0.5rem 0.6rem; }
  .pv-matchup { font-size: 1.02rem; }
  .pv-verdict { font-size: 1rem; }
  .preview-card::before, .preview-card::after { width: 120px; height: 120px; opacity: 0.04; }
  .h3-logo { width: 24px; height: 24px; }
  .match-block > h3 { line-height: 1.35; }
}

@media (max-width: 400px) {
  html { font-size: 14px; }
  .forecast-row { grid-template-columns: 74px 1fr; }
}

/* Expandable rows & highlight columns */
.player-main-row { cursor: pointer; }
.player-main-row.is-expanded { background: rgba(212, 175, 55, 0.04) !important; }
.player-main-row.is-expanded td { border-bottom-color: transparent; }
.player-detail-row { background: rgba(0, 0, 0, 0.15) !important; }
.player-detail-row td { padding: 0 !important; }
.player-detail-content {
  display: flex; gap: 2rem; padding: 0.8rem 1.5rem;
  align-items: center; flex-wrap: wrap; font-size: 0.82rem;
  animation: slideDown 0.2s ease-out;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}
.player-detail-content .detail-stat {
  display: flex; flex-direction: column; gap: 0.2rem;
}
.player-detail-content .detail-stat strong {
  color: var(--ink-3); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.player-detail-content .detail-trend {
  display: flex; flex-direction: column; gap: 0.2rem;
}
.player-detail-content .detail-trend strong {
  color: var(--ink-3); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.player-detail-content .detail-recent-series {
  flex-grow: 1; min-width: 300px;
  display: flex; flex-direction: column; gap: 0.3rem;
}
.player-detail-content .detail-recent-series strong {
  color: var(--ink-3); font-size: 0.68rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.player-detail-content .recent-series-table {
  width: 100%; border-collapse: collapse; font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.2); border-radius: 4px; overflow: hidden;
}
.player-detail-content .recent-series-table th,
.player-detail-content .recent-series-table td {
  padding: 0.35rem 0.5rem; text-align: left;
}
.player-detail-content .recent-series-table th {
  background: rgba(255, 255, 255, 0.03); color: var(--ink-3);
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em;
}
.player-detail-content .recent-series-table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}
.player-detail-content .recent-series-table tr:last-child td {
  border-bottom: none;
}
.expand-icon {
  display: inline-block; font-size: 0.55rem;
  margin-right: 0.35rem; color: var(--ink-3);
  transition: transform 0.15s ease, color 0.15s ease;
  vertical-align: middle;
}
.player-main-row.is-expanded .expand-icon {
  transform: rotate(90deg); color: var(--gold-bright);
}
.live-elo-col {
  background: rgba(212, 175, 55, 0.06);
  font-weight: 700;
  color: var(--gold-bright) !important;
}
.live-elo-header {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-bright) !important;
  border-bottom: 2px solid var(--gold) !important;
}
.pred-table tbody tr.player-main-row:hover { background: var(--surface-2); }

/* Clickable series rows and expanded layouts */
.series-row {
  cursor: pointer;
}
.series-row button, .series-row a, .series-row .whatif-row {
  cursor: default;
}
.series-row.is-expanded {
  background: rgba(255, 244, 214, 0.035);
  border-bottom: 1px solid var(--line-strong);
}

/* Expansion Panel Layout */
.series-expansion-panel {
  grid-column: 1 / -1;
  background: rgba(10, 8, 5, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 1.2rem;
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.expansion-header {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  padding-bottom: 0.4rem;
}

.histogram-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.hist-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.hist-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-2);
  width: 90px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.hist-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hist-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  min-height: 14px;
}

.hist-bar-simulated {
  height: 12px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  padding-left: 0.35rem;
  transition: width 0.8s var(--ease);
  position: relative;
}

.hist-bar-binomial {
  height: 10px;
  border-radius: 2px;
  background: rgba(255, 244, 214, 0.05);
  border: 1px dashed rgba(255, 244, 214, 0.2);
  display: flex;
  align-items: center;
  padding-left: 0.35rem;
  transition: width 0.8s var(--ease);
  position: relative;
}

.hist-val {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  position: absolute;
  left: calc(100% + 6px);
  white-space: nowrap;
}

.hist-legend {
  display: flex;
  gap: 1.2rem;
  font-size: 0.68rem;
  color: var(--ink-3);
  margin-top: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-color.binomial {
  background: rgba(255, 244, 214, 0.05);
  border: 1px dashed rgba(255, 244, 214, 0.2);
}

.hist-row.is-actual {
  background: rgba(121, 196, 108, 0.04);
  border-radius: 4px;
  padding: 0.15rem 0.3rem;
  margin-left: -0.3rem;
  margin-right: -0.3rem;
}

.hist-row.is-pinned {
  background: rgba(212, 175, 55, 0.04);
  border-radius: 4px;
  padding: 0.15rem 0.3rem;
  margin-left: -0.3rem;
  margin-right: -0.3rem;
}


