/* CtrlAltBen palette: ink #372f40, pale key #f7f5fa, accent purple #7600c9 */
:root {
  --bg: #f7f5fa;
  --surface: #ffffff;
  --surface-2: #eeeaf3;
  --text: #372f40;
  --muted: #6a6175;
  --line: #ddd7e4;
  --line-strong: #b8aec4;
  --ink: #372f40;
  --key: #f7f5fa;
  --accent: #7600c9;
  --accent-ink: #ffffff;
  --accent-soft: #efe3fa;
  --accent-soft-ink: #4f0087;
  --win: #e3f4ea;
  --win-ink: #1b6b3f;
  --win-line: #8fcfaa;
  --warn: #fff3d6;
  --warn-ink: #7a5300;
  --live: #d6334a;
  --radius: 10px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16121b;
    --surface: #1f1a26;
    --surface-2: #2a2333;
    --text: #efeaf5;
    --muted: #ab9fba;
    --line: #3a3145;
    --line-strong: #54485f;
    --ink: #d9cfe4;
    --key: #2a2333;
    --accent: #b46cf2;
    --accent-ink: #16121b;
    --accent-soft: #33204a;
    --accent-soft-ink: #e3c9ff;
    --win: #173526;
    --win-ink: #9be0b8;
    --win-line: #2f7a52;
    --warn: #3a2f12;
    --warn-ink: #f2cf7a;
    --live: #ff6b80;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 560px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; color: var(--text); }
/* keycap logo */
.brand { gap: 4px; }
.kc { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border: 1.5px solid var(--ink); border-radius: 7px; background: var(--key); color: var(--ink); font-weight: 700; font-size: 15px; }
.kc.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.kplus { color: var(--accent); font-weight: 700; padding: 0 2px; }
.big .kc { height: 44px; font-size: 22px; padding: 0 14px; border-radius: 10px; }
/* segmented toggles */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 6px 12px; background: var(--surface); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg.small button { font-size: 12px; padding: 3px 10px; }
.code { font-family: Consolas, "SF Mono", monospace; font-size: 22px; letter-spacing: 2px; font-weight: 700; }
.code-inline { font-family: Consolas, "SF Mono", monospace; font-weight: 700; letter-spacing: 1px; margin-left: 6px; color: var(--text); }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); margin-left: 6px; }
.key { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 6px; border: 1.5px solid var(--accent); border-radius: 6px; font-size: 12px; font-weight: 700; color: var(--accent); }
.key.solid { background: var(--accent); color: var(--accent-ink); }
h1 { font-size: 22px; margin: 8px 0 4px; }
h2 { font-size: 17px; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.live { background: var(--live); color: #fff; }
.pill.open { background: var(--warn); color: var(--warn-ink); }
.pill.finished { background: var(--surface-2); color: var(--muted); }
button, .btn { font: inherit; font-size: 14px; padding: 8px 14px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--live); }
input, select, textarea { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); width: 100%; }
textarea { min-height: 160px; resize: vertical; }
label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 160px; }
.row > .key, .row > .pill { flex: 0 0 auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.me { background: var(--accent-soft); color: var(--accent-soft-ink); }

/* bingo card */
.board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sq { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 4px; font-size: 12.5px; line-height: 1.2; border: 1.5px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; user-select: none; overflow-wrap: break-word; hyphens: auto; position: relative; }
.sq.marked { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: var(--accent); border-style: dashed; }
.sq.marked.ok { border-style: solid; background: var(--accent); color: var(--accent-ink); }
.sq.win, .sq.marked.ok.win { background: var(--win); color: var(--win-ink); border-color: var(--win-line); border-style: solid; }
.sq.free { font-weight: 600; cursor: default; }
.locked .sq { cursor: default; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; border: 1.5px solid var(--line-strong); }
.legend .l-pend::before { background: var(--accent-soft); border: 1.5px dashed var(--accent); }
.legend .l-ok::before { background: var(--accent); border-color: var(--accent); }
.legend .l-win::before { background: var(--win); border-color: var(--win-line); }
.banner { padding: 10px 14px; border-radius: var(--radius); background: var(--win); color: var(--win-ink); font-weight: 600; margin: 12px 0; }
.banner.info { background: var(--surface-2); color: var(--muted); font-weight: 400; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); }
.bar.ok > div { background: var(--win-line); }
footer { font-size: 12px; color: var(--muted); text-align: center; padding: 24px 16px; margin-top: 16px; border-top: 1px solid var(--line); line-height: 1.8; }
footer a { color: inherit; }
footer a:hover { color: var(--accent); }
.prose p, .prose li { max-width: 62ch; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.err { color: var(--live); font-size: 13px; min-height: 18px; }

/* big screen */
.big { padding: 24px 32px; }
.big h1 { font-size: 40px; }
.big .cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; margin-top: 16px; }
.big table { font-size: 22px; }
.big .stat { font-size: 64px; font-weight: 700; line-height: 1; }
.big .heat-row { display: grid; grid-template-columns: 220px 1fr 60px; gap: 12px; align-items: center; font-size: 20px; margin: 10px 0; }
.big .bar { height: 18px; border-radius: 9px; }
@media (max-width: 800px) { .big .cols { grid-template-columns: 1fr; } }
header.top { flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 420px) {
  .sq { font-size: 11px; padding: 3px; }
  .board { gap: 4px; }
  .kc { height: 26px; font-size: 13px; padding: 0 8px; }
  h1 { font-size: 20px; }
}

/* CtrlAltBen site bar */
.sitebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: 13px; }
.sitebar a { display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; }
.sitebar a:hover { color: var(--accent); }
.mark { display: block; }
.mark .mk { fill: var(--key); stroke: var(--ink); stroke-width: 5; }
.mark .ma { fill: var(--accent); }
.mark .ml { font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif; font-weight: 700; font-size: 44px; fill: var(--ink); text-anchor: middle; }
.mark .ml.on { fill: var(--accent-ink); }
.mark .mp { font-family: "Segoe UI", Arial, sans-serif; font-weight: 700; font-size: 40px; fill: var(--accent); text-anchor: middle; }
/* Model Radar link: pale tile and wordmark as on its own masthead */
.sitebar a.radar { gap: 7px; color: var(--text); font-weight: 800; letter-spacing: -0.015em; }
.radar-tile { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; background: #f7f5fa; border: 1px solid #b8a8ca; color: #33243f; flex: none; }
.radar-tile svg { width: 20px; height: 20px; display: block; }
/* in person or remote, asked once per card */
.confirm { margin: 12px 0; text-align: center; }
.confirm h2 { margin-top: 0; }
.confirm .row { justify-content: center; }
.confirm button { flex: 1 1 140px; max-width: 220px; padding: 14px; font-size: 16px; font-weight: 600; border-color: var(--accent); color: var(--accent); }
.confirm button:hover { background: var(--accent); color: var(--accent-ink); }
/* demo mode */
.demo-banner { padding: 8px 16px; background: var(--warn); color: var(--warn-ink); font-size: 14px; text-align: center; border-bottom: 1px solid var(--line); }
.pill.demo { background: var(--warn); color: var(--warn-ink); }
