*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary:   #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card:      #ffffff;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --accent:      #2563eb;
  --accent-warm: #ea580c;
  --border:  #e2e8f0;
  --success: #16a34a;
  --danger:  #dc2626;
  --radius: 8px;
  --nav-height: 60px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── NAV ─────────────────────────────────────── */
nav {
  height: var(--nav-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* ── LAYOUT ──────────────────────────────────── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── HERO ────────────────────────────────────── */
.hero { margin-bottom: 48px; }
.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
}
.hero h1 span { color: var(--accent); }
.hero p { color: var(--text-secondary); margin-top: 10px; font-size: 1.05rem; }
.last-updated { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }

/* ── CARDS ───────────────────────────────────── */
.card {
  background: linear-gradient(145deg, #ffffff 40%, #eff6ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  padding: 24px;
}
.card-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── HIGHLIGHT CARDS ─────────────────────────── */
.highlights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
@media (max-width: 720px) {
  .highlights-grid { grid-template-columns: 1fr; }
}
/* give highlight cards a fixed min-height so empty state stays balanced */
.highlights-grid .card {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}
/* MVP card accent border */
#mvp-highlight {
  border-color: #bfdbfe;
}
.highlight-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.highlight-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.highlight-name {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 4px;
}
.highlight-pct {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-top: 10px;
}
.highlight-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.mvp-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px 0 8px;
}
.mvp-team-badge {
  display: inline-block;
  background: #dbeafe;
  color: var(--accent);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 2px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 4px;
}
.matchup {
  display: flex;
  align-items: stretch;
  flex: 1;
  margin: 8px -24px 0;  /* bleed to card edges */
  gap: 0;
}
.matchup-team {
  flex: 1;
  text-align: center;
  padding: 16px 12px 20px;
}
.matchup-team--winner {
  background: #dbeafe;
}
.matchup-team-conf {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.matchup-team--winner .matchup-team-conf {
  color: #60a5fa;
}
.matchup-team-name {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text-primary);
}
.matchup-team--winner .matchup-team-name {
  color: var(--accent);
}
.matchup-team-pct {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 8px;
}
.matchup-team--winner .matchup-team-pct {
  color: #1d4ed8;
}
.matchup-team-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.matchup-team--winner .matchup-team-desc {
  color: #4a63be;
}
.matchup-vs {
  flex-shrink: 0;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  z-index: 1;
}

/* ── SNAPSHOT GRID ───────────────────────────── */
.snapshot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
/* ── HAMBURGER TOGGLE ────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  padding: 4px;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 720px) {
  .snapshot-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }

  nav { position: relative; }

  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 8px 16px 16px;
    gap: 2px;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 10px 14px;
    font-size: 0.95rem;
    border-radius: var(--radius);
  }
}

/* ── SNAPSHOT ROWS ───────────────────────────── */
.snapshot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.snapshot-row:last-child { border-bottom: none; }
.rank {
  width: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  flex-shrink: 0;
}
.player-info { width: 140px; flex-shrink: 0; min-width: 0; }
.player-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-badge  { font-size: 0.75rem; color: var(--text-muted); }
/* bar takes remaining space in snapshot rows */
.snapshot-row .prob-cell { flex: 1; }
.snapshot-row .prob-bar-track { min-width: 0; }

/* ── PROBABILITY BARS ────────────────────────── */
.prob-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prob-bar-track {
  flex: 1;
  height: 18px;
  background: #e0eaff;
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
}
.prob-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.prob-pct {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 38px;
  text-align: right;
  flex-shrink: 0;
}

/* ── CTA LINK ────────────────────────────────── */
.cta-link {
  display: inline-block;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  margin-top: 16px;
}
.cta-link:hover { text-decoration: underline; }

/* ── SECTION HEADER ──────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }
.section-sub   { color: var(--text-muted); font-size: 0.85rem; }

/* ── TABS ────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.tab-btn {
  padding: 10px 22px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
  font-family: inherit;
}
.tab-btn:hover  { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel          { display: none; }
.tab-panel.active   { display: block; }

/* ── TABLES ──────────────────────────────────── */
.table-wrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th[data-sortable] { cursor: pointer; user-select: none; }
thead th[data-sortable]:hover { color: var(--text-secondary); }
thead th.sort-desc::after { content: ' ↓'; color: var(--accent); }
thead th.sort-asc::after  { content: ' ↑'; color: var(--accent); }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:hover { background: var(--bg-secondary); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 12px 14px; vertical-align: middle; }

/* ── SEASON SELECTOR ─────────────────────────── */
.season-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ── ACCURACY PAGE ───────────────────────────── */
.accuracy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.accuracy-stat {
  background: linear-gradient(145deg, #ffffff 40%, #eff6ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.accuracy-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.accuracy-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.correct { color: var(--success); font-weight: 600; }
.wrong   { color: var(--danger);  font-weight: 600; }

/* ── ACTUAL WINNER HIGHLIGHT ─────────────────── */
.actual-winner-row { background: #f0fdf4; }
.actual-winner-row:hover { background: #dcfce7; }
.actual-winner-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--success);
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ── ABOUT / PROSE ───────────────────────────── */
.prose { max-width: 680px; }
.prose h2 { font-size: 1.15rem; font-weight: 700; margin: 36px 0 10px; }
.prose p  { color: var(--text-secondary); margin-bottom: 16px; }
.prose ul { color: var(--text-secondary); padding-left: 20px; margin-bottom: 16px; }
.prose li { margin-bottom: 8px; }
.prose a  { color: var(--accent); }

/* ── CHAMP CALLOUT ───────────────────────────── */
.champ-callout {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.champ-callout strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* ── FOOTER ──────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}
