@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  color-scheme: dark;
  --ink: #f8f8f4;
  --muted: #a9ada9;
  --dim: #747a75;
  --bg: #0b0c0b;
  --panel: rgba(24, 26, 24, .91);
  --line: rgba(255,255,255,.105);
  --orange: #ff5a30;
  --lime: #d8ff3e;
  --cyan: #62e6ff;
  --violet: #b9a0ff;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0,0,0,.26);
}

* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(216,255,62,.07), transparent 28rem),
    radial-gradient(circle at 85% 32%, rgba(255,90,48,.11), transparent 34rem),
    linear-gradient(180deg, #0b0c0b 0%, #111411 52%, #0b0c0b 100%);
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, canvas:focus-visible {
  outline: 3px solid rgba(216,255,62,.82);
  outline-offset: 3px;
}

.ambient { position: fixed; border-radius: 50%; filter: blur(110px); opacity: .13; pointer-events: none; z-index: -1; }
.ambient-one { width: 27rem; height: 27rem; background: var(--orange); right: -13rem; top: 23rem; }
.ambient-two { width: 24rem; height: 24rem; background: #8ba830; left: -13rem; top: 75rem; }

.topbar {
  max-width: 1480px; min-height: 86px; margin: 0 auto; padding: 18px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 22px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: 14px; color: #171817; background: var(--lime);
  font: 800 15px/1 Manrope, sans-serif; letter-spacing: -.04em;
  transform: rotate(-4deg); box-shadow: 0 8px 25px rgba(216,255,62,.16);
}
.brand strong, .brand small { display: block; }
.brand strong { font: 800 16px/1.2 Manrope, sans-serif; letter-spacing: -.02em; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap; }
.topnav a:hover { color: var(--ink); }

main { max-width: 1480px; margin: 0 auto; padding: 0 28px 44px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(15px); }
.section-kicker, .eyebrow { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.section-kicker { margin: 0 0 5px; }
.hero { max-width: 1040px; margin: 0 auto; padding: 80px 0 54px; text-align: center; }
.eyebrow { display: flex; justify-content: center; align-items: center; gap: 9px; }
.eyebrow span { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 18px var(--lime); }
.hero h1 { margin: 17px 0 15px; font: 800 clamp(43px, 7vw, 82px)/.99 Manrope, sans-serif; letter-spacing: -.065em; }
.hero h1 em { color: var(--lime); font-style: normal; }
.hero p { max-width: 780px; margin: 0 auto; color: var(--muted); font-size: clamp(16px,2vw,20px); line-height: 1.55; }

.finder-card { padding: 24px; display: grid; grid-template-columns: minmax(250px,.8fr) minmax(340px,1.2fr); align-items: center; gap: 28px; }
.finder-copy h2, .leaderboard-heading h2, .selected-card h2, .graph-head h2, .method h2 { margin: 0; font: 800 25px/1.15 Manrope, sans-serif; letter-spacing: -.04em; }
.finder-copy > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.search-area { position: relative; z-index: 10; }
.runner-search { min-height: 62px; display: flex; align-items: center; gap: 13px; padding: 0 17px; border-radius: 18px; color: #171817; background: #f6f7ef; box-shadow: 0 17px 40px rgba(0,0,0,.25); }
.runner-search svg { width: 23px; flex: 0 0 auto; fill: none; stroke: #262826; stroke-width: 2; stroke-linecap: round; }
.runner-search input { flex: 1; border: 0; outline: 0; background: transparent; color: #171817; font-size: 17px; }
.runner-search input::placeholder { color: #777c76; }
kbd { padding: 5px 9px; border-radius: 8px; background: #e1e4d8; color: #656a63; font: 700 12px/1 monospace; }
.search-results { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; right: 0; padding: 7px; max-height: 340px; overflow-y: auto; background: #202320; border: 1px solid rgba(255,255,255,.15); border-radius: 16px; box-shadow: 0 26px 70px rgba(0,0,0,.5); }
.search-result { width: 100%; padding: 10px; display: grid; grid-template-columns: 50px minmax(0,1fr) auto; align-items: center; gap: 10px; border: 0; border-radius: 11px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.search-result:hover, .search-result:focus-visible { background: rgba(255,255,255,.075); }
.search-bib { min-height: 32px; display: grid; place-items: center; border-radius: 8px; background: #f4f5ee; color: #191b19; font: 800 12px/1 Manrope, sans-serif; }
.search-result strong, .search-result small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result strong { font-size: 13px; }
.search-result small { margin-top: 3px; color: var(--dim); font-size: 10px; }
.search-result > em { color: var(--muted); font-size: 11px; font-style: normal; white-space: nowrap; }
.empty-results { padding: 25px 12px; color: var(--muted); text-align: center; font-size: 13px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.leaderboard-card { margin-top: 18px; padding: 25px; overflow: hidden; }
.leaderboard-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.leaderboard-heading h2 { font-size: clamp(30px,4vw,46px); }
.leaderboard-heading > div:first-child > p:last-child { max-width: 780px; margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.leaderboard-key { flex: 0 0 auto; min-width: 185px; padding: 13px 15px; border: 1px solid rgba(216,255,62,.24); border-radius: 14px; background: rgba(216,255,62,.06); }
.leaderboard-key span, .leaderboard-key strong { display: block; }
.leaderboard-key span { color: var(--dim); font-size: 9px; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.leaderboard-key strong { margin-top: 4px; color: var(--lime); font: 800 14px/1.2 Manrope, sans-serif; }
.leader-podium { margin: 22px 0 18px; display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.podium-place { min-height: 94px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: rgba(255,255,255,.035); text-align: left; cursor: pointer; }
.podium-place:hover { background: rgba(255,255,255,.07); }
.podium-place.place-1 { border-color: rgba(216,255,62,.34); background: linear-gradient(135deg,rgba(216,255,62,.12),rgba(255,255,255,.025)); }
.podium-place[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--cyan); }
.podium-rank { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #151715; background: var(--lime); font: 800 14px/1 Manrope,sans-serif; transform: rotate(-3deg); }
.place-2 .podium-rank, .place-3 .podium-rank { color: var(--ink); background: rgba(255,255,255,.12); }
.podium-identity strong, .podium-identity small, .podium-total small { display: block; }
.podium-identity strong { overflow: hidden; font: 800 14px/1.2 Manrope,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.podium-identity small { margin-top: 4px; overflow: hidden; color: var(--dim); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.podium-total { text-align: right; }
.podium-total strong { display: block; color: var(--lime); font: 800 25px/1 Manrope,sans-serif; }
.podium-total small { margin-top: 3px; color: var(--dim); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.leaderboard-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.12); }
.leaderboard-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 12px; }
.leaderboard-table th, .leaderboard-table td { padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: right; white-space: nowrap; }
.leaderboard-table thead th { position: sticky; top: 0; z-index: 1; color: var(--dim); background: #171a17; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.leaderboard-table th:nth-child(2), .leaderboard-table td:nth-child(2) { text-align: left; }
.leaderboard-table tbody tr:last-child > * { border-bottom: 0; }
.leaderboard-table tbody tr:hover { background: rgba(255,255,255,.035); }
.leaderboard-table tbody tr[data-selected] { background: rgba(98,230,255,.075); box-shadow: inset 3px 0 0 var(--cyan); }
.leaderboard-rank { color: var(--muted); font: 800 12px/1 Manrope,sans-serif; }
.leaderboard-runner-button { width: 100%; padding: 0; border: 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.leaderboard-runner-button strong, .leaderboard-runner-button small { display: block; }
.leaderboard-runner-button strong { font: 800 12px/1.2 Manrope,sans-serif; }
.leaderboard-runner-button small { margin-top: 3px; color: var(--dim); font-size: 9px; }
.leaderboard-primary { color: var(--lime); font: 800 16px/1 Manrope,sans-serif; }
.positive-number { color: var(--cyan); }
.negative-number { color: var(--orange); }
.leaderboard-footer { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 2px 0; }
.leaderboard-footer p { margin: 0; color: var(--dim); font-size: 11px; }
.leaderboard-toggle { padding: 9px 13px; border: 1px solid rgba(216,255,62,.3); border-radius: 11px; color: var(--lime); background: rgba(216,255,62,.07); font-size: 11px; font-weight: 800; cursor: pointer; }
.leaderboard-toggle:hover { background: rgba(216,255,62,.13); }

.selected-card { margin-top: 18px; padding: 25px; display: grid; grid-template-columns: minmax(250px,.85fr) minmax(480px,1.5fr); gap: 24px; align-items: center; position: relative; overflow: hidden; }
.selected-card::after { content: ''; position: absolute; width: 220px; height: 220px; top: -120px; right: -80px; border-radius: 50%; background: var(--lime); filter: blur(100px); opacity: .08; pointer-events: none; }
.selected-identity { display: flex; align-items: center; gap: 17px; position: relative; z-index: 1; }
.bib-badge { width: 84px; height: 70px; flex: 0 0 auto; display: grid; place-content: center; text-align: center; border-radius: 14px; background: #f5f6ef; color: #171817; transform: rotate(-2deg); box-shadow: 0 10px 25px rgba(0,0,0,.25); }
.bib-badge span { color: #777c75; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.bib-badge strong { font: 800 26px/1 Manrope, sans-serif; }
.selected-identity h2 { font-size: clamp(25px,3vw,38px); overflow-wrap: anywhere; }
.selected-identity #selectedMeta { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.movement-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; position: relative; z-index: 1; }
.stat { min-height: 112px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.035); }
.stat span, .stat small { display: block; }
.stat span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.stat strong { display: block; margin: 5px 0 4px; font: 800 clamp(27px,3vw,40px)/1 Manrope, sans-serif; letter-spacing: -.05em; }
.stat small { color: var(--dim); font-size: 10px; line-height: 1.35; }
.stat.positive strong { color: var(--lime); }
.stat.negative strong { color: var(--orange); }
.stat.net strong { color: var(--cyan); }
.position-strip { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 88px 1fr 1fr; gap: 10px; align-items: stretch; padding-top: 18px; border-top: 1px solid var(--line); }
.position-strip > div { padding: 13px 15px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.07); }
.position-strip span, .position-strip small { display: block; }
.position-strip span { color: var(--dim); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.position-strip strong { display: block; margin: 4px 0 2px; font: 800 21px/1.1 Manrope, sans-serif; }
.position-strip small { color: var(--muted); font-size: 11px; }
.position-strip > svg { width: 70px; align-self: center; justify-self: center; fill: none; stroke: var(--cyan); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.position-strip .official-rank { border-color: rgba(185,160,255,.2); background: rgba(185,160,255,.06); }
.position-strip .official-rank strong { color: var(--violet); }

.graph-card { margin-top: 18px; padding: 25px; }
.graph-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.graph-head h2 { font-size: clamp(28px,4vw,44px); }
.graph-head p:last-child { max-width: 740px; margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.focus-toggle { flex: 0 0 auto; min-width: 175px; display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.045); color: var(--ink); text-align: left; cursor: pointer; }
.focus-toggle:hover { background: rgba(255,255,255,.08); }
.focus-toggle[aria-pressed="true"] { border-color: rgba(216,255,62,.35); background: rgba(216,255,62,.08); }
.focus-dot { width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%; background: var(--lime); box-shadow: 0 0 13px rgba(216,255,62,.65); }
.focus-toggle small, .focus-toggle strong { display: block; }
.focus-toggle small { color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.focus-toggle strong { margin-top: 2px; font-size: 12px; }
.legend { margin: 18px 0 13px; display: flex; flex-wrap: wrap; gap: 8px 17px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend-line { width: 27px; height: 3px; border-radius: 99px; background: #788079; }
.legend-line.overtook { background: var(--lime); }
.legend-line.passer { background: var(--orange); }
.legend-line.selected { height: 5px; background: var(--ink); box-shadow: 0 0 0 1px var(--lime); }
.canvas-shell { width: 100%; height: clamp(580px,70vh,780px); position: relative; overflow: hidden; border-radius: 19px; background: #080a08; border: 1px solid rgba(255,255,255,.1); isolation: isolate; }
#movementCanvas { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: crosshair; }
.canvas-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: #080a08; font-size: 13px; z-index: 2; }
.canvas-tooltip { position: absolute; z-index: 3; width: min(280px,calc(100% - 20px)); padding: 11px 12px; pointer-events: none; border: 1px solid rgba(255,255,255,.17); border-radius: 12px; background: rgba(23,26,23,.97); box-shadow: 0 15px 40px rgba(0,0,0,.42); color: var(--ink); }
.canvas-tooltip strong, .canvas-tooltip span, .canvas-tooltip small { display: block; }
.canvas-tooltip strong { font: 800 13px/1.2 Manrope, sans-serif; }
.canvas-tooltip span { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.canvas-tooltip small { margin-top: 6px; color: var(--dim); font-size: 9px; }
.canvas-help { margin: 10px 2px 0; color: var(--dim); font-size: 11px; }

.method { margin-top: 18px; padding: 28px; display: grid; grid-template-columns: minmax(240px,.7fr) minmax(420px,1.3fr); gap: 24px 50px; align-items: start; }
.method-copy p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.method-copy p:last-child { margin-bottom: 0; }
.method-copy strong { color: var(--ink); }
.method-facts { grid-column: 1 / -1; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 9px; border-top: 1px solid var(--line); }
.method-facts span { padding: 9px 12px; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.04); font-size: 11px; }
.method-facts strong { color: var(--ink); margin-right: 4px; }

footer { max-width: 1480px; margin: 0 auto; padding: 24px 28px 38px; display: flex; justify-content: space-between; gap: 20px; color: var(--dim); font-size: 11px; border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .finder-card, .selected-card, .method { grid-template-columns: 1fr; }
  .leader-podium { grid-template-columns: 1fr; }
  .position-strip { grid-column: auto; grid-template-columns: 1fr 64px 1fr; }
  .position-strip .official-rank { grid-column: 1 / -1; }
  .method-facts { grid-column: auto; }
}

@media (max-width: 620px) {
  .topbar { min-height: 70px; padding: 12px 15px; align-items: flex-start; }
  .brand-mark { width: 40px; height: 40px; }
  .brand small { display: none; }
  .topnav { gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
  .topnav a { font-size: 10px; }
  .topnav a:nth-child(2) { display: none; }
  main { padding: 0 12px 28px; }
  .hero { padding: 48px 4px 36px; }
  .hero h1 { font-size: 45px; }
  .hero p { font-size: 15px; }
  .card { border-radius: 19px; }
  .finder-card, .leaderboard-card, .selected-card, .graph-card, .method { padding: 17px; }
  .finder-card { gap: 18px; }
  .runner-search { min-height: 58px; padding: 0 14px; }
  .runner-search input { font-size: 15px; }
  kbd { display: none; }
  .search-results { position: static; margin-top: 7px; max-height: 285px; }
  .leaderboard-heading { display: grid; gap: 15px; }
  .leaderboard-heading h2 { font-size: 31px; }
  .leaderboard-key { min-width: 0; }
  .leader-podium { margin-top: 17px; }
  .podium-place { min-height: 80px; }
  .leaderboard-table { min-width: 0; table-layout: fixed; }
  .leaderboard-table th, .leaderboard-table td { padding: 10px 8px; }
  .leaderboard-table th:first-child { width: 58px; }
  .leaderboard-table th:nth-child(3) { width: 82px; }
  .leaderboard-table th:nth-child(n+4), .leaderboard-table td:nth-child(n+4) { display: none; }
  .leaderboard-runner-button strong, .leaderboard-runner-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .leaderboard-primary { font-size: 15px; }
  .leaderboard-footer { align-items: flex-start; flex-direction: column; }
  .leaderboard-toggle { width: 100%; min-height: 43px; }
  .selected-card { gap: 18px; }
  .bib-badge { width: 68px; height: 58px; }
  .bib-badge strong { font-size: 21px; }
  .selected-identity { gap: 12px; }
  .selected-identity h2 { font-size: 25px; }
  .movement-stats { grid-template-columns: repeat(2,1fr); }
  .stat.net { grid-column: 1 / -1; min-height: 94px; }
  .stat { min-height: 108px; padding: 13px; }
  .stat strong { font-size: 31px; }
  .position-strip { grid-template-columns: 1fr 42px 1fr; gap: 6px; padding-top: 14px; }
  .position-strip > div { padding: 11px; }
  .position-strip > svg { width: 38px; }
  .position-strip strong { font-size: 17px; }
  .position-strip span { font-size: 8px; }
  .graph-head { display: grid; }
  .graph-head h2 { font-size: 31px; }
  .focus-toggle { width: 100%; min-width: 0; }
  .legend { gap: 8px 12px; }
  .legend span { flex-basis: calc(50% - 8px); font-size: 9px; }
  .legend-line { width: 20px; }
  .canvas-shell { height: 650px; border-radius: 15px; }
  .canvas-help { line-height: 1.45; }
  .method { gap: 18px; }
  .method h2 { font-size: 24px; }
  footer { padding: 20px 16px 30px; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
