/* Quip Clash: a late-night game show. Colors come from the theme (themes.css).
   Answers are speech bubbles; the face-off between two of them is the star of the show. */

:root {
  /* colors live in themes.css (one block per theme) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
/* No double-tap zoom on iPhones (pinch zoom still works) */
html, body, button, a, input, textarea, label, [role="button"] { touch-action: manipulation; }
body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.35;
  color: var(--text);
  background: var(--bg-image), var(--night);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, [role="button"]:focus-visible {
  outline: 3px solid var(--mustard);
  outline-offset: 3px;
}

/* ---- top bar, timer, status ---- */

.timer {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  height: calc(var(--safe-top) + 7px);
  background: var(--glass);
}
.timer-fill {
  position: absolute; inset: auto 0 0 0; height: 7px;
  transform-origin: left center;
  background: var(--mint);
  border-radius: 0 4px 4px 0;
  transition: background-color 0.4s;
}
.timer[data-level="mid"] .timer-fill { background: var(--mustard); }
.timer[data-level="low"] .timer-fill { background: var(--bubble); animation: pulse 0.5s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: 0.55; } }

.bar {
  flex: none;
  display: flex; align-items: center; gap: 10px;
  min-height: calc(var(--sg-corner-top) + 54px);
  padding: var(--sg-corner-top) 14px 6px var(--sg-corner-left); /* the corner control heads the row (shared/menu.css) */
}
.bar > .sg-corner-slot { align-self: flex-start; }
.bar-spacer { flex: 1; }
.bar-count { font-weight: 700; color: var(--lilac); font-size: 17px; }
.bar-score {
  min-width: 56px; padding: 3px 12px; border-radius: 999px; text-align: center;
  background: var(--glass-2); font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums;
}
.bar-me {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer;
}
.bar-me .avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85); }
.pill {
  padding: 4px 14px; border-radius: 999px; background: var(--mint); color: var(--ink);
  font-weight: 800; font-size: 17px; white-space: nowrap;
}
.pill-double { background: var(--mustard); }
.pill-final { background: var(--bubble); }

.conn {
  position: fixed; z-index: 6; top: calc(var(--safe-top) + 66px); left: 50%; transform: translateX(-50%);
  padding: 6px 16px; border-radius: 999px; background: var(--bubble); color: var(--ink);
  font-weight: 800; font-size: 16px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.toast {
  position: fixed; z-index: 7; left: 50%; bottom: calc(var(--safe-bottom) + 110px);
  max-width: calc(100vw - 32px); width: max-content;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 18px; border-radius: 16px; background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: 17px; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- stage and screens ---- */

.stage { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.screen {
  display: flex; flex-direction: column; gap: 16px;
  min-height: 100%;
  max-width: 520px; margin: 0 auto;
  padding: 8px 18px calc(var(--safe-bottom) + 18px);
  animation: screen-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@keyframes screen-in { from { opacity: 0; transform: scale(0.96) translateY(10px); } }
.screen.center { justify-content: center; align-items: center; text-align: center; }
.screen-title { margin: 6px 0 0; font-size: 30px; font-weight: 800; line-height: 1.1; }
.center-text { text-align: center; }

.dock {
  position: sticky; bottom: 0; z-index: 2;
  display: grid; gap: 10px; margin-top: auto;
  padding: 14px 0 4px;
  background: linear-gradient(180deg, transparent, var(--night) 30%);
}
.dock-row { grid-template-columns: 1fr 1.35fr; }
.dock[hidden] { display: none; }
.dock-inline { position: static; margin-top: 0; padding-top: 0; background: none; }
.answer-hint { margin-top: auto; text-align: center; opacity: 0.8; }

.btn {
  min-height: 58px; padding: 10px 18px; border: 0; border-radius: 18px; cursor: pointer;
  font-size: 21px; font-weight: 800; line-height: 1.05;
  transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
}
.btn-go { background: var(--mustard); color: var(--ink); box-shadow: 0 5px 0 var(--mustard-lo); }
.btn-go:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--mustard-lo); }
.btn-go:disabled { background: var(--disabled); color: var(--disabled-ink); box-shadow: 0 5px 0 var(--disabled-lo); cursor: default; }
.btn-quiet { background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 2px var(--glass-line); font-size: 18px; }
.btn-quiet:active:not(:disabled) { transform: scale(0.97); }
.btn-quiet:disabled { opacity: 0.45; }
.btn-link {
  min-height: 44px; padding: 0 4px; border: 0; background: none; cursor: pointer;
  color: var(--lilac); font-size: 17px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
.small { margin: 0; color: var(--lilac); font-size: 16px; line-height: 1.35; }
.big-note { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.2; }

/* ---- brand ---- */

.brand { position: relative; display: flex; justify-content: center; margin: 18px 0 4px; }
.brand-bubble {
  position: relative; display: inline-block;
  padding: 6px 26px 10px; border-radius: 34px;
  background: var(--mustard); color: var(--ink);
  font-size: clamp(34px, 11.5vw, 56px); font-weight: 800; line-height: 1; letter-spacing: -0.01em; white-space: nowrap;
  transform: rotate(-4deg);
  box-shadow: 0 7px 0 var(--mustard-lo);
}
.brand-bubble::after {
  content: ""; position: absolute; left: 30px; bottom: -20px;
  border: 12px solid transparent; border-top: 16px solid var(--mustard); border-left: 4px solid transparent;
  filter: drop-shadow(0 6px 0 var(--mustard-lo));
}
.brand-echo {
  position: absolute; right: calc(50% - 170px); top: -22px;
  padding: 2px 14px 6px; font-size: 26px; background: var(--bubble); box-shadow: 0 4px 0 var(--bubble-lo);
  transform: rotate(9deg);
}
.brand-echo::after { left: auto; right: 14px; bottom: -14px; border-width: 8px; border-top: 10px solid var(--bubble); filter: none; }
/* Pass the Paw's name is longer: a little smaller, so its "Meow!" sits clear of it. */
.brand-doodle .brand-bubble { font-size: clamp(30px, 10vw, 48px); }
.brand-doodle .brand-echo { top: -30px; font-size: 24px; }
.brand-bubble.small { font-size: 30px; padding: 2px 14px 6px; border-radius: 20px; box-shadow: 0 4px 0 var(--mustard-lo); }
.brand-bubble.small::after { left: 16px; bottom: -12px; border-width: 7px; border-top-width: 10px; filter: none; }

/* ---- join ---- */

.join { text-align: center; }
.tagline { margin: 14px auto 0; max-width: 22em; font-size: 19px; color: var(--lilac); }
.name-label { margin-top: 18px; font-size: 20px; font-weight: 800; }
.name-input {
  width: 100%; min-height: 64px; padding: 10px 18px; border: 0; border-radius: 20px;
  background: var(--paper); color: var(--ink); text-align: center;
  font: 800 28px/1.1 "Baloo 2", ui-rounded, system-ui, sans-serif;
  box-shadow: inset 0 -4px 0 rgba(36, 16, 54, 0.12);
}
.name-input::placeholder { color: var(--placeholder); }
.name-input:focus { outline: 4px solid var(--mustard); outline-offset: 0; }
.who { display: grid; justify-items: center; gap: 6px; margin-top: 26px; }
.who p { margin: 0; font-size: 20px; }
.who-avatar { box-shadow: 0 0 0 5px var(--paper), 0 10px 24px rgba(0, 0, 0, 0.35); }

.spinner {
  width: 54px; height: 54px; border-radius: 50%;
  border: 6px solid var(--glass-2); border-top-color: var(--mustard);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- lobby ---- */

.lobby-game {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px;
  padding: 16px; border-radius: 24px; background: var(--glass);
}
.lobby-game p { margin: 0; font-size: 16px; color: var(--lilac); line-height: 1.3; }
.crowd-count { margin: 4px 0 -4px; font-size: 24px; font-weight: 800; }
.crowd {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 14px 8px;
}
.crowd li {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 6px 2px; border-radius: 18px;
  animation: plop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.crowd li.no-pop { animation: none; }
.crowd li.is-tappable { cursor: pointer; }
.crowd li.is-tappable:active { transform: scale(0.95); }
.crowd li.is-me .avatar { box-shadow: 0 0 0 3px var(--night), 0 0 0 6px var(--mustard); }
.crowd li.is-away .avatar, .avatar.is-away { opacity: 0.4; filter: grayscale(0.6); }
.crowd-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 16px; }
.crown, .away-tag {
  position: absolute; top: 0; right: calc(50% - 40px);
  padding: 0 8px; border-radius: 999px; font-size: 13px; font-weight: 800; line-height: 20px;
}
.crown { background: var(--mustard); color: var(--ink); transform: rotate(8deg); }
.away-tag { top: 46px; right: auto; background: #6c5a86; color: var(--text); }
@keyframes plop { from { transform: scale(0.4); opacity: 0; } }

.invite {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 8px 8px 16px; border-radius: 18px; border: 2px dashed var(--glass-line);
}
.invite p { margin: 0; font-size: 16px; color: var(--lilac); line-height: 1.25; overflow-wrap: anywhere; }
.invite b { color: var(--text); }
.btn-chip {
  flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--mint); color: var(--ink); font-size: 17px; font-weight: 800;
}
.btn-chip:active { transform: scale(0.96); }
/* write-in prompts */
.write-in { display: grid; gap: 10px; padding: 16px; border-radius: 22px; background: var(--glass); }
.write-in h3 { margin: 0; font-size: 20px; font-weight: 800; line-height: 1.2; }
.write-in .optional { color: var(--lilac); font-weight: 600; font-size: 16px; }
.write-in-form, .write-in-saved { display: grid; gap: 10px; }
.write-in-form[hidden], .write-in-saved[hidden], .write-in-preview[hidden], .write-in-tip[hidden] { display: none; }
.write-in-input {
  display: block; width: 100%; min-height: 76px; resize: none; padding: 12px 14px; border: 0; border-radius: 16px;
  background: var(--field); color: var(--ink); font: 700 19px/1.25 "Baloo 2", ui-rounded, system-ui, sans-serif;
}
.write-in-input::placeholder { color: var(--placeholder); }
.write-in-input:focus { outline: 4px solid var(--mustard); outline-offset: 0; }
.write-in-preview { margin: 0; padding: 8px 12px; border-radius: 14px; background: var(--paper); color: var(--ink); font-weight: 800; font-size: 17px; line-height: 1.2; }
.write-in-saved-text { margin: 0; padding: 12px 14px; border-radius: 16px; background: var(--paper); color: var(--ink); font-weight: 800; font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.write-in-actions { display: flex; gap: 8px; }
.write-in-count { margin: 0; font-size: 15px; }
.write-in-fold .write-in { padding: 0 16px 16px; background: none; }
.write-in-fold .write-in h3 { display: none; }
.btn-small { min-height: 50px; font-size: 19px; }
.btn-chip.is-quiet { background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 2px var(--glass-line); }

/* toggle switch: a real checkbox, styled */
.switch { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 17px; }
.switch-input { position: absolute; opacity: 0; width: 52px; height: 32px; margin: 0; cursor: pointer; }
.switch-track { position: relative; flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--glass-line); transition: background 0.2s; }
.switch-track::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); transition: transform 0.2s;
}
.switch-input:checked + .switch-track { background: var(--mint); }
.switch-input:checked + .switch-track::after { transform: translateX(20px); }
.switch-input:focus-visible + .switch-track { outline: 3px solid var(--mustard); outline-offset: 3px; }

.how { border-radius: 20px; background: var(--glass); }
.how summary { min-height: 52px; display: flex; align-items: center; padding: 0 18px; font-weight: 800; font-size: 19px; cursor: pointer; list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: "+"; margin-left: auto; font-size: 26px; color: var(--mustard); }
.how[open] summary::after { content: "–"; }
.how ol { margin: 0; padding: 0 18px 16px 40px; color: var(--lilac); font-size: 16px; }
.how li + li { margin-top: 6px; }
/* The family leaderboard row under "How to play": the shared .lb-open look (shared/account.css),
   the sheet is shared/leaderboard.js. */
.lobby-board.lb-open { flex: none; }
/* The party's name keeps the theme's display typeface (the size and weight are the shared .sg-title). */
.brand .brand-bubble.sg-title { font-family: var(--display); }

.waiting-note {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; margin: 0;
  font-size: 19px; font-weight: 700; color: var(--lilac); text-align: center;
}
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--mustard); animation: bounce 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; background: var(--bubble); }
.dots i:nth-child(3) { animation-delay: 0.3s; background: var(--mint); }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-7px); } }

/* ---- intro ---- */

.ticket {
  --notch: radial-gradient(circle at 0 50%, transparent 16px, #000 17px) left / 51% 100% no-repeat,
           radial-gradient(circle at 100% 50%, transparent 16px, #000 17px) right / 51% 100% no-repeat;
  padding: 26px 46px 30px; background: var(--mustard); color: var(--ink);
  -webkit-mask: var(--notch); mask: var(--notch);
  font-size: 58px; font-weight: 800; line-height: 1;
  transform: rotate(-3deg);
  animation: ticket-in 0.7s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.ticket.is-final { background: var(--bubble); }
@keyframes ticket-in { from { transform: rotate(-30deg) scale(0.2); opacity: 0; } }
.intro-line { margin: 22px 0 0; max-width: 18em; font-size: 22px; font-weight: 700; }

/* ---- prompt + answering ---- */

.prompt-card {
  position: relative;
  padding: 20px 22px 22px; border-radius: 26px;
  background: var(--paper); color: var(--ink);
  box-shadow: 0 8px 0 var(--card-shadow);
  transform: rotate(-0.8deg);
}
.prompt-text { margin: 0; font-size: 29px; font-weight: 800; line-height: 1.12; overflow-wrap: anywhere; }
.prompt-card.is-small .prompt-text { font-size: 22px; line-height: 1.15; }
.prompt-card.is-small { padding: 14px 18px 16px; }
.prompt-card.is-final { background: var(--card-final); }
.prompt-card.is-island { background: var(--card-island); }
.custom-badge {
  display: inline-block; justify-self: start; margin: -4px 6px 8px 0; padding: 0 12px; border-radius: 999px;
  background: var(--plum); color: var(--text); font-size: 14px; font-weight: 800; line-height: 26px;
  transform: rotate(-1.5deg);
}
.write-in-saved .custom-badge { margin: 0; background: var(--mint); color: var(--ink); }
.island-badge {
  display: inline-block; margin: -4px 0 8px; padding: 0 12px; border-radius: 999px;
  background: #0d5c63; color: #e6fffb; font-size: 14px; font-weight: 800; line-height: 26px;
  transform: rotate(-2deg);
}
.prompt-subject { display: flex; align-items: center; gap: 8px; margin: -2px 0 8px; font-size: 15px; font-weight: 800; color: var(--card-muted); }

.answer-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; font-weight: 700; color: var(--lilac); }
.clock { min-width: 3ch; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.clock.is-low { color: var(--bubble); }
.answer-box { position: relative; }
.answer-input {
  display: block; width: 100%; min-height: 104px; resize: none;
  padding: 16px 18px 26px; border: 0; border-radius: 22px;
  background: var(--field); color: var(--ink);
  font: 700 23px/1.25 "Baloo 2", ui-rounded, system-ui, sans-serif;
  box-shadow: inset 0 -4px 0 rgba(36, 16, 54, 0.1);
}
.answer-input::placeholder { color: var(--placeholder); }
.answer-input:focus { outline: 4px solid var(--mustard); outline-offset: 0; }
.counter { position: absolute; right: 16px; bottom: 6px; color: var(--card-muted); font-size: 15px; font-weight: 700; }

.done-burst {
  display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%;
  background: var(--mint); color: var(--ink); font-size: 54px; font-weight: 800;
  animation: ticket-in 0.6s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.done-title { margin: 4px 0 0; font-size: 34px; font-weight: 800; }
.waiting-label { margin: 18px 0 8px; font-weight: 800; color: var(--lilac); }
.waiting { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 14px; }
.waiting li { display: grid; justify-items: center; gap: 2px; width: 70px; font-size: 15px; font-weight: 700; animation: wobble 1.6s ease-in-out infinite; }
.waiting li:nth-child(2n) { animation-delay: -0.4s; }
.waiting li:nth-child(3n) { animation-delay: -0.9s; }
.waiting li span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skip-away { margin-top: 20px; min-height: 52px; }
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

/* ---- the face-off ---- */

.faceoff { display: grid; gap: 0; margin-top: 6px; }
.bubble {
  position: relative; display: grid; gap: 10px;
  min-height: 112px; padding: 20px 22px 24px; border: 0; border-radius: 30px;
  color: var(--ink); text-align: left; cursor: pointer;
  font-size: 24px; font-weight: 700; line-height: 1.18;
  transition: transform 0.18s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0.25s, filter 0.25s;
}
.bubble::after { content: ""; position: absolute; bottom: -16px; border: 12px solid transparent; }
.bubble-a { background: var(--mustard); box-shadow: 0 6px 0 var(--mustard-lo); transform: rotate(-1.6deg); margin-right: 22px; }
.bubble-a::after { left: 34px; border-top: 18px solid var(--mustard); border-left-width: 2px; }
.bubble-b { background: var(--bubble); box-shadow: 0 6px 0 var(--bubble-lo); transform: rotate(1.6deg); margin-left: 22px; }
.bubble-b::after { right: 34px; border-top: 18px solid var(--bubble); border-right-width: 2px; }
.bubble-text { overflow-wrap: anywhere; }
.bubble:not(:disabled):active { transform: scale(0.97); }
.bubble:disabled { cursor: default; }
.bubble.is-chosen { transform: rotate(0deg) scale(1.03); box-shadow: 0 0 0 4px #fff, 0 10px 0 rgba(0, 0, 0, 0.25); }
.bubble.is-chosen::before {
  content: "Your vote"; position: absolute; top: -12px; right: 16px;
  padding: 0 10px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 24px;
}
.bubble.is-dim { opacity: 0.45; filter: saturate(0.6); }
.bubble.is-myvote::before {
  content: "Your vote"; position: absolute; top: -12px; left: 16px;
  padding: 0 10px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 24px;
}
.versus {
  z-index: 1; justify-self: center; display: grid; place-items: center;
  width: 56px; height: 56px; margin: -6px 0; border-radius: 50%;
  background: var(--night); color: var(--text); font-size: 22px; font-weight: 800;
  box-shadow: 0 0 0 4px var(--plum);
}
.vote-note { margin: 4px 0 0; text-align: center; font-size: 20px; font-weight: 800; }
.vote-status { margin: 0; text-align: center; color: var(--lilac); font-weight: 700; }

/* reveal: voters drop in, then the author, then the stamp */
.voters { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 30px; }
.voter { box-shadow: 0 0 0 2px #fff; animation: drop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both; animation-delay: calc(0.6s + var(--i, 0) * 0.12s); }
@keyframes drop { from { transform: translateY(-40px) scale(0.3); opacity: 0; } }
.vote-count { margin-left: 4px; font-size: 17px; font-weight: 800; animation: fade 0.3s both 1.1s; }
.author {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: var(--chip-dark); color: var(--text); justify-self: start;
  animation: slide 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) both 1.4s;
}
.author .avatar { box-shadow: 0 0 0 2px #fff; }
.author-name { font-size: 18px; font-weight: 800; }
.points { margin-left: 4px; color: var(--mint); font-weight: 800; font-size: 18px; }
@keyframes slide { from { transform: translateX(-30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.tags { display: flex; gap: 6px; animation: fade 0.3s both 1.6s; }
.tag { padding: 0 10px; border-radius: 999px; background: rgba(36, 16, 54, 0.15); color: var(--ink); font-size: 14px; font-weight: 800; line-height: 24px; }
.stamp {
  position: absolute; top: -16px; right: 12px;
  padding: 2px 14px; border-radius: 12px; border: 3px solid var(--ink);
  background: #fff; color: var(--ink); font-size: 19px; font-weight: 800;
  transform: rotate(8deg);
  animation: stamp 0.4s cubic-bezier(0.3, 1.8, 0.5, 1) both 1.9s;
}
.stamp.is-sweep { background: var(--mint); }
@keyframes stamp { from { transform: rotate(30deg) scale(2.4); opacity: 0; } }
.reveal .bubble-a.is-winner { transform: rotate(-1.6deg) scale(1.03); }
.reveal .bubble-b.is-winner { transform: rotate(1.6deg) scale(1.03); }
.reveal .bubble.is-loser { animation: shrink 0.4s both 1.4s; }
@keyframes shrink { to { opacity: 0.7; filter: saturate(0.55); } }

.faceoff.is-reveal .bubble { cursor: default; }
.faceoff.is-reveal .bubble:active { transform: none; }

/* reactions */
.reacts {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px;
  animation: fade 0.3s both 1.7s;
}
.react {
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 52px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(36, 16, 54, 0.14); color: var(--ink); font-size: 16px; font-weight: 800;
  transition: transform 0.1s;
}
.react-e { font-size: 22px; line-height: 1; }
.react-n:empty { display: none; }
.react.has-count { background: rgba(255, 255, 255, 0.7); }
.react:active { transform: scale(0.9); }
.react.bump { animation: bump 0.25s ease-out; }
@keyframes bump { 50% { transform: scale(1.18); } }
.final-list.is-reveal .reacts { animation-delay: 0.3s; }
.floats { position: fixed; inset: 0; z-index: 8; pointer-events: none; overflow: hidden; }
.float {
  position: absolute; font-size: 30px; line-height: 1; transform: translate(-50%, 0);
  animation: rise 2.1s ease-out var(--delay, 0s) both;
}
@keyframes rise {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -20px) scale(1.15); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift, 0px)), -230px) scale(1); }
}

/* answer of the night */
.aotn {
  position: relative; display: grid; gap: 6px; padding: 16px 18px 18px; border-radius: 24px;
  background: var(--paper); color: var(--ink); box-shadow: 0 6px 0 var(--card-shadow); transform: rotate(-0.8deg);
}
.aotn h3 {
  justify-self: start; margin: -28px 0 0 -4px; padding: 2px 14px; border-radius: 12px;
  background: var(--bubble); color: var(--ink); font-size: 18px; font-weight: 800; transform: rotate(-3deg);
}
.aotn-prompt { margin: 4px 0 0; font-size: 15px; font-weight: 700; color: var(--card-muted); line-height: 1.2; }
.aotn-text { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.aotn-by { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aotn-by .author-name { font-weight: 800; font-size: 18px; }
.aotn-counts { display: flex; gap: 8px; margin-left: auto; font-weight: 800; font-size: 17px; }

/* ---- transitions between phases ---- */

.intro { gap: 14px; }
.ticket { position: relative; }
.ticket.is-double { background: var(--mint); }
.ticket-sticker {
  position: absolute; right: -18px; top: -26px; display: grid; place-items: center;
  width: 74px; height: 74px; border-radius: 50%; background: var(--bubble); color: var(--ink);
  font-size: 34px; font-weight: 800; transform: rotate(14deg); box-shadow: 0 5px 0 var(--bubble-lo);
  animation: stamp 0.45s cubic-bezier(0.3, 1.8, 0.5, 1) both 0.6s;
}
.intro-lines { display: grid; gap: 2px; margin-top: 10px; }
.intro-lines .intro-line { margin: 0; font-size: 26px; font-weight: 800; line-height: 1.15; }
.intro-lines .intro-line + .intro-line { font-size: 20px; font-weight: 700; color: var(--lilac); }
.intro-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.intro-chips span {
  padding: 6px 14px; border-radius: 999px; background: var(--glass-2); font-weight: 800; font-size: 17px;
  animation: plop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.intro-chips span:nth-child(1) { animation-delay: 0.7s; }
.intro-chips span:nth-child(2) { animation-delay: 0.9s; }

/* "Votes are in!" beat: covers the start of each reveal, then the results come in */
.votes-in {
  position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; pointer-events: none;
  background: var(--scrim);
  animation: beat-bg 1.15s ease-in both;
}
.votes-in span {
  padding: 14px 26px 18px; border-radius: 26px; background: var(--mustard); color: var(--ink);
  font-size: 44px; font-weight: 800; line-height: 1; transform: rotate(-4deg); box-shadow: 0 7px 0 var(--mustard-lo);
  animation: beat-stamp 1.15s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
@keyframes beat-bg { 0%, 75% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes beat-stamp {
  0% { transform: rotate(-20deg) scale(2.2); opacity: 0; }
  25% { transform: rotate(-4deg) scale(1); opacity: 1; }
  75% { transform: rotate(-4deg) scale(1); opacity: 1; }
  100% { transform: rotate(-4deg) scale(0.6); opacity: 0; }
}
/* The matchup reveal runs on the server's clock (revealScreen, quip-reveal.js): each piece is added or shown by a timer
   at its beat, so here it just animates the moment it appears. Anything already past (a late join) appears still. */
.screen.reveal.is-timed .is-waiting { visibility: hidden; animation: none !important; }
.screen.reveal.is-timed .voter,
.screen.reveal.is-timed .vote-count,
.screen.reveal.is-timed .author,
.screen.reveal.is-timed .tags,
.screen.reveal.is-timed .stamp,
.screen.reveal.is-timed .reacts,
.screen.reveal.is-timed .bubble.is-loser { animation-delay: 0s; }
.screen.reveal.is-timed .vote-count { animation: none; }
.screen.reveal.is-timed .voter { animation-duration: 0.32s; }
.screen.reveal.is-timed .verdict:empty { display: none; }
.faceoff.is-copycat .voters { display: none; }
.screen.reveal.is-timed .verdict { animation: verdict-in 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) both; }
@keyframes verdict-in { from { transform: scale(1.8); opacity: 0; } }
.screen.reveal.is-timed .verdict.is-waiting { animation: none; }
.screen.reveal.is-timed .is-past, .screen.reveal.is-timed .is-past .stamp { animation: none !important; }
.bubble.nudge { animation: nudge 0.22s ease-out; }
@keyframes nudge { 40% { translate: 0 5px; scale: 1.015; } }
.screen.reveal.is-timed .bubble.is-winner { animation: slam 0.5s cubic-bezier(0.25, 1.6, 0.45, 1) both; z-index: 2; }
@keyframes slam { 0% { scale: 1.35; filter: brightness(1.25); } 60% { scale: 0.97; } 100% { scale: 1; } }
.screen.reveal.is-timed .bubble.is-winner .stamp { font-size: 22px; animation-duration: 0.35s; }
.screen.reveal.is-timed .bubble.is-winner .stamp.is-sweep { font-size: 24px; padding: 4px 16px; }
.faceoff.shake { animation: shake 0.38s ease-out; }
@keyframes shake { 15% { translate: -7px 2px; } 30% { translate: 6px -2px; } 50% { translate: -4px 1px; } 70% { translate: 3px 0; } }
.bubble.is-tied { animation: tied 0.6s ease-in-out; }
@keyframes tied { 25% { rotate: -2.5deg; } 75% { rotate: 2.5deg; } }
/* Copycat: the two answers lean in together and a stamp lands across the middle */
.faceoff.is-copycat { position: relative; }
.bubble.is-copy { animation: copy-in 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
.bubble-a.is-copy { --lean: 10px; }
.bubble-b.is-copy { --lean: -10px; }
@keyframes copy-in { 50% { translate: 0 var(--lean); } }
.copy-stamp {
  position: absolute; left: 50%; top: 50%; z-index: 3; padding: 4px 18px 6px; border-radius: 14px;
  border: 4px solid var(--ink); background: #fff; color: var(--ink); font-size: 32px; font-weight: 800; line-height: 1.1;
  translate: -50% -50%; rotate: -6deg; white-space: nowrap; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.25);
  animation: stamp 0.4s cubic-bezier(0.3, 1.8, 0.5, 1) both;
}
/* Purrfect: a shutout (every vote, at least two) takes the whole screen for a moment */
.purrfect {
  position: fixed; inset: 0; z-index: 7; display: grid; place-content: center; justify-items: center; gap: 6px;
  pointer-events: none; background: var(--scrim);
  animation: purr-bg 1.7s ease-in both;
}
.purrfect b {
  padding: 10px 26px 16px; border-radius: 28px; background: var(--mint); color: var(--ink);
  font-size: clamp(46px, 15vw, 64px); font-weight: 800; line-height: 1; box-shadow: 0 8px 0 rgba(0, 0, 0, 0.3);
  animation: purr-word 1.7s cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
.purrfect span { color: var(--text); font-size: 22px; font-weight: 800; animation: fade 0.3s 0.25s both; }
@keyframes purr-bg { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes purr-word {
  0% { transform: rotate(-16deg) scale(2.6); opacity: 0; }
  22% { transform: rotate(-5deg) scale(1); opacity: 1; }
  80% { transform: rotate(-5deg) scale(1.04); opacity: 1; }
  100% { transform: rotate(-5deg) scale(0.7); opacity: 0; }
}
.custom-badge.is-family { background: var(--mint); color: var(--ink); }

.final-ready { gap: 18px; }
.votes-in-card span {
  display: inline-block; padding: 12px 24px 16px; border-radius: 24px; background: var(--mustard); color: var(--ink);
  font-size: 46px; font-weight: 800; line-height: 1; transform: rotate(-4deg); box-shadow: 0 7px 0 var(--mustard-lo);
  animation: ticket-in 0.7s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.final-ready .prompt-card { width: 100%; text-align: left; }
.final-ready .dock { width: 100%; }
.btn-next { min-height: 64px; font-size: 23px; }

/* pause */
.pause-layer {
  position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; padding: 24px;
  background: var(--scrim-strong); backdrop-filter: blur(3px);
}
.pause-card {
  display: grid; justify-items: center; gap: 10px; width: min(360px, 100%); padding: 28px 22px 22px;
  border-radius: 28px; background: var(--paper); color: var(--ink); text-align: center;
  animation: plop 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.pause-card h2 { margin: 0; font-size: 44px; font-weight: 800; line-height: 1; }
.pause-card p { margin: 0 0 6px; font-size: 18px; font-weight: 700; color: #5d4b6e; }
.pause-card .btn { width: 100%; }
.pause-icon { display: flex; gap: 12px; }
.pause-icon i { width: 16px; height: 46px; border-radius: 6px; background: var(--bubble); }

/* ---- scoreboard ---- */
.board-moving .row { animation: none; }
.board-moving.is-sliding .row { transition: transform 0.75s cubic-bezier(0.3, 1.25, 0.5, 1); }
.row-up {
  display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; vertical-align: 2px;
  background: var(--mint); color: var(--ink); font-size: 14px; font-weight: 800; line-height: 22px;
  opacity: 0; transform: scale(0.4); transition: opacity 0.3s 0.5s, transform 0.3s cubic-bezier(0.3, 1.8, 0.5, 1) 0.5s;
}
.is-settled .row-up { opacity: 1; transform: scale(1); }

.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 26px auto 1fr auto auto; align-items: center; gap: 10px;
  min-height: 56px; padding: 7px 14px 7px 10px; border-radius: 18px; background: var(--glass);
  animation: slide 0.4s cubic-bezier(0.3, 1.3, 0.5, 1) both; animation-delay: calc(var(--i, 0) * 0.06s);
}
.row.is-me { box-shadow: inset 0 0 0 3px var(--mustard); }
.row-rank { font-weight: 800; color: var(--lilac); text-align: center; }
.row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 19px; }
.row-delta { padding: 0 8px; border-radius: 999px; background: var(--mint); color: var(--ink); font-size: 15px; font-weight: 800; line-height: 24px; }
.row-score { min-width: 4ch; text-align: right; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---- final round ---- */

.final-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.final-head .vote-note { margin: 0; text-align: left; font-size: 16px; color: var(--lilac); font-weight: 700; }
.votes-left { flex: none; padding: 2px 12px; border-radius: 999px; background: var(--mustard); color: var(--ink); font-weight: 800; font-size: 16px; }
.final-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.final-card {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; width: 100%;
  min-height: 64px; padding: 12px 16px; border: 0; border-radius: 20px;
  background: var(--paper); color: var(--ink); text-align: left; cursor: pointer;
  font-size: 20px; font-weight: 700; line-height: 1.2;
  box-shadow: 0 4px 0 var(--card-shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}
.final-card:not(:disabled):active { transform: scale(0.98); }
.final-card:disabled { cursor: default; }
.final-card.has-votes { box-shadow: 0 0 0 4px var(--mustard), 0 4px 0 var(--card-shadow); }
.final-card.is-mine { background: rgba(255, 255, 255, 0.55); }
.final-text { overflow-wrap: anywhere; }
.pips { display: flex; gap: 4px; }
.pips i { width: 16px; height: 16px; border-radius: 50%; background: var(--mustard); box-shadow: inset 0 -2px 0 var(--mustard-lo); animation: plop 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.final-list.is-reveal .final-card { grid-template-columns: 1fr; cursor: default; animation: plop 0.45s cubic-bezier(0.3, 1.5, 0.5, 1); }
.final-list.is-reveal .final-card.is-top { background: var(--mustard); box-shadow: 0 6px 0 var(--mustard-lo); }
.final-list.is-reveal .voter, .final-list.is-reveal .author, .final-list.is-reveal .tags, .final-list.is-reveal .stamp { animation-delay: 0.2s; }
.final-list.is-reveal .voter { animation-delay: calc(0.15s + var(--i, 0) * 0.08s); }

/* ---- podium ---- */

.winner-title { text-align: center; font-size: 34px; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin-top: 8px; }
.step { display: grid; justify-items: center; gap: 2px; text-align: center; min-width: 0; }
.step-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 18px; }
.step-score { color: var(--lilac); font-weight: 800; font-variant-numeric: tabular-nums; }
.step-block {
  display: grid; place-items: start center; width: 100%; padding-top: 10px; margin-top: 4px;
  border-radius: 16px 16px 4px 4px; color: var(--ink); font-size: 24px; font-weight: 800;
  transform-origin: bottom; animation: grow 0.7s cubic-bezier(0.3, 1.3, 0.5, 1) both;
}
.step-1 .step-block { height: 132px; background: var(--mustard); animation-delay: 0.9s; }
.step-2 .step-block { height: 98px; background: var(--lilac); animation-delay: 0.5s; }
.step-3 .step-block { height: 72px; background: var(--bubble); animation-delay: 0.2s; }
.step-1 .podium-avatar { box-shadow: 0 0 0 4px var(--mustard); }
.step .podium-avatar { animation: plop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.step-1 .podium-avatar { animation-delay: 1.3s; }
.step-2 .podium-avatar { animation-delay: 0.9s; }
.step-3 .podium-avatar { animation-delay: 0.6s; }
@keyframes grow { from { transform: scaleY(0); } }

.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.confetti i {
  position: absolute; top: -20px; left: var(--x); width: 10px; height: 16px; border-radius: 2px;
  animation: fall var(--d) cubic-bezier(0.3, 0.6, 0.6, 1) var(--delay) both;
}
@keyframes fall { to { transform: translate(var(--drift), 105vh) rotate(var(--r)); } }

/* ---- menus ---- */

.menu-sheet {
  width: min(440px, 100vw); max-width: 100vw; margin: auto auto 0; padding: 22px 18px calc(var(--safe-bottom) + 18px);
  border: 0; border-radius: 28px 28px 0 0; background: var(--paper); color: var(--ink);
  font-family: "Baloo 2", ui-rounded, system-ui, sans-serif; display: grid; gap: 8px;
}
.menu-sheet:not([open]) { display: none; }
.menu-sheet::backdrop { background: var(--scrim); }
.menu-sheet[open] { animation: acct-up 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1); }
.menu-sheet h2 { margin: 0 0 6px; font-size: 24px; font-weight: 800; overflow-wrap: anywhere; }
.menu-item {
  min-height: 54px; padding: 0 18px; border: 0; border-radius: 16px; background: var(--card-2); color: var(--ink);
  text-align: left; font-size: 19px; font-weight: 700; cursor: pointer;
}
.menu-item.is-danger { color: #b0124e; }
.menu-item.is-cancel { background: transparent; text-align: center; color: var(--card-muted); }
@media (min-width: 600px) { .menu-sheet { margin: auto; border-radius: 28px; } }

/* ---- small phones ---- */

@media (max-width: 370px) {
  .screen { padding-left: 14px; padding-right: 14px; }
  .brand-bubble { font-size: clamp(32px, 11vw, 46px); }
  .brand-echo { font-size: 22px; right: calc(50% - 150px); }
  .prompt-text { font-size: 26px; }
  .bubble { font-size: 22px; padding: 18px 18px 22px; }
  .ticket { font-size: 48px; padding: 22px 36px 26px; }
  .btn { font-size: 19px; }
  .dock-row { grid-template-columns: 1fr 1.2fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .votes-in, .purrfect { display: none; }
}

/* iPhone: no double-tap zoom anywhere. touch-action isn't inherited, so it goes on every element
   (anything with its own touch-action keeps it). Text fields stay selectable. */
* { touch-action: manipulation; }
input, textarea { -webkit-user-select: text; user-select: text; }

/* ---- Pass the Paw (doodle.js, pad.js): a doodle-pad feel on the party's theme colours ---- */

.doodle-times[hidden], .write-in[hidden] { display: none; }
.time-row { display: grid; gap: 6px; }
.time-label { font-weight: 800; font-size: 16px; color: var(--lilac); }
.time-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.time-chip {
  min-width: 56px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 2px var(--glass-line);
  font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.time-chip[aria-pressed="true"] { background: var(--mint); color: var(--ink); box-shadow: none; }
.time-chip:disabled { opacity: 0.4; cursor: default; }
.time-chip[aria-pressed="true"]:disabled { opacity: 1; }

/* writing a prompt or a guess */
.d-icon { display: inline-grid; width: 24px; height: 24px; }
.d-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d-icon svg circle { fill: currentColor; stroke: none; }
.d-start { display: grid; gap: 4px; }
.d-lead { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.15; }
.d-give-row { display: grid; gap: 8px; }
.d-give { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; }
.d-rerolls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.d-rerolls[hidden] { display: none; }
.d-reroll { display: inline-flex; align-items: center; gap: 6px; }
.d-reroll .d-icon { width: 20px; height: 20px; }
.d-incoming { display: grid; gap: 8px; }
.d-note { text-align: center; }
.d-words .prompt-text { font-size: 24px; }
.d-kicker { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--card-muted); }

/* drawing */
.d-draw { gap: 10px; padding-top: 4px; padding-bottom: calc(var(--safe-bottom) + 10px); }
.d-draw-card { padding: 8px 16px 12px; border-radius: 20px; box-shadow: 0 5px 0 var(--card-shadow); transform: rotate(-0.5deg); }
.d-draw-card .prompt-text { font-size: 21px; line-height: 1.15; }
.d-kicker-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.d-draw-card .d-kicker { margin: 0; }
.d-draw-card .clock { font-size: 18px; color: var(--ink); }
.d-draw-card .clock.is-low { color: #c92a2a; }
.d-draw-dock { padding-top: 2px; }
.d-draw-dock .btn { min-height: 54px; }
.pad { display: grid; gap: 8px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.pad-board {
  position: relative; width: min(100%, calc((100dvh - var(--safe-top) - var(--safe-bottom) - 392px) * 1.25)); min-width: 240px;
  margin: 0 auto; aspect-ratio: 5 / 4; border-radius: 18px; overflow: hidden; background: #fffaf0;
  box-shadow: 0 0 0 3px var(--paper), 0 6px 0 3px var(--card-shadow);
}
.pad-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pad-live { touch-action: none; cursor: crosshair; }
.pad.is-locked .pad-board { opacity: 0.75; }
.pad-tools { display: grid; gap: 6px; }
.pad-colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pad-color {
  display: grid; place-items: center; min-height: 44px; padding: 0; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--glass); transition: transform 0.08s;
}
.pad-color i { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.18); }
.pad-color[aria-pressed="true"] { background: var(--glass-2); box-shadow: inset 0 0 0 3px var(--mustard); }
.pad-color[aria-pressed="true"] i { transform: scale(1.12); }
.pad-color:active, .pad-tool:active:not(:disabled) { transform: scale(0.94); }
.pad-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.pad-tool {
  display: grid; place-items: center; min-height: 44px; padding: 0; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 2px var(--glass-line);
}
.pad-tool svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pad-tool[aria-pressed="true"] { background: var(--mint); color: var(--ink); box-shadow: none; }
.pad-tool:disabled { opacity: 0.35; cursor: default; }
.pad-size i { display: block; width: var(--d); height: var(--d); border-radius: 50%; background: var(--c, currentColor); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); }

/* a drawing on a card */
.drawing { position: relative; aspect-ratio: 5 / 4; border-radius: 16px; overflow: hidden; background: #fffaf0; box-shadow: 0 0 0 2px var(--paper); }
.drawing-canvas { display: block; width: 100%; height: 100%; }
.drawing-wait { position: absolute; inset: 0; display: none; place-content: center; gap: 6px; }
.drawing.is-loading .drawing-wait { display: flex; align-items: center; justify-content: center; }
.drawing.is-blank { display: grid; place-items: center; color: #8d8299; font-weight: 800; font-size: 19px; }

.d-paw { display: grid; place-items: center; }
.d-paw-icon { width: 56px; height: 56px; }
.d-paw-icon svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }

/* the reveal */
.d-reveal { gap: 12px; }
.d-chain-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.d-chain-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.d-chain-n { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.1; }
.d-chain-by { margin: 0; font-size: 16px; color: var(--lilac); line-height: 1.2; }
.d-save { display: inline-flex; align-items: center; gap: 6px; }
.d-save[hidden] { display: none; }
.d-save .d-icon { width: 20px; height: 20px; }
.d-chain { display: grid; gap: 0; }
.d-link { display: grid; place-items: center; height: 30px; color: var(--glass-line); }
.d-link-paw { width: 22px; height: 22px; }
.d-link-paw svg { width: 100%; height: 100%; fill: currentColor; }
.d-page {
  position: relative; display: grid; gap: 8px; padding: 10px 10px 8px; border-radius: 22px; background: var(--glass);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.d-page.is-new { animation: d-page-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes d-page-in { from { opacity: 0; transform: translateY(18px) rotate(-1deg) scale(0.96); } }
.d-by { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 4px; font-size: 16px; color: var(--lilac); }
.d-by b { color: var(--text); font-weight: 800; }
.d-by .tag { background: var(--glass-2); color: var(--lilac); }
.d-text {
  margin: 0; padding: 14px 16px 16px; border-radius: 18px; background: var(--paper); color: var(--ink);
  font-size: 23px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere;
}
.d-text.is-prompt { background: var(--card-final); }
.d-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.d-foot .reacts { margin: 0; }
.d-pick {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 2px var(--glass-line); font-size: 17px; font-weight: 800;
}
.d-pick[hidden] { display: none; }
.d-pick .d-icon { width: 22px; height: 22px; }
.d-pick[aria-pressed="true"] { background: var(--mustard); color: var(--ink); box-shadow: 0 4px 0 var(--mustard-lo); }
.d-pick[aria-pressed="true"] .d-icon svg { fill: currentColor; }
.d-page.is-picked { box-shadow: inset 0 0 0 3px var(--mustard); }
.d-page.is-fav { background: var(--glass-2); box-shadow: inset 0 0 0 3px var(--mustard), 0 0 26px rgba(255, 209, 102, 0.35); }
.d-ribbon {
  position: absolute; top: -10px; right: 12px; padding: 2px 12px; border-radius: 999px;
  background: var(--mustard); color: var(--ink); font-size: 15px; font-weight: 800; box-shadow: 0 3px 0 var(--mustard-lo);
}
.d-status { text-align: center; min-height: 1.35em; }
.d-dock[hidden] { display: none; }

/* the end */
.d-awards { display: grid; gap: 12px; }
.d-award { display: grid; gap: 8px; padding: 14px; border-radius: 22px; background: var(--glass); }
.d-award h3 { margin: 0; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--mustard); }
.d-award-who { display: flex; flex-wrap: wrap; gap: 12px; }
.d-award-person { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; }
.d-gallery-title { margin: 6px 0 0; font-size: 22px; font-weight: 800; }
.d-gallery { display: grid; gap: 12px; }
.d-album { position: relative; display: grid; gap: 10px; padding: 12px; border-radius: 22px; background: var(--glass); }
.d-album-head { display: flex; align-items: center; gap: 10px; }
.d-album-title { margin: 0; font-weight: 800; font-size: 18px; line-height: 1.2; overflow-wrap: anywhere; }
.d-album-head .small { font-size: 14px; }
.d-album-pick { position: relative; }
.d-album-pick .d-ribbon { top: 8px; right: 8px; }
.d-album .d-save { justify-self: start; }

@media (max-width: 370px) {
  .d-text { font-size: 21px; }
  .pad-color i { width: 26px; height: 26px; }
}
.d-album-label { margin: 0 0 -4px; font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--lilac); }
.d-album-fav { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 800; font-size: 16px; color: var(--mustard); }
.d-album-fav .d-icon { width: 20px; height: 20px; }
.d-album-fav .d-icon svg { fill: currentColor; }
.d-foot .reacts { animation-delay: 0.2s; }

/* ---- Pass the Paw: timers, faces, passing paper (2026-11-18) ---- */

/* The timer ring: drains with the server's clock; amber in the last third, red in the last five seconds. */
.d-ring { position: relative; flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; }
.d-ring[hidden] { display: none; }
.d-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.d-ring circle { fill: none; stroke-width: 5; }
.d-ring-track { stroke: var(--glass-line); }
.d-ring-fill { stroke: var(--mint); stroke-linecap: round; transition: stroke 0.3s; }
.d-ring-n { position: relative; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.d-ring[data-level="mid"] .d-ring-fill { stroke: var(--mustard); }
.d-ring[data-level="low"] .d-ring-fill { stroke: #ff5d5d; }
.d-ring[data-level="low"] .d-ring-n { color: #ff5d5d; }
.d-ring.is-tick { animation: d-tick 0.32s ease-out; }
@keyframes d-tick { 40% { transform: scale(1.16); } }
.d-ring.is-big { width: 58px; height: 58px; }
.d-ring.is-big .d-ring-n { font-size: 20px; }
/* on a light card */
.d-draw-card .d-ring, .d-meta .d-ring { width: 36px; height: 36px; }
.d-draw-card .d-ring-track { stroke: rgba(20, 21, 24, 0.12); }
.d-draw-card .d-ring-n { color: var(--ink); font-size: 15px; }
.d-draw-card .d-ring[data-level="low"] .d-ring-n { color: #c92a2a; }
.d-draw-card .d-ring[data-level="low"] .d-ring-fill { stroke: #e03131; }
.d-draw-card .d-ring[data-level="mid"] .d-ring-fill { stroke: #f2a900; }
.d-draw-card .d-ring:not([data-level]) .d-ring-fill, .d-draw-card .d-ring[data-level="ok"] .d-ring-fill { stroke: #2fb886; }
.timer[data-level="quiet"] .timer-fill { background: var(--glass-line); }

/* A step's header: what to do, the faces, the ring. */
.d-meta { display: flex; align-items: center; gap: 8px; }
.d-meta .d-meta-label { flex: 1; min-width: 0; }
.d-kicker-row { align-items: center; }
.d-kicker-row .d-kicker { flex: 1; min-width: 0; }

/* Faces that tick off. Compact ones overlap a little; the big ones have names. */
.d-crew { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; }
.d-crew li { position: relative; display: grid; justify-items: center; }
.d-crew:not(.has-names) li + li { margin-left: -5px; }
.d-face { position: relative; display: grid; border-radius: 50%; box-shadow: 0 0 0 2px var(--night); transition: opacity 0.25s; }
.d-draw-card .d-face { box-shadow: 0 0 0 2px var(--paper); }
.d-crew li:not(.is-done) .d-face { opacity: 0.45; }
.d-crew li.is-away:not(.is-done) .d-face { opacity: 0.25; }
.d-tick {
  position: absolute; right: -3px; bottom: -3px; display: none; place-items: center; width: 15px; height: 15px; border-radius: 50%;
  background: var(--mint); color: var(--ink); box-shadow: 0 0 0 2px var(--night);
}
.d-tick svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.d-crew li.is-done .d-tick { display: grid; }
.d-crew li.is-pop .d-face { animation: d-pop 0.4s cubic-bezier(0.3, 1.7, 0.5, 1); }
@keyframes d-pop { from { transform: scale(0.6); } }
.d-crew.has-names { justify-content: center; gap: 12px 10px; }
.d-crew.has-names li { width: 64px; gap: 2px; font-size: 14px; font-weight: 700; }
.d-crew.has-names .d-tick { width: 22px; height: 22px; right: -4px; bottom: -4px; }
.d-crew.has-names .d-tick svg { width: 15px; height: 15px; }
.d-face-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-crew li:not(.is-done) .d-face-name { color: var(--lilac); }

/* The steps of the game, as little pages. */
.d-track { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.d-track-step { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--glass); color: var(--lilac); }
.d-track-step .d-icon { width: 17px; height: 17px; }
.d-track-step.is-past { background: var(--mint); color: var(--ink); }
.d-track-step.is-now { background: var(--mustard); color: var(--ink); animation: d-now 1.2s ease-in-out infinite alternate; }
.d-track-step.is-end { color: var(--mustard); }
@keyframes d-now { to { transform: translateY(-3px); } }
.d-wait { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; }
.d-wait .waiting-label { margin: 0; text-align: left; }
.d-next { margin: 0; }

/* Passing the paper: the next page slides in from the neighbour; what you sent is stamped and flies on. */
.screen.d-pass { animation: d-pass-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.08); }
@keyframes d-pass-in { from { opacity: 0; transform: translateX(46%) rotate(5deg); } }
.answer-box, .pad-board { position: relative; }
.d-stamp {
  position: absolute; left: 50%; top: 50%; z-index: 3; display: grid; justify-items: center; gap: 0;
  padding: 8px 18px 6px; border: 4px solid var(--mint); border-radius: 18px; background: rgba(20, 21, 24, 0.82); color: var(--mint);
  font-size: 22px; font-weight: 800; pointer-events: none;
  transform: translate(-50%, -50%) rotate(-8deg);
  animation: d-stamp 0.34s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.d-stamp-paw { width: 42px; height: 42px; }
.d-stamp-paw svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }
@keyframes d-stamp { from { opacity: 0; transform: translate(-50%, -50%) rotate(-24deg) scale(2.2); } }
.d-sent { position: relative; overflow: hidden; }
.d-sent .done-burst { animation: d-thump 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) 0.15s both; }
@keyframes d-thump { from { opacity: 0; transform: scale(2.1) rotate(-20deg); } }
.d-fly {
  position: absolute; left: 50%; top: 18%; width: 150px; height: 120px; margin-left: -75px; border-radius: 12px;
  display: grid; place-items: center; color: var(--mint);
  background: var(--paper); box-shadow: 0 6px 0 var(--card-shadow); pointer-events: none;
  animation: d-fly 0.6s cubic-bezier(0.5, 0, 0.8, 0.4) both;
}
@keyframes d-fly { to { opacity: 0; transform: translate(70vw, -30px) rotate(24deg) scale(0.7); } }
.d-fly-paw { width: 54px; height: 54px; transform: rotate(-12deg); }
.d-fly-paw svg { width: 100%; height: 100%; fill: currentColor; stroke: none; }

/* The reveal: each chain drops in with a drum roll, a drawing comes out from under its sheet. */
.d-chain-head.is-intro { animation: d-head-in 0.55s cubic-bezier(0.3, 1.5, 0.5, 1); }
@keyframes d-head-in { from { opacity: 0; transform: translateY(-26px) rotate(-2deg) scale(0.92); } }
.d-curtain {
  position: absolute; inset: 0; z-index: 1; background: repeating-linear-gradient(-45deg, #f2ead8 0 14px, #ece2cc 14px 28px);
  transform-origin: top; animation: d-curtain 0.42s cubic-bezier(0.6, 0, 0.4, 1) 0.28s forwards;
}
@keyframes d-curtain { to { transform: translateY(-101%); } }
.d-pickbox { display: grid; justify-items: center; gap: 8px; }
.d-pickbox[hidden] { display: none; }
.d-pickrow { display: flex; align-items: center; justify-content: center; gap: 10px; }
.d-pickrow .d-status { margin: 0; text-align: left; }
.d-pickbox .d-crew { justify-content: center; }
.d-page.is-fav .d-ribbon { animation: d-ribbon 0.45s cubic-bezier(0.3, 1.7, 0.5, 1); }
@keyframes d-ribbon { from { opacity: 0; transform: scale(0.3) rotate(-14deg); } }

/* The big vote. */
.d-vote { gap: 12px; }
.d-vote.is-intro .d-vote-head { animation: d-head-in 0.55s cubic-bezier(0.3, 1.5, 0.5, 1); }
.d-vote-head { display: grid; gap: 2px; }
.d-vote-head .screen-title { margin: 0; }
.d-vote-lead { margin: 2px 0 0; color: var(--lilac); font-size: 17px; line-height: 1.3; }
.d-vote-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  margin: 0 -18px; padding: 8px 18px; background: var(--night); box-shadow: 0 1px 0 var(--glass-line);
}
.d-vote-bar .d-status { flex: 1; margin: 0; text-align: left; }
.d-pips { display: flex; gap: 5px; }
.d-pips i { width: 18px; height: 18px; border-radius: 50%; background: var(--mustard); box-shadow: inset 0 -2px 0 var(--mustard-lo); transition: opacity 0.2s, transform 0.2s; }
.d-pips i.is-used { opacity: 0.25; transform: scale(0.8); }
.d-vote > .d-crew { justify-content: center; }
.d-ballot { display: grid; gap: 14px; }
.d-solo-chain { margin: -6px 0 0; padding: 0 4px; font-size: 14px; color: var(--lilac); }
.d-from { margin: 0; padding: 0 4px; font-size: 16px; color: var(--lilac); line-height: 1.25; }
.d-from q { color: var(--text); font-weight: 700; }
.d-from.is-draw { display: grid; grid-template-columns: 42% 1fr; align-items: end; gap: 10px; }
.d-from.is-draw .drawing { border-radius: 12px; }
.d-yours { margin-left: auto; padding: 4px 12px; background: var(--glass-2); color: var(--lilac); }
.d-vote-btn { min-width: 112px; justify-content: center; }
.d-vote-btn[aria-pressed="true"] { animation: bump 0.3s ease-out; }
.d-vote-rule { margin: 4px 0 0; color: var(--lilac); }

/* The results. */
.d-end .winner-title { overflow-wrap: anywhere; }
.d-tie-note { margin: -6px 0 0; color: var(--lilac); }
.d-podium .step { position: relative; }
.d-podium .step-score { font-size: 15px; }
.d-podium .step.is-me .step-name { color: var(--mustard); }
.d-crown { width: 34px; height: 34px; color: var(--mustard); margin-bottom: -4px; }
.d-crown svg { width: 100%; height: 100%; fill: currentColor; stroke: var(--mustard-lo); stroke-width: 1.4; stroke-linejoin: round; }
/* a block's height goes by place (two who share 1st both stand tall), not by where it stands */
.d-podium .step .d-step-1 { height: 118px; background: var(--mustard); }
.d-podium .step .d-step-2 { height: 88px; background: var(--lilac); }
.d-podium .step .d-step-3 { height: 64px; background: var(--bubble); }
/* a quicker rise than Quip Clash's: about a second from first block to crown */
.d-end .step-3 .step-block { animation-delay: 0.05s; }
.d-end .step-2 .step-block { animation-delay: 0.2s; }
.d-end .step-1 .step-block { animation-delay: 0.4s; }
.d-end .step-3 .podium-avatar { animation-delay: 0.3s; }
.d-end .step-2 .podium-avatar { animation-delay: 0.45s; }
.d-end .step-1 .podium-avatar { animation-delay: 0.7s; }
.d-end .d-crown { animation: d-crown 0.45s cubic-bezier(0.3, 1.7, 0.5, 1) 0.95s both; }
@keyframes d-crown { from { opacity: 0; transform: translateY(-30px) rotate(-30deg) scale(0.4); } }
.d-end.is-intro .winner-title { animation: d-head-in 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) 0.8s both; }
.d-rest { margin: 0; }
.d-bests { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.d-best { display: grid; align-content: start; gap: 6px; padding: 8px; border-radius: 18px; background: var(--glass); min-width: 0; }
.d-best.is-mine { box-shadow: inset 0 0 0 2px var(--mustard); }
.d-best .d-by { padding: 0 2px; font-size: 15px; gap: 5px; }
.d-best .d-by b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.d-best-why { display: flex; align-items: center; gap: 4px; min-height: 20px; margin: 0; padding: 0 2px; color: var(--mustard); font-weight: 800; font-size: 15px; }
.d-best-why .d-icon { width: 18px; height: 18px; }
.d-best-why .d-icon svg { fill: currentColor; }
.d-best .d-text { padding: 10px 12px 12px; font-size: 17px; border-radius: 14px; }
.d-best .drawing { border-radius: 12px; }

/* The reveal as a sketchbook: each page hangs from a wire spiral, lies a touch off square, flips down over the
   spiral as it arrives; drawings are taped in, words are written on lined paper. The player's theme keeps its colours. */
.d-reveal .d-chain { perspective: 1100px; }
.d-reveal .d-page {
  padding-top: 26px; border-radius: 10px 10px 18px 18px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22), inset 0 0 0 1px var(--glass-line);
}
.d-reveal .d-page::before {
  content: ''; position: absolute; top: 6px; left: 18px; right: 18px; height: 14px; pointer-events: none;
  background:
    radial-gradient(circle at 50% 70%, rgba(0, 0, 0, 0.45) 0 2.5px, transparent 3px) 0 0 / 22px 14px repeat-x,
    linear-gradient(180deg, transparent 0 3px, rgba(225, 228, 236, 0.95) 3px 5px, rgba(140, 146, 160, 0.9) 5px 7px, transparent 7px) 0 0 / 22px 14px repeat-x;
  -webkit-mask: radial-gradient(circle at 11px 7px, #000 0 6px, transparent 6.5px) 0 0 / 22px 14px repeat-x;
  mask: radial-gradient(circle at 11px 7px, #000 0 6px, transparent 6.5px) 0 0 / 22px 14px repeat-x;
}
.d-reveal .d-page { transform: rotate(var(--tilt, 0deg)); }
.d-reveal .d-page:nth-child(4n + 1) { --tilt: -0.6deg; }
.d-reveal .d-page:nth-child(4n + 3) { --tilt: 0.5deg; }
.d-reveal .d-page.is-picked { box-shadow: inset 0 0 0 3px var(--mustard), 0 10px 22px rgba(0, 0, 0, 0.22); }
.d-reveal .d-page.is-fav { box-shadow: inset 0 0 0 3px var(--mustard), 0 0 26px rgba(255, 209, 102, 0.35); }
.d-reveal .d-page .drawing { overflow: visible; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); }
.d-reveal .d-page .drawing > canvas { border-radius: 4px; }
.d-reveal .d-page .drawing::after {
  content: ''; position: absolute; top: -9px; left: 50%; width: 72px; height: 20px; margin-left: -36px; z-index: 2;
  background: rgba(255, 236, 170, 0.72); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  clip-path: polygon(3% 0, 97% 4%, 100% 100%, 0 96%);
}
.d-reveal .d-page .d-curtain { border-radius: 4px; }
.d-reveal .d-text {
  border-radius: 4px; padding-left: 30px;
  background:
    linear-gradient(90deg, transparent 18px, rgba(220, 90, 90, 0.45) 18px 20px, transparent 20px),
    repeating-linear-gradient(180deg, transparent 0 26px, rgba(80, 120, 200, 0.22) 26px 27px),
    var(--paper);
  background-position: 0 0, 0 9px, 0 0;
}
.d-reveal .d-text.is-prompt {
  background:
    linear-gradient(90deg, transparent 18px, rgba(220, 90, 90, 0.45) 18px 20px, transparent 20px),
    repeating-linear-gradient(180deg, transparent 0 26px, rgba(80, 120, 200, 0.22) 26px 27px),
    var(--card-final);
  background-position: 0 0, 0 9px, 0 0;
}
.d-reveal .d-link { height: 22px; }
.d-reveal .d-page.is-new { transform-origin: 50% 0; animation: d-turn 0.6s cubic-bezier(0.25, 0.9, 0.3, 1.15) both; }
@keyframes d-turn {
  0% { opacity: 0; transform: rotateX(-88deg) translateY(-6px); }
  45% { opacity: 1; }
  100% { transform: rotateX(0) rotate(var(--tilt, 0deg)); }
}
.d-reveal .d-page.is-home { animation: d-home 0.7s ease-out; }
@keyframes d-home {
  0% { box-shadow: 0 0 0 0 rgba(255, 209, 102, 0.7), 0 10px 22px rgba(0, 0, 0, 0.22); }
  100% { box-shadow: 0 0 0 18px rgba(255, 209, 102, 0), 0 10px 22px rgba(0, 0, 0, 0.22); }
}

/* The big vote's winner: the room goes dark and holds on the winning page while the drums roll. */
.d-spot {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse 70% 55% at 50% 45%, rgba(255, 230, 160, 0.16), rgba(0, 0, 0, 0.9) 70%), rgba(6, 6, 10, 0.86);
  color: #fff; text-align: center; cursor: pointer; animation: d-spot-in 0.35s ease-out;
}
@keyframes d-spot-in { from { opacity: 0; } }
.d-spot.is-out { animation: d-spot-out 0.38s ease-in forwards; }
@keyframes d-spot-out { to { opacity: 0; transform: scale(1.04); } }
.d-spot-kicker { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 0.02em; opacity: 0.9; animation: d-spot-pulse 0.9s ease-in-out infinite alternate; }
@keyframes d-spot-pulse { to { opacity: 0.55; } }
.d-spot-page { width: min(86vw, 420px); padding: 12px; border-radius: 10px; background: var(--glass); box-shadow: 0 0 60px rgba(255, 220, 140, 0.25); animation: d-spot-shake 0.11s linear infinite alternate; }
@keyframes d-spot-shake { from { transform: rotate(-0.6deg) translateY(1px); } to { transform: rotate(0.6deg) translateY(-1px); } }
.d-spot-page .d-text { font-size: 26px; }
.d-spot-who { display: grid; justify-items: center; gap: 10px; opacity: 0; transform: scale(0.5); }
.d-spot-faces { display: flex; gap: 8px; justify-content: center; }
.d-spot-name { margin: 0; font-size: 34px; font-weight: 800; line-height: 1.1; color: var(--mustard); text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4); }
.d-spot-skip { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); margin: 0; font-size: 15px; opacity: 0.6; }
.d-spot.is-hit .d-spot-kicker { animation: none; opacity: 0.6; }
.d-spot.is-hit .d-spot-page { animation: d-spot-punch 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); box-shadow: 0 0 0 4px var(--mustard), 0 0 80px rgba(255, 209, 102, 0.55); }
@keyframes d-spot-punch { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }
.d-spot.is-hit .d-spot-who { animation: d-spot-who 0.5s cubic-bezier(0.3, 1.7, 0.5, 1) forwards; }
@keyframes d-spot-who { to { opacity: 1; transform: scale(1); } }
.d-spot.is-hit::after { content: ''; position: absolute; inset: 0; background: #fff; pointer-events: none; animation: d-spot-flash 0.4s ease-out forwards; }
@keyframes d-spot-flash { from { opacity: 0.55; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .d-curtain, .d-fly { display: none; }
  .d-reveal .d-page.is-new, .d-reveal .d-page.is-home { animation: none; }
}

/* ---- Cat Hat (hat.js): the forehead card, the cards for everyone else, the recap ---- */

.h-kicker { margin: 0; font-weight: 800; font-size: 18px; color: var(--lilac); text-transform: uppercase; letter-spacing: 0.04em; }
.h-how { margin: 0 auto; max-width: 22em; font-size: 18px; color: var(--text); }
.h-big-avatar { box-shadow: 0 0 0 5px var(--paper), 0 12px 28px rgba(0, 0, 0, 0.35); }
.h-ready .screen-title, .h-count .screen-title { text-align: center; }
.h-start { min-height: 72px; font-size: 26px; }
.h-switch { justify-content: center; }
.h-team { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 15px; font-weight: 800; color: #fff; }
.h-team-0 { background: #d9822b; }
.h-team-1 { background: #3d4a66; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5); }

.h-scores { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.h-scores li { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--glass); font-size: 16px; }
.h-scores li.is-up { box-shadow: inset 0 0 0 2px var(--mustard); }
.h-scores li b { font-variant-numeric: tabular-nums; }
.h-sname { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-scores-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.h-tscore { display: grid; justify-items: center; padding: 8px; border-radius: 18px; color: #fff; }
.h-tscore span { font-weight: 800; font-size: 15px; }
.h-tscore b { font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.h-tscore.is-win { outline: 4px solid var(--mustard); }

.h-count-n { font-size: 150px; line-height: 1; font-weight: 800; color: var(--mustard); }
.h-count-n.is-pop { animation: h-pop 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes h-pop { from { transform: scale(1.6); opacity: 0.3; } }

/* the guesser's phone: the whole screen is the card; top half Pass, bottom half Got it */
.h-forehead { position: fixed; inset: 0; z-index: 12; background: #fff7ea; color: #231433; overflow: hidden; }
.h-zone {
  position: absolute; left: 0; right: 0; height: 50%; border: 0; padding: 0; cursor: pointer;
  display: flex; justify-content: center; font: inherit; font-weight: 800; font-size: 18px; color: rgba(35, 20, 51, 0.55);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.h-zone span { padding: 10px 18px; border-radius: 999px; background: rgba(35, 20, 51, 0.06); }
.h-zone-pass { top: 0; align-items: flex-start; padding-top: calc(var(--safe-top) + 76px); background: linear-gradient(180deg, #ffe1c2, #fff7ea); }
.h-zone-got { bottom: 0; align-items: flex-end; padding-bottom: calc(var(--safe-bottom) + 22px); background: linear-gradient(0deg, #d6f7e6, #fff7ea); }
.h-zone:active { filter: brightness(0.95); }
.h-word-box {
  position: absolute; left: 50%; top: 50%; width: var(--w, 90vw); transform: translate(-50%, -50%);
  display: grid; place-items: center; text-align: center; pointer-events: none;
}
.h-word-box[data-turn="right-up"] { transform: translate(-50%, -50%) rotate(90deg); }
.h-word-box[data-turn="left-up"] { transform: translate(-50%, -50%) rotate(-90deg); }
.h-word-box[data-turn="bottom-up"] { transform: translate(-50%, -50%) rotate(180deg); }
.h-word { margin: 0; font-weight: 800; line-height: 1.02; overflow-wrap: anywhere; }
.h-hud {
  position: absolute; top: calc(var(--safe-top) + 14px); right: 14px; display: flex; gap: 10px; align-items: center;
  font-weight: 800; font-size: 18px; pointer-events: none;
}
.h-hud-got { padding: 4px 12px; border-radius: 999px; background: rgba(35, 20, 51, 0.08); }
.h-clock { min-width: 2.2ch; padding: 2px 10px; border-radius: 999px; background: #231433; color: #fff7ea; text-align: center; font-size: 24px; font-variant-numeric: tabular-nums; }
.h-flash {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0;
  font-weight: 800; font-size: 64px; color: #fff;
}
.h-flash[data-kind="got"] { background: #1fae6a; }
.h-flash[data-kind="pass"] { background: #e8833a; }
.h-flash.is-on { animation: h-flash 0.7s ease-out; }
@keyframes h-flash { 0% { opacity: 0.96; transform: scale(1.04); } 60% { opacity: 0.9; } 100% { opacity: 0; transform: none; } }
@media (prefers-reduced-motion: reduce) { .h-flash.is-on { animation: h-flash-still 0.7s linear; } .h-count-n.is-pop { animation: none; } }
@keyframes h-flash-still { 0%, 60% { opacity: 0.92; } 100% { opacity: 0; } }

/* everyone else's phone */
.h-watch-top { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; }
.h-who { margin: 0; font-weight: 800; font-size: 18px; line-height: 1.15; }
.h-watch-got { font-weight: 800; color: var(--lilac); }
.h-watch-got b { color: var(--text); font-size: 22px; }
.h-card {
  position: relative; display: grid; place-items: center; min-height: 220px; padding: 22px; border-radius: 26px;
  background: #fff7ea; color: #231433; text-align: center; box-shadow: 0 10px 0 #c9b8ff, 0 18px 30px var(--card-shadow); overflow: hidden;
}
.h-card .h-flash { border-radius: 26px; font-size: 44px; }
.h-card-word { margin: 0; font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; }
.h-tip { margin: 0; text-align: center; font-weight: 700; color: var(--lilac); }
.h-tally, .h-recap { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.h-tally li, .h-recap li { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 14px; background: var(--glass); font-weight: 700; font-size: 18px; }
.h-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; }
.is-got .h-mark { background: #1fae6a; color: #fff; }
.is-pass .h-mark { background: var(--glass-line); color: var(--text); }
.is-pass > span:last-child { opacity: 0.75; }
.is-left .h-mark { background: none; }
.is-left > span:last-child { opacity: 0.6; font-style: italic; }

.h-end-top { display: flex; align-items: center; gap: 12px; }
.h-end-top .screen-title { font-size: 26px; }
.h-end-n { display: inline-block; min-width: 0.6em; text-align: center; font-variant-numeric: tabular-nums; }
.h-board.h-rise .row { animation: none; }
.h-board .row { grid-template-columns: 2ch auto 1fr auto auto; }
.h-board .row.is-win { background: linear-gradient(90deg, rgba(255, 209, 102, 0.28), var(--glass)); }
.h-board .row.is-win .row-name::after { content: " 👑"; }
.h-end .reacts { justify-content: center; animation-delay: 0.3s; }
.h-end .react { background: var(--glass-2); color: var(--text); }
.h-end .react.has-count { background: var(--glass-line); }
.h-row-sub { font-size: 14px; color: var(--lilac); font-weight: 700; }
.h-best { margin: 0; text-align: center; color: var(--lilac); font-weight: 700; }
.h-best b { color: var(--text); }
.h-all { padding: 0 14px 10px; }
.h-all summary { min-height: 48px; display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.h-all-turn { margin-top: 10px; }
.h-all-who { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-weight: 800; }

/* lobby and one-phone choices */
.h-deck-pick { display: grid; gap: 6px; }
.h-decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.h-deck {
  display: grid; gap: 0; min-height: 56px; padding: 8px 12px; border: 0; border-radius: 14px; text-align: left; cursor: pointer;
  background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 2px var(--glass-line);
}
.h-deck b { font-size: 17px; line-height: 1.15; }
.h-deck span { font-size: 14px; color: var(--lilac); line-height: 1.2; }
.h-deck[aria-pressed="true"] { background: var(--mint); color: var(--ink); box-shadow: none; }
.h-deck[aria-pressed="true"] span { color: var(--ink); opacity: 0.75; }
.h-deck:disabled { cursor: default; }
.h-deck[hidden], .h-fam-head[hidden] { display: none; }
.h-fam-head { margin-top: 6px; }
.h-names { display: grid; gap: 8px; }
.h-name-row { display: grid; grid-template-columns: 1fr 48px; gap: 8px; align-items: center; }
.h-name { margin: 0; width: 100%; }
.h-rm { width: 48px; height: 48px; border: 0; border-radius: 14px; background: var(--glass-2); color: var(--text); font-size: 26px; font-weight: 800; cursor: pointer; }
.h-add { justify-self: start; }
.h-add[hidden] { display: none; }
.h-fam-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.h-fam-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--glass); }
.h-cards-input { min-height: 220px; font-size: 18px; line-height: 1.4; }
.h-err { margin: 0; color: var(--bubble); font-weight: 800; }
.h-err:empty { display: none; }

/* the title picture and the hats sheet */
.h-title-art { display: grid; place-items: center; }
.h-title-art svg { max-height: 100%; width: auto; }
.h-hats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.h-hat {
  display: grid; justify-items: center; gap: 2px; min-height: 120px; padding: 6px 4px; border: 0; border-radius: 16px;
  background: rgba(127, 127, 127, 0.12); color: inherit; font: inherit; cursor: pointer;
}
.h-hat.is-on { box-shadow: inset 0 0 0 3px #f2b84b; }
.h-hat:disabled { cursor: default; opacity: 0.55; }
.h-hat-name { font-size: 14px; font-weight: 700; line-height: 1.15; text-align: center; }
.h-hat-lock { display: grid; place-items: center; width: 72px; height: 86px; font-size: 40px; font-weight: 800; opacity: 0.5; }
/* over the painted scene the title is light */
#mm.sg-scened { --sg-title: #fff; --sg-title-shadow: 0 3px 0 rgba(30, 10, 40, .7); }
