.leaderboard-page { background: var(--paper-bright); }
.leaderboard-header { position: absolute; }
.leaderboard-hero {
  position: relative;
  overflow: hidden;
  padding: 168px 0 88px;
  background: var(--ink);
  color: var(--white);
}
.leaderboard-hero::after {
  position: absolute;
  width: 500px;
  height: 500px;
  right: -180px;
  bottom: -280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 182, 255, .35), transparent 68%);
  content: "";
}
.leaderboard-hero-layout { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr .8fr; gap: 90px; align-items: end; }
.leaderboard-hero h1 { margin: 0; font-size: clamp(54px, 6vw, 84px); line-height: .96; letter-spacing: -.055em; }
.leaderboard-hero h1 em { color: var(--blue); font-family: var(--serif); font-weight: 400; }
.leaderboard-hero-layout > div:first-child > p:last-child { max-width: 680px; margin: 30px 0 0; color: #b8c2d9; font-size: 17px; line-height: 1.7; }
.leaderboard-summary { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .05); }
.leaderboard-summary div { display: flex; min-height: 142px; flex-direction: column; justify-content: flex-end; padding: 23px; border-right: 1px solid rgba(255, 255, 255, .14); }
.leaderboard-summary div:last-child { border-right: 0; }
.leaderboard-summary strong { font-family: var(--serif); font-size: 44px; font-weight: 400; }
.leaderboard-summary span { margin-top: 6px; color: #9faac2; font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.leaderboard-section { background: var(--paper-bright); }
.leaderboard-heading { display: grid; grid-template-columns: 1fr .72fr; gap: 90px; align-items: end; }
.leaderboard-heading > p { color: var(--muted); font-size: 17px; line-height: 1.75; }
.leaderboard-panel { min-height: 430px; border: 1px solid var(--line); background: var(--paper); }
.leaderboard-status { display: flex; min-height: 430px; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.leaderboard-status[hidden], .leaderboard-content[hidden] { display: none !important; }
.leaderboard-status.is-error { padding: 30px; color: var(--red-dark); text-align: center; }
.status-spinner { width: 18px; height: 18px; border: 2px solid rgba(16, 27, 54, .14); border-top-color: var(--red); border-radius: 50%; animation: leaderboard-spin .8s linear infinite; }
@keyframes leaderboard-spin { to { transform: rotate(360deg); } }

.controls { display: grid; grid-template-columns: 1fr 1.15fr .9fr 1.15fr auto; gap: 12px; padding: 22px; border-bottom: 1px solid var(--line); background: #ebe9e2; }
.controls label { display: flex; min-width: 0; flex-direction: column; gap: 7px; }
.controls label > span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.controls select, .controls input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid rgba(16, 27, 54, .2); border-radius: 2px; background: var(--paper-bright); color: var(--ink); font: inherit; font-size: 13px; }
.control-actions { display: flex; align-items: flex-end; gap: 6px; }
.control-actions button { min-height: 44px; padding: 0 12px; border: 1px solid rgba(16, 27, 54, .2); background: var(--paper-bright); color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 750; }
.control-actions button:hover { border-color: var(--ink); }

.view-context { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 30px 28px 24px; }
.view-context p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.view-context h3 { margin: 7px 0 0; font-size: 28px; letter-spacing: -.03em; }
.view-context > p { padding-bottom: 4px; white-space: nowrap; }

.table-scroll { overflow-x: auto; margin: 0 22px 26px; border: 1px solid var(--line); background: var(--paper-bright); }
.results-table { width: 100%; min-width: 760px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.results-table th, .results-table td { padding: 17px 15px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.results-table th { position: sticky; top: 0; z-index: 1; background: #e5e9f1; color: var(--ink-soft); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.results-table th:nth-child(1), .results-table td:nth-child(1) { width: 62px; text-align: center; }
.results-table th:nth-child(2), .results-table td:nth-child(2) { min-width: 260px; text-align: left; }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table tbody tr:hover { background: #f2f5fa; }
.metric-sort { padding: 0; border: 0; background: none; color: inherit; cursor: pointer; font: inherit; font-weight: 800; letter-spacing: inherit; text-transform: inherit; }
.metric-sort:hover, .metric-sort:focus-visible { color: var(--red-dark); }
.metric-sort.is-sorted { color: var(--red-dark); }
.rank-badge { display: inline-grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: #e9e7df; font-family: var(--serif); font-size: 15px; }
.results-table tr:nth-child(1) .rank-badge { background: #e6c95c; }
.results-table tr:nth-child(2) .rank-badge { background: #cdd3dc; }
.results-table tr:nth-child(3) .rank-badge { background: #dca77b; }
.model-name { display: block; max-width: 360px; overflow: hidden; font-weight: 750; text-overflow: ellipsis; }
.model-family { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 650; }
.metric-value { font-size: 13px; font-weight: 750; }
.metric-value.is-ranking { color: var(--red-dark); }
.metric-std { margin-left: 3px; color: var(--muted); font-size: 10px; }
.empty-state { margin: 0 22px 26px; padding: 42px 20px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }

.methodology-note { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px; padding: 26px 28px; border-top: 1px solid var(--line); background: #ebe9e2; }
.methodology-note strong { font-size: 12px; }
.methodology-note p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.methodology-note a { color: var(--red-dark); font-weight: 750; }

.leaderboard-cta { padding: 88px 0; background: var(--ink); color: var(--white); }
.leaderboard-cta .shell > div { display: grid; grid-template-columns: 1fr .8fr; gap: 80px; align-items: end; }
.leaderboard-cta h2 { margin: 0; font-size: clamp(42px, 4.4vw, 64px); line-height: 1.02; letter-spacing: -.045em; }
.leaderboard-cta p { margin: 0 0 25px; color: #aeb9d0; font-size: 15px; line-height: 1.7; }
.leaderboard-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 1040px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .control-actions { align-items: stretch; }
  .control-actions button { flex: 1; }
}

@media (max-width: 960px) {
  .leaderboard-hero-layout, .leaderboard-heading, .leaderboard-cta .shell > div { grid-template-columns: 1fr; gap: 38px; }
  .leaderboard-summary { max-width: 620px; }
}

@media (max-width: 720px) {
  .leaderboard-hero { padding: 128px 0 66px; }
  .leaderboard-hero h1 { font-size: clamp(47px, 14vw, 66px); }
  .leaderboard-summary div { min-height: 112px; padding: 15px; }
  .leaderboard-summary strong { font-size: 34px; }
  .controls, .methodology-note { grid-template-columns: 1fr; }
  .control-actions { flex-wrap: wrap; }
  .control-actions button:first-child { flex-basis: 100%; }
  .view-context { align-items: flex-start; flex-direction: column; gap: 12px; padding: 24px 18px 18px; }
  .table-scroll, .empty-state { margin-inline: 14px; }
  .results-table th:nth-child(1), .results-table td:nth-child(1) { position: sticky; left: 0; z-index: 2; width: 42px; min-width: 42px; padding-inline: 7px; background: var(--paper-bright); }
  .results-table th:nth-child(2), .results-table td:nth-child(2) { position: sticky; left: 42px; z-index: 2; min-width: 190px; max-width: 190px; background: var(--paper-bright); box-shadow: 8px 0 14px -12px rgba(16,27,54,.55); }
  .results-table th:nth-child(1), .results-table th:nth-child(2) { z-index: 3; background: #e5e9f1; }
  .results-table tbody tr:hover td:nth-child(1), .results-table tbody tr:hover td:nth-child(2) { background: #f2f5fa; }
  .model-name { max-width: 160px; }
  .methodology-note { gap: 20px; padding-inline: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .status-spinner { animation: none; }
}
