:root {
  --ink: #182334;
  --ink-soft: #526579;
  --brand: #334e6f;
  --brand-deep: #20364f;
  --signal: #15956f;
  --paper: #f5f6f7;
  --surface: #ffffff;
  --line: rgba(31, 45, 62, 0.13);
  --header: #edf3fa;
  --rank-width: 72px;
  --team-width: 220px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(51, 78, 111, 0.08), transparent 30rem),
    var(--paper);
  font-family: Inter, "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.site-nav {
  display: flex;
  width: min(1480px, 100%);
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  color: var(--brand-deep);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.nav-actions { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 650; }

main { width: min(1480px, 100%); margin: 0 auto; padding: 0 28px 64px; }

.leaderboard-hero { padding: 62px 0 30px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--signal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--brand-deep);
  font-size: clamp(42px, 7vw, 74px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero-copy {
  max-width: 850px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: clamp(17px, 2vw, 21px);
}

.leaderboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 24px;
  color: #5a6d81;
  font-size: 13px;
}

.eligibility {
  padding: 6px 10px;
  border: 1px solid rgba(21, 149, 111, 0.22);
  border-radius: 999px;
  color: #0c6c51;
  background: rgba(21, 149, 111, 0.07);
}

.leaderboard-section { padding-top: 12px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h2 { margin: 0; color: var(--brand-deep); font-size: clamp(25px, 3vw, 34px); }
.section-heading p { margin: 5px 0 0; color: var(--ink-soft); font-size: 14px; }

button {
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
}

button:hover { background: var(--brand-deep); }
button:disabled { cursor: wait; opacity: 0.65; }

.leaderboard-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 16px 42px rgba(31, 42, 55, 0.08);
}

.leaderboard-scroll { max-height: min(68vh, 760px); overflow: auto; outline: none; }
.leaderboard-scroll:focus-visible { box-shadow: inset 0 0 0 3px rgba(51, 78, 111, 0.18); }

.leaderboard-table {
  width: 100%;
  min-width: 2200px;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

th,
td {
  height: 54px;
  padding: 11px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  white-space: nowrap;
}

th:last-child,
td:last-child { border-right: 0; }

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  color: #2a4058;
  background: var(--header);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.3;
}

thead tr:first-child th { top: 0; height: 46px; }
thead tr:nth-child(2) th { top: 46px; }

.metric-group {
  color: var(--brand-deep);
  background: #e5edf6;
  font-size: 13px;
  letter-spacing: 0.02em;
}

tbody td { color: #3e5268; font-size: 13px; }
tbody tr:nth-child(even) td { background: #fafbfd; }
tbody tr:hover td { background: #f2f7fb; }

.rank-column {
  left: 0;
  z-index: 8;
  width: var(--rank-width);
  min-width: var(--rank-width);
  font-weight: 800;
}

.team-column {
  left: var(--rank-width);
  z-index: 8;
  width: var(--team-width);
  min-width: var(--team-width);
  max-width: var(--team-width);
  text-align: left;
  box-shadow: 8px 0 14px -14px rgba(18, 35, 54, 0.9);
}

tbody .rank-column,
tbody .team-column { position: sticky; background: #fff; }
tbody tr:nth-child(even) .rank-column,
tbody tr:nth-child(even) .team-column { background: #fafbfd; }
tbody tr:hover .rank-column,
tbody tr:hover .team-column { background: #f2f7fb; }

tbody .team-column {
  overflow: hidden;
  color: var(--brand-deep);
  font-weight: 750;
  text-overflow: ellipsis;
}

.rcs-column { min-width: 112px; color: #0b7557; font-weight: 850; }
tbody .rcs-column { background: rgba(21, 149, 111, 0.055); font-size: 14px; }
.missing-value { color: #9aa6b2; }

.message-row td {
  height: 180px;
  color: var(--ink-soft);
  font-size: 15px;
  text-align: left;
}

.leaderboard-status {
  min-height: 24px;
  margin: 0;
  padding: 11px 16px;
  color: var(--ink-soft);
  font-size: 13px;
}

.leaderboard-status.is-error { color: #b42318; background: #fff7f6; }

footer {
  display: flex;
  width: min(1480px, 100%);
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  margin: 0 auto;
  padding: 30px 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
}

@media (max-width: 720px) {
  :root { --rank-width: 58px; --team-width: 168px; }
  .site-nav, main, footer { padding-right: 18px; padding-left: 18px; }
  .site-nav { align-items: flex-start; padding-top: 13px; padding-bottom: 13px; }
  .nav-actions { align-items: flex-end; flex-direction: column; gap: 2px; }
  .leaderboard-hero { padding-top: 42px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .section-heading button { align-self: flex-start; }
  .leaderboard-shell { border-radius: 13px; }
  th, td { padding-right: 10px; padding-left: 10px; }
}
