/* =========================================================================
   Daily Puzzles — design system
   "Sunday puzzle page meets candy shop": warm paper, inky outlines,
   offset shadows, and a signature colour for every game.
   ========================================================================= */

@font-face {
  font-family: 'Bricolage';
  src: url('../fonts/bricolage.woff2') format('woff2-variations'), url('../fonts/bricolage.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #fff6e9;
  --bg-dots: #f3e6d1;
  --surface: #ffffff;
  --surface-2: #fbf2e4;
  --ink: #1d1a16;
  --muted: #6b6358;
  --edge: #1d1a16;
  --soft: #eadcc6;
  --ok: #2f9e5b;
  --close: #f2b705;
  --bad: #e5484d;
  --miss: #8d857a;

  /* game colours */
  --c-fold: #ff8a3d;
  --c-birdaday: #33b679;
  --c-ripple: #7b6cf6;
  --c-rungs: #ff5a5f;
  --c-tangle: #ffc93c;
  --c-pantry: #e45fa8;
  --c-overlap: #3ab0e2;
  --c-timeline: #a3d65c;
  --c-hivemind: #f4a62a;
  --c-ballpark: #f47ba7;
  --c-glimpse: #d9955a;
  --c-chorus: #ff9e7a;
  --c-clutch: #9cc3e6;
  --c-birdsong: #2bb3a3;

  --accent: #1d1a16;
  --on-accent: #ffffff;

  --paper: #fffdf6;
  --paper-edge: #b9ae98;
  --flap: #ffe2c7;
  --ghost: #e4d6bf;

  --radius: 18px;
  --radius-sm: 12px;
  --bw: 2.5px;
  --shadow: 4px 4px 0 var(--edge);
  --shadow-sm: 2px 2px 0 var(--edge);
  --display: 'Bricolage', ui-rounded, system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --bg-dots: #1f1c17;
    --surface: #221f1a;
    --surface-2: #2a2620;
    --ink: #f6efe3;
    --muted: #b1a796;
    --edge: #000000;
    --soft: #3a352d;
    --miss: #5d574e;
    --paper: #f6efe0;
    --paper-edge: #8d846f;
    --flap: #ffd6b0;
    --ghost: #3a352d;
    --shadow: 4px 4px 0 #000;
    --shadow-sm: 2px 2px 0 #000;
  }
  .card, .btn, .modal, .summary, .clue, .guess-name, .option, .icon-btn, .back, .ripple-board, .board-frame, .progress, .stat {
    outline: 1px solid rgb(255 255 255 / 0.1);
  }
}

/* Each game page sets body[data-game]; that game's colour becomes the accent. */
body[data-game='fold'] { --accent: var(--c-fold); --on-accent: #1d1a16; }
body[data-game='birdaday'] { --accent: var(--c-birdaday); --on-accent: #10261a; }
body[data-game='ripple'] { --accent: var(--c-ripple); --on-accent: #ffffff; }
body[data-game='rungs'] { --accent: var(--c-rungs); --on-accent: #ffffff; }
body[data-game='tangle'] { --accent: var(--c-tangle); --on-accent: #1d1a16; }
body[data-game='pantry'] { --accent: var(--c-pantry); --on-accent: #ffffff; }
body[data-game='overlap'] { --accent: var(--c-overlap); --on-accent: #10232d; }
body[data-game='birdsong'] { --accent: var(--c-birdsong); --on-accent: #0d2622; }
body[data-game='hivemind'] { --accent: var(--c-hivemind); --on-accent: #1d1a16; }
body[data-game='glimpse'] { --accent: var(--c-glimpse); --on-accent: #2a1a0b; }
body[data-game='chorus'] { --accent: var(--c-chorus); --on-accent: #2b130a; }
body[data-game='clutch'] { --accent: var(--c-clutch); --on-accent: #1f2a33; }
body[data-game='ballpark'] { --accent: var(--c-ballpark); --on-accent: #2b1020; }
body[data-game='beforeafter'] { --accent: var(--c-timeline); --on-accent: #1d2a10; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--bg-dots) 1.2px, transparent 1.2px);
  background-size: 18px 18px;
  color: var(--ink);
  font: 16px/1.5 var(--body);
}

a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 0.5rem; text-wrap: balance; letter-spacing: -0.01em; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem 1rem calc(4rem + env(safe-area-inset-bottom));
}

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  padding-top: max(0.6rem, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar h1 { margin: 0; display: flex; align-items: center; gap: 0.45rem; font-size: 1.45rem; font-weight: 800; }
.topbar h1 .game-dot { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--accent); border: 2px solid var(--edge); }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--display); font-weight: 800; font-size: 1.15rem; text-decoration: none; white-space: nowrap; }
.brand .logo { width: 32px; height: 32px; flex: none; }
.back {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: var(--bw) solid var(--edge);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.back svg { width: 18px; height: 18px; }
.actions { display: flex; justify-content: flex-end; gap: 0.35rem; }
.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: var(--bw) solid var(--edge);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.icon-btn:active, .back:active { transform: translate(2px, 2px); box-shadow: none; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.signed-in { background: var(--c-birdaday); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 50px;
  padding: 0.65rem 1.3rem;
  border: var(--bw) solid var(--edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font: inherit;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
body:not([data-game]) .btn.primary { background: var(--ink); color: var(--bg); }
.btn:focus-visible, .option:focus-visible, .icon-btn:focus-visible, .card:focus-visible, .tile:focus-visible, .letter:focus-visible, .key:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- modal & toast ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  justify-items: center;
  background: rgb(20 15 10 / 0.5);
  animation: fade 0.15s ease-out;
}
.modal {
  position: relative;
  width: min(100%, 480px);
  max-height: 88dvh;
  overflow: auto;
  padding: 1.5rem 1.4rem calc(1.5rem + env(safe-area-inset-bottom));
  border: var(--bw) solid var(--edge);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  animation: sheet 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@media (min-width: 600px) {
  .overlay { align-items: center; padding: 1rem; }
  .modal { border-bottom: var(--bw) solid var(--edge); border-radius: 24px; box-shadow: 8px 8px 0 var(--edge); }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.modal h2 { font-size: 1.6rem; padding-right: 2.5rem; }
.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 38px;
  height: 38px;
  border: var(--bw) solid var(--edge);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.help-list { padding-left: 1.1rem; }
.help-list li { margin-bottom: 0.4rem; }
.help-steps { display: flex; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.help-steps svg { flex: 1; min-width: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  z-index: 30;
  transform: translate(-50%, 1rem);
  opacity: 0;
  padding: 0.75rem 1.2rem;
  border: var(--bw) solid var(--edge);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; text-align: center; margin: 1rem 0; }
.stat { padding: 0.6rem 0.2rem; border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); background: var(--surface-2); }
.stat strong { display: block; font-family: var(--display); font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: 0.75rem; color: var(--muted); }
.stat-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding-top: 1rem; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.signin { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.signin input { flex: 1 1 200px; }
.code-input { font-size: 1.4rem; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.oauth-btn { width: 100%; justify-content: center; gap: 0.6rem; }
.oauth-btn .g { font-weight: 800; font-size: 1.15rem; color: #4285f4; }
.or { display: flex; align-items: center; gap: 0.75rem; margin: 1rem 0; color: var(--muted); font-size: 0.85rem; }
.or::before, .or::after { content: ''; flex: 1; border-top: 2px dashed var(--edge); opacity: 0.35; }
.linklike { background: none; border: 0; padding: 0.25rem 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 0.9rem; }

input[type='text'], input[type='email'] {
  min-height: 52px;
  padding: 0.6rem 1rem;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  box-shadow: inset 2px 2px 0 var(--soft);
}
input:focus { outline: 3px solid var(--accent); outline-offset: 1px; }

/* ---------- home ---------- */
.today { margin: 0.5rem 0 1.25rem; }
.today .date { font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--muted); }
.today h1 { font-size: clamp(2.2rem, 10vw, 3.1rem); font-weight: 800; margin: 0.15rem 0 0.85rem; }
.progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.progress-dots { display: flex; flex-wrap: wrap; gap: 0.3rem; max-width: 6.6rem; flex: none; }
.progress-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--edge); background: var(--surface-2); }
.progress-text { flex: 1; font-weight: 700; font-size: 0.95rem; line-height: 1.3; }
.progress-text small { display: block; font-weight: 400; color: var(--muted); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 196px;
  padding: 0.9rem;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius);
  background: var(--card, var(--surface));
  color: var(--card-ink, var(--ink));
  box-shadow: var(--shadow);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.1s, box-shadow 0.1s;
}
a.card:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--edge); }
a.card:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--edge); }
.card .icon { width: 56px; height: 56px; margin-bottom: auto; }
.card strong { font-family: var(--display); font-size: 1.35rem; font-weight: 800; line-height: 1.05; }
.card .tagline { font-size: 0.82rem; line-height: 1.3; opacity: 0.9; }
.card .status {
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0.2rem 0.7rem;
  border: 2px solid var(--edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.85rem;
}
.card.done .status { background: var(--ink); color: var(--bg); }
.card .streak { position: absolute; top: 0.75rem; right: 0.8rem; font-family: var(--display); font-weight: 800; font-size: 0.9rem; }
.card.new::after {
  content: 'NEW';
  position: absolute;
  top: 0.8rem;
  right: -1.9rem;
  transform: rotate(35deg);
  padding: 0.1rem 2.2rem;
  background: var(--edge);
  color: #fff;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}
.soon-title { margin: 2rem 0 0.75rem; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.cards.soon { grid-template-columns: 1fr; }
.cards.soon .card { min-height: 0; flex-direction: row; align-items: center; gap: 0.8rem; background: transparent; box-shadow: none; border-style: dashed; color: var(--muted); }
.cards.soon .icon { width: 36px; height: 36px; margin: 0; flex: none; opacity: 0.6; }
.cards.soon .card-text { display: grid; }
.footer-note { margin-top: 2rem; text-align: center; font-size: 0.85rem; color: var(--muted); }

/* ---------- shared game bits ---------- */
.round-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.85rem; font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.dots { display: flex; gap: 0.3rem; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--edge); background: var(--surface); }
.dot.now { background: var(--accent); }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }

.summary {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  text-align: center;
  padding: 1.6rem 1.1rem 1.4rem;
  margin-bottom: 1.25rem;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.summary::before { content: ''; position: absolute; inset: 0 0 auto; height: 12px; background: var(--accent); border-bottom: var(--bw) solid var(--edge); }
.summary h2 { font-size: 1.7rem; margin-top: 0.4rem; }
.summary p { margin: 0; }
.summary .btn { width: min(100%, 320px); }
.big { font-family: var(--display); font-size: 2.8rem; font-weight: 800; line-height: 1; }
.squares { font-size: 1.5rem; letter-spacing: 0.1em; white-space: pre-line; }
.small-squares { font-size: 1.1rem; line-height: 1.35; }
.feedback { min-height: 1.5em; text-align: center; font-family: var(--display); font-weight: 700; font-size: 1.1rem; margin: 0.75rem 0; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }
.next { display: flex; width: min(100%, 320px); margin: 0 auto; }
.next[hidden] { display: none; }

/* ---------- Fold ---------- */
.steps { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.75rem; }
.steps figure { flex: 1 1 0; min-width: 0; max-width: 160px; margin: 0; text-align: center; }
.steps figcaption { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.steps figure.punch svg { background: color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 10px; }
.prompt { text-align: center; font-family: var(--display); font-weight: 700; font-size: 1.15rem; margin: 0.25rem 0 0.85rem; }
.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
.option {
  position: relative;
  padding: 0.5rem;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}
.option:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.option:disabled { cursor: default; }
.option.correct { background: color-mix(in srgb, var(--ok) 25%, var(--surface)); outline: 3px solid var(--ok); }
.option.wrong { background: color-mix(in srgb, var(--bad) 18%, var(--surface)); outline: 3px solid var(--bad); }
.option:disabled:not(.correct):not(.wrong) { opacity: 0.45; }
.option svg { margin-top: 0.6rem; }
.opt-label { position: absolute; top: 0.25rem; left: 0.6rem; font-family: var(--display); font-size: 0.85rem; font-weight: 800; color: var(--muted); }
svg { display: block; width: 100%; height: auto; }
svg .ghost { fill: none; stroke: var(--ghost); stroke-width: 1.5; stroke-dasharray: 3 3; }
svg .paper { fill: var(--paper); stroke: var(--paper-edge); stroke-width: 1.5; }
svg .flap { fill: var(--flap); stroke: var(--paper-edge); stroke-width: 1.5; }
svg .grid { stroke: var(--paper-edge); stroke-opacity: 0.25; stroke-width: 0.6; }
svg .foldline { stroke: #d2551a; stroke-width: 1.8; stroke-dasharray: 4 3; }
svg .arrow { fill: none; stroke: #d2551a; stroke-width: 2.4; }
svg .arrowhead { fill: #d2551a; }
svg .hole { fill: #2a2722; }

.review { margin-top: 1.5rem; }
.review h3 { font-size: 1.15rem; }
.review-row { display: grid; grid-template-columns: 1.5rem 1fr 22%; gap: 0.5rem; align-items: center; padding: 0.5rem 0; border-top: 2px dashed var(--soft); }
.review-n { font-family: var(--display); font-weight: 800; color: var(--muted); }
.review-steps { display: flex; gap: 0.25rem; }
.review-steps svg { flex: 1; min-width: 0; max-width: 90px; }

/* ---------- Birdaday ---------- */
.clues { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.55rem; }
.clue { padding: 0.75rem 0.95rem; border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); }
.clue p { margin: 0.25rem 0 0; }
.clue-label { display: inline-block; font-family: var(--display); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 0.1rem 0.55rem; border: 2px solid var(--edge); border-radius: 999px; background: var(--accent); color: var(--on-accent); }
.clue.locked { background: transparent; border-style: dashed; box-shadow: none; padding: 0.5rem 0.95rem; }
.clue.locked .clue-label { background: transparent; border: 0; color: var(--muted); padding: 0; }
.clue.locked p { font-size: 0.85rem; }

.guesses { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.guess-row { display: grid; grid-template-columns: 1fr repeat(3, 3rem); gap: 0.35rem; align-items: center; }
.guess-row.head { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.guess-row.head span:not(:first-child) { text-align: center; }
.guess-name { font-weight: 700; font-size: 0.95rem; padding: 0.5rem 0.6rem; border: var(--bw) solid var(--edge); border-radius: 10px; background: var(--surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guess-row.correct .guess-name { background: var(--ok); color: #fff; }
.chip { display: grid; place-items: center; height: 2.5rem; border: var(--bw) solid var(--edge); border-radius: 10px; color: #fff; font-weight: 800; }
.chip.match { background: var(--ok); }
.chip.close { background: var(--close); color: #2b2205; }
.chip.miss { background: var(--miss); }
.chip.up, .chip.down { background: var(--surface); color: var(--ink); }

.guess-input { position: relative; }
.guess-input input { width: 100%; }
.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 4;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.suggestions li { padding: 0.65rem 0.75rem; border-radius: 8px; cursor: pointer; font-weight: 600; }
.suggestions li.active, .suggestions li:hover { background: color-mix(in srgb, var(--accent) 28%, var(--surface)); }
.bird-name { font-size: 2.1rem; }

/* ---------- Ripple ---------- */
.ripple-count strong { color: var(--ink); }
.ripple-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: min(100%, 420px);
  margin: 0.5rem auto 0.85rem;
  padding: 8px;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.ripple-board .cell { position: relative; aspect-ratio: 1; border-radius: 10px; background: color-mix(in srgb, var(--soft) 55%, transparent); transition: background 0.15s; }
.ripple-board .cell.trail { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.tile {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: var(--bw) solid var(--edge);
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 3px 0 var(--edge);
  cursor: pointer;
  transition: transform 0.08s;
}
.tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.tile:disabled { cursor: default; }
.tile.burst { background: var(--c-tangle); color: #1d1a16; }
.tile .face { width: 60%; display: grid; }
.tile .face svg { width: 100%; height: auto; }
.tile.popping { animation: pop 0.3s ease-out forwards; pointer-events: none; }
@keyframes pop {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.25); opacity: 0.9; }
  100% { transform: scale(0); opacity: 0; }
}
.tile.numbered .face { width: 42%; opacity: 0.5; }
.step-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: auto;
  width: 1.9rem;
  height: 1.9rem;
  border: 2px solid var(--edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 800;
}
.solution { width: 100%; }
.solution .ripple-board { width: min(100%, 300px); }
.help-tiles { display: grid; grid-template-columns: 48px 1fr; gap: 0.5rem 0.75rem; align-items: center; margin: 0.75rem 0; }
.tile.demo { position: relative; width: 48px; height: 48px; cursor: default; }

@media (max-width: 380px) {
  .guess-row { grid-template-columns: 1fr repeat(3, 2.6rem); }
  .brand span { display: none; }
  .cards { gap: 0.65rem; }
  .card { min-height: 176px; padding: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile.popping { opacity: 0; }
}

/* ---------- Rungs ---------- */
.rungs-head { display: flex; justify-content: space-between; align-items: stretch; gap: 0.75rem; margin-bottom: 0.9rem; }
.theme-pill, .pool {
  display: grid;
  align-content: center;
  padding: 0.45rem 0.9rem;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1.1;
}
.theme-pill { flex: 1; }
.theme-pill small, .pool small { font-family: var(--body); font-weight: 600; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pool { text-align: center; min-width: 5.5rem; }
.pool strong { font-size: 1.5rem; }
.ladder {
  position: relative;
  display: grid;
  gap: 0.6rem;
  padding: 0.25rem 0.9rem;
  margin-bottom: 1rem;
}
.ladder::before, .ladder::after {
  content: '';
  position: absolute;
  top: -0.25rem;
  bottom: -0.25rem;
  width: 8px;
  border: var(--bw) solid var(--edge);
  border-radius: 6px;
  background: var(--accent);
}
.ladder::before { left: 0; }
.ladder::after { right: 0; }
.rung {
  position: relative;
  padding: 0.55rem 0.6rem 0.6rem;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.rung:not(.active):not(.solved) { opacity: 0.55; box-shadow: none; border-style: dashed; }
.rung.active { box-shadow: var(--shadow); }
.rung-label { display: flex; justify-content: space-between; align-items: center; font-size: 0.75rem; font-weight: 700; color: var(--muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }
.rung-label span { display: grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--ink); color: var(--bg); font-family: var(--display); }
.rows { display: grid; gap: 0.3rem; justify-content: center; }
.row { display: flex; gap: 0.3rem; justify-content: center; }
.row .cell {
  display: grid;
  place-items: center;
  width: clamp(2.3rem, 12vw, 3rem);
  aspect-ratio: 1;
  border: var(--bw) solid var(--soft);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.2rem, 6vw, 1.55rem);
  text-transform: uppercase;
}
.row .cell.typed { border-color: var(--edge); animation: bump 0.1s; }
.row .cell.hit { background: var(--accent); color: var(--on-accent); border-color: var(--edge); }
.row .cell.near { background: var(--surface); border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--accent); }
.row .cell.miss { background: var(--soft); color: var(--muted); border-color: var(--soft); }
.row.locked .cell { border-style: dashed; }
.row.answer .cell { opacity: 0.6; }
.row.reveal .cell { animation: flip 0.4s ease both; animation-delay: calc(var(--i) * 110ms); }
.row.shake { animation: shake 0.35s; }
.row.demo { justify-content: flex-start; margin: 0.5rem 0; }
.row.demo .cell { width: 2.4rem; font-size: 1.2rem; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes bump { 50% { transform: scale(1.08); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.keyboard {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 0.4rem;
  padding: 0.6rem 0.2rem calc(0.6rem + env(safe-area-inset-bottom));
  margin: 0 -1rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
}
.krow { display: flex; gap: 0.3rem; justify-content: center; }
.key {
  flex: 1 1 0;
  max-width: 2.6rem;
  min-height: 3.3rem;
  padding: 0;
  border: 2px solid var(--edge);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 0 var(--edge);
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
}
.key:active { transform: translateY(2px); box-shadow: none; }
.key.wide { max-width: 4rem; flex-grow: 1.6; font-size: 0.8rem; }
.key.hit { background: var(--accent); color: var(--on-accent); }
.key.near { box-shadow: inset 0 0 0 3px var(--accent), 0 2px 0 var(--edge); }
.key.miss { background: var(--soft); color: var(--muted); }
body[data-game='rungs'] main { padding-bottom: 0; }

/* ---------- Tangle ---------- */
.tangle-head { display: flex; justify-content: space-between; align-items: stretch; gap: 0.75rem; margin-bottom: 0.6rem; }
.tray { min-height: 2.6rem; text-align: center; font-family: var(--display); font-weight: 800; font-size: 1.8rem; letter-spacing: 0.12em; }
.board-frame {
  position: relative;
  width: min(100%, 400px);
  margin: 0 auto 1rem;
  padding: 10px;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.tangle-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 4px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.tangle-lines { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); pointer-events: none; z-index: 0; }
.tangle-lines polyline { fill: none; stroke-width: 38; stroke-linecap: round; stroke-linejoin: round; opacity: 0.55; }
.tangle-lines polyline.trace { stroke-width: 30; opacity: 0.25; }
.tangle-lines polyline.reveal-line { stroke-width: 14; opacity: 0.8; stroke-dasharray: 2 26; }
.letter {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.2rem, 6.5vw, 1.7rem);
  cursor: pointer;
  transition: transform 0.08s;
}
.letter.selected { background: var(--ink); color: var(--bg); transform: scale(1.08); }
.letter.found { color: #1d1a16; }
.letter.found::after { content: none; }
.letter.hinted { box-shadow: inset 0 0 0 3px var(--accent); animation: pulse 1.4s infinite; }
.letter.revealed { background: var(--accent); color: var(--on-accent); border: 2px solid var(--edge); }
@keyframes pulse { 50% { box-shadow: inset 0 0 0 6px var(--accent); } }
.tangle-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Pantry ---------- */
.recipe {
  position: relative;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem 0.8rem 1.1rem;
  border: var(--bw) solid var(--edge);
  border-radius: var(--radius-sm);
  background:
    repeating-linear-gradient(to bottom, transparent 0 2.15rem, color-mix(in srgb, #3ab0e2 25%, transparent) 2.15rem calc(2.15rem + 1px)),
    var(--paper);
  color: #1d1a16;
  box-shadow: var(--shadow);
}
.recipe::before { content: ''; position: absolute; top: 0; bottom: 0; left: 2.4rem; width: 2px; background: color-mix(in srgb, var(--c-rungs) 45%, transparent); }
.recipe-title { font-family: var(--display); font-weight: 800; font-size: 1.2rem; padding-left: 1.9rem; margin-bottom: 0.2rem; }
.recipe ol { margin: 0; padding-left: 3.1rem; }
.recipe .ing { min-height: 2.15rem; display: flex; align-items: center; font-size: 1.05rem; font-weight: 600; animation: inkin 0.35s ease-out; }
.recipe .ing::marker { font-family: var(--display); font-weight: 800; color: #8a7f6d; }
.recipe .ing.locked { color: #b5aa96; font-weight: 400; letter-spacing: 0.2em; animation: none; }
@keyframes inkin { from { opacity: 0; transform: translateX(-6px); } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pantry-guesses .guess-row { grid-template-columns: 1fr repeat(2, 3.6rem); }
.guess-name small, .suggestions small { font-weight: 500; color: var(--muted); }
.guess-row.correct .guess-name small { color: inherit; opacity: 0.85; }
@media (prefers-color-scheme: dark) {
  .tangle-lines polyline.found { opacity: 0.9; }
  .tangle-lines polyline.trace { stroke: #f6efe3; opacity: 0.3; }
}

/* ---------- text pages (privacy etc.) ---------- */
.prose { max-width: 40rem; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; line-height: 1.6; }
.prose h1 { font-size: clamp(2rem, 8vw, 2.75rem); line-height: 1.05; margin: 1rem 0 0.25rem; }
.prose h2 { font-size: 1.25rem; margin: 1.75rem 0 0.4rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin: 0.35rem 0; }
.prose a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.footer-note a { color: inherit; }

/* ---------- how everyone did ---------- */
.compare { width: 100%; display: grid; gap: 0.5rem; justify-items: center; }
.compare-line { font-weight: 700; font-size: 1.05rem; }
.dist { width: min(100%, 320px); display: grid; gap: 4px; text-align: left; }
.dist-row { display: grid; grid-template-columns: 4.5rem 1fr; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.dist-label { text-align: right; color: var(--muted); font-weight: 600; white-space: nowrap; }
.dist-bar { position: relative; height: 22px; width: var(--w); min-width: 2.6rem; background: color-mix(in srgb, var(--ink, #1d1a16) 12%, transparent); border-radius: 6px; display: flex; align-items: center; justify-content: flex-end; padding: 0 6px; box-sizing: border-box; }
.dist-bar b { font-size: 0.75rem; }
.dist-row.mine .dist-label { color: inherit; }
.dist-row.mine .dist-bar { background: var(--accent); color: var(--on-accent, #fff); border: 2px solid var(--edge); }

/* ---------- usage dashboard ---------- */
.usage { max-width: 760px; display: grid; gap: 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; }
.stat-tile { display: grid; gap: 0.15rem; padding: 0.85rem 1rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); }
.stat-tile strong { font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.panel { padding: 1rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); }
.panel h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
.chart { position: relative; padding-top: 1.2rem; }
.y-max { position: absolute; top: 0; left: 0; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 25%, transparent); }
.bar-hit { flex: 1; height: 100%; display: flex; align-items: flex-end; padding: 0; background: none; border: 0; cursor: default; }
.bar { width: 100%; height: max(var(--h), 2px); background: var(--c-rungs, #ff5a5f); border-radius: 4px 4px 0 0; }
.bar-hit:hover .bar, .bar-hit:focus-visible .bar { filter: brightness(0.85); }
.chart-tip { position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); width: max-content; max-width: 220px; padding: 0.4rem 0.6rem; font-size: 0.8rem; background: var(--ink); color: var(--surface); border-radius: 6px; pointer-events: none; }
.x-axis { display: flex; justify-content: space-between; margin-top: 0.3rem; }
.panel table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.panel th, .panel td { padding: 0.4rem 0.5rem; text-align: right; border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); }
.panel th:first-child, .panel td:first-child { text-align: left; }
.panel th { font-size: 0.75rem; color: var(--muted); }
.panel details { margin-top: 0.75rem; }
.panel summary { cursor: pointer; font-size: 0.85rem; color: var(--muted); }

/* ---------- add to home screen ---------- */
.install-card { display: flex; gap: 1rem; align-items: flex-start; margin-top: 1.25rem; padding: 1rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.install-icon { flex: 0 0 52px; height: 52px; }
.install-text { display: grid; gap: 0.3rem; font-size: 0.95rem; }
.install-text strong { font-size: 1.05rem; }
.ios-share { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.15em; }
.install-actions { display: flex; gap: 1rem; align-items: center; margin-top: 0.25rem; }
.install-actions .btn { min-height: 40px; padding: 0.4rem 1rem; font-size: 0.9rem; }

/* ---------- practice mode ---------- */
.practice-bar { max-width: 560px; margin: 0 auto; padding: 0.5rem 1rem; display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; font-weight: 700; background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px); border: 2px dashed var(--edge); border-radius: var(--radius-sm); }
.practice-links { display: flex; gap: 1rem; }
.practice-links a { color: inherit; }
.practice-game { display: grid; gap: 0.6rem; padding: 1rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); }
.practice-game h2 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; margin: 0; }
.practice-game h2 .icon { width: 36px; height: 36px; }
.practice-nums { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; }
.practice-nums a { display: grid; place-items: center; min-height: 46px; font-weight: 800; color: var(--ink); text-decoration: none; border: 2px solid var(--edge); border-radius: 10px; background: var(--surface-2); }
.practice-nums a.done { background: var(--pc); color: var(--pc-ink); }
.practice { display: grid; gap: 1rem; }

/* ---------- Before/After ---------- */
.ba-stage { display: grid; gap: 0.6rem; margin: 0.5rem 0 1rem; }
.event-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.85rem; padding: 1rem 1.1rem; min-height: 96px; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.event-emoji { font-size: 2rem; line-height: 1; }
.event-text { font-weight: 700; font-size: 1.08rem; line-height: 1.25; }
.event-year { font-weight: 800; font-size: 1.15rem; padding: 0.3rem 0.7rem; border: 2px solid var(--edge); border-radius: 999px; background: var(--accent); color: var(--on-accent, #1d1a16); font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-card.mystery .event-year { background: var(--surface-2); color: var(--ink); min-width: 3.2rem; text-align: center; }
.event-card.mystery { border-style: dashed; }
.event-card.right { border-style: solid; background: color-mix(in srgb, #33b679 18%, var(--surface)); animation: pop 0.3s ease; }
.event-card.wrong { border-style: solid; background: color-mix(in srgb, #ff5a5f 18%, var(--surface)); animation: shake 0.35s ease; }
.event-card.right .event-year, .event-card.wrong .event-year { background: var(--ink); color: var(--surface); }
.ba-question { text-align: center; font-weight: 800; font-size: 1.05rem; margin: 0.15rem 0; }
.ba-question.right { color: #1f8a55; }
.ba-question.wrong { color: #d6363b; }
.ba-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.ba-btn { min-height: 64px; font-size: 1.05rem; background: var(--accent); color: var(--on-accent, #1d1a16); }
.ba-timeline { margin-top: 1.25rem; }
.ba-timeline h3 { margin-bottom: 0.6rem; }
.ba-timeline ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-left: 3px solid var(--edge); margin-left: 2.6rem; }
.ba-timeline li { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; padding: 0.55rem 0 0.55rem 1rem; }
.ba-timeline li::before { content: ''; position: absolute; left: -8px; top: 0.95rem; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--edge); }
.tl-year { position: absolute; right: calc(100% + 0.9rem); top: 0.62rem; font-weight: 800; font-size: 0.85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-text { font-size: 0.95rem; }
.tl-mark { font-weight: 800; }
.ba-timeline li.ok .tl-mark { color: #1f8a55; }
.ba-timeline li.bad .tl-mark { color: #d6363b; }
.ba-timeline li.start::before { background: var(--accent); }
@media (prefers-color-scheme: dark) { .ba-question.right, .ba-timeline li.ok .tl-mark { color: #5ad392; } .ba-question.wrong, .ba-timeline li.bad .tl-mark { color: #ff7b7f; } }

/* ---------- Hivemind ---------- */
.hive-prompt { text-align: center; padding: 1.5rem 1rem 1rem; display: grid; gap: 0.35rem; justify-items: center; }
.hive-emoji { font-size: 3.2rem; line-height: 1; }
.hive-prompt h2 { font-size: clamp(1.6rem, 7vw, 2.1rem); line-height: 1.1; }
.hive-confirm { display: grid; gap: 1rem; justify-items: center; padding: 1rem; }
.hive-choice { font-size: 1.8rem; font-weight: 800; padding: 0.6rem 1.4rem; background: var(--accent); color: var(--on-accent); border: var(--bw) solid var(--edge); border-radius: 999px; box-shadow: var(--shadow); }
.hive-confirm-actions { display: flex; gap: 0.75rem; }
.hive-results { display: grid; gap: 0.85rem; margin-top: 1rem; }
.hive-card { padding: 1rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); display: grid; gap: 0.6rem; }
.hive-card h3 { font-size: 1.05rem; margin: 0; }
.hive-card .dist { width: 100%; }
.hive-card .dist-row { grid-template-columns: 7.5rem 1fr; }
.hive-card .dist-label { white-space: normal; line-height: 1.15; }
.yesterday-link { display: flex; justify-content: center; margin-top: 1rem; }

/* ---------- Overlap ---------- */
.ov-ask { text-align: center; font-weight: 700; margin: 0.5rem 0 0.25rem; }
.venn { position: relative; height: 210px; margin: 0.5rem auto 1rem; max-width: 360px; }
.venn-a, .venn-b { position: absolute; top: 0; width: 62%; aspect-ratio: 1; max-height: 210px; border: var(--bw) solid var(--edge); border-radius: 50%; display: flex; align-items: center; font-weight: 800; font-size: 1rem; line-height: 1.15; }
.venn-a { left: 0; background: color-mix(in srgb, var(--accent) 55%, transparent); justify-content: flex-start; padding-left: 7%; }
.venn-b { right: 0; background: color-mix(in srgb, #ffc93c 55%, transparent); justify-content: flex-end; padding-right: 7%; text-align: right; }
.venn-a > span, .venn-b > span { max-width: 50%; }
.venn-q { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: 50%; }
.ov-form { justify-content: center; }
.ov-form.shake { animation: shake 0.35s ease; }
.ov-status { text-align: center; font-weight: 700; min-height: 1.5em; margin: 0.6rem 0; }
.ov-status.right { color: #1f8a55; }
.ov-status.wrong { color: #d6363b; }
.ov-lives { display: flex; gap: 4px; font-size: 1.1rem; color: var(--accent); -webkit-text-stroke: 1px var(--edge); }
.ov-lives .lost { color: transparent; }
.ov-results { display: grid; gap: 0.85rem; margin-top: 1rem; }
.ov-answers { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; font-size: 0.92rem; }
.ov-answers li { display: flex; justify-content: space-between; padding: 0.3rem 0.5rem; border-radius: 6px; }
.ov-answers li.mine { background: var(--accent); color: var(--on-accent); font-weight: 800; }
.ov-answers li.mine .muted { color: inherit; }
.ov-answers li.unclaimed span:first-child { font-style: italic; }
@media (prefers-color-scheme: dark) { .ov-status.right { color: #5ad392; } .ov-status.wrong { color: #ff7b7f; } }

/* ---------- Birdsong ---------- */
.song { display: grid; justify-items: center; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.song-btn { --p: 0; position: relative; width: 132px; height: 132px; border-radius: 50%; border: var(--bw) solid var(--edge); background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; }
.song-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--edge); }
.song-ring { position: absolute; inset: 8px; border-radius: 50%; background: conic-gradient(var(--on-accent) calc(var(--p) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 54px, #000 55px); mask: radial-gradient(circle, transparent 54px, #000 55px); opacity: 0.85; }
.song-label { font-size: 2.6rem; line-height: 1; margin-left: 0.25rem; }
.song-btn.playing .song-label { margin-left: 0; font-size: 2rem; }
.song-bars { position: absolute; bottom: 24px; display: flex; gap: 3px; height: 16px; align-items: flex-end; opacity: 0; }
.song-bars i { width: 4px; height: 30%; background: var(--on-accent); border-radius: 2px; }
.song-btn.playing .song-bars { opacity: 1; }
.song-btn.playing .song-bars i { animation: songbar 0.9s ease-in-out infinite; }
.song-btn.playing .song-bars i:nth-child(2) { animation-delay: 0.15s; }
.song-btn.playing .song-bars i:nth-child(3) { animation-delay: 0.3s; }
.song-btn.playing .song-bars i:nth-child(4) { animation-delay: 0.45s; }
.song-btn.playing .song-bars i:nth-child(5) { animation-delay: 0.6s; }
.song-btn.playing .song-label { transform: translateY(-8px); }
@keyframes songbar { 0%, 100% { height: 25%; } 50% { height: 100%; } }
@media (prefers-reduced-motion: reduce) { .song-btn.playing .song-bars i { animation: none; height: 60%; } }
.credit a { color: inherit; }
.ov-hint { font-weight: 700; font-size: 0.9rem; }
.venn-note { display: block; font-size: 0.72rem; font-weight: 600; margin-top: 0.2rem; }
.practice-bar { flex-wrap: wrap; row-gap: 0.25rem; }
.practice-links { white-space: nowrap; }
.share-buttons { width: min(100%, 320px); display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.share-buttons .btn { width: 100%; }
.share-buttons .btn.primary { grid-column: 1 / -1; }
.share-buttons .x-btn { background: #000; color: #fff; text-decoration: none; justify-content: center; }
.share-buttons > :last-child:nth-child(2) { grid-column: 1 / -1; }

/* ---------- Ballpark ---------- */
.bp-prompt { padding-bottom: 0.5rem; }
.bp-prompt h2 { font-size: clamp(1.35rem, 5.5vw, 1.8rem); max-width: 22em; }
.bp-form { display: grid; gap: 0.7rem; justify-items: center; }
.bp-inputs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.4rem; font-weight: 700; }
.bp-inputs input { width: 5.8rem; font: inherit; font-size: 1.15rem; font-weight: 800; text-align: center; padding: 0.6rem 0.5rem; border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.bp-unit { flex-basis: 100%; text-align: center; color: var(--muted); font-weight: 600; }
.bp-status { text-align: center; min-height: 2.6em; margin: 0; font-size: 0.95rem; }
.bp-status.wrong { color: #d6363b; font-weight: 700; }
.bp-go { min-width: 12rem; background: var(--accent); color: var(--on-accent); }
.bp-reveal { display: grid; gap: 0.6rem; justify-items: center; text-align: center; padding: 0.5rem 0 1rem; }
.bp-verdict { font-weight: 800; font-size: 1.15rem; margin: 0; }
.bp-verdict.right { color: #1f8a55; }
.bp-verdict.wrong { color: #d6363b; }
.bp-big { margin: 0; }
.bp-line { position: relative; width: 100%; max-width: 440px; height: 64px; margin: 1.6rem 0 0.4rem; }
.bp-line::before { content: ''; position: absolute; left: 0; right: 0; top: 24px; height: 4px; background: var(--edge); opacity: 0.25; border-radius: 2px; }
.bp-range { position: absolute; top: 14px; height: 24px; min-width: 6px; background: var(--accent); border: var(--bw) solid var(--edge); border-radius: 999px; transform: translateX(0); }
.bp-line.miss .bp-range { background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.bp-answer { position: absolute; top: 4px; width: 4px; height: 44px; margin-left: -2px; background: #1d1a16; border-radius: 2px; }
.bp-answer b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 0.8rem; padding: 0 0.3rem; background: var(--surface); border-radius: 4px; }
.bp-tick { position: absolute; top: 44px; transform: translateX(-50%); font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.bp-list { display: grid; gap: 0.85rem; margin-top: 1rem; }
.bp-card .bp-line { margin-top: 1.1rem; max-width: none; }
@media (prefers-color-scheme: dark) { .bp-verdict.right { color: #5ad392; } .bp-verdict.wrong, .bp-status.wrong { color: #ff7b7f; } .bp-answer { background: #fffdf6; } }

/* ---------- Glimpse ---------- */
.glimpse-frame { position: relative; aspect-ratio: 1; width: 100%; max-width: 420px; margin: 0.5rem auto 1rem; overflow: hidden; border: var(--bw) solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow); background: #2a2520; }
.glimpse-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.7s cubic-bezier(.3,.7,.3,1); user-select: none; -webkit-user-drag: none; }
.glimpse-frame.done { aspect-ratio: auto; }
.glimpse-frame.done img { height: auto; object-fit: contain; }
.glimpse-zoom { position: absolute; right: 10px; bottom: 10px; padding: 0.15rem 0.6rem; font-weight: 800; font-size: 0.85rem; background: var(--surface); color: var(--ink); border: 2px solid var(--edge); border-radius: 999px; }

/* ---------- Dawn Chorus ---------- */
.voices { display: grid; gap: 0.5rem; margin: 0 0 1rem; }
.voice { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0.7rem; padding: 0.6rem 0.85rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); }
.voice.known { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.voice.missed { background: color-mix(in srgb, #ff5a5f 25%, var(--surface)); }
.voice-name { font-weight: 800; }
.voice-bars { display: flex; gap: 3px; height: 18px; align-items: flex-end; }
.voice-bars i { width: 4px; height: 4px; background: var(--edge); border-radius: 2px; }
.voice.live .voice-bars i { animation: bars 0.9s ease-in-out infinite; }
.voice.live .voice-bars i:nth-child(2) { animation-delay: -0.3s; }
.voice.live .voice-bars i:nth-child(3) { animation-delay: -0.6s; }
.voice.live .voice-bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes bars { 0%, 100% { height: 4px; } 50% { height: 18px; } }
.chorus-credits { list-style: none; padding: 0; margin: 0.25rem 0; display: grid; gap: 0.15rem; }

/* ---------- Life list ---------- */
.life-note { font-weight: 700; margin: 0.25rem 0; }
.life-note.fresh { padding: 0.4rem 0.8rem; background: #fff3c4; color: #1d1a16; border: 2px solid var(--edge); border-radius: 999px; }
.life-note.fresh a { color: inherit; }
.life-head { text-align: center; display: grid; gap: 0.4rem; justify-items: center; margin-bottom: 1rem; }
.life-head .big small { font-size: 1rem; font-weight: 700; color: var(--muted); }
.life-bar { width: 100%; max-width: 360px; height: 16px; border: var(--bw) solid var(--edge); border-radius: 999px; overflow: hidden; background: var(--surface); }
.life-bar span { display: block; height: 100%; background: var(--c-birdaday); }
.life-family { margin: 1.2rem 0; }
.life-family h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.life-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.6rem; }
.life-card { display: grid; gap: 0.25rem; align-content: start; padding: 0.4rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); font-size: 0.85rem; line-height: 1.15; }
.life-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.life-card.unseen { opacity: 0.55; border-style: dashed; justify-items: center; text-align: center; }
.life-q { display: grid; place-items: center; width: 100%; aspect-ratio: 1; font-size: 1.8rem; font-weight: 800; background: color-mix(in srgb, var(--edge) 8%, transparent); border-radius: 8px; }
.life-link { display: grid; grid-template-columns: auto 1fr auto; gap: 0.8rem; align-items: center; margin: 1.2rem 0 0; padding: 0.8rem 1rem; background: var(--surface); color: var(--ink); text-decoration: none; border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 1.05rem; }
.life-link > span:first-child { font-size: 1.6rem; }
.life-link small { display: block; color: var(--muted); font-size: 0.85rem; }
.life-families { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.life-families li { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr auto; gap: 0.6rem; align-items: center; font-weight: 700; font-size: 0.92rem; }
.life-families li.complete { color: #1f8a55; }
.life-dots { display: flex; flex-wrap: wrap; gap: 3px; }
.life-dots i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--edge); opacity: 0.35; }
.life-dots i.on { background: var(--c-birdaday); opacity: 1; }
@media (prefers-color-scheme: dark) { .life-families li.complete { color: #5ad392; } }

/* =========================================================================
   Field guide theme (the bird site): aged paper, serif type, thin ruled
   plates, Latin names in italics, muted natural colours. Set on <html>.
   ========================================================================= */
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }

html[data-theme='fieldguide'] {
  --bg: #f3ead6;
  --bg-dots: transparent;
  --surface: #fbf6ea;
  --surface-2: #efe5cf;
  --ink: #2b2418;
  --muted: #6f624d;
  --edge: #3d3427;
  --soft: #ddd0b4;
  --ok: #5d8a4e;
  --close: #c9a227;
  --bad: #b5523b;
  --miss: #9a8f7c;
  --c-birdaday: #8fae7c;
  --c-birdsong: #7fb0a8;
  --c-glimpse: #d2a865;
  --c-chorus: #e0a184;
  --c-clutch: #a9c2d4;
  --radius: 6px;
  --radius-sm: 4px;
  --bw: 1.5px;
  --shadow: 0 1px 0 rgb(61 52 39 / 0.25), 0 6px 14px -8px rgb(61 52 39 / 0.45);
  --shadow-sm: 0 1px 0 rgb(61 52 39 / 0.25);
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --body: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
}
@media (prefers-color-scheme: dark) {
  html[data-theme='fieldguide'] {
    --bg: #1c1a14;
    --surface: #26231b;
    --surface-2: #2e2a20;
    --ink: #efe6d2;
    --muted: #b3a68c;
    --edge: #8b7d62;
    --soft: #3a3428;
    --shadow: 0 6px 14px -8px #000;
    --shadow-sm: none;
  }
}
/* Paper: a faint fibre texture instead of the puzzle site's dots. */
html[data-theme='fieldguide'] body {
  background-image:
    radial-gradient(ellipse at 20% 0%, rgb(255 255 255 / 0.35), transparent 60%),
    repeating-linear-gradient(0deg, rgb(61 52 39 / 0.025) 0 1px, transparent 1px 3px);
  background-size: auto;
}
html[data-theme='fieldguide'] body[data-game='birdaday'] { --on-accent: #1e2a16; }
html[data-theme='fieldguide'] body[data-game='birdsong'] { --on-accent: #10231f; }
html[data-theme='fieldguide'] body[data-game='glimpse'] { --on-accent: #2a1d08; }
html[data-theme='fieldguide'] body[data-game='chorus'] { --on-accent: #2b150b; }

/* Type: serif headings, small-caps labels, italic Latin names. */
html[data-theme='fieldguide'] h1, html[data-theme='fieldguide'] h2, html[data-theme='fieldguide'] h3 { font-weight: 600; letter-spacing: 0; font-variation-settings: 'SOFT' 50, 'WONK' 0; }
html[data-theme='fieldguide'] .topbar h1, html[data-theme='fieldguide'] .brand span:last-child { font-family: var(--display); font-style: italic; font-weight: 600; letter-spacing: 0.01em; }
html[data-theme='fieldguide'] .today .date,
html[data-theme='fieldguide'] .round-head,
html[data-theme='fieldguide'] .guess-row.head,
html[data-theme='fieldguide'] .clue-label { font-family: var(--display); font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.08em; font-weight: 600; }
html[data-theme='fieldguide'] .today h1 { font-weight: 500; font-style: italic; }
html[data-theme='fieldguide'] .bird-name { font-family: var(--display); font-weight: 600; }
html[data-theme='fieldguide'] em { font-family: var(--display); }

/* Plates: thin double-ruled frames instead of chunky outlines. */
html[data-theme='fieldguide'] .card,
html[data-theme='fieldguide'] .summary,
html[data-theme='fieldguide'] .progress,
html[data-theme='fieldguide'] .modal,
html[data-theme='fieldguide'] .life-link,
html[data-theme='fieldguide'] .hive-card,
html[data-theme='fieldguide'] .glimpse-frame {
  outline: 1px solid var(--edge);
  outline-offset: 3px;
}
html[data-theme='fieldguide'] .card { min-height: 210px; margin: 4px; }
html[data-theme='fieldguide'] .card strong { font-family: var(--display); font-weight: 600; font-size: 1.3rem; }
html[data-theme='fieldguide'] .card .icon { width: 64px; height: 64px; padding: 6px; border: 1px solid var(--card-ink, var(--edge)); border-radius: 50%; background: rgb(255 255 255 / 0.35); }
html[data-theme='fieldguide'] .card .icon svg { --edge: #3d3427; }
html[data-theme='fieldguide'] .card .status, html[data-theme='fieldguide'] .btn { font-family: var(--display); font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.06em; font-weight: 600; }
html[data-theme='fieldguide'] .btn { border-radius: var(--radius-sm); }
html[data-theme='fieldguide'] .card.new::after { font-family: var(--display); }
html[data-theme='fieldguide'] .icon-btn, html[data-theme='fieldguide'] .back { box-shadow: none; }
html[data-theme='fieldguide'] .chip, html[data-theme='fieldguide'] .guess-name { border-radius: var(--radius-sm); }
html[data-theme='fieldguide'] .song-btn { box-shadow: var(--shadow); outline: 1px solid var(--edge); outline-offset: 4px; }
html[data-theme='fieldguide'] .life-card { outline: none; }
html[data-theme='fieldguide'] .life-card strong { font-family: var(--display); font-weight: 600; }
html[data-theme='fieldguide'] .life-bar span, html[data-theme='fieldguide'] .life-dots i.on { background: var(--ok); }
html[data-theme='fieldguide'] .footer-note { font-style: italic; }
@media (prefers-color-scheme: dark) {
  html[data-theme='fieldguide'] .card .icon { background: rgb(255 255 255 / 0.5); }
}
html[data-theme='fieldguide'] body { font-variant-numeric: lining-nums; }
html[data-theme='fieldguide'] .clue-label { border-radius: 2px; }
@media (prefers-color-scheme: dark) {
  html[data-theme='fieldguide'] body { background-image: repeating-linear-gradient(0deg, rgb(255 255 255 / 0.015) 0 1px, transparent 1px 3px); }
}
/* Field-guide illustrations: round cream medallions. */
.fg-icon { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.fg-logo { border-radius: 7px; }
html[data-theme='fieldguide'] .card .icon { width: 84px; height: 84px; padding: 0; overflow: hidden; background: #f1e9d6; }
html[data-theme='fieldguide'] .life-icon { width: 52px; height: 52px; border: 1px solid var(--edge); border-radius: 50%; overflow: hidden; }
html[data-theme='fieldguide'] .install-icon .fg-icon, html[data-theme='fieldguide'] .brand .logo .fg-icon { border-radius: 7px; }
.life-link .life-icon { display: block; width: 52px; height: 52px; flex: none; }
.life-link .life-icon svg { width: 100%; height: 100%; display: block; }

/* ---------- Clutch ---------- */
.clutch-birds { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1rem; }
.clutch-bird { display: grid; gap: 0.35rem; align-content: start; justify-items: center; text-align: center; padding: 0.6rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); }
.clutch-bird strong { font-family: var(--display); line-height: 1.15; font-size: 0.95rem; min-height: 2.3em; display: grid; place-items: center; }
.clutch-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: grid; place-items: center; font-size: 2rem; background: var(--surface-2); }
.clutch-slot { width: 84px; height: 84px; display: grid; place-items: center; padding: 0; border: 2px dashed var(--edge); border-radius: 14px; background: var(--surface-2); color: var(--ink); cursor: pointer; overflow: hidden; }
.clutch-slot.full { border-style: solid; background: #111; }
.clutch-slot.selected, .clutch-egg.selected { outline: 3px solid var(--accent); outline-offset: 3px; transform: translateY(-2px); }
.clutch-slot:disabled { cursor: default; }
.egg-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clutch-tray { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.25rem 0 0.5rem; }
.clutch-egg { width: 76px; height: 76px; padding: 0; border: var(--bw) solid var(--edge); border-radius: 14px; overflow: hidden; background: #111; cursor: pointer; box-shadow: var(--shadow-sm); }
.clutch-msg { text-align: center; min-height: 1.5em; color: var(--muted); margin: 0.25rem 0; }
.clutch-msg.shown { color: var(--ink); font-weight: 700; }
.clutch-check { min-width: 10rem; }
.clutch-nest { font-size: 0.82rem; line-height: 1.3; margin: 0; text-align: left; color: var(--muted); }
.clutch-nest span { font-weight: 700; color: var(--ink); }
.clutch-history { list-style: none; padding: 0; margin: 0.5rem 0; display: grid; gap: 0.35rem; }
.clutch-history li { display: grid; grid-template-columns: 1.2rem 1fr auto; align-items: center; gap: 0.6rem; }
.clutch-mini { display: flex; gap: 4px; }
.egg-img.mini { width: 34px; height: 34px; border-radius: 6px; background: #111; }

/* ---------- Question of the day (bird site home) ---------- */
.qotd { margin: 0 0 1.25rem; padding: 1rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 0.6rem; }
.qotd h2 { font-size: 1.25rem; margin: 0; line-height: 1.25; }
.qotd-label { margin: 0; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.qotd-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.qotd-options .btn { min-height: 46px; padding: 0.5rem 0.7rem; line-height: 1.2; white-space: normal; text-align: center; }
.qotd-range { display: grid; gap: 0.5rem; justify-items: center; }
.qotd-msg { margin: 0; text-align: center; }
.qotd-birds { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.5rem; }
.qotd-bird { position: relative; display: grid; gap: 0.3rem; padding: 0.4rem; background: var(--surface-2); color: var(--ink); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); font: inherit; font-weight: 700; font-size: 0.88rem; line-height: 1.15; cursor: pointer; }
.qotd-bird img, .qotd-nophoto { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: grid; place-items: center; font-size: 1.6rem; }
.qotd-bird.picked { outline: 3px solid var(--ok); outline-offset: 1px; }
.qotd-rank { position: absolute; top: 6px; left: 6px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ok); color: #fff; font-size: 1rem; }
.qotd > .btn, .qotd div > .btn.primary { justify-self: center; min-width: 9rem; }
.qotd-verdict { margin: 0; font-weight: 800; font-size: 1.1rem; }
.qotd-verdict.right { color: var(--ok); }
.qotd-verdict.wrong { color: var(--bad); }
.qotd-answer { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.15rem; }
.qotd-foot { margin: 0; color: var(--muted); font-weight: 700; }
html[data-theme='fieldguide'] .qotd { outline: 1px solid var(--edge); outline-offset: 3px; }
html[data-theme='fieldguide'] .qotd-label { font-family: var(--display); font-variant: small-caps; text-transform: lowercase; letter-spacing: 0.08em; font-weight: 600; }
.qotd-size { display: grid; gap: 0.5rem; }

/* =========================================================================
   Game box theme (the puzzles site): a 1950s–60s board game on the family
   shelf. Cardboard, bold slab lettering, slightly faded primary colours,
   game-card frames and chunky pieces. Set on <html>.
   ========================================================================= */
@font-face { font-family: 'Alfa Slab'; src: url('../fonts/alfa-slab-one.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Zilla Slab'; src: url('../fonts/zilla-slab-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Zilla Slab'; src: url('../fonts/zilla-slab-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

html[data-theme='gamebox'] {
  --bg: #ecdcb8;
  --bg-dots: transparent;
  --surface: #fbf3df;
  --surface-2: #f3e6c8;
  --ink: #1f1a17;
  --muted: #6b5a45;
  --edge: #1f1a17;
  --soft: #dcc9a3;
  --ok: #3b8a57;
  --close: #e0a526;
  --bad: #c8402e;
  --miss: #8f8170;
  --c-timeline: #e3a72f;
  --c-ballpark: #c8402e;
  --c-fold: #2f6f9f;
  --c-ripple: #3b8a57;
  --radius: 10px;
  --radius-sm: 7px;
  --bw: 3px;
  --shadow: 5px 5px 0 var(--edge);
  --shadow-sm: 3px 3px 0 var(--edge);
  --display: 'Alfa Slab', 'Rockwell', 'Roboto Slab', Georgia, serif;
  --body: 'Zilla Slab', 'Rockwell', Georgia, serif;
}
@media (prefers-color-scheme: dark) {
  html[data-theme='gamebox'] {
    --bg: #211c17;
    --surface: #2e2720;
    --surface-2: #372f26;
    --ink: #f4e8cf;
    --muted: #bba98b;
    --edge: #0d0b09;
    --soft: #43392d;
  }
}
html[data-theme='gamebox'] body[data-game='beforeafter'] { --on-accent: #1f1a17; }
html[data-theme='gamebox'] body[data-game='ballpark'] { --on-accent: #fff6e3; }
html[data-theme='gamebox'] body[data-game='fold'] { --on-accent: #fff6e3; }
html[data-theme='gamebox'] body[data-game='ripple'] { --on-accent: #fff6e3; }

/* Cardboard: flecks of fibre over a warm tan, and a striped band along the top like a box lid. */
html[data-theme='gamebox'] body {
  font-size: 17px;
  background-image:
    radial-gradient(rgb(90 60 30 / 0.07) 1px, transparent 1.5px),
    radial-gradient(rgb(255 255 255 / 0.18) 1px, transparent 1.5px);
  background-size: 7px 7px, 11px 11px;
  background-position: 0 0, 3px 5px;
}
html[data-theme='gamebox'] body::before {
  content: ''; display: block; height: 10px;
  background: repeating-linear-gradient(90deg, #c8402e 0 28px, #e3a72f 28px 56px, #2f6f9f 56px 84px, #3b8a57 84px 112px);
  border-bottom: 3px solid var(--edge);
}
@media (prefers-color-scheme: dark) {
  html[data-theme='gamebox'] body { background-image: radial-gradient(rgb(255 255 255 / 0.04) 1px, transparent 1.5px); background-size: 7px 7px; }
}

/* Lettering: slab titles, uppercase labels. */
html[data-theme='gamebox'] h1, html[data-theme='gamebox'] h2, html[data-theme='gamebox'] h3 { font-weight: 400; letter-spacing: 0.01em; }
html[data-theme='gamebox'] .today h1 { font-weight: 400; font-size: clamp(2.3rem, 10.5vw, 3.2rem); text-shadow: 3px 3px 0 var(--soft); }
html[data-theme='gamebox'] .topbar h1, html[data-theme='gamebox'] .brand span:last-child { font-family: var(--display); font-weight: 400; letter-spacing: 0.02em; }
html[data-theme='gamebox'] .today .date, html[data-theme='gamebox'] .round-head { font-family: var(--body); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

/* Game cards: like box lids, a cream rule inset from the coloured panel. */
html[data-theme='gamebox'] .card {
  box-shadow: var(--shadow), inset 0 0 0 6px var(--card, var(--surface)), inset 0 0 0 8px rgb(255 246 227 / 0.75);
  padding: 1rem;
}
html[data-theme='gamebox'] .card strong { font-family: var(--display); font-weight: 400; font-size: 1.45rem; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1.05; }
html[data-theme='gamebox'] .card .tagline { font-size: 0.98rem; line-height: 1.3; }
html[data-theme='gamebox'] .card .status,
html[data-theme='gamebox'] .btn { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.05em; border-radius: var(--radius-sm); }
html[data-theme='gamebox'] .card.new::after { font-family: var(--display); font-weight: 400; }
html[data-theme='gamebox'] .summary, html[data-theme='gamebox'] .progress, html[data-theme='gamebox'] .modal, html[data-theme='gamebox'] .life-link {
  box-shadow: var(--shadow), inset 0 0 0 5px var(--surface), inset 0 0 0 7px var(--soft);
}
html[data-theme='gamebox'] .big { font-family: var(--display); font-weight: 400; }
html[data-theme='gamebox'] .footer-note { font-weight: 700; letter-spacing: 0.03em; }
html[data-theme='gamebox'] .card strong { font-size: clamp(1.05rem, 5.2vw, 1.4rem); }
html[data-theme='gamebox'] body { font-variant-numeric: lining-nums tabular-nums; }
/* Cream lettering on the darker box colours (the registry's ink suits the default colours). */
html[data-theme='gamebox'] .card[href='ballpark/'], html[data-theme='gamebox'] .card[href='fold/'], html[data-theme='gamebox'] .card[href='ripple/'] { --card-ink: #fff6e3 !important; }
html[data-theme='gamebox'] .card[href='before-after/'] { --card-ink: #1f1a17 !important; }
html[data-theme='gamebox'] { font-synthesis: none; } /* the slab face has one weight: never fake-bold it */
.life-link .sister-icon img { border-radius: 10px; }
html[data-theme='fieldguide'] .install-card { outline: 1px solid var(--edge); outline-offset: 3px; }
html[data-theme='gamebox'] .install-card { box-shadow: var(--shadow), inset 0 0 0 5px var(--surface), inset 0 0 0 7px var(--soft); }
/* Game-box illustrations: cream game pieces with an ink edge. */
.gb-icon { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
html[data-theme='gamebox'] .card .icon { width: 80px; height: 80px; border: var(--bw) solid var(--edge); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-sm); background: #ecdcb8; }
html[data-theme='gamebox'] .brand .logo .gb-icon, html[data-theme='gamebox'] .install-icon .gb-icon { border-radius: 6px; }

/* ---------- email sign-up ---------- */
.signup-card { margin: 1.2rem 0 0; padding: 1rem; background: var(--surface); border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); box-shadow: var(--shadow); display: grid; gap: 0.35rem; }
.signup-card strong { font-family: var(--display); font-size: 1.15rem; }
.signup-card p { margin: 0; }
.signup-form { display: flex; gap: 0.5rem; margin-top: 0.35rem; }
.signup-form input[type='email'] { flex: 1; min-width: 0; font: inherit; padding: 0.6rem 0.75rem; border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); }
.signup-form .btn { min-height: 0; white-space: nowrap; }
.signup-msg { margin-top: 0.15rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
html[data-theme='fieldguide'] .signup-card { box-shadow: var(--shadow); outline: 1px solid var(--edge); outline-offset: 3px; }
html[data-theme='gamebox'] .signup-card { box-shadow: var(--shadow), inset 0 0 0 5px var(--surface), inset 0 0 0 7px var(--soft); }
.signup-card > * { min-width: 0; }
.signup-form input[type='email'] { width: 100%; }
.signup-form .btn { flex: none; padding-inline: 1rem; }

/* ---------- feedback ---------- */
.page-feedback { max-width: 560px; margin: -2.5rem auto 2rem; padding: 0 1rem calc(1rem + env(safe-area-inset-bottom)); text-align: center; font-size: 0.9rem; }
.page-feedback .linklike { color: var(--muted); }
.feedback-form { display: grid; gap: 0.6rem; }
.feedback-form textarea, .feedback-form input { font: inherit; padding: 0.6rem 0.75rem; border: var(--bw) solid var(--edge); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); width: 100%; }
.feedback-form textarea { resize: vertical; min-height: 7rem; }
.feedback-form p { margin: 0; }
.feedback-form .btn { justify-self: start; }
.feedback-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.feedback-list li { padding: 0.6rem 0.75rem; border: 1px solid var(--soft); border-radius: var(--radius-sm); background: var(--surface-2); }
.feedback-list p { margin: 0; white-space: pre-wrap; }
