:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101114;
  color: #f0f0f2;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --page: #101114;
  --panel: #17181d;
  --panel-hover: #1c1e24;
  --border: #2b2d35;
  --muted: #9295a1;
  --text: #f0f0f2;
  --accent: #a7c5ff;
  --accent-bg: #26354c;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--page); }
button, select { font: inherit; }
button:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
.app-shell { width: min(900px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 3px 0 26px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 21px; font-weight: 720; letter-spacing: -0.65px; }
.brand-mark { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #3a3e49; border-radius: 9px; color: var(--accent); background: #1b202a; }
.brand-mark svg { width: 21px; height: 21px; }
.header-note { color: var(--muted); font-size: 13px; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 24px 0 28px; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.segment { border: 0; border-radius: 7px; padding: 9px 12px; background: transparent; color: #a9abb5; cursor: pointer; font-size: 13px; font-weight: 550; transition: background .15s ease, color .15s ease; }
.segment:hover { color: var(--text); }
.segment.is-active { color: #eaf1ff; background: var(--accent-bg); box-shadow: inset 0 0 0 1px #3b4c68; }
.limit-select-wrap { position: relative; flex: 0 0 auto; }
.limit-select { appearance: none; min-width: 124px; padding: 11px 35px 11px 13px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--panel); cursor: pointer; font-size: 13px; }
.limit-select-wrap svg { position: absolute; width: 15px; height: 15px; top: 50%; right: 12px; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.leaderboard { overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: var(--panel); }
.list-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 17px; }
.list-heading h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.25px; }
.entry-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.table-head, .ranking-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 100px; align-items: center; gap: 12px; }
.table-head { padding: 11px 22px; color: var(--muted); background: #141519; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 650; letter-spacing: .055em; text-transform: uppercase; }
.score-heading { text-align: right; }
.ranking-row { min-height: 65px; padding: 12px 22px; border-bottom: 1px solid #282a31; transition: background .12s ease; }
.ranking-row:last-child { border-bottom: 0; }
.ranking-row:hover { background: var(--panel-hover); }
.rank-number { color: #9b9eaa; font-size: 13px; font-variant-numeric: tabular-nums; }
.rank-number.top-rank { color: var(--accent); font-weight: 700; }
.calculator-name { min-width: 0; overflow-wrap: anywhere; color: var(--text); font-size: 14px; font-weight: 560; }
.calculator-type { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 450; }
.calculator-score { text-align: right; color: #f3f4f7; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.empty-state, .loading-state { padding: 38px 20px; color: var(--muted); text-align: center; font-size: 13px; }
.error-message { margin: 0; padding: 16px 22px; color: #ffb4b4; border-top: 1px solid var(--border); font-size: 13px; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 2px 0; color: var(--muted); font-size: 11px; }
.footer a { color: #bfc1ca; }
.footer a:hover { color: var(--text); }
.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; }
@media (max-width: 620px) {
  .app-shell { width: min(100% - 24px, 900px); padding-top: 18px; }
  .topbar { padding-bottom: 19px; }
  .header-note { font-size: 11px; }
  .controls { align-items: stretch; flex-direction: column; margin: 17px 0 20px; }
  .segmented { display: grid; grid-template-columns: 1fr 1fr; }
  .segment:last-child { grid-column: 1 / -1; }
  .limit-select-wrap, .limit-select { width: 100%; }
  .table-head, .ranking-row { grid-template-columns: 45px minmax(0, 1fr) 72px; gap: 8px; }
  .table-head { padding: 10px 13px; }
  .ranking-row { padding: 12px 13px; min-height: 62px; }
  .list-heading { padding: 17px 14px 14px; }
  .calculator-name { font-size: 13px; }
  .calculator-score { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }