/* Ink on paper, in light and dark. System fonts only.
   Brand tokens are copied from burst-kit web/shared/burst.css (source of truth,
   docs/BRAND.md): the game frame is a sandboxed opaque origin and cannot load
   the site's CSS. Copied: --burst-background, --burst-text, --burst-muted,
   --burst-accent-text, --burst-surface (dark paper), --burst-orange. The paper
   and ink colours are game art (BRAND.md "art" exception) and stay in this file.
   Contrast on paper: ink 14.8 light / 14.6 dark; soft ink 8.7 / 8.4; purr ink
   4.6 / 5.9; accent 5.0 / 8.4. */
:root,
:root[data-burst-theme="light"] {
  color-scheme: light;
  --burst-orange: #ff6a1a;
  --burst-background: #fffaf5;
  --burst-text: #101010;
  --burst-muted: #675c52;
  --burst-accent-text: #b33b00;
  /* art */
  --paper: #f3ecdc;
  --ink: #1f1912;
  --ink-soft: #4a3f33;
  --ink-purr: #7b6650;
  --ink-silent: #2b2b2e;
  --grain-dark: 90, 72, 50;
  --grain-light: 255, 250, 238;
  --fibre: 110, 92, 64;
  --vignette: 120, 95, 60;
  --hud-bg: rgba(243, 236, 220, 0.88);
  /* /art */
  --focus: var(--burst-accent-text);
}
:root[data-burst-theme="dark"] {
  color-scheme: dark;
  --burst-background: #101010;
  --burst-text: #fffaf5;
  --burst-muted: #beb2a7;
  --burst-accent-text: #ff9a62;
  /* art: light ink on deep warm-dark paper (the paper is --burst-surface) */
  --paper: #1b1917;
  --ink: #f2e9de;
  --ink-soft: #beb2a7;
  --ink-purr: #a8927a;
  --ink-silent: #dcdcd4;
  --grain-dark: 0, 0, 0;
  --grain-light: 120, 104, 86;
  --fibre: 150, 130, 108;
  --vignette: 0, 0, 0;
  --hud-bg: rgba(27, 25, 23, 0.88);
  /* /art */
}
/* Before the script sets data-burst-theme, follow the system (no flash). */
@media (prefers-color-scheme: dark) {
  :root:not([data-burst-theme]) {
    color-scheme: dark;
    --burst-background: #101010;
    --burst-text: #fffaf5;
    --burst-muted: #beb2a7;
    --burst-accent-text: #ff9a62;
    --paper: #1b1917;
    --ink: #f2e9de;
    --ink-soft: #beb2a7;
    --hud-bg: rgba(27, 25, 23, 0.88);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--ink); overflow: hidden; }
body { font: 16px/1.35 Georgia, "Iowan Old Style", "Palatino Linotype", serif; -webkit-tap-highlight-color: transparent; }
.page { position: relative; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.page:focus { outline: none; }
.page:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.paper { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) 16px 8px;
  pointer-events: none;
}
.hud > * { margin: 0; }
.title { font-size: 18px; font-weight: 700; font-style: italic; letter-spacing: 0.01em; flex: 1 1 auto; }
.score { font-variant-numeric: tabular-nums; font-size: 20px; }
.label { font-size: 13px; color: var(--ink-soft); font-style: italic; }
.time.stopped { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-soft); }
.faces { font-size: 18px; letter-spacing: 2px; }
.pill {
  pointer-events: auto; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--hud-bg); border: 1.5px solid var(--ink); border-radius: 999px;
  padding: 6px 12px; min-height: 36px; cursor: pointer; white-space: nowrap;
}
.mute[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.pill:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(88%, 440px); padding: 20px 22px; text-align: center;
  background: var(--hud-bg); border: 1.5px solid var(--ink); border-radius: 4px;
  pointer-events: none;
}
.overlay-title { margin: 0 0 6px; font-size: 30px; font-style: italic; }
.overlay-body { margin: 0; font-size: 17px; }

.hint {
  position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%);
  margin: 0; width: max-content; max-width: calc(100% - 32px); text-align: center;
  font-size: 15px; font-style: italic; color: var(--ink);
  background: var(--hud-bg); padding: 4px 10px; border-radius: 4px; pointer-events: none;
}

.foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: center;
  padding: 6px 16px max(8px, env(safe-area-inset-bottom));
  font-size: 13px; color: var(--ink-soft); pointer-events: none;
}
.foot #best { font-variant-numeric: tabular-nums; color: var(--ink); }
.who { flex: 1 1 auto; text-align: center; }
.note { font-style: italic; }
.tag { font-style: italic; }
.tag b { font-weight: 400; color: var(--burst-accent-text); }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: -1px; }

@media (max-width: 480px) {
  .hud { flex-wrap: wrap; row-gap: 4px; }
  .title { font-size: 16px; flex-basis: 100%; }
  .score { flex: 1 1 auto; }
  .pill { font-size: 13px; padding: 5px 10px; min-height: 34px; }
  .score { font-size: 18px; }
  .who { display: none; }
  .hint { bottom: 84px; }
}
