/*
  Chrillion: "knitted sweater" identity.
  Cranberry knit page, cream knitted patches, chunky stamped buttons, pixel sprites, Fair Isle trim.
*/
:root {
  --page: #6e1620;
  --page-deep: #4c0e15;
  --page-ink: #f6ecd6;
  --page-muted: #ecc8b8;
  --patch: #f4e8d0;
  --patch-2: #eadcbf;
  --ink: #2b1d18;
  --muted: #6e5a4c;
  --line: rgba(43, 29, 24, 0.18);
  --stitch: rgba(43, 29, 24, 0.28);
  --red: #c8323a;
  --red-deep: #8e1f26;
  --green: #2f7a46;
  --green-deep: #1d5230;
  --gold: #f2c14e;
  --gold-deep: #b8892a;

  --t-miracle: #d79b00;
  --t-75: #e2562b;
  --t-50: #23924a;
  --t-25: #2f74c0;
  --t-trap: #c2399a;
  --t-10: #9a7650;
  --t-miss: #8e1f26;
  --t-timeout: #ffffff;

  --radius: 10px;
  --drop: 0 4px 0 rgba(30, 6, 9, 0.45);
  --font-display: "Jersey 15", "Arial Narrow", Impact, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --knit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='9'%3E%3Cellipse cx='3' cy='4.5' rx='2.1' ry='4' transform='rotate(-22 3 4.5)' fill='%23ffffff' fill-opacity='0.055'/%3E%3Cellipse cx='7' cy='4.5' rx='2.1' ry='4' transform='rotate(22 7 4.5)' fill='%23ffffff' fill-opacity='0.055'/%3E%3C/svg%3E");
  --knit-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='9'%3E%3Cellipse cx='3' cy='4.5' rx='2.1' ry='4' transform='rotate(-22 3 4.5)' fill='%232b1d18' fill-opacity='0.045'/%3E%3Cellipse cx='7' cy='4.5' rx='2.1' ry='4' transform='rotate(22 7 4.5)' fill='%232b1d18' fill-opacity='0.045'/%3E%3C/svg%3E");
  --zigzag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 1 L6 7 L12 1' fill='none' stroke='%23f6ecd6' stroke-width='2.2'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }

body {
  min-height: 100vh;
  background-color: var(--page);
  background-image: var(--knit), linear-gradient(180deg, var(--page) 0%, var(--page-deep) 100%);
  background-attachment: fixed;
  color: var(--page-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.sheet-open { overflow: hidden; }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.wrap { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 10px 16px 48px; }
[hidden] { display: none !important; }
.spr { display: inline-block; vertical-align: middle; flex: none; }

.eyebrow {
  font: 400 17px/1 var(--font-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0;
}
.muted { color: var(--muted); font-size: 14px; }

/* A knitted patch: cream, faint stitch texture, stitched (dashed) inner border. */
.patch, .card, .hero, .prompt-card, .feedback, dialog, .tile-sm, .ol-panel {
  background-color: var(--patch);
  background-image: var(--knit-dark);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--drop);
  outline: 2px dashed var(--stitch);
  outline-offset: -7px;
}

/* ---------- buttons ---------- */
.btn {
  appearance: none; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 8px; padding: 11px 18px;
  font: 700 16px/1.2 var(--font-body); color: var(--page-ink);
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s ease;
}
.btn:active, .tile:active, .tile-sm:active, .pill-gold:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:hover { filter: brightness(1.06); }
button:focus-visible, input:focus-visible, .wordmark:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--red); }
.btn-secondary { background: var(--green); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; box-shadow: none; }
.btn-ghost:active { transform: none; box-shadow: none; }
.btn-block { display: block; width: 100%; margin-top: 10px; }

.icon-btn {
  appearance: none; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 8px;
  border: 2px solid rgba(246, 236, 214, 0.55); background: rgba(0, 0, 0, 0.12);
  color: var(--page-ink); font-size: 18px; cursor: pointer;
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.24); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; stroke-linejoin: miter; }
.icon-btn[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
#btn-sfx .mute { display: none; }
#btn-sfx[aria-pressed="false"] .wave { display: none; }
#btn-sfx[aria-pressed="false"] .mute { display: inline; }
#btn-sfx[aria-pressed="true"] { color: var(--page-ink); border-color: rgba(246, 236, 214, 0.55); }

/* ---------- top bar with Fair Isle trim ---------- */
.appbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  max-width: 520px; margin: 0 auto 10px; padding: 12px 16px 10px;
  background-color: var(--page-deep);
  background-image: var(--knit);
}
/* A snowdrift hanging off the bottom of the top bar, like snow on a roof. */
.appbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -13px; height: 18px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='18'%3E%3Cpath d='M0 0H64V8C60 8 59 14 54 14C49 14 49 9 44 9C40 9 39 17 33 17C27 17 27 10 22 10C18 10 17 13 12 13C7 13 7 7 3 7C2 7 1 7 0 8Z' fill='%23f6ecd6'/%3E%3Cpath d='M0 8C1 7 2 7 3 7C7 7 7 13 12 13C17 13 18 10 22 10C27 10 27 17 33 17C39 17 40 9 44 9C49 9 49 14 54 14C59 14 60 8 64 8' fill='none' stroke='%23c9d8df' stroke-width='1.5'/%3E%3C/svg%3E") repeat-x;
  filter: drop-shadow(0 3px 0 rgba(30, 6, 9, 0.35));
}
.wordmark {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 0;
  font: 400 34px/1 var(--font-display); color: var(--page-ink); letter-spacing: 0.02em;
  text-shadow: 2px 2px 0 var(--red-deep);
}
.appbar-actions { display: flex; gap: 8px; align-items: center; }
.pill-gold {
  appearance: none; cursor: pointer; height: 40px; padding: 0 14px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: var(--ink); border: 2px solid var(--ink);
  font: 700 15px var(--font-body); box-shadow: 0 4px 0 var(--ink);
}
.pill-gold i { display: inline-flex; }

/* ---------- home ---------- */
.hero { overflow: hidden; margin-top: 8px; outline-offset: -7px; }
.hero-text { padding: 18px 20px 12px; }
.hero-title { font: 400 clamp(44px, 12vw, 58px)/0.95 var(--font-display); margin: 6px 0 6px; color: var(--ink); letter-spacing: 0.01em; }
.hero-sub { margin: 0; color: var(--muted); font-size: 15px; }
.hero-knit { display: block; width: 100%; border-top: 3px solid var(--ink); }

.tiles-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.tile {
  position: relative; appearance: none; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 12px; padding: 16px 14px; min-height: 86px;
  border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 5px 0 var(--ink);
  background-image: var(--knit);
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s ease;
}
.tile:hover { filter: brightness(1.07); }
.tile-daily { background-color: var(--green); color: var(--page-ink); }
.tile-online { background-color: var(--gold); color: var(--ink); background-image: var(--knit-dark); }
.tile-ico {
  flex: none; width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.18);
}
.tile-online .tile-ico { background: rgba(43, 29, 24, 0.15); }
.tile-online .tile-ico .spr rect[fill="#f6ecd6"], .tile-online .tile-ico .spr rect[fill="#d8c9a8"],
.tile-online .tile-ico .spr rect[fill="#f2c14e"] { fill: var(--ink); }
.ol-card .ol-input { width: 100%; }
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-text b { font: 400 25px/1 var(--font-display); letter-spacing: 0.02em; }
.tile-text small { font-size: 13px; opacity: 0.9; margin-top: 4px; line-height: 1.25; }
.badge {
  position: absolute; top: -11px; right: 10px; padding: 3px 9px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  font: 400 15px/1.1 var(--font-display); letter-spacing: 0.05em; border: 2px solid var(--ink);
}
.badge-new { background: var(--red); color: var(--page-ink); }
.badge-streak { background: var(--patch); color: var(--ink); }

.tiles-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.tile-sm {
  appearance: none; cursor: pointer; text-align: left; border: 0;
  display: flex; align-items: center; gap: 10px; padding: 14px 14px;
  transition: transform 0.06s ease, filter 0.15s ease;
}
.tile-sm:hover { filter: brightness(0.97); }
.tile-sm .tile-text b { font-size: 21px; }
.tile-sm .tile-text small { color: var(--muted); opacity: 1; font-size: 12px; }
.tile-sm-ico { flex: none; width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: rgba(43, 29, 24, 0.08); }

.xmas-count {
  text-align: center; margin: 22px auto 0; padding: 4px 14px; width: fit-content; border-radius: 6px;
  border: 2px dashed rgba(246, 236, 214, 0.5); color: var(--gold);
  font: 400 20px var(--font-display); letter-spacing: 0.05em;
}
.next-daily { text-align: center; color: var(--page-muted); font-size: 14px; margin-top: 12px; font-variant-numeric: tabular-nums; }

/* ---------- menu sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(30, 6, 9, 0.6); display: flex; justify-content: center; animation: fade 0.2s ease; }
.sheet-panel {
  width: 100%; max-width: 520px; height: 100%; overflow-y: auto;
  background-color: var(--page-deep); background-image: var(--knit);
  padding: 18px 20px 28px; animation: slide-in 0.25s ease; color: var(--page-ink);
}
.sheet-panel .eyebrow { color: var(--gold); }
.sheet-top { display: flex; justify-content: space-between; align-items: center; }
.sheet-title { font: 400 56px/1 var(--font-display); margin: 6px 0 16px; text-shadow: 3px 3px 0 var(--red-deep); }
.sheet-title em { color: var(--gold); font-style: normal; }
.supporter-card {
  appearance: none; width: 100%; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 10px;
  background-color: var(--gold); background-image: var(--knit-dark); color: var(--ink);
  border: 2px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
}
.supporter-card small { font: 400 15px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--red-deep); }
.supporter-card b { font: 400 30px/1 var(--font-display); letter-spacing: 0.02em; }
.supporter-card span { font-size: 13px; }
.supporter-card.is-supporter { background-color: var(--green); color: var(--page-ink); }
.supporter-card.is-supporter small { color: var(--gold); }
.sheet-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 6px; }
.toggle {
  appearance: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-radius: 10px; border: 2px dashed rgba(246, 236, 214, 0.45); background: rgba(0, 0, 0, 0.15);
  color: var(--page-ink); font: 700 14px var(--font-body);
}
.toggle span { text-align: left; }
.toggle i { position: relative; width: 40px; height: 22px; border-radius: 4px; background: rgba(246, 236, 214, 0.25); transition: background 0.2s; flex: none; border: 2px solid var(--ink); }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 2px; background: var(--patch); transition: transform 0.2s; }
.toggle[aria-pressed="true"] i { background: var(--green); }
.toggle[aria-pressed="true"] i::after { transform: translateX(18px); }
.sheet-list { display: flex; flex-direction: column; margin-top: 10px; }
.sheet-list button {
  appearance: none; border: 0; border-bottom: 2px dashed rgba(246, 236, 214, 0.22); background: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 4px;
  color: var(--page-ink); text-align: left; font: inherit;
}
.sheet-list button:hover b { color: var(--gold); }
.sheet-list b { font: 400 26px/1 var(--font-display); letter-spacing: 0.02em; }
.sheet-list span { font-size: 13px; color: var(--page-muted); text-align: right; }
.sheet-foot { text-align: center; color: var(--page-muted); font-size: 13px; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateY(16px); opacity: 0.6; } to { transform: none; opacity: 1; } }

/* ---------- game ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin: 12px 0 16px; }
.dots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; flex: 1; justify-content: center; }
.dots li {
  width: 28px; height: 28px; border-radius: 6px; background: rgba(0, 0, 0, 0.2);
  border: 2px solid rgba(246, 236, 214, 0.35); display: grid; place-items: center;
}
.dots li.current { border-color: var(--gold); background: rgba(242, 193, 78, 0.18); }
.score-pill {
  flex: none; background: var(--patch); color: var(--ink); border: 2px solid var(--ink); border-radius: 6px;
  padding: 4px 10px; font: 400 20px/1.1 var(--font-display); letter-spacing: 0.04em; font-variant-numeric: tabular-nums;
}
.timer { height: 14px; border-radius: 4px; background: rgba(0, 0, 0, 0.3); border: 2px solid var(--ink); overflow: hidden; }
.timer-fill {
  height: 100%; width: 100%; transform-origin: left center;
  background: repeating-linear-gradient(90deg, var(--gold) 0 10px, #e0ac38 10px 12px);
}
.timer.urgent .timer-fill { background: repeating-linear-gradient(90deg, var(--red) 0 10px, var(--red-deep) 10px 12px); }
.timer-label { text-align: right; font: 400 20px var(--font-display); color: var(--page-muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.timer.urgent + .timer-label { color: var(--gold); }

.prompt-card { padding: 22px 20px 26px; margin: 12px 0 16px; }
.prompt-num { margin: 0 0 6px; color: var(--red); font: 400 18px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; }
.prompt-text { margin: 0; font: 700 clamp(22px, 6vw, 27px)/1.25 var(--font-body); color: var(--ink); }

#answer-form { display: flex; gap: 10px; }
.answer-msg { min-height: 24px; margin: 0 0 6px; text-align: center; font: 400 19px var(--font-display); letter-spacing: 0.04em; color: var(--gold); }
.answer-msg b { color: var(--page-ink); }
.dym-btn {
  appearance: none; cursor: pointer; margin-left: 4px; padding: 2px 12px; border-radius: 6px; border: 2px solid var(--ink);
  background: var(--gold); color: var(--ink); font: 400 18px/1.2 var(--font-display); letter-spacing: 0.04em; box-shadow: 0 2px 0 var(--ink);
}
.dym-btn.dym-no { background: var(--patch); }
.fb-later { margin: 0; text-align: center; color: var(--muted); font-size: 13px; }
.shake { animation: shake 0.38s cubic-bezier(.36,.07,.19,.97); }
.shake input, .shake #answer, .shake .ol-input { border-color: var(--gold); }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(5px); }
  30%, 50%, 70% { transform: translateX(-9px); }
  40%, 60% { transform: translateX(9px); }
}
#answer, .ol-input {
  flex: 1; min-width: 0; padding: 13px 15px; border-radius: 8px; border: 2px solid var(--ink);
  background: var(--patch); color: var(--ink); font: 700 18px var(--font-body);
  box-shadow: inset 0 3px 0 rgba(43, 29, 24, 0.12);
}
#answer::placeholder, .ol-input::placeholder { color: rgba(43, 29, 24, 0.45); }

.feedback { --tc: var(--t-miss); text-align: center; padding: 22px 20px; animation: pop 0.28s ease-out; outline-color: var(--tc); }
[data-tier="miracle"] { --tc: var(--t-miracle); }
[data-tier="t75"] { --tc: var(--t-75); }
[data-tier="t50"] { --tc: var(--t-50); }
[data-tier="t25"] { --tc: var(--t-25); }
[data-tier="trap"] { --tc: var(--t-trap); }
[data-tier="t10"] { --tc: var(--t-10); }
[data-tier="miss"] { --tc: var(--t-miss); }
[data-tier="timeout"] { --tc: var(--t-timeout); }
.feedback[data-tier="miracle"] { box-shadow: var(--drop), 0 0 0 4px var(--gold); }
.fb-emoji { line-height: 0; }
.fb-label { font: 400 34px/1 var(--font-display); color: var(--tc); margin-top: 8px; letter-spacing: 0.03em; }
.fb-points { font: 400 54px/1 var(--font-display); margin: 4px 0 10px; color: var(--ink); font-variant-numeric: tabular-nums; }
.fb-said { margin: 0 0 4px; }
.fb-blurb { margin: 0 0 12px; color: var(--muted); font-size: 14px; font-style: italic; }
.fb-blurb:empty { display: none; }
.fb-best { text-align: left; background: rgba(43, 29, 24, 0.07); border-radius: 8px; padding: 12px 14px; margin: 8px 0 16px; font-size: 14px; }
.fb-best h3 { margin: 0 0 6px; font: 400 17px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); }
.fb-best ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.fb-best .note { color: var(--muted); font-size: 13px; display: block; margin-left: 22px; }
#btn-next { width: 100%; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- results ---------- */
#summary { padding-top: 4px; }
.sum-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 8px; }
.sum-brand { font: 400 30px var(--font-display); color: var(--gold); text-shadow: 2px 2px 0 var(--red-deep); }
.sum-head .eyebrow { color: var(--page-muted); }
.sum-score-row { display: flex; align-items: flex-end; gap: 14px; margin: 6px 0 16px; }
.sum-total { font: 400 112px/0.85 var(--font-display); font-variant-numeric: tabular-nums; text-shadow: 4px 4px 0 var(--red-deep); }
.sum-side { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; }
.sum-max { font: 400 24px var(--font-display); color: var(--page-muted); }
.sum-rating { font: 400 26px/1 var(--font-display); color: var(--gold); letter-spacing: 0.02em; }

.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stile {
  display: flex; flex-direction: column; padding: 12px 12px 10px; border-radius: 8px;
  background-color: var(--patch); background-image: var(--knit-dark); color: var(--ink);
  box-shadow: 0 3px 0 rgba(30, 6, 9, 0.4);
}
.stile-k { font: 400 15px var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stile b { font: 400 34px/1 var(--font-display); color: var(--green-deep); margin: 2px 0; font-variant-numeric: tabular-nums; }
.stile small { font-size: 12px; color: var(--muted); }
.upsell {
  appearance: none; width: 100%; cursor: pointer; display: flex; align-items: center; gap: 12px; text-align: left;
  margin: 0 0 20px; padding: 14px 16px; border-radius: 10px; border: 2px solid var(--ink);
  background-color: var(--gold); background-image: var(--knit-dark); color: var(--ink); box-shadow: 0 4px 0 var(--ink);
}
.upsell-ico { flex: none; width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; background: rgba(43, 29, 24, 0.12); }
.upsell-ico .spr rect { fill: var(--red-deep); }
.upsell-text { flex: 1; display: flex; flex-direction: column; }
.upsell-text b { font: 400 25px/1 var(--font-display); }
.upsell-text small { font-size: 13px; }
.upsell-arrow { font: 400 34px/1 var(--font-display); }
.card { padding: 16px 16px 14px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.card-head h3 { margin: 0; font: 400 20px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); }
.card-head span { font: 400 16px var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.card svg:not(.spr) { display: block; width: 100%; height: auto; }
.dist-text { margin: 8px 0 0; font: 400 19px var(--font-display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--green-deep); }
.dist-note { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.dist-note:empty { display: none; }
.dist-text.soft { text-transform: none; letter-spacing: 0; font: 400 14px var(--font-body); color: var(--muted); }
.chart-axis { fill: var(--muted); font: 400 11px var(--font-display); }
.chart-you { font: 400 20px var(--font-display); letter-spacing: 0.06em; }
.chart-mark { font: 400 16px var(--font-display); letter-spacing: 0.05em; }
.dist-card .chart-axis { font-size: 13px; }
.chart-val { fill: var(--ink); font: 400 13px var(--font-display); }

.sum-grid { display: flex; justify-content: center; gap: 8px; margin: 2px 0 16px; }
.sum-actions { display: grid; gap: 12px; margin-bottom: 20px; }
.bd-title { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 2px 8px; }
.bd-title h3 { margin: 0; font: 400 24px var(--font-display); letter-spacing: 0.04em; color: var(--page-ink); }
.bd-title span { font-size: 13px; color: var(--page-muted); }
.breakdown { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.breakdown > li {
  background-color: var(--patch); background-image: var(--knit-dark); color: var(--ink);
  border-radius: 8px; box-shadow: 0 3px 0 rgba(30, 6, 9, 0.4); border-left: 6px solid var(--tc); overflow: hidden;
}
.bd summary {
  display: grid; grid-template-columns: 30px 1fr auto 16px; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; list-style: none;
}
.bd summary::-webkit-details-marker { display: none; }
.bd-mid { display: flex; flex-direction: column; min-width: 0; }
.bd-emoji { text-align: center; line-height: 0; }
.bd-prompt { font-size: 13px; color: var(--muted); }
.bd-answer { font-weight: 700; overflow-wrap: anywhere; color: var(--tc); }
.bd-pts { font: 400 22px var(--font-display); font-variant-numeric: tabular-nums; }
.bd-caret { font-size: 14px; color: var(--muted); transition: transform 0.2s ease; }
.bd[open] .bd-caret { transform: rotate(180deg); }
.ans-groups { display: grid; gap: 10px; padding: 4px 12px 14px; border-top: 2px dashed var(--line); }
.ans-head { display: flex; align-items: center; gap: 6px; margin: 8px 0 6px; }
.ans-head b { font: 400 20px var(--font-display); letter-spacing: 0.03em; color: var(--tc); }
.ans-head span { margin-left: auto; font-size: 12px; color: var(--muted); }
.ans-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ans-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 5px;
  font-size: 13px; font-weight: 700; color: var(--tc); border: 2px solid var(--tc);
  background: color-mix(in srgb, var(--tc) 10%, transparent);
}
.ans-chip.is-you { background: var(--tc); color: var(--patch); box-shadow: 0 2px 0 var(--ink); }
.ans-chip i { font: 400 13px var(--font-display); font-style: normal; letter-spacing: 0.06em; }
#summary > .btn-ghost { color: var(--page-ink); }

/* ---------- archive ---------- */
.screen-head { display: flex; align-items: center; gap: 12px; margin: 12px 0 8px; }
.screen-head h2 { margin: 0; font: 400 40px/1 var(--font-display); letter-spacing: 0.02em; }
#archive-note { color: var(--page-muted); }
.archive-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.archive-list button {
  appearance: none; width: 100%; cursor: pointer; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 8px; border: 0; background-color: var(--patch); background-image: var(--knit-dark);
  color: var(--ink); text-align: left; font: inherit; box-shadow: 0 3px 0 rgba(30, 6, 9, 0.4);
}
.archive-list b { display: block; font: 400 22px/1 var(--font-display); }
.archive-list small { color: var(--muted); font-size: 13px; }
.archive-list .arch-score { font: 400 20px var(--font-display); color: var(--red); }

/* ---------- dialogs ---------- */
dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border: 0; padding: 24px 22px; }
dialog::backdrop { background: rgba(30, 6, 9, 0.72); }
dialog h2 { font: 400 40px/1 var(--font-display); margin: 0 0 12px; letter-spacing: 0.02em; color: var(--ink); }
dialog p { margin: 0 0 12px; }
dialog .btn-ghost { color: var(--ink); }
.info-body p { margin: 0 0 10px; }
.info-body h3 { margin: 14px 0 4px; font-size: 15px; }
.info-body ul { margin: 0 0 12px; padding-left: 20px; }
.info-body li { margin-bottom: 6px; }
.faq { border-top: 2px dashed var(--line); margin-bottom: 8px; }
.faq details { border-bottom: 2px dashed var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 2px; cursor: pointer; list-style: none; font-weight: 700; font-size: 15px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { position: relative; flex: none; width: 14px; height: 14px; }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; background: var(--ink); }
.faq summary i::after { transform: rotate(90deg); transition: transform 0.2s ease; }
.faq details[open] summary i::after { transform: rotate(0deg); }
.faq details[open] summary { color: var(--red); }
.faq details p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.tier-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.tier-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; background: rgba(43, 29, 24, 0.07); border-radius: 8px; padding: 7px 10px; font-size: 14px; }
.tier-list b { font: 400 22px var(--font-display); }
.tier-list .desc { display: block; color: var(--muted); font-size: 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.stat { background: rgba(43, 29, 24, 0.07); border-radius: 8px; padding: 12px 6px; text-align: center; }
.stat b { display: block; font: 400 38px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.pay-mark { text-align: center; line-height: 0; margin-bottom: 8px; }
#dlg-paywall h2 { text-align: center; }
.perks { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.perks li { display: flex; gap: 10px; align-items: center; background: rgba(43, 29, 24, 0.07); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.perks i { display: inline-flex; }
.price { text-align: center; font: 400 44px/1.1 var(--font-display); color: var(--red); }
.restore { margin-top: 12px; font-size: 14px; color: var(--muted); }
.restore summary { cursor: pointer; text-align: center; }
.restore form { display: flex; gap: 8px; margin-top: 10px; }
.restore input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 8px; border: 2px solid var(--ink); background: #fff8ea; color: var(--ink); font: 500 15px var(--font-body); }

/* ---------- feedback ---------- */
.dlg-bar { display: flex; justify-content: space-between; align-items: center; margin: -6px 0 14px; padding-bottom: 10px; border-bottom: 2px dashed var(--line); }
.dlg-bar form { margin: 0; }
.dlg-x { appearance: none; border: 0; background: none; cursor: pointer; font-size: 20px; color: var(--ink); padding: 4px 8px; }
.fb-form { display: grid; gap: 6px; }
.fb-form label { margin-top: 8px; font-size: 14px; }
.fb-form input, .fb-form textarea {
  width: 100%; padding: 11px 12px; border-radius: 8px; border: 2px solid var(--ink); background: #fff8ea; color: var(--ink);
  font: 500 15px var(--font-body); resize: vertical;
}
.fb-privacy { margin: 6px 0 0 !important; font-size: 12px; }
.missing-btn { color: var(--page-ink); margin-top: 12px; border-style: dashed; }

/* ---------- share panel ---------- */
#dlg-share h2 { text-align: center; }
.share-card { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 14px; border-radius: 10px; border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.share-main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-label { margin: 16px 0 8px !important; font: 400 20px var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; color: var(--red); }
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.share-btn {
  appearance: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px;
  border: 2px solid var(--ink); background: #fff8ea; color: var(--ink); font: 700 14px var(--font-body); box-shadow: 0 3px 0 var(--ink);
}
.share-btn i { width: 14px; height: 14px; border-radius: 3px; background: var(--pc); border: 2px solid var(--ink); flex: none; }
.share-btn:hover { background: color-mix(in srgb, var(--pc) 14%, #fff8ea); }
.share-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.share-note { margin: 12px 0 0 !important; text-align: center; }

/* ---------- online ---------- */
.ol-card { margin-top: 8px; padding: 18px 16px; }
.ol-label { display: block; font: 400 18px var(--font-display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); margin-bottom: 8px; }
.ol-emojis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.ol-emoji { appearance: none; cursor: pointer; padding: 8px 0; border-radius: 8px; border: 2px solid var(--line); background: rgba(43, 29, 24, 0.06); line-height: 0; }
.ol-emoji[aria-checked="true"] { border-color: var(--ink); background: var(--gold); }
.ol-quick { width: 100%; margin: 16px 0 6px; }
.ol-join { display: flex; gap: 10px; margin-top: 14px; }
.ol-join .ol-input { text-transform: uppercase; letter-spacing: 0.2em; text-align: center; }
.ol-note { margin-top: 14px; text-align: center; color: var(--page-muted); }
.ol-error { color: var(--gold); text-align: center; font-weight: 700; margin-top: 12px; }
.ol-top { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.ol-room { flex: 1; display: flex; flex-direction: column; }
.ol-room .eyebrow { color: var(--gold); }
.ol-room b { font: 400 34px/1 var(--font-display); letter-spacing: 0.06em; }
.ol-invite { padding: 9px 14px; font-size: 14px; color: var(--page-ink); }
.ol-panel { padding: 20px 18px; margin-bottom: 16px; }
.ol-center { text-align: center; }
.ol-center p { margin: 6px 0; }
.ol-big { font: 400 64px/1.1 var(--font-display); margin: 4px 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.ol-count { font-size: 96px; color: var(--red); }
.ol-title { font: 400 38px/1 var(--font-display); margin: 4px 0 12px; }
.ol-winner { margin-top: 12px !important; color: var(--t-miracle); font-weight: 700; }
.ol-form { display: flex; gap: 10px; margin-top: 14px; }
.ol-answered { text-align: center; margin: 10px 0 0; }
.ol-small { font-size: 20px; }
.ol-locked { --tc: var(--t-miss); display: flex; gap: 12px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: 8px; border: 2px solid var(--tc); background: rgba(43, 29, 24, 0.06); }
.ol-locked b { display: block; color: var(--tc); font: 400 24px/1 var(--font-display); }
.ol-locked small { color: var(--muted); }
.ol-reveal, .ol-board, .ol-podium { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.ol-reveal li, .ol-board li, .ol-podium li { display: grid; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(43, 29, 24, 0.07); }
.ol-reveal li { grid-template-columns: 30px 1fr auto 44px; border-left: 4px solid var(--tc, transparent); }
.ol-board li { grid-template-columns: 20px 30px 1fr auto 44px; }
.ol-podium li { grid-template-columns: 30px 30px 1fr auto; font-size: 17px; }
.is-me { box-shadow: inset 0 0 0 2px var(--red); }
.ol-av { text-align: center; line-height: 0; }
.ol-who { display: flex; flex-direction: column; min-width: 0; }
.ol-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ol-who small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ol-rank { font: 400 18px var(--font-display); color: var(--muted); text-align: center; }
.ol-score { font: 400 22px var(--font-display); text-align: right; font-variant-numeric: tabular-nums; }
.ol-status { color: var(--green); font-weight: 800; }
.ol-tier { line-height: 0; }
.ol-medal { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--ink); font: 400 20px var(--font-display); }
.ol-medal.m1 { background: var(--gold); }
.ol-medal.m2 { background: #cfd3d6; }
.ol-medal.m3 { background: #d39a6a; }
.ol-top-answer { margin: 12px 0 0; }
.ol-next { margin: 6px 0 0; }

/* ---------- Pass the Parcel ---------- */
.pp-rules p { margin: 0 0 8px; font-size: 14px; }
.pp-stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1.25; margin-bottom: 8px; overflow: hidden;
  border-radius: 14px; border: 3px solid var(--ink); box-shadow: var(--drop);
  background-color: var(--green-deep); background-image: var(--knit);
}
.pp-stage::before {        /* a knitted rug with Fair Isle trim */
  content: ""; position: absolute; left: 6%; right: 6%; top: 39%; bottom: 6%; border-radius: 50%;
  background-color: var(--red-deep); background-image: var(--knit);
  box-shadow: inset 0 0 0 4px rgba(246, 236, 214, 0.55), inset 0 0 0 9px var(--red-deep), inset 0 0 0 11px rgba(246, 236, 214, 0.35);
}
.pp-stage.my-turn { box-shadow: var(--drop), 0 0 0 4px var(--gold); }
.pp-banner {
  position: absolute; left: 4%; right: 4%; top: 3%; z-index: 2; text-align: left;
  padding: 10px 14px; border-radius: 10px; background: var(--patch); background-image: var(--knit-dark); color: var(--ink);
  outline: 2px dashed var(--stitch); outline-offset: -6px; box-shadow: 0 4px 0 rgba(30, 6, 9, 0.45);
}
.pp-banner h2 { margin: 2px 0 2px; font: 700 clamp(16px, 4.6vw, 20px)/1.2 var(--font-body); }
.pp-banner small { font: 400 15px var(--font-display); letter-spacing: 0.04em; color: var(--muted); }
.pp-seats { position: absolute; inset: 0; z-index: 3; }
.pp-seat {
  position: absolute; transform: translate(-50%, -50%); width: 78px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.pp-av { position: relative; z-index: 2; height: 40px; line-height: 0; transition: transform 0.2s ease; }
.pp-cushion {
  width: 58px; height: 18px; margin-top: -8px; border-radius: 50%;
  background-color: var(--patch-2); background-image: var(--knit-dark); border: 2px solid var(--ink);
  box-shadow: 0 3px 0 rgba(30, 6, 9, 0.5);
}
.pp-name {
  margin-top: 3px; max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 15px/1.1 var(--font-display); letter-spacing: 0.03em; color: var(--page-ink); text-shadow: 1px 1px 0 var(--ink);
}
.pp-hearts { display: flex; gap: 1px; justify-content: center; margin-top: 1px; line-height: 0; }
.pp-score { margin-top: 2px; padding: 0 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.35); font: 400 14px/1.3 var(--font-display); letter-spacing: 0.04em; color: var(--gold); }
.ol-practice { color: var(--page-ink); border-style: dashed; }
.pp-seat.is-turn .pp-cushion { background-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 193, 78, 0.45), 0 3px 0 rgba(30, 6, 9, 0.5); }
.pp-seat.is-turn .pp-av { transform: translateY(-4px); animation: bob 0.7s ease-in-out infinite alternate; }
.pp-seat.is-turn .pp-name { color: var(--gold); }
.pp-seat.is-me { box-shadow: none; }
.pp-seat.is-me .pp-name { text-decoration: underline; text-underline-offset: 3px; }
.pp-seat.is-out { opacity: 0.6; }
.pp-seat.is-out .pp-name { text-decoration: line-through; }
.pp-seat.is-win .pp-cushion { background-color: var(--gold); }
.pp-seat.is-empty .pp-cushion { background: transparent; border-style: dashed; border-color: rgba(246, 236, 214, 0.45); box-shadow: none; }
.pp-seat.is-empty .pp-name { color: rgba(246, 236, 214, 0.45); text-shadow: none; }
.pp-seat.is-empty .pp-av { height: 30px; }
.pp-pop {
  position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); z-index: 5;
  display: inline-flex; align-items: center; gap: 4px; max-width: 130px; padding: 3px 7px; border-radius: 6px;
  background: var(--patch); color: var(--ink); border: 2px solid var(--tc, var(--ink));
  font: 700 12px var(--font-body); white-space: nowrap; animation: pop 0.25s ease-out;
}
.pp-pop span { overflow: hidden; text-overflow: ellipsis; }
.pp-pop.is-fail { border-color: var(--red); color: var(--red-deep); }
.pp-parcel {
  position: absolute; z-index: 2; transform: translate(-50%, -50%); line-height: 0;
  transition: left 0.45s cubic-bezier(.3,1.4,.5,1), top 0.45s cubic-bezier(.3,1.4,.5,1);
  filter: drop-shadow(0 5px 0 rgba(30, 6, 9, 0.5));
}
.pp-parcel.is-hot .spr { animation: wobble 0.5s ease-in-out infinite alternate; }
.pp-center {
  position: absolute; left: 50%; top: 74%; transform: translate(-50%, -50%); z-index: 4; text-align: center;
  color: var(--page-ink); font: 400 22px var(--font-display); letter-spacing: 0.04em; text-shadow: 2px 2px 0 var(--ink); white-space: nowrap;
}
.pp-count { font-size: 72px; color: var(--gold); }
.pp-status { margin: 4px 0 0; text-align: center; font: 400 20px var(--font-display); letter-spacing: 0.04em; color: var(--page-ink); min-height: 24px; }
.pp-bar { display: flex; gap: 10px; align-items: center; }
.pp-ring {
  --p: 1; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1turn), rgba(0, 0, 0, 0.35) 0);
  border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
}
.pp-ring.urgent { background: conic-gradient(var(--red) calc(var(--p) * 1turn), rgba(0, 0, 0, 0.35) 0); }
.pp-ring-in {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 2px;
  background: var(--page-deep); color: var(--page-ink); font: 400 22px var(--font-display); border: 2px solid var(--ink);
}
.pp-ring.mine .pp-ring-in { color: var(--gold); }
.pp-form { flex: 1; display: flex; gap: 8px; min-width: 0; }
.pp-form .ol-input:disabled { opacity: 0.7; }
.pp-set { display: flex; justify-content: space-between; align-items: center; padding: 8px 2px; border-bottom: 2px dashed var(--line); }
.pp-set > span:first-child { font: 400 22px var(--font-display); letter-spacing: 0.03em; }
.pp-step { display: inline-flex; align-items: center; gap: 10px; }
.pp-step b { font: 400 26px var(--font-display); min-width: 40px; text-align: center; }
.pp-stepbtn {
  appearance: none; cursor: pointer; width: 34px; height: 34px; border-radius: 6px; border: 2px solid var(--ink);
  background: var(--gold); color: var(--ink); font: 700 20px/1 var(--font-body); box-shadow: 0 3px 0 var(--ink);
}
.pp-stepbtn:disabled { opacity: 0.4; cursor: not-allowed; }
.pp-note { margin: 10px 0 0; }
.pp-log { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; font-size: 14px; }
.pp-log li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px; border-radius: 6px; background: rgba(43, 29, 24, 0.06); }
.pp-log li.is-bad { color: var(--red-deep); }
.pp-pts { margin-left: auto; font: 400 18px var(--font-display); }
@keyframes bob { from { transform: translateY(-2px); } to { transform: translateY(-8px); } }
@keyframes wobble { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }

/* ---------- reward animation layer ---------- */
/* Behind the cards (so buttons stay readable) but above the background; presents pile up in the gaps. */
#fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; transition: opacity 0.6s ease; contain: strict; }
body.fx-front #fx { z-index: 15; }
#game.revealing .prompt-card, #game.revealing .timer, #game.revealing .timer-label, #game.revealing .answer-msg { display: none; }
#game.revealing .feedback { margin-top: clamp(96px, 15vh, 190px); }
#fx.fx-fade { opacity: 0; }
.fx-item { position: absolute; left: 0; top: 0; line-height: 0; will-change: transform; user-select: none; }
.fx-gift .spr { transform-origin: 50% 100%; }
.fx-gift.fx-landed .spr { animation: squash 0.38s cubic-bezier(.3,1.6,.5,1); }
@keyframes squash { 0% { transform: scale(1.25, 0.7); } 60% { transform: scale(0.92, 1.08); } 100% { transform: none; } }
.fx-sleigh { display: flex; align-items: flex-end; gap: 4px; }
.fx-sleigh .deer:nth-child(2) { transform: translateY(-5px); }
.fx-sleigh .deer:nth-child(3) { transform: translateY(-2px); }
.fx-sleigh .rein { width: 10px; height: 2px; background: var(--gold); margin-bottom: 18px; }
.fx-spark { }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 30;
  background: var(--ink); color: var(--page-ink); padding: 10px 16px; border-radius: 8px; border: 2px solid var(--gold);
  font-weight: 700; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 440px) {
  .pill-gold span { display: none; }
  .pill-gold { padding: 0 10px; }
}
@media (max-width: 400px) {
  .tile { flex-direction: column; align-items: flex-start; gap: 8px; }
  .dots li { width: 24px; height: 24px; }
  .wordmark { font-size: 30px; }
}
@media (max-width: 360px) {
  #answer-form { flex-direction: column; }
  .appbar-actions { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .feedback, .sheet, .sheet-panel { animation: none; }
  .btn, .toast, .toggle i, .toggle i::after { transition: none; }
}

/* ---------- live prompt scene ---------- */
.scene {
  display: block; width: 100%; height: 96px; margin: 10px 0 0; border-radius: 10px;
  border: 2px solid var(--ink); box-shadow: 0 3px 0 rgba(30, 6, 9, 0.45); image-rendering: pixelated; background: #14253f;
}
#game.revealing .scene { display: none; }

/* ---------- Jingle the elf ---------- */
.fb-mascot { display: flex; align-items: flex-end; gap: 8px; justify-content: center; margin: -4px 0 10px; }
.fb-elf { line-height: 0; transform-origin: 50% 100%; }
.fb-bubble {
  position: relative; max-width: 230px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--ink);
  background: #fff8ea; color: var(--ink); font: 400 19px/1.15 var(--font-display); letter-spacing: 0.03em; text-align: left;
  box-shadow: 0 3px 0 var(--ink);
}
.fb-bubble::before { content: ""; position: absolute; left: -9px; bottom: 10px; border: 7px solid transparent; border-right-color: var(--ink); }
.fb-mascot.talk .fb-elf { animation: elf-hop 0.55s cubic-bezier(.3,1.6,.5,1); }
.fb-mascot.talk .fb-bubble { animation: bubble-in 0.35s cubic-bezier(.3,1.5,.5,1) 0.08s both; }
@keyframes elf-hop { 0% { transform: translateY(8px) scale(1, 0.85); } 50% { transform: translateY(-10px) scale(0.95, 1.08); } 100% { transform: none; } }
@keyframes bubble-in { from { transform: scale(0.4) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- livelier reveal ---------- */
.feedback .fb-emoji .spr { animation: tier-pop 0.6s cubic-bezier(.3,1.7,.5,1); }
.feedback .fb-label { animation: rise 0.45s ease-out 0.1s both; }
.feedback .fb-points { animation: rise 0.45s ease-out 0.18s both; }
.feedback[data-tier="miracle"] .fb-emoji .spr, .feedback[data-tier="t75"] .fb-emoji .spr { filter: drop-shadow(0 0 10px var(--tc)); }
@keyframes tier-pop { 0% { transform: scale(0.2) rotate(-25deg); } 70% { transform: scale(1.18) rotate(6deg); } 100% { transform: none; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- results extras ---------- */
.sum-miles { font: 400 18px var(--font-display); letter-spacing: 0.04em; color: var(--page-muted); }
.recap-score { color: var(--red) !important; font-size: 20px !important; }
#dist-you.pop { animation: you-pop 0.5s cubic-bezier(.3,1.7,.5,1); transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes you-pop { from { transform: scale(0.3); } to { transform: none; } }

/* ---------- mobile polish ---------- */
html { -webkit-text-size-adjust: 100%; }
button, a, summary, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.appbar { padding-top: max(12px, env(safe-area-inset-top)); }
.wrap { padding-bottom: max(48px, calc(24px + env(safe-area-inset-bottom))); }
.fb-form input, .fb-form textarea, .restore input { font-size: 16px; }   /* stops iPhone zooming into fields */
@media (max-width: 400px) {
  .wrap { padding-left: 12px; padding-right: 12px; }
  .prompt-card { padding: 18px 16px 20px; }
  .feedback { padding: 18px 14px; }
  .fb-points { font-size: 46px; }
  .sum-total { font-size: 92px; }
  .stat-tiles { gap: 8px; }
  .stile b { font-size: 28px; }
  .share-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-height: 700px) {
  .scene { height: 72px; }
  .prompt-text { font-size: 21px; }
  .hero-title { font-size: 40px; }
}

/* ---------- animated title scene ---------- */
.hero-scene {
  display: block; width: 100%; height: clamp(200px, 58vw, 290px);
  border-top: 3px solid var(--ink); background: #1b3560;
}

/* Nothing Landed is white: shown on a dark night-blue card so it reads */
.feedback[data-tier="timeout"] { background: #1b2a44; background-image: none; color: #fff; outline-color: #fff; }
.feedback[data-tier="timeout"] .fb-points, .feedback[data-tier="timeout"] .fb-said { color: #fff; }
.feedback[data-tier="timeout"] .fb-blurb, .feedback[data-tier="timeout"] .fb-later { color: #c9d6e6; }
.breakdown > li[data-tier="timeout"] { background: #1b2a44; background-image: none; color: #fff; }
.breakdown > li[data-tier="timeout"] .bd-prompt, .breakdown > li[data-tier="timeout"] .bd-caret { color: #c9d6e6; }
.breakdown > li[data-tier="timeout"] .ans-groups { background: var(--patch); color: var(--ink); }
.ol-locked[data-tier="timeout"] { background: #1b2a44; color: #fff; }
