/* cookiefail components. Colours, fonts, borders and timing come from tokens.css. */

*, *::before, *::after { box-sizing: border-box; border-radius: var(--radius) !important; }
html { font-size: var(--fs-base); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-paper) url(/clay/set/clay-bg.webp) 0 0 / 420px;
  color: var(--c-ink);
  font-family: var(--font-body);
  line-height: var(--lh-body);
  min-height: 100dvh;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 4px solid var(--c-focus); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--c-ink); color: var(--c-paper); padding: 12px; z-index: 100; }
.skip-link:focus { left: 0; }

.app { outline: none; }
.screen {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) calc(44px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  letter-spacing: var(--tracking-display);
  line-height: var(--lh-tight);
  margin: 0;
  font-weight: 800;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0; }
.eyebrow { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-primary); }
.muted { color: var(--c-muted); }
.small { font-size: var(--fs-small); }
.center { text-align: center; }
.section-title { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.3rem; margin: 2px 0 0; }

/* ------------------------------------------------------------------ */
/* Stop-motion primitives. Everything moves in held frames, never smoothly. */

/* Standing still, alive: a slow breath, drawn at 12fps */
@keyframes breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(0.996, 1.011); }
}
/* Dropped on the table: falls, squashes, settles */
@keyframes plop {
  0% { transform: translateY(-140%) scale(0.92, 1.1); opacity: 0; }
  12% { opacity: 1; }
  52% { transform: translateY(0) scale(1.2, 0.78); }
  70% { transform: translateY(-9%) scale(0.94, 1.08); }
  86% { transform: translateY(0) scale(1.06, 0.95); }
  100% { transform: none; opacity: 1; }
}
/* The same drop for big panels, which would otherwise fall across the whole page */
@keyframes plop-big {
  0% { transform: translateY(-36px) scale(0.98, 1.02); opacity: 0; }
  20% { opacity: 1; }
  55% { transform: translateY(0) scale(1.03, 0.97); }
  78% { transform: translateY(-5px) scale(0.99, 1.01); }
  100% { transform: none; opacity: 1; }
}
/* A rubber stamp hitting paper */
@keyframes slam {
  0% { transform: scale(2.6) rotate(var(--r, -6deg)); opacity: 0; }
  40% { transform: scale(0.94) rotate(var(--r, -6deg)); opacity: 1; }
  60% { transform: scale(1.05) rotate(var(--r, -6deg)); }
  100% { transform: scale(1) rotate(var(--r, -6deg)); opacity: 1; }
}
@keyframes squash {
  0% { transform: scale(1.14, 0.82); }
  50% { transform: scale(0.94, 1.1); }
  100% { transform: none; }
}
@keyframes hop {
  0% { transform: none; }
  18% { transform: translateY(1%) scale(1.04, 0.96); }
  50% { transform: translateY(-7%) scale(0.98, 1.03); }
  78% { transform: translateY(0.5%) scale(1.03, 0.97); }
  100% { transform: none; }
}
@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(9px); }
  75% { transform: translateX(-5px); }
}

/* ------------------------------------------------------------------ */
/* The clay slabs that wipe between pages */
.wipe { position: fixed; inset: -4% -30%; z-index: 90; pointer-events: none; display: grid; grid-template-rows: 1fr 1fr 1fr; transform: skewY(-5deg); }
.wipe i { display: block; animation: wipe-band 550ms steps(7, end) both; border-block: 6px solid var(--c-ink); }
.wipe i:nth-child(1) { background: var(--c-red); }
.wipe i:nth-child(2) { background: var(--c-gold); animation-delay: 30ms; }
.wipe i:nth-child(3) { background: var(--c-green); animation-delay: 60ms; }
@keyframes wipe-band {
  0% { transform: translateX(-102%); }
  42%, 58% { transform: translateX(0); }
  100% { transform: translateX(102%); }
}

/* Top bar with the always-visible Back */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap;
  min-height: 52px; padding: 0 14px 0 10px;
  background: var(--c-surface); border: var(--border); box-shadow: 3px 3px 0 var(--c-ink);
  font-weight: 700; font-size: 1rem; text-decoration: none; color: var(--c-ink); cursor: pointer;
  transition: transform var(--dur-fast) steps(1), box-shadow var(--dur-fast) steps(1);
}
.back-link:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--c-ink); }
.back-link::before { content: ""; width: 12px; height: 12px; border-left: 4px solid var(--c-ink); border-bottom: 4px solid var(--c-ink); transform: rotate(45deg); margin-left: 4px; }
.wordmark { display: block; text-decoration: none; background: var(--c-ink); padding: 5px 9px; box-shadow: 3px 3px 0 rgba(42, 21, 11, 0.35); transform: rotate(1deg); }
.wordmark img { height: clamp(21px, 7vw, 28px); width: auto; }

/* Buttons */
.btn {
  appearance: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 100%; min-height: var(--tap);
  padding: 12px 18px;
  background: var(--c-surface); color: var(--c-ink);
  border: var(--border); box-shadow: var(--shadow);
  font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.3rem; line-height: 1.05; text-align: center;
  cursor: pointer; text-decoration: none; touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) steps(1), box-shadow var(--dur-fast) steps(1);
}
.btn:active:not(:disabled) { transform: translate(4px, 4px) scale(1.02, 0.95); box-shadow: var(--shadow-press); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn--primary { background: var(--c-primary); color: var(--c-primary-ink); }
.btn--secondary { background: var(--c-secondary); color: var(--c-secondary-ink); }
.btn--gold { background: var(--c-gold); color: var(--c-gold-ink); }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--huge { min-height: var(--tap-huge); font-size: 1.55rem; padding: 16px 20px; }
.btn--small { min-height: 48px; font-size: 1.05rem; padding: 8px 12px; width: auto; box-shadow: 3px 3px 0 var(--c-ink); }
.btn__label { display: block; }
.btn__sub { display: block; font-family: var(--font-body); font-stretch: normal; font-weight: 400; font-size: 0.88rem; line-height: 1.25; opacity: 0.95; }
.btn__role { display: block; font-family: var(--font-body); font-stretch: normal; font-weight: 700; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--c-gold); }
.btn--gold .btn__role, .btn:not([class*="btn--primary"]):not([class*="btn--secondary"]) .btn__role { color: inherit; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-stack { display: flex; flex-direction: column; gap: 16px; }
.code-link { appearance: none; background: none; border: 0; min-height: 48px; padding: 6px 2px; color: var(--c-ink); font-size: 0.92rem; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn {
  appearance: none; background: none; border: 0; padding: 12px 4px; min-height: 48px;
  color: var(--c-ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 3px; font-weight: 700; cursor: pointer; align-self: center;
}

/* Cards and panels */
.card { background: var(--c-surface); border: var(--border); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.panel { background: var(--c-surface-2); border: var(--border); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.notice { border: var(--border); background: var(--c-gold); color: var(--c-gold-ink); padding: 12px 14px; font-weight: 700; }
.notice--danger { background: var(--c-danger); color: #fff; }
.error-text { color: var(--c-danger); font-weight: 700; }
.error-text:not(:empty) { animation: shake 250ms steps(1) 1; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.label { font-weight: 700; font-size: 1.05rem; }
.input {
  width: 100%; min-height: var(--tap);
  padding: 12px 14px; font-size: 1.3rem;
  background: var(--c-surface); border: var(--border); box-shadow: inset 4px 4px 0 rgba(42, 21, 11, 0.08);
}
.input--code { font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; letter-spacing: 0.18em; text-align: center; }
.toggle {
  display: flex; align-items: center; gap: 14px; min-height: var(--tap); padding: 10px 14px;
  background: var(--c-surface); border: var(--border); cursor: pointer; font-weight: 700;
}
.toggle input { width: 30px; height: 30px; accent-color: var(--c-secondary); flex: none; margin: 0; }
.toggle__sub { display: block; font-weight: 400; font-size: var(--fs-small); color: var(--c-muted); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 6px 12px;
  background: var(--c-surface); border: var(--border); font-weight: 700;
  animation: plop 500ms steps(3) both; animation-delay: calc(var(--i, 0) * 50ms);
}
button.chip { cursor: pointer; box-shadow: 3px 3px 0 var(--c-ink); min-height: 52px; }
button.chip:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--c-ink); }
.chip__count { font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; background: var(--c-ink); color: var(--c-paper); padding: 1px 6px; }

.badge { display: inline-flex; align-items: center; gap: 6px; vertical-align: 0.2em; font-family: var(--font-body); font-weight: 700; font-size: 0.68rem; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.1em; padding: 3px 8px; border: 2px solid var(--c-ink); background: var(--c-surface-2); color: var(--c-ink); }
.badge--live { background: var(--c-red); color: #fff; animation: live-blink 1s steps(1) infinite; }
.badge--done { background: var(--c-gold); color: var(--c-gold-ink); }
.badge--kid { background: var(--c-frost); }
@keyframes live-blink { 50% { background: var(--c-red-deep); } }

/* ------------------------------------------------------------------ */
/* Landing */
.screen--landing { padding-top: 0; }
.hero {
  position: relative; overflow: hidden;
  margin: 0 calc(var(--gutter) * -1);
  height: clamp(420px, 53dvh, 500px);
  background: #3a1020 url(/clay/set/street.webp) center 36% / cover no-repeat;
  border-bottom: var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding-top: calc(16px + env(safe-area-inset-top));
}
.logo { --lh: min(23.4vw, 118px); position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: inherit; }
.logo__row { display: flex; align-items: flex-end; justify-content: center; }
.logo__row--1 { --lh: min(26.5vw, 134px); transform: rotate(-2.5deg); margin-top: -4px; }
.logo__l { display: block; height: var(--lh); margin-left: -0.4%; animation: plop 750ms steps(3) both; animation-delay: calc(var(--i) * 95ms + 180ms); transform-origin: 50% 100%; }
.logo__l--short { height: calc(var(--lh) * 0.735); }
.logo__gag { display: block; position: relative; height: 100%; transform-origin: 50% 100%; }
.logo__gag img { height: 100%; width: auto; }
.logo__row--0 { position: relative; }

/* Gag 1: Bob (known cookie thief) turns up and the second "o" rolls off to him. It comes back bitten. */
.logo__gag--o2 { animation: o-roll 16s steps(2) infinite 2.2s; z-index: -1; }
@keyframes o-roll {
  0%, 30% { transform: none; }
  31% { transform: translateX(6%) rotate(-5deg); }
  32% { transform: translateX(40%) rotate(50deg); }
  33% { transform: translateX(90%) rotate(120deg); }
  34% { transform: translateX(150%) rotate(200deg); }
  35% { transform: translateX(220%) rotate(290deg); }
  36% { transform: translateX(300%) rotate(380deg); }
  37% { transform: translateX(380%) rotate(470deg); }
  38% { transform: translateX(460%) rotate(560deg); }
  39%, 51% { transform: translateX(600%) rotate(720deg); }
  52% { transform: translateX(460%) rotate(600deg); }
  53% { transform: translateX(340%) rotate(470deg); }
  54% { transform: translateX(240%) rotate(340deg); }
  55% { transform: translateX(150%) rotate(220deg); }
  56% { transform: translateX(80%) rotate(120deg); }
  57% { transform: translateX(30%) rotate(40deg); }
  58% { transform: translateX(-4%) rotate(-6deg) scale(1.08, 0.92); }
  59%, 100% { transform: none; }
}
.logo__gag img.logo__bitten { position: absolute; left: 0; top: 0; opacity: 0; animation: o-bitten 16s steps(1) infinite 2.2s; }
@keyframes o-bitten { 0%, 45% { opacity: 0; } 46%, 99% { opacity: 1; } 100% { opacity: 0; } }
.logo__gag--o2 > img:first-child { animation: o-whole 16s steps(1) infinite 2.2s; }
@keyframes o-whole { 0%, 45% { opacity: 1; } 46%, 99% { opacity: 0; } 100% { opacity: 1; } }
.hero__bob {
  position: absolute; z-index: 4; right: -2%; bottom: 3%; height: 60%; width: auto;
  animation: bob-steal 16s steps(2) infinite 2.2s; transform: translateX(120%);
}
@keyframes bob-steal {
  0%, 26% { transform: translateX(120%); }
  27% { transform: translateX(90%); }
  28% { transform: translateX(60%); }
  29% { transform: translateX(35%); }
  30%, 38% { transform: translateX(14%) rotate(0); }
  39% { transform: translateX(14%) rotate(-5deg); }
  40% { transform: translateX(14%) rotate(5deg); }
  41% { transform: translateX(14%) rotate(-3deg); }
  42%, 46% { transform: translateX(14%) translateY(-2%) scale(1.03, 0.98); }
  47% { transform: translateX(14%); }
  48% { transform: translateX(45%); }
  49% { transform: translateX(80%); }
  50%, 100% { transform: translateX(120%); }
}
/* Gag 2: the last letter of "fail" can't stay up */
.logo__gag--l { animation: l-topple 16s steps(2) infinite 2.2s; transform-origin: 30% 100%; }
@keyframes l-topple {
  0%, 74% { transform: none; }
  75% { transform: rotate(9deg); }
  76% { transform: rotate(26deg); }
  77% { transform: rotate(52deg); }
  78% { transform: rotate(84deg); }
  79% { transform: rotate(76deg); }
  80%, 88% { transform: rotate(84deg); }
  89% { transform: rotate(60deg); }
  90% { transform: rotate(32deg); }
  91% { transform: rotate(8deg); }
  92% { transform: rotate(-5deg) scale(1.05, 0.95); }
  93%, 100% { transform: none; }
}
.hero__lede { position: relative; z-index: 3; margin-top: 10px; padding: 5px 12px 6px; background: var(--c-ink); color: var(--c-paper); border: 2px solid var(--c-paper); box-shadow: 3px 3px 0 rgba(30, 5, 15, 0.6); font-weight: 700; font-size: 0.98rem; line-height: 1.2; white-space: nowrap; transform: rotate(-1deg); animation: slam 350ms steps(3) 1.3s both; --r: -1deg; }
.snow { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.snow i {
  position: absolute; top: -20px; display: block;
  background: radial-gradient(circle at 35% 30%, #fff 0 45%, #e6dccb 100%);
  border-radius: 50% !important; box-shadow: 1px 2px 2px rgba(30, 5, 15, 0.25);
  animation: snowfall var(--t) steps(var(--s)) infinite; animation-delay: var(--d);
}
@keyframes snowfall { to { transform: translate(var(--x), 620px); } }

.room-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.room-card { display: block; text-decoration: none; color: var(--c-ink); background: var(--c-surface); border: var(--border); box-shadow: var(--shadow); transition: transform var(--dur-fast) steps(1), box-shadow var(--dur-fast) steps(1); -webkit-tap-highlight-color: transparent; }
.room-card:active { transform: translate(4px, 4px); box-shadow: var(--shadow-press); }
.room-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 12px 14px; }
.room-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.room-row__name { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.9rem; line-height: 1; }
.room-row__meta { color: var(--c-muted); font-size: 0.98rem; }
.room-row__go { position: relative; display: block; width: 58px; height: 58px; background: var(--c-gold); border: var(--border); box-shadow: 3px 3px 0 var(--c-ink); animation: nudge 1.3s steps(1) infinite; }
.room-row__go::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-right: 5px solid var(--c-ink); border-top: 5px solid var(--c-ink); transform: translateX(-3px) rotate(45deg); }
@keyframes nudge { 0%, 60% { transform: none; } 70% { transform: translateX(4px); } 80% { transform: translateX(-2px); } 90% { transform: translateX(2px); } }

/* ------------------------------------------------------------------ */
/* The live clay kitchen */
.kitchen {
  position: relative; overflow: hidden; margin: 0 calc(var(--gutter) * -1);
  height: clamp(180px, 25dvh, 280px);
  background: #e9d6b0 url(/clay/family-banner-1200.webp) left center / auto 100% no-repeat;
  border-block: var(--border);
  isolation: isolate;
}
.kitchen--mini { margin: 0; height: auto; aspect-ratio: 3200 / 1050; border-width: 0 0 3px; background-size: 100% auto; }
.stage { position: absolute; top: 0; left: 0; height: 100%; aspect-ratio: 3200 / 1050; user-select: none; -webkit-user-select: none; will-change: transform; animation: pan 40s steps(480) infinite alternate; }
.kitchen--mini .stage { width: 100%; height: auto; animation: none; }
@keyframes pan { to { transform: translateX(var(--pan, 0)); } }
.stage__bg, .stage__table { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.fig { position: absolute; transform-origin: 50% 100%; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.kitchen--mini .fig { pointer-events: none; }
.fig__puppet { position: relative; transform-origin: 50% 100%; animation: breathe var(--bt, 3.6s) steps(22) infinite; animation-delay: var(--bd, 0s); }
.fig__body { display: block; width: 100%; max-width: none; pointer-events: auto; }
.fig__head { position: absolute; max-width: none; pointer-events: auto; animation: head-idle var(--ht, 7s) steps(18) infinite; animation-delay: var(--hd, 0s); }
@keyframes head-idle {
  0%, 100% { transform: rotate(0deg); }
  22% { transform: rotate(1.5deg); }
  48% { transform: rotate(-0.5deg); }
  72% { transform: rotate(-1.7deg); }
  88% { transform: rotate(0.4deg); }
}
.fig--look-l .fig__head { animation: look-l 2.6s steps(6) 1; }
.fig--look-r .fig__head { animation: look-r 2.6s steps(6) 1; }
@keyframes look-l { 0% { transform: rotate(0); } 16%, 76% { transform: rotate(-5deg); } 100% { transform: rotate(0); } }
@keyframes look-r { 0% { transform: rotate(0); } 16%, 76% { transform: rotate(5deg); } 100% { transform: rotate(0); } }
.fig--hop { animation: hop 830ms steps(3) 1; }
.fig--sway { animation: sway 2.5s steps(10) 1; }
@keyframes sway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-1.6deg); } 70% { transform: rotate(1.4deg); } }
.fig__tag {
  position: absolute; left: 50%; top: -2px; z-index: 5; white-space: nowrap; pointer-events: none;
  background: var(--c-gold); border: 2px solid var(--c-ink); box-shadow: 2px 2px 0 var(--c-ink);
  font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 0.86rem; line-height: 1; padding: 4px 7px;
  animation: tag-pop 250ms steps(3) both; transform: translate(-50%, -30%);
}
@keyframes tag-pop { from { transform: translate(-50%, -30%) scale(1.8) rotate(-6deg); } to { transform: translate(-50%, -30%) scale(1) rotate(-2deg); } }
.bulb { position: absolute; width: 1.3%; aspect-ratio: 1; margin: -0.65% 0 0 -0.65%; pointer-events: none; background: radial-gradient(circle, #fff6c8 0 28%, rgba(255, 210, 90, 0.6) 45%, transparent 70%); animation: bulb 1.5s steps(3) infinite; animation-delay: var(--d); }
@keyframes bulb { 0%, 100% { opacity: 0.2; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.5); } }
.kitchen__label {
  position: absolute; left: 10px; bottom: 9px; z-index: 6;
  background: var(--c-red); color: var(--c-paper); border: var(--border); box-shadow: 3px 3px 0 var(--c-ink);
  font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.05rem; line-height: 1; padding: 6px 10px 7px; transform: rotate(-1.5deg);
  animation: slam 350ms steps(3) both; --r: -1.5deg;
}

/* ------------------------------------------------------------------ */
/* Room: one clean page */
.screen--room { gap: 12px; }
.howto {
  appearance: none; display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px;
  width: 100%; padding: 6px 12px 6px 6px; min-height: 76px; text-align: left; cursor: pointer;
  background: var(--c-ink); color: var(--c-paper); border: var(--border); box-shadow: var(--shadow);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) steps(1), box-shadow var(--dur-fast) steps(1);
}
.howto:active { transform: translate(4px, 4px); box-shadow: var(--shadow-press); }
.howto__thumb { position: relative; display: grid; place-items: center; height: 62px; background: var(--c-red) url(/clay/family-banner-1200.webp) 58% 34% / auto 240% no-repeat; border: 2px solid var(--c-paper); overflow: hidden; }
.howto__play { display: block; width: 0; height: 0; margin-left: 5px; border-left: 24px solid var(--c-gold); border-top: 15px solid transparent; border-bottom: 15px solid transparent; filter: drop-shadow(2px 2px 0 var(--c-ink)); animation: play-beat 1.2s steps(1) infinite; }
@keyframes play-beat { 0%, 70% { transform: none; } 75% { transform: scale(1.3, 0.85); } 85% { transform: scale(0.9, 1.15); } }
.howto__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.howto__title { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.4rem; line-height: 1.05; color: var(--c-gold); }
.howto__sub { font-size: 0.86rem; line-height: 1.25; }
.player { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); animation: fade-in 170ms steps(2) both; }
@keyframes fade-in { from { opacity: 0; } }
.player video { flex: 1; min-height: 0; width: 100%; max-width: none; object-fit: contain; background: #000; }
.player .btn { border-width: 0 0 3px; box-shadow: none; flex: none; }

.room-status { display: flex; align-items: center; gap: 12px; padding: 7px 12px; background: var(--c-surface-2); border: var(--border); }
.room-status__n { font-family: var(--font-display); font-stretch: 78%; font-weight: 800; font-size: 2.3rem; line-height: 1; color: var(--c-red); min-width: 1.05em; text-align: center; animation: squash 330ms steps(4) 1; }
.room-status__text { display: flex; flex-direction: column; line-height: 1.22; font-size: 0.98rem; }
.room-status__judges { color: var(--c-muted); font-size: 0.9rem; }

.doors { display: flex; flex-direction: column; gap: 14px; margin-top: 2px; }
.door { position: relative; align-items: flex-start; text-align: left; min-height: 90px; padding: 10px 118px 11px 18px; animation: plop-big 450ms steps(3) both; animation-delay: 120ms; }
.door + .door { animation-delay: 240ms; }
.door .btn__label { font-size: clamp(1.3rem, 7.5vw, 1.52rem); line-height: 1; margin: 2px 0 3px; white-space: nowrap; }
.door__cast { position: absolute; right: 4px; bottom: 0; height: calc(100% + 14px); display: flex; align-items: flex-end; pointer-events: none; }
.door__cast img { height: 100%; width: auto; margin-left: -12px; animation: breathe 3.6s steps(22) infinite, door-hop 7s steps(2) infinite; animation-delay: var(--d), var(--d); transform-origin: 50% 100%; }
@keyframes door-hop { 0%, 86% { translate: 0 0; scale: 1 1; } 88% { translate: 0 2%; scale: 1.06 0.93; } 91% { translate: 0 -9%; scale: 0.96 1.05; } 95% { translate: 0 1%; scale: 1.04 0.96; } 98%, 100% { translate: 0 0; scale: 1 1; } }
.door:active .door__cast img { animation: squash 250ms steps(3) 1; }

.whos-in, .mine { display: flex; flex-direction: column; gap: 8px; }
.door--wait { min-height: 78px; padding-block: 7px 8px; animation-delay: 360ms; }
.door--wait .btn__label { font-size: clamp(1.3rem, 7.5vw, 1.52rem); }

/* Waiting room */
.screen--wait { gap: 12px; }
.wait__title { margin-top: 2px; }
.wait__live { display: flex; flex-direction: column; gap: 12px; }
.chip--new { animation: slam 400ms steps(4) both; --r: -2deg; background: var(--c-gold); }
.screen--wait .chip:not(.chip--new) { animation: none; }
.wait__judges { position: relative; display: grid; grid-template-columns: 96px 1fr; align-items: end; gap: 10px; padding: 12px 12px 12px 8px; background: var(--c-surface); border: var(--border); }
.wait__duo { display: flex; align-items: flex-end; height: 104px; margin-top: -24px; }
.wait__duo img { height: 100%; width: auto; margin-right: -14px; transform-origin: 50% 100%; animation: breathe 3.6s steps(22) infinite; animation-delay: var(--d); }

/* Scores are in */
.scores-in { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.scores-in__gifts { height: clamp(150px, 25dvh, 240px); width: auto; margin-top: 2px; transform-origin: 50% 100%; animation: plop 750ms steps(3) both, gift-sway 3s steps(30) 900ms infinite; }
@keyframes gift-sway { 0%, 100% { rotate: -1.5deg; } 50% { rotate: 1.5deg; } }
.scores-in__title { font-size: clamp(2.5rem, 12vw, 3.5rem); color: var(--c-red); animation: slam 400ms steps(4) 300ms both; --r: -2deg; }
.scores-in__sub { max-width: 30em; font-size: 1rem; line-height: 1.3; }

/* The unwrapping */
.cer-open, .cer-open body { overflow: hidden; }
.cer { position: fixed; inset: 0; z-index: 75; overflow-y: auto; display: flex; flex-direction: column; background: #2a0a12 url(/clay/set/stage.webp) center top / cover no-repeat fixed; color: var(--c-paper); -webkit-overflow-scrolling: touch; }
.cer::before { content: ""; position: fixed; inset: 0; background: rgba(20, 5, 10, 0.34); pointer-events: none; transition: background 500ms steps(6); }
.cer--dim::before { background: radial-gradient(circle at 50% 56%, rgba(20, 5, 10, 0.12) 0 26%, rgba(10, 2, 5, 0.9) 62%); }
.cer__top { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 8px; padding: calc(4px + env(safe-area-inset-top)) 12px 0; }
.cer__link { appearance: none; background: none; border: 0; min-height: 48px; padding: 6px 4px; color: var(--c-paper); font-weight: 700; font-size: 0.92rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.cer__body { position: relative; z-index: 1; flex: 1; width: 100%; max-width: var(--max-w); margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 4px var(--gutter) calc(24px + env(safe-area-inset-bottom)); text-align: center; }
.cer__eyebrow { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-paper); text-shadow: 2px 2px 0 var(--c-ink); }
.cer__title { font-size: clamp(3.2rem, 17vw, 5rem); font-stretch: 76%; line-height: 0.92; color: var(--c-gold); text-shadow: 5px 5px 0 var(--c-ink); animation: slam 450ms steps(4) both; --r: -3deg; }
.cer__crew { display: flex; justify-content: center; align-items: flex-end; flex-wrap: wrap; gap: 0 2px; max-width: 100%; margin-top: 8px; }
.cer__crew img { height: clamp(88px, 15dvh, 130px); width: auto; animation: plop 620ms steps(3) both; animation-delay: calc(var(--i) * 90ms + 300ms); }
.cer__place { font-size: clamp(2.8rem, 14vw, 4.2rem); font-stretch: 76%; color: var(--c-gold); text-shadow: 4px 4px 0 var(--c-ink); animation: slam 400ms steps(4) both; --r: -2deg; }
.cer__gift { appearance: none; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; transform-origin: 50% 100%; animation: plop 700ms steps(3) both; }
.cer__gift img { height: clamp(210px, 38dvh, 340px); width: auto; transform-origin: 50% 100%; animation: gift-sway 2.6s steps(26) infinite; }
.cer__gift--shake-1 img { animation: gift-shake 500ms steps(6) infinite; --a: 3; }
.cer__gift--shake-2 img { animation: gift-shake 300ms steps(4) infinite; --a: 7; }
.cer__gift--shake-3 img { animation: gift-shake 170ms steps(2) infinite; --a: 12; scale: 1.12; }
@keyframes gift-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(calc(var(--a) * -1px)) rotate(calc(var(--a) * -0.6deg)); }
  75% { transform: translateX(calc(var(--a) * 1px)) rotate(calc(var(--a) * 0.6deg)); }
}
.cer__line { font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: clamp(1.9rem, 9vw, 2.8rem); line-height: 1.05; color: var(--c-paper); text-shadow: 3px 3px 0 var(--c-ink); animation: slam 400ms steps(4) both; --r: -1deg; }
.cer__count { margin: 0; font-family: var(--font-display); font-stretch: 76%; font-weight: 800; font-size: clamp(6rem, 34vw, 11rem); line-height: 0.9; color: var(--c-gold); text-shadow: 7px 7px 0 var(--c-ink); animation: slam 380ms steps(4) both; --r: -4deg; }
.cer__count--front { position: fixed; inset: 0; z-index: 5; display: grid; place-content: center; }
.cer__curtain { position: fixed; top: 0; bottom: 0; z-index: 4; width: 51%; background: repeating-linear-gradient(90deg, #7c0d1b 0 34px, #b3172a 34px 70px, #8e1222 70px 96px); border: 6px solid var(--c-ink); transition: transform 1.1s steps(13); }
.cer__curtain--l { left: 0; }
.cer__curtain--r { right: 0; }
.cer__curtain--l.cer__curtain--open { transform: translateX(-104%); }
.cer__curtain--r.cer__curtain--open { transform: translateX(104%); }
.burst { position: fixed; left: 50%; top: 52%; z-index: 6; pointer-events: none; }
.burst i { position: absolute; width: 16px; height: 20px; border: 2px solid var(--c-ink); animation: burst-out 800ms steps(9) both; }
@keyframes burst-out { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0.2; } }
.cer__card { position: relative; width: 100%; background: var(--c-surface); color: var(--c-ink); border: var(--border); box-shadow: var(--shadow); animation: plop-big 500ms steps(3) both; text-align: left; }
.cer__medal { position: absolute; left: -7px; top: -11px; z-index: 2; padding: 5px 12px 7px; background: var(--c-gold); color: var(--c-ink); border: var(--border); box-shadow: 3px 3px 0 var(--c-ink); font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: 1.5rem; line-height: 1; transform: rotate(-4deg); }
.cer__medal--2 { background: #d9d9d9; }
.cer__medal--3 { background: #d49a6a; }
.cer__photo { position: relative; display: block; width: 100%; padding: 0; border: 0; border-bottom: var(--border); background: var(--c-surface-2); cursor: zoom-in; }
.cer__photo img { width: 100%; height: clamp(190px, 37dvh, 340px); object-fit: cover; }
.cer__photo-tip { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; background: var(--c-ink); color: var(--c-paper); font-size: 0.78rem; font-weight: 700; }
.cer__puppet { position: absolute; right: 4px; top: clamp(70px, 18dvh, 180px); z-index: 2; height: clamp(120px, 21dvh, 190px); width: auto; max-width: none; pointer-events: none; transform-origin: 50% 100%; animation: plop 700ms steps(3) 260ms both, puppet-cheer 1.5s steps(4) 1s infinite; }
@keyframes puppet-cheer { 0%, 100% { translate: 0 0; scale: 1 1; } 18% { translate: 0 1%; scale: 1.04 0.96; } 50% { translate: 0 -7%; scale: 0.98 1.03; } 78% { translate: 0 0.5%; scale: 1.03 0.97; } }
.cer__info { padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.cer__name { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.cer__points { font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; color: var(--c-primary); }
.cer__roast { font-weight: 700; line-height: 1.25; font-size: 1rem; }
.cer .btn { width: 100%; }
.cer__card--tied .cer__photo img { height: clamp(120px, 21dvh, 200px); }
.cer__card--tied .cer__puppet { top: clamp(10px, 3dvh, 30px); height: clamp(90px, 15dvh, 150px); }
.cer__card--tied .cer__name { font-size: 1.7rem; }
.cer__card--tied .cer__roast { font-size: 0.92rem; }
.cer__ready { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; text-align: center; }
.cer__ready-title { font-family: var(--font-display); font-stretch: 76%; font-weight: 800; font-size: clamp(3.4rem, 18vw, 6rem); line-height: 0.92; color: var(--c-gold); text-shadow: 5px 5px 0 var(--c-ink); animation: slam 450ms steps(4) both; --r: -3deg; }
.cer__ready-sub { color: var(--c-paper); font-weight: 700; font-size: 1.15rem; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8); }
.cer__hold { width: 100%; height: 12px; background: rgba(255, 245, 226, 0.25); border: 2px solid var(--c-ink); }
.cer__hold i { display: block; height: 100%; background: var(--c-gold); transform-origin: 0 50%; animation: hold-down linear both; }
@keyframes hold-down { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.control__title { font-size: clamp(2.8rem, 14vw, 3.8rem); color: var(--c-red); animation: slam 400ms steps(4) both; --r: -2deg; }
.control__tip { font-size: 1rem; line-height: 1.3; color: var(--c-muted); }

/* ------------------------------------------------------------------ */
/* Add-cookie steps */
.stepper { display: flex; gap: 6px; }
.stepper__dot { flex: 1; height: 12px; background: var(--c-surface); border: 2px solid var(--c-ink); }
.stepper__dot--on { background: var(--c-primary); }
.stepper__dot--now { animation: squash 330ms steps(3) 1; }
.screen--add h1, .screen--judge h1 { animation: plop 500ms steps(3) both; }

.viewfinder { position: relative; width: 100%; aspect-ratio: 1; background: #120a06; border: var(--border); box-shadow: var(--shadow); overflow: hidden; }
.viewfinder__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.viewfinder__guide {
  position: absolute; inset: 9%; border: 6px dashed var(--c-gold); border-radius: 50% !important;
  box-shadow: 0 0 0 999px rgba(20, 8, 2, 0.5); pointer-events: none;
  animation: guide-spin 8s steps(96) infinite, guide-pulse 1.3s steps(5) infinite;
}
@keyframes guide-spin { to { rotate: 360deg; } }
@keyframes guide-pulse { 50% { scale: 0.97; } }
.viewfinder__sweep { position: absolute; left: 12%; right: 12%; height: 5px; top: 12%; background: var(--c-gold); box-shadow: 0 0 18px 6px rgba(255, 194, 58, 0.65); animation: sweep 2.2s steps(26) infinite alternate; pointer-events: none; }
@keyframes sweep { to { top: 86%; } }
.viewfinder__hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px; text-align: center; background: rgba(42, 21, 11, 0.8); color: var(--c-paper); font-weight: 700; }
.viewfinder__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.viewfinder__flash--on { animation: flash 300ms steps(4) both; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.viewfinder--starting::after { content: "Opening the camera…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--c-paper); font-weight: 700; }
.shutter {
  display: block; width: 100%; min-height: 92px; cursor: pointer; touch-action: manipulation;
  background: var(--c-primary); color: var(--c-paper); border: var(--border); box-shadow: var(--shadow);
  font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 2rem; text-transform: uppercase;
  transition: transform var(--dur-fast) steps(1), box-shadow var(--dur-fast) steps(1);
}
.shutter:active:not(:disabled) { transform: translate(4px, 4px) scale(1.03, 0.92); box-shadow: var(--shadow-press); }
.shutter:disabled { opacity: 0.5; }

.preview { width: 100%; margin: 0; border: var(--border); box-shadow: var(--shadow); background: var(--c-surface); animation: plop-big 500ms steps(3) both; }
.preview img { width: 100%; height: auto; }

.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theme-tile {
  position: relative; display: flex; flex-direction: column; padding: 0; text-align: left; cursor: pointer; overflow: hidden;
  background: var(--c-surface); border: var(--border); box-shadow: 3px 3px 0 var(--c-ink);
  font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.12rem; line-height: 1.05;
  animation: plop 500ms steps(3) both; animation-delay: calc(var(--i, 0) * 70ms); touch-action: manipulation;
}
.theme-tile img { width: 100%; aspect-ratio: 1.25; object-fit: cover; border-bottom: var(--border); }
.theme-tile__name { display: block; padding: 8px 10px 9px; min-height: 56px; }
.theme-tile--selected { background: var(--c-secondary); color: var(--c-secondary-ink); box-shadow: var(--shadow); outline: 5px solid var(--c-gold); outline-offset: -8px; }
.theme-tile--selected img { animation: squash 250ms steps(3) 1; }
.theme-tile--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 96px 1fr; align-items: center; }
.theme-tile--wide img { aspect-ratio: 1.2; border-bottom: 0; border-right: var(--border); }
.theme-tile--wide .theme-tile__name { min-height: 0; }

.progress { position: relative; height: 34px; border: var(--border); background: var(--c-surface); margin: 18px 30px 18px 0; }
.progress__bar { position: relative; height: 100%; width: 0%; background: repeating-linear-gradient(45deg, var(--c-red) 0 14px, var(--c-paper) 14px 28px); transition: width var(--dur) steps(3); }
.progress__bar::after { content: ""; position: absolute; right: -32px; top: 50%; width: 64px; height: 64px; margin-top: -32px; background: url(/clay/logo/o1.webp) center / contain no-repeat; animation: roll 660ms steps(8) infinite; }
@keyframes roll { to { rotate: 360deg; } }

/* Roast and glam reveal */
.roast { position: relative; overflow: hidden; background: var(--c-ink); color: var(--c-paper); border: var(--border); box-shadow: var(--shadow); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.roast__wait { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 120px; padding: 4px 96px 6px 0; }
.roast__bob { position: absolute; right: -14px; bottom: -44px; height: 178px; width: auto; max-width: none; pointer-events: none; transform-origin: 50% 100%; animation: bob-sneak 4.4s steps(5) infinite both; }
@keyframes bob-sneak {
  0% { transform: translateY(100%); } 8% { transform: translateY(70%); } 16% { transform: translateY(40%); } 24%, 44% { transform: translateY(14%) rotate(-3deg); }
  52%, 70% { transform: translateY(8%) rotate(4deg); } 78% { transform: translateY(30%); } 88% { transform: translateY(70%); } 100% { transform: translateY(100%); }
}
.roast__label { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; color: var(--c-gold); text-transform: uppercase; letter-spacing: 0.08em; font-size: 1rem; }
.roast__text { font-family: var(--font-display); font-stretch: 90%; font-weight: 800; font-size: 1.5rem; line-height: 1.16; }
.roast__text--in { animation: slam 400ms steps(4) both; --r: 0deg; }
.roast__guess { color: var(--c-gold); font-size: var(--fs-small); }
.glam { border: var(--border); box-shadow: var(--shadow); background: var(--c-surface); }
.glam img { width: 100%; height: auto; animation: plop-big 500ms steps(3) both; }
.glam__caption { padding: 8px 12px; font-weight: 700; border-top: var(--border); }
.done-head { display: flex; gap: 14px; align-items: center; }
.done-head img { width: 96px; height: 96px; object-fit: cover; border: var(--border); box-shadow: 3px 3px 0 var(--c-ink); flex: none; background: var(--c-surface-2); animation: plop 600ms steps(3) both; }
.done-head h1 { font-size: var(--fs-h2); }
.loading-box { min-height: 130px; display: grid; place-items: center; gap: 10px; padding: 16px; text-align: center; background: var(--c-surface-2); border: var(--border); }
.loader { display: inline-block; width: 54px; height: 54px; background: url(/clay/logo/o1.webp) center / contain no-repeat; animation: roll 1s steps(10) infinite; }
.loader span { display: none; }

/* People who wander in */
.cameo { position: fixed; z-index: 30; left: 2vw; bottom: 0; height: 36vh; pointer-events: none; animation: cameo 2.6s steps(26) both; transform-origin: 50% 100%; }
.cameo img { height: 100%; width: auto; max-width: none; }
@keyframes cameo {
  0% { transform: translateY(105%); } 14% { transform: translateY(0) scale(1.05, 0.95); }
  24% { transform: translateY(-12%) scale(0.96, 1.05); } 34% { transform: none; }
  46% { transform: translateY(-12%) scale(0.96, 1.05); } 56%, 84% { transform: none; }
  100% { transform: translateY(105%); }
}

/* Rubber stamps */
.stamp {
  position: absolute; z-index: 3; pointer-events: none; white-space: nowrap;
  font-family: var(--font-display); font-stretch: 78%; font-weight: 800; font-size: 2.1rem; line-height: 1; text-transform: uppercase;
  color: var(--c-red); border: 5px solid var(--c-red); padding: 3px 12px 6px; background: rgba(255, 245, 226, 0.92);
  animation: slam 350ms steps(3) both;
}

/* ------------------------------------------------------------------ */
/* Judges */
.judges-duo { align-self: center; display: flex; align-items: flex-end; height: 190px; animation: plop 650ms steps(3) both; }
.judges-duo img { height: 100%; width: auto; margin: 0 -6px; transform-origin: 50% 100%; animation: breathe 3.6s steps(22) infinite; animation-delay: var(--d); }
.judge-head { display: flex; flex-direction: column; gap: 2px; }
.judge-count { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.9rem; line-height: 1; }
.jump-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.jump { position: relative; min-width: 52px; min-height: 52px; padding: 0 8px; background: var(--c-surface); border: var(--border); font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.jump--scored { background: var(--c-secondary); color: var(--c-secondary-ink); }
.jump--current { outline: 4px solid var(--c-gold); outline-offset: 2px; animation: squash 330ms steps(3) 1; }
.jump--new::after { content: "NEW"; position: absolute; top: -10px; right: -10px; font-size: 0.6rem; background: var(--c-primary); color: #fff; padding: 2px 4px; border: 2px solid var(--c-ink); animation: live-blink 1s steps(1) infinite; }
.judge-photo { position: relative; display: block; width: 100%; padding: 0; border: var(--border); box-shadow: var(--shadow); background: var(--c-surface); cursor: zoom-in; overflow: hidden; }
.judge-photo img { width: 100%; height: auto; max-height: 62vh; object-fit: contain; background: var(--c-surface-2); animation: plop-big 400ms steps(3) both; }
.judge-photo__zoom { position: absolute; right: 8px; bottom: 8px; background: var(--c-ink); color: var(--c-paper); padding: 4px 10px; font-weight: 700; font-size: 0.9rem; }
.judge-photo .stamp { left: 12px; top: 12px; --r: -8deg; }
.score-row { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--c-surface); border: var(--border); }
.score-row__label { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.4rem; line-height: 1; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.score-row__value { font-family: var(--font-body); font-stretch: normal; font-weight: 400; font-size: 1rem; color: var(--c-muted); }
.score-row__hint { color: var(--c-muted); font-size: 1rem; line-height: 1.25; }
.score-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.score-btn { min-height: var(--tap); background: var(--c-paper); border: var(--border); box-shadow: 3px 3px 0 var(--c-ink); font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.score-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--c-ink); }
.score-btn--on { background: var(--c-primary); color: var(--c-primary-ink); animation: squash 300ms steps(4) 1; }
.score-scale { display: flex; justify-content: space-between; font-size: var(--fs-small); color: var(--c-muted); }
.saved-indicator { min-height: 1.5em; font-weight: 700; color: var(--c-ok); text-align: center; }
.saved-indicator--error { color: var(--c-danger); }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.summary-tile { display: flex; flex-direction: column; background: var(--c-surface); border: var(--border); box-shadow: 3px 3px 0 var(--c-ink); padding: 0; cursor: pointer; text-align: left; animation: plop 500ms steps(3) both; animation-delay: calc(var(--i, 0) * 60ms); }
.summary-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-bottom: var(--border); }
.summary-tile__text { padding: 8px 10px; font-weight: 700; display: flex; flex-direction: column; }
.summary-tile--todo { outline: 5px dashed var(--c-primary); outline-offset: -5px; }
.reveal-btn { animation: door-beat 1.3s steps(1) infinite; }
@keyframes door-beat { 0%, 70% { transform: none; } 75% { transform: scale(1.03, 0.95); } 85% { transform: scale(0.98, 1.04); } }

/* ------------------------------------------------------------------ */
/* Results */
.results-wrap { display: flex; flex-direction: column; gap: 22px; }
.results-title { margin-top: 6px; }
.division { display: flex; flex-direction: column; gap: 14px; }
.podium { display: flex; flex-direction: column; gap: 18px; }
.podium__place { position: relative; background: var(--c-surface); border: var(--border); box-shadow: var(--shadow); animation: plop-big 500ms steps(3) both; animation-delay: 100ms; }
.podium__place:nth-child(2) { animation-delay: 280ms; }
.podium__place:nth-child(3) { animation-delay: 460ms; }
.podium__medal { position: absolute; top: -12px; left: -8px; z-index: 1; font-family: var(--font-display); font-stretch: 80%; font-weight: 800; font-size: 1.5rem; line-height: 1; padding: 6px 12px 8px; border: var(--border); box-shadow: 3px 3px 0 var(--c-ink); background: var(--c-gold); color: var(--c-gold-ink); transform: rotate(-4deg); }
.podium__place--2 .podium__medal { background: #d9d9d9; }
.podium__place--3 .podium__medal { background: #d49a6a; }
.podium__photo { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-bottom: var(--border); background: var(--c-surface-2); }
.podium__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.podium__name { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.podium__total { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--c-primary); }
.results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.result-card { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; background: var(--c-surface); border: var(--border); box-shadow: 3px 3px 0 var(--c-ink); }
.result-card img { width: 96px; height: 96px; object-fit: cover; border: 2px solid var(--c-ink); }
.result-card__rank { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.result-card__name { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: 1.5rem; line-height: 1.05; }
.result-card__roast { font-weight: 700; line-height: 1.3; }
.result-card__scores { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--fs-small); }
.result-card__scores span { border: 2px solid var(--c-ink); padding: 0 6px; background: var(--c-surface-2); }
.result-card__photos { grid-column: 1 / -1; display: flex; gap: 8px; }
.photo-toggle { display: flex; gap: 8px; }

/* Admin */
.admin-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.admin-entry { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 12px; background: var(--c-surface); border: var(--border); }
.admin-entry img { width: 88px; height: 88px; object-fit: cover; border: 2px solid var(--c-ink); }
.admin-entry__name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.admin-entry__actions { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.kv__value { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; }

/* Modal, lightbox, toast */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--gutter); background: rgba(42, 21, 11, 0.72); animation: fade-in 170ms steps(2) both; }
.modal__panel { width: min(100%, 480px); background: var(--c-paper); border: var(--border); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; animation: plop 500ms steps(3) both; }
.modal__actions { display: flex; flex-direction: column; gap: 12px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.lightbox img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.lightbox .btn { border-left: 0; border-right: 0; border-bottom: 0; box-shadow: none; min-height: var(--tap-huge); }
.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 160%);
  z-index: 70; max-width: calc(100% - 32px); padding: 14px 18px;
  background: var(--c-ink); color: var(--c-paper); border: 3px solid var(--c-paper); font-weight: 700;
  transition: transform var(--dur) steps(3), visibility 0s var(--dur); pointer-events: none; visibility: hidden;
}
.toast--on { transform: translate(-50%, 0); visibility: visible; transition: transform var(--dur) steps(3); }

.empty { padding: 22px 16px; text-align: center; background: var(--c-surface); border: var(--border); display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* Confetti and cookies for the reveal */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 78; overflow: hidden; }
.confetti i { position: absolute; top: -40px; display: block; width: 12px; height: 16px; border: 2px solid var(--c-ink); animation: fall steps(36) forwards; }
.confetti img { position: absolute; top: -70px; width: 46px; height: auto; animation: fall steps(36) forwards; }
@keyframes fall { to { transform: translateY(112vh) rotate(720deg); } }

.footer { margin-top: 10px; text-align: center; color: var(--c-muted); font-size: var(--fs-small); }
.footer a { color: inherit; }

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
