:root {
  --bg: #f4f5f9;
  --panel: #ffffff;
  --text: #1b1d2a;
  --muted: #6b6f85;
  --line: #e2e4ee;
  --accent: #2f7d45;
  --accent-text: #ffffff;
  --danger: #c0392b;
  --gold: #b8860b;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121320;
    --panel: #1b1d2a;
    --text: #e8e9f2;
    --muted: #9a9db5;
    --line: #2c2f42;
    --accent: #4ad66d;
    --accent-text: #0d1a10;
    --danger: #ff6b5e;
    --gold: #fad228;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
[hidden] { display: none !important; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.who { display: flex; gap: 12px; align-items: center; color: var(--muted); }

main { max-width: 1000px; margin: 0 auto; padding: 20px 16px 60px; }
main.center { display: flex; justify-content: center; padding-top: 60px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.narrow { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.card.inline { margin-bottom: 20px; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 6px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 0;
}
button {
  font: inherit; cursor: pointer; border-radius: 8px; padding: 8px 14px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 600; }
button.danger { color: var(--danger); }
button.link { border: none; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
button:disabled { opacity: .5; cursor: default; }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 14px; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; margin: 0; }
code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: none; background: none; border-bottom: 3px solid transparent; border-radius: 0; padding: 10px 14px; color: var(--muted); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list th, .list td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.list th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.list tr:last-child td { border-bottom: none; }
.list .num { text-align: right; font-variant-numeric: tabular-nums; }
.list td.actions { text-align: right; white-space: nowrap; }
.list td.actions button { margin-left: 6px; }
.rank1 td:first-child { color: var(--gold); font-weight: 700; }
.player { font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: .08em; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); }
.badge.ok { color: var(--accent); border-color: var(--accent); }
.badge.off { color: var(--danger); border-color: var(--danger); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 99px;
}

@media (max-width: 640px) {
  .list th:nth-child(n+5), .list td:nth-child(n+5):not(.actions) { display: none; }
}
