:root {
  --bg: #fbfbfa; --panel: #ffffff; --panel2: #f2f2ef; --text: #1d1f22; --muted: #686d74;
  --line: rgba(20, 25, 35, .14); --accent: #1f5fbf; --accent-ink: #fff;
  --good: #1a8a4c; --bad: #c6392f; --sim: #8a5a00;
  --radius: 8px; --shadow: 0 1px 2px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111315; --panel: #181b1e; --panel2: #202428; --text: #e8e9ea; --muted: #9aa1a8;
    --line: rgba(255, 255, 255, .13); --accent: #6aa3ff; --accent-ink: #0b1220;
    --good: #4cc47f; --bad: #ff7a6e; --sim: #e0b25a; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
header { display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px max(16px, calc(50% - 640px)); border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { font-weight: 800; font-size: 17px; text-decoration: none; color: var(--text); letter-spacing: -.01em; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { text-decoration: none; color: var(--muted); padding: 5px 10px; border-radius: 6px; font-size: 14px; }
nav a:hover { background: var(--panel2); color: var(--text); }
nav a.on { color: var(--text); background: var(--panel2); font-weight: 600; }
main { max-width: 1280px; margin: 0 auto; padding: 24px 16px 48px; }
footer { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  padding: 18px max(16px, calc(50% - 640px)); border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
h1 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 28px 0 8px; }
.muted, .lede { color: var(--muted); }
.lede { font-size: 16px; max-width: 760px; margin: 0 0 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); margin: 0 0 14px; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--accent); }
a.card b { color: var(--accent); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.stat .big { font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
button.btn, a.btn { font: inherit; font-size: 14px; padding: 7px 13px; border-radius: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; }
button.btn:hover, a.btn:hover { background: var(--panel2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
select, input[type=number], input[type=email], input[type=text] { font: inherit; font-size: 14px; padding: 6px 8px;
  border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--text); max-width: 100%; }
label.inline { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.legend b { color: var(--text); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; }
.tabs button { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.tabs button.on { background: var(--panel2); color: var(--text); font-weight: 600; }
.note { border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--panel2); border-radius: 0 6px 6px 0; margin: 10px 0; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.choice label { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  cursor: pointer; background: var(--panel); }
.choice input { margin-right: 6px; }
.choice label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); font-size: 12.5px; position: sticky; top: 0; background: var(--panel); }
td.num, th.num { text-align: right; }
.meter { display: inline-block; height: 7px; border-radius: 4px; background: var(--accent); vertical-align: middle; opacity: .75; }
.pos { color: var(--good); } .neg { color: var(--bad); }
details summary { cursor: pointer; font-weight: 600; }
.points { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; }
.points input { width: 76px; }
article.post { max-width: 720px; }
article.post p, article.post li { font-size: 16px; }
.ad { min-height: 0; margin: 20px 0; }

/* ---- bracket board ---- */
.wrap { overflow-x: auto; overflow-y: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 6px; }
.board { position: relative; }
.board > svg { position: absolute; inset: 0; }
.hdr { position: absolute; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  opacity: .45; text-align: center; }
.reg { position: absolute; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .65; }
.game { position: absolute; border: 1px solid var(--line); border-radius: 6px; overflow: visible; background: var(--panel); }
.slot { display: flex; align-items: center; gap: 5px; height: 20px; padding: 0 5px; font-size: 11.5px;
  cursor: pointer; white-space: nowrap; border: none; background: none; width: 100%; text-align: left;
  font-family: inherit; color: var(--text); }
.slot + .slot, .playin { border-top: 1px solid var(--line); }
.slot:hover { background: var(--panel2); }
.ro .slot, .ro button { cursor: default; }
.slot img { width: 15px; height: 15px; object-fit: contain; flex: 0 0 15px; }
.slot .sd { width: 14px; text-align: right; font-size: 9.5px; opacity: .55; flex: 0 0 14px; }
.slot .nm { overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.slot.won { font-weight: 700; background: var(--panel2); }
.slot.won .nm { color: var(--accent); }
.slot.won.sim .nm { color: var(--sim); font-style: italic; }
.slot.out { opacity: .32; }
.slot.ghost { opacity: .45; font-style: italic; }
.slot.empty, .slot.empty:hover { cursor: default; opacity: .3; background: none; }
.slot.hit .nm { color: var(--good); } .slot.miss .nm { color: var(--bad); }
.playin { display: flex; height: 20px; }
.playin button { flex: 1 1 0; min-width: 0; border: none; background: none; cursor: pointer; font-size: 9.5px;
  font-family: inherit; color: var(--text); opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; }
.playin button:hover { background: var(--panel2); opacity: 1; }
.playin span { font-size: 9px; opacity: .35; align-self: center; }
.dice { position: absolute; right: -11px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); line-height: 1;
  cursor: pointer; padding: 0; z-index: 2; }
.dice.left { right: auto; left: -11px; }
.dice { display: flex; align-items: center; justify-content: center; color: var(--muted); }
.dice:hover { background: var(--panel2); }
.final { border-width: 2px; border-color: var(--accent); }
.trophy { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 4px; border-top: 1px solid var(--line); }
.trophy .cap { font-size: 8.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .5; font-weight: 700; }
.trophy .who { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.trophy .who.proj { opacity: .5; font-style: italic; font-weight: 600; }
.trophy .who.hit { color: var(--good); } .trophy .who.miss { color: var(--bad); }
.trophy .who img { width: 18px; height: 18px; }
