:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --surface: #121212;
  --raised: #1b1b1a;
  --text: #ececea;
  --text-2: #b9b8b1;
  --muted: #8d8c86;
  --grid: #2a2a28;
  --axis: #3a3a37;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --good: #0ca30c;
  --bad: #e66767;
  --font: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body:not(.bare) { display: grid; grid-template-columns: 180px minmax(0, 1fr); min-height: 100vh; }

a { color: var(--text); text-underline-offset: 3px; text-decoration-color: var(--axis); }
a:hover { text-decoration-color: var(--text); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 20px; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 28px 0 8px; }
section { margin-top: 44px; }
p { margin: 0 0 12px; }
.dim, .conf { color: var(--muted); }
.conf { font-size: 14px; max-width: 75ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.side { position: sticky; top: 0; align-self: start; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px; background: var(--surface); }
.brand { font-size: 18px; font-weight: 600; text-decoration: none; padding: 0 8px; margin-bottom: 24px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { padding: 7px 8px; text-decoration: none; color: var(--text-2); }
.side nav a:hover { color: var(--text); background: var(--raised); }
.side nav a.on { color: var(--text); background: var(--raised); font-weight: 600; }
.who { margin-top: auto; padding: 0 8px; color: var(--muted); font-size: 14px; }
.who form { margin-top: 2px; }

.main { padding: 24px 32px 80px; min-width: 0; max-width: 1240px; width: 100%; }

input, select, button { font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--axis); padding: 8px 12px; border-radius: 2px; min-height: 40px; }
input::placeholder { color: var(--muted); }
button { cursor: pointer; }
button:hover { background: var(--grid); }
button.primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
button.primary:hover { background: #fff; }
button.link { background: none; border: 0; padding: 0; min-height: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--axis); }

.find { display: flex; gap: 8px; margin-bottom: 28px; max-width: 620px; }
.find input { flex: 1; min-width: 0; }

.flash { padding: 10px 14px; background: var(--raised); max-width: 75ch; }
.flash.bad { box-shadow: inset 3px 0 0 var(--bad); }
.flash.good { box-shadow: inset 3px 0 0 var(--good); }

.hero { margin: 8px 0 12px; }
.hero-n { font-size: 56px; line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
.hero-l { color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 24px 28px; margin: 24px 0 0; }
.tiles dt { color: var(--muted); font-size: 14px; }
.tiles dd { margin: 2px 0 0; font-size: 24px; font-weight: 600; }
.tiles dd.sub { font-size: 13px; font-weight: 400; color: var(--muted); }

.scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--grid); white-space: nowrap; }
table.data thead th { color: var(--muted); font-weight: 400; }
table.data tbody th { font-weight: 400; color: var(--text-2); }
table.data .r { text-align: right; font-variant-numeric: tabular-nums; }
table.data th:first-child, table.data td:first-child { padding-left: 0; }
table.data th:last-child, table.data td:last-child { padding-right: 0; }
table.data tbody tr:hover { background: var(--surface); }
.game a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.game a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.game img { border-radius: 2px; background: var(--raised); flex: none; }
.game span { display: inline-block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.tag { margin-left: 8px; font-size: 12px; color: var(--muted); vertical-align: 10px; }
.tiles + .scroll { margin-top: 36px; }
.spark { display: block; }
.spark polyline { fill: none; stroke: var(--series-1); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }

.seg { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 20px; }
.seg a { padding: 6px 12px; text-decoration: none; color: var(--text-2); background: var(--surface); font-size: 14px; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--text); color: var(--bg); font-weight: 600; }
.seg-gap { width: 16px; }

.ghead { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 24px; }
.ghead img { border-radius: 2px; background: var(--raised); }
.ghead-t { flex: 1; min-width: 240px; }
.ghead h1 { margin: 0 0 4px; overflow-wrap: anywhere; }
.ghead p { margin: 0; font-size: 14px; }
.ghead-a { display: flex; gap: 8px; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.cols section h2:not(:first-child) { margin-top: 32px; }

.facts { margin: 14px 0; font-size: 14px; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.empty { color: var(--muted); }
.code { background: var(--surface); padding: 12px 14px; overflow-x: auto; font-size: 13px; margin: 0 0 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px 20px; max-width: 840px; margin-bottom: 12px; }
.grid label, .stack label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--text-2); }
.grid-end { display: flex; align-items: flex-end; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row select { max-width: 100%; }

.picker fieldset { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 20px; }
.picker legend { color: var(--muted); padding: 0; margin-bottom: 8px; }
.picker label { display: flex; align-items: center; gap: 8px; min-height: 28px; overflow: hidden; }
.picker input { min-height: 0; flex: none; }
.picker { margin-bottom: 28px; }

.gate { max-width: 340px; margin: 14vh auto 0; padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.chart text { fill: var(--muted); font: 12px var(--font); font-variant-numeric: tabular-nums; }
.chart .label { fill: var(--text-2); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .event { stroke: var(--muted); stroke-width: 1; }
.chart .event-dot { fill: var(--text-2); stroke: var(--bg); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .dot { stroke: var(--bg); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .bar { fill: var(--series-1); }
.chart .slot:hover .bar { fill: #6da7ec; }
.chart .cell:hover { stroke: var(--text); stroke-width: 1.5; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 13px; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend i { display: inline-block; width: 14px; height: 2px; }
.scale { display: flex; align-items: center; gap: 3px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.scale i { display: inline-block; width: 22px; height: 10px; }
.scale span:first-child { margin-right: 6px; }
.scale span:last-child { margin-left: 6px; }

details.tw { margin-top: 8px; font-size: 13px; }
details.tw summary { color: var(--muted); cursor: pointer; }
details.tw .scroll { max-height: 320px; overflow: auto; margin-top: 6px; }

#tip { position: fixed; z-index: 10; pointer-events: none; background: var(--raised); box-shadow: 0 0 0 1px var(--axis); padding: 8px 10px; font-size: 13px; min-width: 120px; max-width: 260px; }
#tip .t { color: var(--muted); margin-bottom: 3px; }
#tip .r { display: flex; align-items: center; gap: 7px; }
#tip .r b { font-weight: 600; font-variant-numeric: tabular-nums; }
#tip .r span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tip .r i { flex: none; width: 10px; height: 2px; }
#tip .e { color: var(--text-2); margin-top: 3px; }

#servers { margin-top: 16px; }

@media (max-width: 860px) {
  body:not(.bare) { display: block; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 16px; }
  .brand { margin: 0 8px 0 0; padding: 0; }
  .side nav { flex-direction: row; flex-wrap: wrap; }
  .who { margin: 0 0 0 auto; padding: 0; display: flex; gap: 10px; align-items: center; }
  .who form { margin: 0; }
  .main { padding: 16px 16px 60px; }
  .cols { grid-template-columns: minmax(0, 1fr); }
  .hero-n { font-size: 48px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
  .tiles dd { font-size: 21px; }
}
