:root {
  --bg: #090b0f;
  --bg-accent: #11161d;
  --panel: rgba(16, 20, 28, 0.9);
  --panel-strong: rgba(20, 25, 35, 0.96);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f7fb;
  --muted: #9ea8b7;
  --accent: #74d3c1;
  --task-divider: rgba(116, 211, 193, 0.24);
  --warning: #f7c66e;
  --danger: #f28d8d;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(116, 211, 193, 0.12), transparent 28rem),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 82%);
  opacity: 0.22;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem clamp(1rem, 2vw, 2.5rem);
}

.leaderboard-card {
  width: min(1600px, calc(100vw - 2rem));
  padding: clamp(1.1rem, 2vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: card-enter 500ms ease-out both;
}

.card-header {
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.05;
}

.subtitle {
  max-width: 88ch;
  margin: 0.8rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

code {
  font-family: "Consolas", "Courier New", monospace;
  padding: 0.16rem 0.46rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.92em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.58rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.94rem;
}

.status-pill::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.9;
}

.status-pill.is-loading {
  color: var(--warning);
}

.status-pill.is-ready {
  color: var(--accent);
}

.status-pill.is-error {
  color: var(--danger);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(7, 10, 15, 0.4);
  isolation: isolate;
}

.leaderboard {
  width: max-content;
  min-width: max(100%, 640px);
  border-collapse: separate;
  border-spacing: 0;
}

.leaderboard thead {
  background: rgba(255, 255, 255, 0.03);
}

.leaderboard thead tr:first-child th {
  background: rgba(20, 25, 35, 0.92);
}

.leaderboard th,
.leaderboard td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background-clip: padding-box;
}

.leaderboard th {
  vertical-align: middle;
}

.leaderboard tbody tr {
  transition: background-color 180ms ease;
}

.leaderboard tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.leaderboard tbody tr:last-child td {
  border-bottom: 0;
}

.leaderboard th.model-column-header {
  position: sticky;
  left: 0;
  z-index: 5;
  min-width: 12rem;
  background: var(--panel-strong);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.08),
    18px 0 30px -24px rgba(0, 0, 0, 0.9);
}

.leaderboard td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 12rem;
  background: rgba(16, 20, 28, 0.95);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.06),
    16px 0 28px -24px rgba(0, 0, 0, 0.8);
}

.task-group-header {
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dataset-header {
  background: rgba(17, 22, 29, 0.94);
}

.leaderboard th.task-divider-start,
.leaderboard td.task-divider-start {
  box-shadow:
    inset 1px 0 0 var(--task-divider),
    inset 12px 0 18px -18px rgba(116, 211, 193, 0.55);
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.sort-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.sort-indicator {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.leaderboard th[aria-sort="ascending"] .sort-indicator,
.leaderboard th[aria-sort="descending"] .sort-indicator {
  color: var(--accent);
}

.is-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding: 1rem 0.75rem;
  }

  .leaderboard-card {
    border-radius: 18px;
  }

  .leaderboard th.model-column-header,
  .leaderboard td:first-child {
    min-width: 9.5rem;
  }

  .leaderboard th,
  .leaderboard td {
    padding: 0.85rem 0.9rem;
  }

  .task-group-header {
    font-size: 0.76rem;
    letter-spacing: 0.08em;
  }

  .subtitle {
    font-size: 0.96rem;
  }
}

@media (min-width: 1500px) {
  .leaderboard-card {
    width: min(1800px, calc(100vw - 3rem));
  }
}
