:root {
  color-scheme: light;
  --paper: #f7f5f0;
  --surface: #fff;
  --ink: #111;
  --muted: #77736d;
  --line: #d8d4cc;
  --soft: #eeebe5;
  --dark: #111;
  --dark-ink: #fafafa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .5; }
.shell { width: min(100% - 28px, 560px); margin: 0 auto; padding: 22px 0 48px; }
.brand { display: flex; align-items: baseline; gap: 5px; margin-bottom: 42px; font: 700 12px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .13em; }
.brand strong { font-size: 16px; letter-spacing: -.04em; }
.panel, .match-card { border: 1.5px solid var(--line); background: var(--surface); padding: 20px; }
.panel { margin-bottom: 14px; }
.eyebrow { margin: 0 0 10px; color: var(--muted); font: 700 10px/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: .14em; }
h1 { margin: 0 0 22px; font-size: clamp(30px, 8vw, 44px); line-height: .98; letter-spacing: -.055em; }
label { display: block; margin: 16px 0 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.input-row { display: flex; gap: 8px; }
input, select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); padding: 10px 12px; }
button { min-height: 46px; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); color: white; padding: 10px 15px; font-weight: 800; }
#open-dashboard { width: 100%; margin-top: 16px; }
.status { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.status.error { color: #a12c22; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.dashboard-heading h1 { margin-bottom: 5px; font-size: clamp(26px, 7vw, 38px); }
.muted { margin: 0; color: var(--muted); font-size: 13px; }
.heading-actions { display: flex; gap: 6px; }
.quiet { min-height: 34px; padding: 6px 9px; border-color: var(--line); background: transparent; color: var(--ink); font-size: 11px; }
.match-card { margin-bottom: 14px; padding: 22px; }
.match-card.white-mode { background: #fff; border-color: #111; color: #111; }
.match-card.black-mode { background: #111; border-color: #111; color: #fff; }
.match-card.black-mode .muted, .match-card.black-mode .eyebrow { color: #b8b8b8; }
.match-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.match-label { font: 800 11px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .13em; }
.match-colour { font: 800 11px/1.2 "SFMono-Regular", Consolas, monospace; text-align: right; }
.match-card h2 { margin: 34px 0 6px; font-size: clamp(26px, 8vw, 42px); line-height: .95; letter-spacing: -.06em; }
.match-detail { margin: 0; font-size: 14px; }
.match-time { margin: 25px 0 0; font: 700 12px/1.3 "SFMono-Regular", Consolas, monospace; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1.5px solid var(--line); margin-bottom: 14px; background: var(--surface); }
.stat { min-width: 0; padding: 16px 12px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-label { display: block; color: var(--muted); font: 700 10px/1.2 "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; }
.stat-value { display: block; margin-top: 8px; font: 800 clamp(22px, 7vw, 32px)/1 "SFMono-Regular", Consolas, monospace; letter-spacing: -.06em; }
.stat-note { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.rounds-panel { padding-bottom: 8px; }
.round { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid var(--soft); }
.round:first-child { border-top: 0; }
.round-number { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; font: 700 11px "SFMono-Regular", Consolas, monospace; }
.round.win .round-number { background: var(--ink); color: white; }
.round-opponent { min-width: 0; font-weight: 700; }
.round-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.round-score { text-align: right; font: 700 13px "SFMono-Regular", Consolas, monospace; }
.empty { padding: 22px 0; color: var(--muted); font-size: 14px; }
@media (max-width: 420px) { .input-row { display: block; } .input-row button { width: 100%; margin-top: 8px; } .dashboard-heading { display: block; } .heading-actions { margin-top: 12px; } }
