:root {
  --bg: #f4f5f7; --card: #ffffff; --ink: #1c2230; --muted: #667085; --line: #e3e6eb;
  --accent: #2f6fed; --good: #1a9e5c; --bad: #c8372d;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f131a; --card: #181e28; --ink: #e8ebf2; --muted: #98a2b3; --line: #2a3140; --accent: #6b9bff; --good: #3ccb85; --bad: #ff7a70; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 0 16px env(safe-area-inset-bottom);
}
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: .8rem; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.top { display: flex; align-items: center; gap: 10px; padding: 14px 0; max-width: 720px; margin: 0 auto; }
.top h1 { flex: 1; }
select, input, button {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; min-height: 40px;
}
button { cursor: pointer; background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; }
button.ghost { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 400; }
main { max-width: 720px; margin: 0 auto; padding-bottom: 32px; display: grid; gap: 12px; }
.meta { margin: 0; color: var(--muted); font-size: .85rem; }
.sep { opacity: .5; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 6px; }
.dot.off { background: var(--bad); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big { font-size: 3.2rem; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.num { font-size: 1.9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); font-size: .8rem; margin-top: 4px; }
#spark { width: 100%; height: 56px; margin-top: 12px; display: block; }
#spark polyline { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
#spark path { fill: var(--accent); opacity: .12; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; margin-top: 2px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child { text-align: left; font-weight: 500; }
thead th { color: var(--muted); font-size: .78rem; font-weight: 600; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td { font-weight: 600; }
tr.est td { font-weight: 500; }
.login { min-height: 100vh; display: grid; place-items: center; }
.login form { width: min(360px, 100%); display: grid; gap: 10px; }
.login label { color: var(--muted); font-size: .85rem; }
.err { color: var(--bad); margin: 0; }
form { margin: 0; }
.top .back { font-size: 1.8rem; line-height: 1; text-decoration: none; color: var(--muted); padding: 0 6px; }
.top select { flex: 1; min-width: 0; }
a.game { display: block; color: inherit; text-decoration: none; }
a.game:active { background: var(--line); }
.gname { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }
.tag { font-size: .68rem; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.gstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
code { font-size: .85em; }
.five { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.tile.wide { grid-column: 1 / -1; }
.tile .num { font-size: 2rem; line-height: 1.1; }
.tile .big2 { font-size: 3.2rem; }
.tile .sub { margin-top: 2px; }
.foot { margin: 0; color: var(--muted); font-size: .75rem; }
.total { border-color: var(--accent); }
.meta a { color: var(--accent); }
