main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* ---- hero content specific to the leaderboard page (shared hero-band chrome lives in theme.css) ---- */

.hero-band h1 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--hero-ink);
  font-size: clamp(2.75rem, 6vw + 1rem, 4.75rem);
  line-height: 0.98;
  letter-spacing: 0.005em;
  margin: 0 0 18px;
}

.hero-sub {
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--hero-ink-soft);
  max-width: 52ch;
  margin: 0 0 36px;
}

.hero-stats {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  color: var(--hero-gold);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hero-ink-soft);
  max-width: 16ch;
}

/* ---- board ---- */

.board {
  padding: 48px 0 40px;
}

.board h2, .methodology h2 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 20px;
  color: var(--pitch);
}

.leaderboard {
  display: flex;
  flex-direction: column;
}

.row {
  display: grid;
  grid-template-columns: 30px 160px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
  margin-bottom: 2px;
  border-radius: 6px;
}

.row:hover {
  background: var(--accent-wash);
}

.row-rank {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.row-rank.medal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-weight: 700;
  color: #241a02;
}

.row-rank.medal[data-rank="1"] { background: var(--gold-1); }
.row-rank.medal[data-rank="2"] { background: var(--silver-1); }
.row-rank.medal[data-rank="3"] { background: var(--bronze-1); }

.row-team {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-bar-track {
  height: 8px;
  background: var(--baseline);
  border-radius: 4px;
  display: flex;
  align-items: center;
  opacity: 0.5;
}

.row-bar {
  height: 8px;
  background: var(--accent);
  border-radius: 4px;
  min-width: 3px;
}

.row-value {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-align: right;
}

.row.hidden {
  display: none;
}

.board-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toggle-all {
  margin-top: 20px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.toggle-all:hover {
  background: var(--accent-wash);
  border-color: var(--accent);
}

.toggle-all:active {
  transform: scale(0.98);
}

.toggle-all:focus-visible, .row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle-all:disabled {
  opacity: 0.6;
  cursor: wait;
}

.resimulate-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 10px 0 0;
}

/* ---- methodology ---- */

.methodology {
  padding: 40px 0 0;
  border-top: 1px solid var(--gridline);
}

.methodology ol {
  padding-left: 20px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.methodology li {
  margin-bottom: 10px;
}

.methodology li strong {
  color: var(--text-primary);
}

.caveat {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gridline);
}

.caveat a {
  color: var(--text-secondary);
}

@media (max-width: 520px) {
  .hero-stats { gap: 20px; }
  .row { grid-template-columns: 24px 92px minmax(0, 1fr) 46px; gap: 8px; }
  .row-team { font-size: 0.8125rem; }
}
