:root {
  --bg: #0a0c11; --panel: #12161f; --panel-2: #181d28; --line: #252c3a; --text: #e9edf4; --muted: #8e97ab;
  --accent: #3cff8f; --accent-ink: #062b16; --red: #ff4f61; --green: #3cff8f; --orange: #ffa63d; --mixed: #b6a7ff; --warn: #ffcf5c;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1040px; margin: 0 auto; padding: 8px 16px 48px; }
h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.15; margin: 20px 0 8px; letter-spacing: -0.01em; }
h1 small { font-size: 0.55em; color: var(--muted); font-weight: 500; margin-left: 6px; }
h2 { font-size: 19px; margin: 32px 0 10px; }
small, .small { color: var(--muted); font-size: 13px; }

header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); max-width: 1040px; margin: 0 auto; }
.brand { color: var(--text); font-weight: 800; font-size: 20px; letter-spacing: 0.02em; }
.brand b { color: var(--accent); font-weight: 800; }
header nav { display: flex; gap: 4px; flex-wrap: wrap; }
header nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; }
header nav a[aria-current="page"], header nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
footer { max-width: 1040px; margin: 0 auto; padding: 24px 16px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

.hero { padding: 36px 0 8px; }
.hero h1 { font-size: clamp(32px, 7vw, 56px); margin: 0 0 12px; }
.hero p { max-width: 640px; color: var(--muted); font-size: 18px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.button, button { display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 700; border: 0; border-radius: 10px; padding: 10px 16px; font-size: 15px; cursor: pointer; }
.button:hover, button:hover { text-decoration: none; filter: brightness(1.08); }
.button.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 28px; }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; color: var(--text); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card h2 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { color: var(--muted); font-weight: 600; font-size: 13px; background: var(--panel-2); }
tbody tr:last-child td { border-bottom: 0; }
.n { text-align: right; }
th.grp { text-align: center; }
.strong { font-weight: 700; }
.matrix { width: auto; }
.matrix th, .matrix td { padding: 6px 8px; font-size: 14px; }
.matrix td.self { background: var(--panel-2); }
.matrix td:not(:empty) { color: var(--text); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--mixed); }
.dot.red { background: var(--red); } .dot.green { background: var(--green); } .dot.orange { background: var(--orange); }
.meta, .crumbs { color: var(--muted); margin: 4px 0 16px; }
.crumbs { margin: 16px 0 0; font-size: 14px; }
.warn { color: var(--warn); }
p.warn { background: rgba(255, 207, 92, 0.08); border: 1px solid rgba(255, 207, 92, 0.3); padding: 10px 12px; border-radius: 10px; }
.empty { color: var(--muted); padding: 24px 0; }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 12px 0; color: var(--muted); font-size: 14px; }
.pager { display: flex; gap: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 16px 0; }
.chips a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.chips a[aria-current="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.notice { background: var(--panel-2); border: 1px solid var(--accent); padding: 10px 12px; border-radius: 10px; }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; vertical-align: middle; }
.games-used { color: var(--muted); }

.live { margin-bottom: 24px; }
.live h2 { display: flex; align-items: center; gap: 10px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 79, 97, 0.7); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 79, 97, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 79, 97, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.live-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.live-game { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.live-game > header { padding: 10px 12px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.live-game .state { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.live-game[data-state="playing"] .state { color: var(--red); font-weight: 700; }
.live-game p { padding: 0 12px; }
tr.quiet td { color: var(--muted); }

body.board main { max-width: none; }
.bigboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; padding-top: 12px; }
.bigboard .live-game > header { font-size: clamp(18px, 2.4vw, 30px); }
.bigboard table td, .bigboard table th { font-size: clamp(18px, 2.6vw, 34px); padding: 8px 14px; }
@media (max-width: 480px) { .bigboard { grid-template-columns: 1fr; } }
