:root {
  --bg: #ffffff;
  --fg: #0f0f0f;
  --muted: #5a5a5a;
  --faint: #e2e2e2;
  --accent: #e5430a;
  --tag-bg: #f6f6f6;
  --confirmed: #16a34a;
  --sponsored: #2563eb;
  --unknown: #d97706;
  --col-width: 680px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
}

/* ─── layout ─────────────────────────────────────────────── */
.wrap {
  max-width: var(--col-width);
  margin: 0 auto;
  padding: 64px 24px 120px;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* ─── header ─────────────────────────────────────────────── */
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 12px;
  margin-bottom: 40px;
}

.wordmark {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.wordmark span {
  color: var(--muted);
  font-weight: 300;
}

.updated {
  color: var(--muted);
  font-size: 13px;
}

/* ─── sport tabs ─────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--faint);
}

.tab {
  padding: 8px 16px 8px 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: lowercase;
  position: relative;
}

.tab.active {
  color: var(--fg);
  font-weight: 500;
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 16px;
  height: 2px;
  background: var(--accent);
}

.tab:hover { color: var(--fg); }

/* ─── section headings ────────────────────────────────────── */
.section-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ─── brand bars ─────────────────────────────────────────── */
.brands {
  margin-bottom: 56px;
}

.brand-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--faint);
}

.brand-row:last-child { border-bottom: 1px solid var(--faint); }

.brand-name {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.bar-track {
  height: 2px;
  background: var(--faint);
  position: relative;
}

.bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.6s ease;
}

.brand-count {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

/* ─── athlete table ───────────────────────────────────────── */
.athletes { margin-bottom: 48px; }

.table-head {
  display: grid;
  grid-template-columns: 32px 1fr 44px 1fr 90px;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--fg);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.athlete-row {
  display: grid;
  grid-template-columns: 32px 1fr 44px 1fr 90px;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--faint);
  align-items: baseline;
  transition: background 0.1s;
}

.athlete-row:hover {
  background: var(--tag-bg);
}

.rank {
  color: var(--muted);
  font-size: 12px;
}

.name { font-weight: 400; font-size: 13px; }

.flag {
  font-size: 11px;
  color: var(--muted);
}

.watch-brand {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.watch-unknown {
  color: var(--muted);
  font-style: italic;
}

.conf {
  font-size: 11px;
  letter-spacing: 0.03em;
}

.conf-sponsored { color: var(--sponsored); }
.conf-confirmed { color: var(--confirmed); }
.conf-unknown   { color: var(--unknown); }

a.conf {
  text-decoration: none;
  cursor: pointer;
}
a.conf:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ─── load more ──────────────────────────────────────────── */
.load-more {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: -1px;
  background: none;
  border: 1px solid var(--faint);
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.08em;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, color 0.15s;
}

.load-more:hover {
  border-color: var(--fg);
  color: var(--fg);
}

/* ─── footnotes ──────────────────────────────────────────── */
.footnotes {
  border-top: 1px solid var(--faint);
  padding-top: 24px;
  margin-top: 56px;
  font-size: 13px;
  color: var(--muted);
  line-height: 2;
}

.footnotes p + p { margin-top: 4px; }

.fn-key {
  display: inline-block;
  width: 90px;
}

.fn-link {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ─── gender toggle ──────────────────────────────────────── */
.gender-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  align-items: baseline;
}

.gender-btn {
  padding: 4px 12px 4px 0;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-transform: lowercase;
  position: relative;
}

.gender-btn.active {
  color: var(--fg);
  font-weight: 500;
}

.gender-btn.coming-soon {
  cursor: default;
}

.coming-soon-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
  margin-left: 4px;
  vertical-align: middle;
  text-transform: lowercase;
}

/* ─── history chart ──────────────────────────────────────── */
.history {
  margin-bottom: 56px;
}

.chart-wrap {
  position: relative;
  border-left: 1px solid var(--faint);
  border-bottom: 1px solid var(--faint);
  height: 140px;
  margin-bottom: 8px;
}

.chart-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--faint) 1px, transparent 1px);
  background-size: 100% 35px;
  background-position: 0 0;
  pointer-events: none;
}

svg.chart {
  width: 100%;
  height: 140px;
  overflow: visible;
}

.chart-x-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.chart-legend {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
}

.legend-dot {
  width: 8px;
  height: 2px;
  flex-shrink: 0;
}

/* ─── footer ─────────────────────────────────────────────── */
footer {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--fg);
  display: flex;
  align-items: baseline;
  font-size: 13px;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover { color: var(--fg); }

footer a.active { color: var(--fg); }

.footer-byline-link { margin-left: 0; }

.footer-nav { margin-left: auto; white-space: nowrap; }

.footer-nav a { margin-left: 16px; }

.footer-gh { display: inline-flex; align-items: center; vertical-align: middle; transform: translateY(-2px); }

/* ─── footer panels ──────────────────────────────────────── */
.footer-panel {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}

.footer-panel p + p { margin-top: 6px; }

@media (max-width: 520px) {
  footer { flex-direction: column; gap: 10px; }
  .footer-nav { margin-left: 0; }
  .footer-nav a:first-child { margin-left: 0; }
}
