:root {
  --bg: #060a10;
  --surface: #0c1018;
  --surface2: #111822;
  --border: #1a2332;
  --text: #c8d0dc;
  --text-dim: #5a6a80;
  --text-bright: #eaf0f8;
  --accent: #e8a838;
  --accent-dim: #b07818;
  --blue: #4a90d9;
  --green: #38c87a;
  --red: #d94a4a;
  --purple: #9a6adf;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.mono { font-family: 'IBM Plex Mono', monospace; }
.serif { font-family: 'Instrument Serif', serif; }

/* --- HERO --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  padding: 2rem;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(232,168,56,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(74,144,217,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.hero-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeUp 1s 0.2s forwards;
}

.hero h1 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 400;
  color: var(--text-bright);
  line-height: 1.05;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 1s 0.4s forwards;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 540px;
  opacity: 0;
  animation: fadeUp 1s 0.6s forwards;
}

/* --- ACCURACY COMPARISON (hero) --- */
.accuracy-comparison {
  margin-top: 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.acc-cards {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.acc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 120px;
}

.acc-card-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

.acc-card-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-bright);
}

.acc-card-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.acc-vs {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}


.scroll-hint {
  position: absolute;
  bottom: 3rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  opacity: 0;
  animation: fadeUp 1s 1s forwards;
}

.scroll-hint::after {
  content: '';
  display: block;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--text-dim), transparent);
  margin: 0.8rem auto 0;
  animation: pulse 2s infinite;
}

/* --- SECTIONS --- */
.section {
  padding: 8rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

.section-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 1rem;
}

.section h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  color: var(--text-bright);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.section h2 em { font-style: italic; color: var(--accent); }

.section p {
  font-size: 1.15rem;
  color: var(--text);
  max-width: 680px;
  margin-bottom: 1.5rem;
}

.section p.dim { color: var(--text-dim); font-size: 1.05rem; }

/* --- DIVIDER --- */
.divider {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

/* --- STATS ROW --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, var(--accent), transparent);
}

.stat-card.highlight::before {
  background: linear-gradient(to right, var(--green), transparent);
}

.stat-card.blue-hl::before {
  background: linear-gradient(to right, var(--blue), transparent);
}

.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.stat-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-bright);
}

.stat-value.accent { color: var(--accent); }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }

.stat-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
}

/* --- COMPARISON TABLE --- */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
}

.compare-table th {
  text-align: left;
  padding: 1rem 1.2rem;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.compare-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.compare-table tr:hover td {
  background: var(--surface);
}

.compare-table .best {
  color: var(--green);
  font-weight: 600;
}

.compare-table .model-name {
  color: var(--text-bright);
  font-weight: 500;
}

.compare-table tr.winner td {
  background: rgba(56, 200, 122, 0.05);
}

/* --- BAR CHART --- */
.bar-chart {
  margin: 2.5rem 0;
}

.bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.6rem;
  position: relative;
  cursor: default;
}

.bar-tooltip {
  display: none;
  position: absolute;
  left: 140px;
  top: 100%;
  z-index: 10;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text);
  max-width: 360px;
  line-height: 1.4;
  white-space: normal;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.bar-row:hover .bar-tooltip {
  display: block;
}

.bar-label {
  width: 140px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text);
  text-align: right;
  padding-right: 1rem;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 28px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  padding-left: 0.8rem;
}

.bar-fill span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--bg);
}

/* --- SEASON CHART --- */
.season-chart {
  position: relative;
  height: 280px;
  margin: 3rem 0 2rem;
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0 0 2rem 3rem;
}

.season-chart .y-label {
  position: absolute;
  left: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  transform: translateX(-100%) translateX(-8px);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  height: 250px;
  gap: 3px;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 1s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.chart-bar.seed { background: var(--text-dim); opacity: 0.4; }
.chart-bar.model { background: var(--accent); }

.chart-bar-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  color: var(--text-dim);
  margin-top: 6px;
  transform: rotate(-45deg);
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  justify-content: center;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
}

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

/* --- TEAM TABLE --- */
.team-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

.team-table th {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.8rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.team-table th:first-child,
.team-table th:nth-child(2) { text-align: left; }

.team-table td {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  padding: 0.65rem 0.8rem;
  text-align: right;
  border-bottom: 1px solid rgba(26,35,50,0.5);
  color: var(--text);
}

.team-table td:first-child { text-align: left; color: var(--text-bright); font-weight: 500; }
.team-table td:nth-child(2) { text-align: left; color: var(--accent-dim); }

.team-table tr:hover td { background: var(--surface); }

.team-table .prob-high { color: var(--accent); font-weight: 600; }
.team-table .prob-med { color: var(--text); }
.team-table .prob-low { color: var(--text-dim); }

.team-table .delta-pos { color: var(--green); }
.team-table .delta-neg { color: var(--red); }

/* --- PIPELINE FLOW --- */
.pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  margin: 3rem 0;
  background: var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.pipeline-step {
  background: var(--surface);
  padding: 2rem 1.5rem;
  position: relative;
}

.pipeline-step::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid var(--accent-dim);
  z-index: 1;
}

.pipeline-step:last-child::after { display: none; }

.pipeline-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  color: var(--accent-dim);
  letter-spacing: 0.15em;
  margin-bottom: 0.8rem;
}

.pipeline-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.pipeline-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* --- CALLOUT --- */
.callout {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.callout.blue-callout { border-left-color: var(--blue); }
.callout.green-callout { border-left-color: var(--green); }

.callout p {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0;
}

.callout strong { color: var(--text-bright); }

/* --- TAG --- */
.tag {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  background: rgba(232,168,56,0.1);
  color: var(--accent);
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag.blue { background: rgba(74,144,217,0.1); color: var(--blue); }
.tag.green { background: rgba(56,200,122,0.1); color: var(--green); }
.tag.purple { background: rgba(154,106,223,0.1); color: var(--purple); }

/* --- FEATURE GRID --- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
}

.feature-card h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-bright);
  margin-bottom: 0.3rem;
}

.feature-card p {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.4;
}

/* --- SAMPLE TABLE --- */
.sample-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  overflow-x: auto;
}

.sample-table th {
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-dim);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  white-space: nowrap;
}

.sample-table td {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid rgba(26,35,50,0.4);
  color: var(--text-dim);
  white-space: nowrap;
}

.sample-table tr:first-child td { color: var(--text); }
.sample-table .fade-row td { opacity: 0.35; }

/* --- OPPONENT ADJUSTMENT VISUAL --- */
.adj-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  margin: 3rem 0;
}

.adj-team {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.adj-team-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.adj-raw {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.3rem;
}

.adj-raw-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}

.adj-context {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.02);
  border-radius: 6px;
  margin-bottom: 1.2rem;
}

.adj-arrow {
  font-size: 1.2rem;
  color: var(--accent-dim);
  margin: 0.8rem 0;
}

.adj-result {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

.adj-adjusted {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.5rem;
  font-weight: 600;
}

.adj-adjusted.winner { color: var(--green); }
.adj-adjusted.loser { color: var(--text-dim); }

.adj-vs {
  font-family: 'Instrument Serif', serif;
  font-size: 1.5rem;
  color: var(--text-dim);
  font-style: italic;
}

/* --- UPSET CARDS --- */
.upset-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2.5rem 0;
}

.upset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.6rem;
  position: relative;
  overflow: hidden;
}

.upset-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--green);
}

.upset-card .upset-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
}

.upset-card .upset-seeds {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
}

.upset-card .upset-prob {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.upset-card .upset-prob strong {
  color: var(--green);
  font-size: 1.1rem;
}

.upset-card .upset-teams {
  margin-bottom: 1rem;
}

.upset-card .upset-winner {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-bright);
}

.upset-card .upset-loser {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.upset-card .upset-loser span {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  color: var(--text-dim);
}

.upset-card .upset-bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.upset-card .upset-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
}

.upset-card .upset-bar-label {
  width: 90px;
  color: var(--text-dim);
  text-align: right;
  flex-shrink: 0;
}

.upset-card .upset-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  display: flex;
}

.upset-card .upset-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.upset-card .upset-bar-val {
  width: 40px;
  color: var(--text-dim);
  font-size: 0.6rem;
  flex-shrink: 0;
}

.upset-card .upset-why {
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.5;
}

.upset-card .upset-why strong {
  color: var(--text-bright);
}

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

/* --- MATCHUP VISUAL --- */
.matchup-visual {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  margin: 2.5rem 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
}

.matchup-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
}

.matchup-col-header {
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 0.8rem;
}

.matchup-row {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(26,35,50,0.3);
}

.matchup-row:last-child { border-bottom: none; }

.matchup-row .feat { color: var(--text-dim); }
.matchup-row .val { color: var(--text-bright); }
.matchup-row .val.pos { color: var(--green); }
.matchup-row .val.neg { color: var(--red); }

.matchup-op {
  font-family: 'Instrument Serif', serif;
  font-size: 1.8rem;
  color: var(--text-dim);
  text-align: center;
}

/* --- CALIBRATION IMAGE --- */
.calibration-container {
  margin: 2.5rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.calibration-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.calibration-caption {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 1rem;
}

/* --- ITERATION VISUAL --- */
.iteration-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: 8px;
  overflow-x: auto;
}

.iter-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  flex-shrink: 0;
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg);
  transition: all 0.3s;
}

.iter-dot.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,168,56,0.08);
}

.iter-dot.done {
  border-color: var(--green);
  color: var(--green);
  background: rgba(56,200,122,0.08);
}

.iter-arrow {
  color: var(--text-dim);
  font-size: 0.7rem;
  flex-shrink: 0;
  opacity: 0.4;
}

/* --- SIM COUNTER --- */
.sim-counter {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  color: var(--accent);
  text-align: center;
  margin: 2rem 0 0.5rem;
}

.sim-counter-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 2rem;
}

/* --- BRACKET --- */
.bracket-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 0;
}

.prob-toggle {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.prob-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.4rem 1rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.prob-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.prob-btn.active {
  background: rgba(232, 168, 56, 0.12);
  color: var(--accent);
}

.prob-btn:hover:not(.active) {
  color: var(--text);
}

.prob-desc {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.5rem;
  transition: opacity 0.15s;
}

.bracket-wrapper {
  padding: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bracket {
  display: flex;
  align-items: stretch;
  min-width: 1100px;
  max-width: 1400px;
  margin: 0 auto;
  height: 800px;
}

.bracket-side {
  display: flex;
  flex-direction: column;
  flex: 5;
  gap: 8px;
}

.bracket-region {
  display: flex;
  flex: 1;
  align-items: stretch;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  min-width: 115px;
}

.b-pair {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-around;
  position: relative;
}

.b-game {
  display: flex;
  flex-direction: column;
  position: relative;
}

.b-team {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  line-height: 1;
  height: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  color: var(--text-dim);
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  cursor: default;
}

.b-team:last-child { margin-top: -1px; }

.b-team.path-active { position: relative; z-index: 3; }

.b-team.winner {
  background: rgba(74, 144, 217, 0.12);
  border-color: var(--blue);
  color: var(--text-bright);
  position: relative;
  z-index: 1;
}

.b-team .b-seed {
  min-width: 14px;
  font-size: 0.6rem;
  opacity: 0.6;
}

.b-team .b-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.b-team .b-prob {
  font-size: 0.55rem;
  opacity: 0.45;
  margin-left: auto;
  flex-shrink: 0;
}

.b-team.winner .b-prob {
  color: var(--blue);
  opacity: 0.9;
}

/* Clickable underdogs */
.b-team:not(.winner) {
  cursor: pointer;
}

.b-team:not(.winner):hover {
  background: rgba(74, 144, 217, 0.06);
  border-color: rgba(74, 144, 217, 0.3);
}

/* User-overridden upset winner */
.b-team.winner.upset {
  background: rgba(232, 216, 56, 0.15);
  border-color: #e0d438;
  cursor: pointer;
}

.b-team.winner.upset .b-prob {
  color: #e0d438;
  opacity: 0.8;
}

/* Path highlight on hover */
.b-team.path-active {
  background: rgba(56, 200, 122, 0.22) !important;
  border-color: var(--green) !important;
  color: var(--text-bright) !important;
  z-index: 2;
}

.b-team.path-active .b-prob {
  color: var(--green) !important;
  opacity: 1 !important;
}

/* Completed game — correct prediction */
.b-team.completed.winner.correct {
  background: rgba(56, 200, 122, 0.15);
  border-color: var(--green);
  color: var(--text);
  cursor: default !important;
  position: relative;
  z-index: 1;
}

.b-team.completed.winner.correct .b-prob {
  color: var(--green);
  opacity: 0.9;
}

/* Completed game — wrong prediction */
.b-team.completed.winner.wrong {
  background: rgba(217, 74, 74, 0.15);
  border-color: var(--red);
  color: var(--text);
  cursor: default !important;
  position: relative;
  z-index: 1;
}

.b-team.completed.winner.wrong .b-prob {
  color: var(--red);
  opacity: 0.9;
}

.b-team.completed:not(.winner) {
  cursor: default !important;
  opacity: 0.45;
}

.b-team.completed:not(.winner):hover {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

/* Bracket key/legend */
.bracket-key {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.key-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-dim);
}

.key-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1.5px solid;
}

.key-swatch.sw-predict {
  background: rgba(74, 144, 217, 0.12);
  border-color: var(--blue);
}

.key-swatch.sw-correct {
  background: rgba(56, 200, 122, 0.15);
  border-color: var(--green);
}

.key-swatch.sw-wrong {
  background: rgba(217, 74, 74, 0.15);
  border-color: var(--red);
}

.key-swatch.sw-user {
  background: rgba(232, 216, 56, 0.15);
  border-color: #e0d438;
}

.bracket.has-hover .b-team:not(.path-active) {
  opacity: 0.25;
}

.bracket.has-hover .b-pair::after,
.bracket.has-hover .b-game::before {
  opacity: 0.15;
}

/* Left side bracket connectors */
.bracket-side.left .bracket-round:not(:last-child) { padding-right: 20px; }

.bracket-side.left .bracket-round:not(:last-child) .b-pair::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 25%;
  bottom: 25%;
  width: 10px;
  border: 1px solid var(--border);
  border-left: none;
  transition: opacity 0.15s;
}

.bracket-side.left .bracket-round:not(:first-child) .b-game::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  width: 10px;
  height: 0;
  border-top: 1px solid var(--border);
  transition: opacity 0.15s;
}

/* Right side bracket connectors */
.bracket-side.right .bracket-round:not(:first-child) { padding-left: 20px; }

.bracket-side.right .bracket-round:not(:first-child) .b-pair::after {
  content: '';
  position: absolute;
  left: -10px;
  top: 25%;
  bottom: 25%;
  width: 10px;
  border: 1px solid var(--border);
  border-right: none;
  transition: opacity 0.15s;
}

.bracket-side.right .bracket-round:not(:last-child) .b-game::before {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  width: 10px;
  height: 0;
  border-top: 1px solid var(--border);
  transition: opacity 0.15s;
}

/* Bracket center */
.bracket-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 140px;
  padding: 0 10px;
}

.bracket-f4-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}

.bracket-f4-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 6px;
}

.bracket-center .b-game { width: 100%; }

.bracket-champ {
  text-align: center;
  padding: 10px 0;
}

.bracket-champ-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 3px;
}

.bracket-champ-team {
  font-family: 'Instrument Serif', serif;
  font-size: 1.4rem;
  color: var(--accent);
}

.bracket-champ-prob {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-dim);
}

/* --- PREDICTOR --- */
.predictor { margin: 3rem 0; }

.pred-result {
  text-align: center;
  margin-bottom: 2rem;
}

.pred-team-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.pred-team-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.pred-team-name.a { color: var(--accent); }
.pred-team-name.b { color: var(--blue); }

.pred-bar {
  height: 40px;
  background: var(--blue);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.pred-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  border-radius: 7px 0 0 7px;
  transition: width 0.3s ease;
}

.pred-pct {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
}

.pred-pct-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.8rem;
  font-weight: 600;
}

.pred-pct-val.a { color: var(--accent); }
.pred-pct-val.b { color: var(--blue); }

.pred-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 700px) {
  .pred-panels { grid-template-columns: 1fr; }
}

.pred-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.pred-panel.a { border-top: 2px solid var(--accent); }
.pred-panel.b { border-top: 2px solid var(--blue); }

.pred-select {
  width: 100%;
  padding: 0.6rem 1rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-bright);
  cursor: pointer;
  margin-bottom: 1.2rem;
}

.pred-select:focus {
  outline: none;
  border-color: var(--accent);
}

.pred-features {
  margin-top: 0.8rem;
}

.pred-feat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(26,35,50,0.3);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
}

.pred-feat-row:last-child { border-bottom: none; }

.pred-feat-name {
  color: var(--text-dim);
}

.pred-feat-val {
  color: var(--text-bright);
}

/* --- ANIMATIONS --- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- FOOTER --- */
.footer {
  text-align: center;
  padding: 4rem 2rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* --- RESPONSIVE --- */
@media (max-width: 700px) {
  .adj-compare {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .adj-vs { transform: none; }
  .matchup-visual {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .matchup-op { transform: rotate(90deg); }
}
