
:root {
  --ink: #10243a;
  --muted: #66778b;
  --line: #d9e3e8;
  --panel: rgba(255, 255, 255, 0.88);
  --paper: #fbfbf7;
  --bg: #e9f1f2;
  --teal: #0f7d73;
  --teal-dark: #064f53;
  --rust: #c95737;
  --gold: #e2a847;
  --target: rgba(15, 125, 115, 0.2);
  --reference: rgba(83, 102, 124, 0.14);
  --shadow: 0 24px 80px rgba(16, 36, 58, 0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  background:
    radial-gradient(circle at top left, rgba(15, 125, 115, .18), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(201, 87, 55, .12), transparent 34rem),
    linear-gradient(120deg, #e7eff1, #fbfbf7 48%, #dfe9eb);
  color: var(--ink);
  font-family: Avenir Next, Trebuchet MS, sans-serif;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  overflow: auto;
}
.brand { display: grid; gap: 6px; margin-bottom: 22px; }
.brand span, .label, label { color: var(--muted); text-transform: uppercase; font-size: 11px; font-weight: 850; letter-spacing: .11em; }
.brand strong { font-family: Georgia, serif; font-size: 25px; line-height: 1.02; }
.brand p, .subtitle, .info-card p, .sidebar-note { color: var(--muted); line-height: 1.45; margin: 0; }
label { display: grid; gap: 8px; margin: 16px 0; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 13px;
  font: inherit;
  background: white;
  color: var(--ink);
}
.sidebar-note {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .7);
  font-size: 13px;
}
.athlete-list { display: grid; gap: 8px; margin-top: 18px; }
.athlete-button {
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 12px;
  background: #f6f1e8;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.athlete-button:hover { transform: translateY(-1px); border-color: rgba(15, 125, 115, .25); }
.athlete-button.active { background: linear-gradient(135deg, var(--teal-dark), var(--teal)); color: white; box-shadow: 0 16px 36px rgba(15, 86, 97, .22); }
.athlete-button span { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; }
.athlete-button small { display: block; margin-top: 5px; color: inherit; opacity: .72; }
.compare-action {
  display: inline-block;
  margin-top: 7px;
  color: inherit;
  font-size: 12px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.main { min-width: 0; padding: 28px clamp(18px, 3vw, 44px); display: grid; gap: 22px; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.info-card, .hero-panel, .chart-section, .table-section, .metrics {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.info-card { box-shadow: none; }
.hero-panel { display: flex; justify-content: space-between; gap: 18px; align-items: end; }
h1, h2 { margin: 4px 0 0; font-family: Georgia, serif; line-height: 1.05; }
h1 { font-size: clamp(34px, 4.8vw, 64px); max-width: 900px; }
h2 { font-size: 25px; }
.athlete-country-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  vertical-align: middle;
  font-family: Avenir Next, Trebuchet MS, sans-serif;
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 850;
  letter-spacing: .04em;
  color: var(--muted);
}
.athlete-country-badge .flag { font-size: 1.15em; line-height: 1; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tabs button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: white;
  cursor: pointer;
  font-weight: 800;
}
.tabs button.active { background: var(--ink); color: white; border-color: var(--ink); }
.metrics {
  display: grid;
  grid-template-columns: minmax(260px, .95fr) minmax(300px, 1.2fr) minmax(240px, .85fr);
  gap: 18px;
  align-items: stretch;
}
.metric-panel {
  background: rgba(247, 250, 249, .9);
  border: 1px solid rgba(217, 227, 232, .9);
  border-radius: 22px;
  padding: 18px;
}
.metric-panel h3 {
  margin: 0 0 14px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .09em;
}
.metric-stack { display: grid; gap: 12px; }
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(16, 36, 58, .08);
}
.metric-row:last-child { border-bottom: 0; padding-bottom: 0; }
.metric-row span, .odds-item span { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.metric-row strong { font-size: clamp(18px, 2vw, 28px); text-align: right; overflow-wrap: anywhere; }
.odds-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.odds-item {
  min-height: 92px;
  border-radius: 18px;
  padding: 13px;
  background: #fff;
  border: 1px solid rgba(217, 227, 232, .9);
}
.odds-item strong { display: block; margin-top: 5px; font-size: clamp(24px, 3vw, 38px); }
.odds-item small, .funnel-card small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.funnel-card {
  height: 100%;
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(15, 125, 115, .13), rgba(255,255,255,.78));
  border: 1px solid rgba(15, 125, 115, .24);
}
.funnel-card span { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.funnel-card strong { display: block; margin-top: 8px; font-size: clamp(28px, 3.5vw, 44px); line-height: 1.02; }
.confidence-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(16, 36, 58, .08);
  color: var(--ink) !important;
  font-size: 11px !important;
  letter-spacing: .04em !important;
}
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.tier-label { min-width: 230px; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: -2px 0 16px; color: var(--muted); font-size: 13px; }
.legend span { display: inline-flex; gap: 7px; align-items: center; }
.legend i { width: 24px; height: 10px; border-radius: 999px; display: inline-block; }
.legend-target { background: var(--target); border: 1px solid rgba(15, 125, 115, .36); }
.legend-reference { background: var(--reference); border: 1px dashed rgba(83, 102, 124, .38); }
.legend-point { width: 10px !important; background: var(--rust); box-shadow: 0 0 0 4px rgba(201, 87, 55, .12); }
.legend-compare { width: 10px !important; background: #2757c7; box-shadow: 0 0 0 4px rgba(39, 87, 199, .12); }
.sample-note {
  margin: -6px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  background: rgba(255,255,255,.62);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.compare-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}
.compare-key-label {
  width: 100%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.compare-chip {
  --compare-color: #2757c7;
  border: 1px solid rgba(39, 87, 199, .2);
  border-radius: 999px;
  background: rgba(39, 87, 199, .08);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  padding: 8px 11px;
  cursor: pointer;
}
.compare-chip::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--compare-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--compare-color) 16%, transparent);
}
.compare-chip.active { background: color-mix(in srgb, var(--compare-color) 14%, white); color: var(--ink); border-color: color-mix(in srgb, var(--compare-color) 32%, white); }
.compare-chip.muted { background: rgba(83, 102, 124, .08); color: var(--muted); border-color: rgba(83, 102, 124, .18); }
.chart {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: rgba(255,255,255,.62);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.chart-svg { display: block; width: 100%; height: 520px; overflow: visible; }
.grid-line { stroke: rgba(16, 36, 58, .08); stroke-width: 1; }
.axis-line { stroke: rgba(16, 36, 58, .22); stroke-width: 1.2; }
.reference-area { fill: rgba(83, 102, 124, .16); stroke: rgba(83, 102, 124, .42); stroke-width: 1.4; stroke-dasharray: 4 4; }
.target-area { fill: rgba(15, 125, 115, .22); stroke: rgba(15, 125, 115, .62); stroke-width: 1.8; }
.athlete-line { fill: none; stroke: var(--rust); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.compare-line { fill: none; stroke: #2757c7; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .72; }
.athlete-point { fill: var(--rust); stroke: #fff; stroke-width: 2.5; cursor: pointer; }
.compare-point { fill: #2757c7; stroke: #fff; stroke-width: 2; opacity: .78; }
.hover-capture { fill: transparent; cursor: crosshair; }
.tick-label, .chart-label { fill: var(--muted); font-size: 11px; font-weight: 650; }
.chart-label { font-size: 12px; }
.chart-tooltip {
  position: absolute;
  z-index: 20;
  min-width: 220px;
  max-width: 280px;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(16, 36, 58, .14);
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 50px rgba(16, 36, 58, .18);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity .12s ease;
}
.chart-tooltip.visible { opacity: 1; }
.chart-tooltip strong { display: block; margin-bottom: 5px; font-size: 15px; }
.chart-tooltip span { display: block; color: var(--muted); }
.empty { padding: 36px; color: var(--muted); text-align: center; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-target { background: rgba(15, 125, 115, .16); color: var(--teal-dark); }
.status-reference { background: rgba(44, 84, 148, .13); color: #2351b7; }
.status-outside { background: rgba(201, 87, 55, .14); color: #aa3b21; }
@media (max-width: 850px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .info-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .odds-grid { grid-template-columns: 1fr 1fr; }
  .hero-panel, .section-head { display: grid; }
  .tabs { justify-content: flex-start; }
  table { min-width: 900px; }
  #season-table { overflow-x: auto; }
  .chart { min-height: 390px; }
  .chart-svg { height: 390px; }
}
@media (max-width: 1180px) and (min-width: 851px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .funnel-card { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .odds-grid { grid-template-columns: 1fr; }
}
