:root {
  --paper: #f4f3ee;
  --card: #fbfaf6;
  --ink: #151713;
  --muted: #6d7168;
  --line: #d9dbd2;
  --accent: #dfff36;
  --accent-soft: #efffb0;
  --deep: #20231e;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.sidebar { min-height: 100vh; padding: 28px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 900; letter-spacing: .14em; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; background: var(--ink); color: var(--accent); border-radius: 8px; letter-spacing: 0; }
.sidebar nav { display: grid; gap: 6px; margin-top: 54px; }
.sidebar nav a { padding: 11px 12px; border-radius: 10px; font-size: 14px; color: var(--muted); font-weight: 650; }
.sidebar nav a.active { background: var(--deep); color: white; }
.sidebar nav a.active::after { content: ""; float: right; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.sidebar-foot { margin-top: auto; font-size: 12px; line-height: 1.5; font-weight: 700; }
.sidebar-foot span { color: var(--muted); font-weight: 500; }

main { padding: 38px clamp(30px, 5vw, 72px) 70px; max-width: 1500px; width: 100%; margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.eyebrow, .label { margin: 0; font-size: 10px; letter-spacing: .16em; font-weight: 900; color: var(--muted); }
.topbar h1 { margin: 7px 0 0; font-size: clamp(27px, 3vw, 42px); letter-spacing: -.045em; line-height: 1; font-family: "Arial Narrow", "Helvetica Neue", sans-serif; }
.topbar-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.season-pill, .data-status { border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.38); }
.data-status { color: var(--muted); }
.data-status.live { color: var(--ink); background: var(--accent-soft); border-color: #d5ef6f; }
.data-status.live::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #738c00; }

.explorer-bar { margin-bottom: 14px; display: grid; grid-template-columns: minmax(230px, .8fr) minmax(420px, 1.2fr); gap: 24px; align-items: end; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.38); }
.explorer-copy { display: grid; gap: 4px; }
.explorer-copy strong { font-size: 17px; letter-spacing: -.02em; }
.explorer-copy > span:last-child { font-size: 11px; color: var(--muted); line-height: 1.45; }
.explorer-controls { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(240px, 1.3fr); gap: 10px; }
.explorer-controls label { display: grid; gap: 6px; }
.explorer-controls label > span { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--muted); }
.explorer-controls select { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; color: var(--ink); background: var(--card); font-size: 13px; font-weight: 700; outline: none; }
.explorer-controls select:focus { border-color: #8d9c48; box-shadow: 0 0 0 3px rgba(223,255,54,.24); }

.player-hero { background: var(--deep); color: white; border-radius: 26px; padding: 30px; display: flex; justify-content: space-between; gap: 30px; align-items: center; box-shadow: 0 14px 40px rgba(20,24,17,.08); }
.hero-copy { display: flex; gap: 22px; align-items: center; min-width: 0; }
.avatar { width: 78px; height: 78px; flex: 0 0 78px; border-radius: 21px; background: var(--accent); color: var(--ink); display: grid; place-items: center; font-weight: 950; font-size: 22px; letter-spacing: -.04em; }
.hero-meta { display: flex; gap: 8px; color: #b8bdb1; font-size: 13px; font-weight: 650; }
.player-hero h2 { margin: 7px 0 9px; font-family: "Arial Narrow", "Helvetica Neue", sans-serif; font-size: clamp(34px, 5vw, 62px); line-height: .95; letter-spacing: -.055em; overflow-wrap: anywhere; }
.facts { display: flex; gap: 13px; flex-wrap: wrap; color: #c9cdc4; font-size: 12px; }
.fact { padding-right: 13px; border-right: 1px solid #4d5148; }
.fact:last-child { border-right: 0; }
.confidence-card { width: 225px; flex: 0 0 auto; padding: 20px; border-radius: 18px; background: #2b2f28; border: 1px solid #3b4037; display: grid; gap: 6px; }
.confidence-card .label { color: #989e91; }
.confidence-card strong { font-size: 18px; }
.confidence-card span:last-child { font-size: 12px; color: #b9beb2; line-height: 1.4; }

.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0; }
.summary-card { min-height: 126px; border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; background: var(--card); display: flex; flex-direction: column; }
.summary-card.accent { background: var(--accent-soft); border-color: #d5ef6f; }
.summary-card strong { font-size: 30px; letter-spacing: -.04em; margin: auto 0 1px; }
.summary-card > span:last-child { font-size: 11px; color: var(--muted); }

.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 46px; }
.insight-card { min-height: 132px; padding: 19px; border-radius: var(--radius); border: 1px solid var(--line); background: #ecece6; display: grid; gap: 18px; }
.insight-card h3 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.025em; }
.insight-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.insight-chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 9px 7px 11px; border: 1px solid #d0d2c8; background: var(--card); font-size: 11px; }
.insight-chip strong { font-weight: 750; }
.insight-chip span { display: inline-grid; place-items: center; min-width: 34px; height: 22px; border-radius: 999px; background: var(--deep); color: white; font-size: 10px; font-weight: 900; }
.muted { color: var(--muted); font-size: 11px; }

.section-head { display: grid; grid-template-columns: 1fr minmax(280px, 520px); gap: 30px; align-items: end; margin-bottom: 18px; }
.section-head h3, .evidence-panel h3 { margin: 6px 0 0; font-size: 27px; letter-spacing: -.035em; }
.section-head > p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }

.metric-groups { display: grid; gap: 16px; }
.metric-group { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.metric-group-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.metric-group-head h4 { margin: 0; font-size: 14px; }
.metric-group-head span { color: var(--muted); font-size: 11px; }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); }
.metric { padding: 20px; border-bottom: 1px solid var(--line); }
.metric:nth-child(odd) { border-right: 1px solid var(--line); }
.metric:nth-last-child(-n+2) { border-bottom: 0; }
.metric-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.metric-label { font-size: 13px; font-weight: 750; }
.metric-value { font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 850; }
.metric-rank { margin-top: 15px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.track { height: 7px; background: #e5e6df; border-radius: 999px; overflow: hidden; position: relative; }
.fill { height: 100%; background: var(--ink); border-radius: inherit; transition: width .32s ease; }
.metric.standout .fill, .metric.strong .fill { background: #6f8700; }
.metric.watch .fill { background: #8a5c34; }
.percentile { min-width: 52px; font-size: 12px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
.metric-bottom { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 10px; color: var(--muted); }
.direction { border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; background: #f7f6f1; white-space: nowrap; }
.direction.contextual { background: #efeee8; }

.evidence-panel { margin-top: 34px; padding: 26px; border-radius: 20px; border: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1.3fr; gap: 34px; background: #ecece6; }
.evidence-copy p { margin: 0 0 10px; font-size: 13px; font-weight: 750; }
.evidence-copy .muted { color: var(--muted); font-weight: 500; line-height: 1.55; font-size: 12px; }

.loading { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; }
.error { padding: 18px; border: 1px solid #d7a6a6; background: #fff3f1; border-radius: 12px; font-size: 13px; }

@media (max-width: 1050px) {
  .explorer-bar { grid-template-columns: 1fr; align-items: stretch; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  main { padding: 24px 18px 50px; }
  .topbar { align-items: flex-end; }
  .season-pill { display: none; }
  .explorer-controls { grid-template-columns: 1fr; }
  .player-hero { align-items: flex-start; flex-direction: column; }
  .confidence-card { width: 100%; }
  .summary-grid, .insight-grid { grid-template-columns: 1fr; }
  .section-head, .evidence-panel { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr; }
  .metric:nth-child(odd) { border-right: 0; }
  .metric { border-bottom: 1px solid var(--line) !important; }
  .metric:last-child { border-bottom: 0 !important; }
}

@media (max-width: 560px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .topbar-meta { justify-content: flex-start; }
  .player-hero { padding: 22px; }
  .hero-copy { align-items: flex-start; }
  .avatar { width: 58px; height: 58px; flex-basis: 58px; border-radius: 16px; font-size: 17px; }
  .player-hero h2 { font-size: 36px; }
  .metric-bottom { align-items: flex-start; flex-direction: column; }
}
