@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/fonts/atkinson-hyperlegible-next.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #141210;
  --panel: #1c1a17;
  --panel-2: #26231f;
  --line: #2c2824;
  --line-2: #3a352f;
  --ink: #f1ece6;
  --ink-2: #e6dfd6;
  --ink-3: #c2b8ad;
  --gold: #e0b04a;
  --gold-ink: #141210;
  --bad: #e5806b;
  --good: #9cc27a;
  --dark-top: #5a534b;
  --dark-bottom: #221f1b;
  --display: "Pixelify Sans", ui-monospace, monospace;
  --body: "Atkinson Hyperlegible Next", system-ui, "Segoe UI", sans-serif;
  --bevel: inset 0 2px 0 var(--dark-top), inset 0 -3px 0 var(--dark-bottom);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { image-rendering: pixelated; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.15; }
h1 { font: 700 36px/1 var(--display); }
h2 { font: 500 22px/1.1 var(--display); margin-top: 8px; }
h3 { font-size: 14px; font-weight: 700; color: var(--ink-2); }
p { margin: 0 0 12px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--panel-2); padding: 1px 5px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px;
  min-height: 60px; padding: 10px 24px;
  background: var(--panel);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.brand img { width: 36px; height: 36px; image-rendering: auto; border-radius: 50%; }
.brand span { font: 700 20px/1 var(--display); }
.top-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.top-links a { font-weight: 600; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.top-links a:hover { border-bottom-color: var(--line-2); }
.top-links a.active { border-bottom-color: var(--gold); }

.main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 24px 40px; }
.footer { padding: 18px 24px; color: var(--ink-3); font-size: 13px; border-top: 2px solid var(--line); }
.footer p { max-width: 1120px; margin: 0 auto; }
.loading, .empty { color: var(--ink-3); padding: 24px 0; }
.error-box { color: var(--bad); padding: 16px 0; }

.intro { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; margin-bottom: 32px; align-items: start; }
.intro h1 { margin-bottom: 14px; }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; }

.block { margin-bottom: 36px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.block-head h2 { margin: 0; }

.panel { background: var(--panel); box-shadow: var(--bevel); padding: 18px 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }

.bar { height: 10px; background: var(--panel-2); margin: 8px 0 6px; }
.bar > span { display: block; height: 100%; background: var(--gold); }

.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; margin-left: 6px; background: var(--panel-2); color: var(--ink-2); white-space: nowrap; }
.tag.gold { background: var(--gold); color: var(--gold-ink); }
.up { color: var(--good); }
.down { color: var(--bad); }

.controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 14px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-3); }
input, select, button { font: inherit; color: var(--ink); background: var(--panel-2); border: 2px solid var(--line-2); padding: 7px 10px; border-radius: 0; }
input:focus, select:focus { border-color: var(--ink-3); outline: none; }
input[type="search"] { min-width: 220px; }
button { cursor: pointer; font-weight: 600; }
button:hover { border-color: var(--ink-3); }
button.link { background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 700; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
th button { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; font-weight: inherit; }
th button[aria-sort="ascending"]::after { content: " \2191"; }
th button[aria-sort="descending"]::after { content: " \2193"; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--panel); }
.who { display: inline-flex; align-items: center; gap: 8px; }
.who img { width: 22px; height: 22px; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; color: var(--ink-3); font-size: 13px; }

.tabs { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 14px; border-bottom: 2px solid var(--line); }
.tabs button { background: none; border: 0; padding: 8px 0; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs button[aria-selected="true"] { border-bottom-color: var(--gold); }

.chart-box { position: relative; background: var(--panel); box-shadow: var(--bevel); padding: 14px 14px 8px; }
.chart-box svg { display: block; width: 100%; height: 260px; overflow: visible; }
.chart-box .grid { stroke: var(--line); stroke-width: 1; }
.chart-box .axis { fill: var(--ink-3); font-size: 12px; font-family: var(--body); }
.chart-box .line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .cross { stroke: var(--ink-3); stroke-width: 1; }
.chart-box .dot { fill: var(--gold); stroke: var(--panel); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--panel-2); box-shadow: var(--bevel); padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.tip b { display: block; }

.profile-head { display: flex; gap: 20px; align-items: center; margin-bottom: 26px; flex-wrap: wrap; }
.profile-head img { width: 96px; height: 96px; }
.profile-head h1 { margin-bottom: 6px; }
.stat-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 36px; margin-bottom: 30px; }
.stat-groups h3 { margin: 14px 0 6px; }
.stat-groups dl { margin: 0; display: grid; grid-template-columns: 1fr max-content; gap: 4px 12px; }
.stat-groups dt { color: var(--ink-3); }
.stat-groups dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 2px 28px; }
.badges li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.badges li.locked { color: var(--ink-3); }
.badges strong { font: 500 17px/1.2 var(--display); display: block; }
.badges li.locked strong { color: var(--ink-3); }
.badges li:not(.locked) strong { color: var(--gold); }

.results { list-style: none; margin: 0; padding: 0; }
.results li { padding: 6px 0; }

@media (max-width: 760px) {
  .topbar { padding: 10px 16px; }
  .main { padding: 20px 16px 32px; }
  .intro, .split { grid-template-columns: 1fr; gap: 20px; }
  h1 { font-size: 30px; }
  input[type="search"] { min-width: 0; width: 100%; }
  .controls label { flex: 1 1 140px; }
  .chart-box svg { height: 200px; }
}
