/* ==========================================================================
   DOODLINGS — a very cute drawing & guessing party
   Sketchbook UI: graph-paper desk, ink-outlined stickers with pastel offset
   shadows, washi tape, a spiral-bound drawing pad and pressable chunky buttons.
   ========================================================================== */

@font-face {
  font-family: 'Fredoka';
  /* Relative on purpose: served from /v/<stamp>/style.css the font inherits the
     same stamped prefix, so it is cacheable forever without ever going stale. */
  src: url('assets/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --cream: #fff5ea;
  --cream-deep: #ffe9d8;
  --paper: #fffdf9;
  --ink: #4b3a54;
  --ink-soft: #85738f;
  --ink-faint: #b6a8bf;
  --line: #4b3a54;
  --line-soft: rgba(75, 58, 84, 0.16);
  --grid: rgba(122, 160, 222, 0.14);

  --pink: #ffa9cb;
  --pink-deep: #ff6ba6;
  --pink-wash: #ffecf4;
  --mint: #93e8cf;
  --mint-deep: #34b994;
  --mint-wash: #e3fbf3;
  --sky: #a9d6ff;
  --sky-deep: #4fa6f2;
  --sky-wash: #e8f4ff;
  --butter: #ffe08a;
  --butter-deep: #f2b42a;
  --butter-wash: #fff6d6;
  --lilac: #d2c1ff;
  --lilac-deep: #9a7bf0;
  --lilac-wash: #f3eeff;
  --coral: #ffb196;
  --coral-deep: #ff7a59;

  --bw: 2.5px;
  --radius: 24px;
  --radius-sm: 14px;

  --font: 'Fredoka', 'Baloo 2', 'Quicksand', 'Segoe UI Rounded', 'Apple SD Gothic Neo',
    'Noto Sans KR', 'Malgun Gothic', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  background: var(--cream);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* Graph-paper desk with soft pastel washes. A fixed layer of its own, so it is
   composited once and never repaints while you draw or scroll. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 6%, rgba(255, 182, 212, 0.55), transparent 36%),
    radial-gradient(circle at 94% 6%, rgba(172, 216, 255, 0.55), transparent 34%),
    radial-gradient(circle at 84% 98%, rgba(170, 238, 210, 0.55), transparent 38%),
    radial-gradient(circle at 6% 96%, rgba(214, 198, 255, 0.45), transparent 32%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 26px 26px,
    var(--cream);
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--pink-deep); font-weight: 600; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; display: inline-block; vertical-align: -0.18em; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(75, 58, 84, 0.2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }

/* ---------------------------------------------------------------- sky ---- */

.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.sky__blob {
  position: absolute;
  border-radius: 46% 54% 60% 40% / 55% 45% 55% 45%;
  opacity: 0.4;
  animation: drift 28s ease-in-out infinite;
}
.sky__blob--1 { width: 320px; height: 280px; left: -110px; top: 12%; background: #ffd3e6; }
.sky__blob--2 { width: 300px; height: 280px; right: -110px; top: 46%; background: #d3ecff; animation-delay: -9s; }
.sky__blob--3 { width: 260px; height: 230px; left: 30%; bottom: -130px; background: #d4fbeb; animation-delay: -17s; }

.sky__doodle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s, 30px);
  height: var(--s, 30px);
  color: var(--c);
  opacity: 0.55;
  animation: bobble 7s ease-in-out infinite;
  animation-delay: var(--d);
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(24px, -28px, 0) rotate(12deg); }
}
@keyframes bobble {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-14px) rotate(10deg); }
}

/* ------------------------------------------------------------ screens ---- */

.screen { position: relative; z-index: 1; display: none; height: 100%; }
.screen.is-active { display: flex; }

.screen--home {
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: clamp(14px, 3vh, 34px) 18px 18px;
  overflow-y: auto;
}

.screen--room { flex-direction: column; padding: 10px 12px 12px; gap: 12px; }

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

.brand { text-align: center; flex-shrink: 0; position: relative; }

.brand__word {
  margin: 0;
  font-size: clamp(42px, 7.6vw, 80px);
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  justify-content: center;
  gap: 0.02em;
  line-height: 1;
}

.brand__word span {
  display: inline-block;
  color: var(--c);
  -webkit-text-stroke: 0.06em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 0.09em 0 var(--ink);
  animation: letter-bob 2.8s ease-in-out infinite;
  animation-delay: calc(var(--n) * 0.1s);
}

@keyframes letter-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

.brand__squiggle {
  display: block;
  width: min(320px, 70vw);
  height: 14px;
  margin: 8px auto 0;
  fill: none;
  stroke: var(--pink-deep);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: scribble-in 1.4s 0.2s ease-out forwards;
}
@keyframes scribble-in { to { stroke-dashoffset: 0; } }

.brand__tag {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 500;
}

/* A little gang of mascots bobbing between the logo and the cards. */
.parade {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: flex-end;
  height: 58px;
  margin-bottom: -26px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.parade__pal {
  width: 56px;
  height: 56px;
  animation: hop 2.4s ease-in-out infinite;
  animation-delay: calc(var(--n) * -0.35s);
}
.parade__pal:nth-child(odd) { width: 48px; height: 48px; }
@keyframes hop {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  40% { transform: translateY(-9px) rotate(4deg); }
  60% { transform: translateY(-9px) rotate(4deg); }
}

/* --------------------------------------------------------------- card ---- */

.card {
  position: relative;
  background: var(--paper);
  border: var(--bw) solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px 20px;
  box-shadow: 7px 8px 0 var(--card-shadow, var(--pink));
}
.card--play { --card-shadow: var(--mint); }

.card__title {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 9px;
}
.card__title .icon { color: var(--pink-deep); width: 22px; height: 22px; }
.card--play .card__title .icon { color: var(--mint-deep); }

/* washi tape */
.tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 104px;
  height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.4) 0 6px, transparent 6px 12px),
    var(--tape, #ffc2da);
  opacity: 0.92;
  clip-path: polygon(3% 0, 97% 6%, 100% 50%, 97% 100%, 2% 94%, 0 50%);
  pointer-events: none;
}
.tape--mint { --tape: #a4ecd6; transform: translateX(-50%) rotate(2.5deg); }
.card .tape { left: 30px; transform: rotate(-8deg); }
.card .tape--mint { left: auto; right: 30px; transform: rotate(7deg); }
.tape--sky { --tape: #b9dcff; }
.tape--butter { --tape: #ffe49a; }

.home-grid {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 26px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------ buttons ---- */

.btn {
  --btn-bg: var(--pink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--ink);
  border: var(--bw) solid var(--line);
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 0 var(--line);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.04) saturate(1.06); transform: translateY(-1px); box-shadow: 0 5px 0 var(--line); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: 0 4px 0 var(--line); filter: grayscale(0.35); }

.btn--pink { --btn-bg: var(--pink); }
.btn--mint { --btn-bg: var(--mint); }
.btn--sky { --btn-bg: var(--sky); }
.btn--butter { --btn-bg: var(--butter); }
.btn--ghost { --btn-bg: #fff; }

.btn--jumbo {
  width: 100%;
  justify-content: flex-start;
  padding: 10px 18px 10px 10px;
  border-radius: 22px;
  margin-bottom: 14px;
  font-size: 18px;
  gap: 14px;
}
.btn__icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  border: var(--bw) solid var(--line);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.btn__icon .icon { width: 24px; height: 24px; }
.btn--pink .btn__icon { color: var(--pink-deep); }
.btn--mint .btn__icon { color: var(--mint-deep); }
.btn__stack { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; min-width: 0; }
.btn__stack small { font-size: 12.5px; font-weight: 500; opacity: 0.8; }
.btn__go { margin-left: auto; width: 22px; height: 22px; transition: transform 0.2s ease; }
.btn--jumbo:hover .btn__go { transform: translateX(4px); }

.btn--send {
  --btn-bg: var(--mint);
  width: 46px; height: 46px; padding: 0; border-radius: 50%; flex-shrink: 0;
}
.btn--send .icon { width: 21px; height: 21px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 2px 0 var(--line);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}
.chip:hover { transform: translateY(-1px); background: var(--pink-wash); }
.chip:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.chip .icon { width: 15px; height: 15px; }

.iconbtn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: #fff;
  border: var(--bw) solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  flex-shrink: 0;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}
.iconbtn:hover { background: var(--pink-wash); transform: translateY(-1px); }
.iconbtn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.iconbtn .icon { width: 21px; height: 21px; }
#btn-home .icon { transform: scaleX(-1); }

/* -------------------------------------------------------------- input ---- */

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); padding-left: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.field__hint { font-size: 12px; color: var(--ink-faint); padding-left: 14px; }

.input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 999px;
  border: var(--bw) solid var(--line);
  background: #fff;
  font-weight: 600;
  outline: none;
  box-shadow: inset 0 3px 0 rgba(75, 58, 84, 0.07);
  transition: box-shadow 0.15s ease, background 0.15s ease;
}
.input::placeholder { color: var(--ink-faint); font-weight: 500; }
.input:focus { box-shadow: inset 0 3px 0 rgba(75, 58, 84, 0.07), 0 0 0 4px rgba(255, 143, 187, 0.35); }

.input--code {
  text-transform: uppercase;
  letter-spacing: 0.42em;
  text-align: center;
  font-weight: 700;
  font-size: 20px;
  padding: 10px 10px 10px 22px;
}

.join { display: flex; align-items: flex-end; gap: 10px; margin: 2px 0 16px; }
.join .btn { flex-shrink: 0; padding: 11px 24px; }

/* ------------------------------------------------------------- avatar ---- */

.avatar {
  --size: 40px;
  --tint: var(--pink);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--size);
  height: var(--size);
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.85), transparent 58%), var(--tint);
  border: max(1.5px, calc(var(--size) * 0.045)) solid var(--line);
  box-shadow: inset 0 calc(var(--size) * -0.08) 0 rgba(75, 58, 84, 0.12);
  line-height: 1;
}
.avatar__face { display: block; width: 116%; height: 116%; flex-shrink: 0; transform: translateY(-4%); }
.mascot-art { display: block; width: 100%; height: 100%; overflow: visible; }
.mascot-eye { transform-box: fill-box; transform-origin: center; }
.avatar--xl { --size: 112px; animation: wiggle 3.4s ease-in-out infinite; }
.avatar--xl .mascot-eye { animation: mascot-blink 5.8s ease-in-out infinite; }

@keyframes wiggle {
  0%, 100% { transform: rotate(-4deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-6px); }
}
@keyframes mascot-blink { 0%, 92%, 96%, 100% { transform: scaleY(1); } 94% { transform: scaleY(0.08); } }

.me { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.me__preview { position: relative; padding: 6px; }
.me__preview::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px dashed rgba(75, 58, 84, 0.25);
  animation: spin 24s linear infinite;
}
.me__sparkle {
  position: absolute; top: -2px; right: -6px; width: 24px; height: 24px; color: var(--butter-deep);
  animation: twinkle 1.8s ease-in-out infinite;
}
.me__preview.is-bounce .avatar { animation: boing 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50% { transform: scale(1.3) rotate(25deg); opacity: 1; }
}
@keyframes boing {
  0% { transform: scale(1); }
  35% { transform: scale(1.14, 0.9); }
  65% { transform: scale(0.94, 1.08); }
  100% { transform: scale(1); }
}

.picker__label {
  margin: 0 0 9px; padding-left: 2px; font-size: 12.5px; font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.picker:last-child { margin-bottom: 0; }

.picker--avatars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; }
.picker--avatars button {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid transparent;
  display: grid;
  place-items: center;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.12s ease, background 0.12s ease;
}
.picker--avatars .mascot-art { width: 92%; height: 92%; }
.picker--avatars button:hover { transform: translateY(-3px) rotate(-6deg); background: var(--pink-wash); }
.picker--avatars button[aria-checked='true'] {
  border-color: var(--line);
  background: var(--butter-wash);
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 3px 0 var(--line);
}

.picker--colors { gap: 10px; }
.picker--colors button {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--line);
  box-shadow: inset 0 -4px 0 rgba(75, 58, 84, 0.16), inset 0 3px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.picker--colors button:hover { transform: scale(1.12); }
.picker--colors button[aria-checked='true'] { transform: scale(1.14); box-shadow: inset 0 -4px 0 rgba(75, 58, 84, 0.16), 0 0 0 3px #fff, 0 0 0 5.5px var(--line); }

/* -------------------------------------------------------------- rooms ---- */

.rooms { border-top: 2.5px dashed var(--line-soft); padding-top: 14px; }
.rooms__head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; padding-left: 2px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.rooms__title { display: inline-flex; align-items: center; gap: 6px; }
.rooms__list { list-style: none; margin: 0; padding: 2px 2px 6px; display: flex; flex-direction: column; gap: 8px; max-height: 176px; overflow-y: auto; }
.rooms__empty {
  color: var(--ink-faint); font-size: 13.5px; padding: 14px 6px; text-align: center;
  border: 2px dashed var(--line-soft); border-radius: 16px;
}

.room-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 16px; background: #fff;
  border: 2px solid var(--line); width: 100%; text-align: left;
  box-shadow: 0 3px 0 var(--line);
  transition: transform 0.12s ease, background 0.12s ease;
}
.room-row:hover { background: var(--mint-wash); transform: translateY(-2px); }
.room-row:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.room-row__faces { display: flex; }
.room-row__faces .avatar { margin-right: -9px; }
.room-row__code { font-weight: 700; letter-spacing: 0.12em; margin-left: 12px; }
.room-row__meta { margin-left: auto; display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.room-row__state { padding: 2px 9px; border-radius: 99px; background: var(--butter-wash); border: 1.5px solid var(--butter-deep); color: #8a5d0c; }
.room-row__state--open { background: var(--mint-wash); border-color: var(--mint-deep); color: #16705a; }

/* --------------------------------------------------------- how to play ---- */

.how {
  width: min(1000px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  flex-shrink: 0;
  margin-top: 6px;
}
.how__step {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 2px dashed rgba(75, 58, 84, 0.3);
}
.how__num {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700;
  background: var(--c); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line);
}
.how__icon { width: 24px; height: 24px; color: var(--ink-soft); }
.how__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.how__text strong { font-size: 15px; }
.how__text small { font-size: 12.5px; color: var(--ink-soft); }

.home-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
  font-size: 12.5px; color: var(--ink-soft); padding-bottom: 8px; flex-shrink: 0;
}

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #fff; border: 2px solid var(--line-soft);
}
.pill__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--butter-deep); animation: pulse 1.4s ease-in-out infinite; }
.pill--ok .pill__dot { background: var(--mint-deep); animation: none; }
.pill--bad .pill__dot { background: #ff7a7a; }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ------------------------------------------------------------- topbar ---- */

.topbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 9px 12px;
  border-radius: 22px;
  background: var(--paper);
  border: var(--bw) solid var(--line);
  box-shadow: 0 5px 0 var(--sky);
}
.topbar__left, .topbar__right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__right { justify-content: flex-end; }

.topbar__label { display: block; font-size: 10.5px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.1em; line-height: 1; }

.round-badge {
  display: flex; flex-direction: column; gap: 3px;
  padding: 5px 13px 6px; border-radius: 14px;
  background: var(--lilac-wash); border: 2px solid var(--line-soft);
  min-width: 78px;
}
.round-badge strong { font-size: 17px; font-weight: 700; line-height: 1.05; }
.turn-dots { display: flex; gap: 3px; height: 6px; }
.turn-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(75, 58, 84, 0.18); }
.turn-dots i.is-done { background: var(--lilac-deep); }
.turn-dots i.is-now { background: var(--pink-deep); box-shadow: 0 0 0 2px rgba(255, 107, 166, 0.25); }

.wordbar { min-width: 0; max-width: min(760px, 56vw); display: flex; flex-direction: column; align-items: center; gap: 5px; }
.wordbar__tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; min-height: 40px; align-items: center; }
.wordbar__hint {
  font-size: 12px; color: var(--ink-soft); font-weight: 600;
  padding: 1px 10px; border-radius: 99px; background: var(--cream);
}
.wordbar__hint.is-good { background: var(--mint-wash); color: #16705a; }
.wordbar__hint.is-draw { background: var(--butter-wash); color: #8a5d0c; }

/* idle doodle shown in the word bar outside a turn */
.wordbar__idle { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-faint); }
.wordbar__idle .icon { width: 22px; height: 22px; }

.tile-word { display: inline-flex; gap: 4px; }
.tile {
  --i: 0;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 38px; padding: 0 5px;
  border-radius: 9px; background: #fff;
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  font-weight: 700; font-size: 21px; color: var(--ink); line-height: 1;
  animation: tile-pop 0.36s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--i) * 28ms);
}
.tile--blank {
  background: rgba(255, 255, 255, 0.6);
  border-style: dashed;
  border-color: rgba(75, 58, 84, 0.42);
  box-shadow: none;
  position: relative;
}
.tile--blank::after {
  content: '';
  position: absolute; left: 7px; right: 7px; bottom: 7px; height: 3px; border-radius: 3px;
  background: rgba(75, 58, 84, 0.22);
}
.tile--reveal { background: var(--butter); }
.tile--fresh { animation: tile-flip 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes tile-pop { from { transform: translateY(-10px) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tile-flip {
  0% { transform: rotateY(90deg) scale(1.2); background: #fff; }
  60% { transform: rotateY(0) scale(1.18); }
  100% { transform: none; }
}

/* ticket-stub room code */
.ticket {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 6px 34px 7px 14px; border-radius: 14px;
  background: var(--butter-wash);
  border: var(--bw) solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}
.ticket::before {
  content: '';
  position: absolute; inset: 3px; border-radius: 10px;
  border: 1.5px dashed rgba(75, 58, 84, 0.3);
  pointer-events: none;
}
.ticket:hover { background: #fff1bf; transform: translateY(-1px); }
.ticket:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.ticket__label { font-size: 10.5px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.1em; line-height: 1; }
.ticket__code { font-size: 17px; font-weight: 700; letter-spacing: 0.16em; line-height: 1; }
.ticket__icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-soft); }

/* -------------------------------------------------------------- timer ---- */

.timer {
  position: relative; flex-shrink: 0;
  width: 56px; height: 56px;
  display: grid; place-items: center;
}
/* alarm-clock bells */
.timer::before, .timer::after {
  content: '';
  position: absolute; top: -3px; width: 16px; height: 11px;
  border-radius: 12px 12px 3px 3px;
  background: var(--butter);
  border: 2px solid var(--line);
}
.timer::before { left: 0; transform: rotate(-34deg); }
.timer::after { right: 0; transform: rotate(34deg); }
.timer__ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(-90deg); z-index: 1;
  border-radius: 50%;
  background: #fff;
  border: var(--bw) solid var(--line);
  box-shadow: 0 3px 0 var(--line);
}
.timer__track { fill: none; stroke: var(--cream-deep); stroke-width: 6; }
.timer__fill {
  fill: none; stroke: var(--mint-deep); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.25s linear, stroke 0.4s ease;
}
.timer__count { position: relative; z-index: 2; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer[data-level='mid'] .timer__fill { stroke: var(--butter-deep); }
.timer[data-level='low'] .timer__fill { stroke: var(--coral-deep); }
.timer[data-level='idle'] .timer__fill { stroke: transparent; }
.timer.is-urgent { animation: alarm 0.5s ease-in-out infinite; }
.timer.is-urgent .timer__count { color: #d6452b; }
@keyframes alarm {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-7deg) scale(1.04); }
  75% { transform: rotate(7deg) scale(1.04); }
}

/* --------------------------------------------------------------- play ---- */

.play {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 300px;
  gap: 14px;
}

.panel {
  position: relative;
  background: var(--paper);
  border-radius: 22px;
  border: var(--bw) solid var(--line);
  box-shadow: 0 5px 0 var(--panel-shadow, var(--pink));
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel--players { --panel-shadow: var(--butter); }
.panel--chat { --panel-shadow: var(--mint); }
.panel--stage { padding: 4px; background: transparent; border: none; box-shadow: none; }

.panel__title {
  margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 8px; padding: 0 4px; flex-shrink: 0;
}
.panel__title .icon { width: 19px; height: 19px; color: var(--ink-soft); }
.panel__count {
  margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-soft);
  padding: 1px 9px; border-radius: 99px; background: var(--cream);
}

/* ------------------------------------------------------------ players ---- */

.players { list-style: none; margin: 0; padding: 6px 2px 2px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; min-height: 0; }

.player {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px 7px 8px; border-radius: 16px;
  background: #fff; border: 2px solid var(--line-soft);
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}
.player.is-you { border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.player.is-drawer { background: var(--butter-wash); border-color: var(--butter-deep); }
.player.is-guessed { background: var(--mint-wash); border-color: var(--mint-deep); }
.player.is-you.is-drawer, .player.is-you.is-guessed { border-color: var(--line); }
.player.is-away { opacity: 0.5; }
.player.just-scored { animation: score-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes score-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06) rotate(-1.5deg); }
  100% { transform: scale(1); }
}

.player__rank {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
  background: var(--cream);
}
.player__rank--1 { background: #ffd977; color: var(--ink); border: 1.5px solid var(--line); }
.player__rank--2 { background: #e3e1ef; color: var(--ink); border: 1.5px solid var(--line); }
.player__rank--3 { background: #f6c39f; color: var(--ink); border: 1.5px solid var(--line); }
.player__pic { position: relative; flex-shrink: 0; display: flex; }
.player__crown { position: absolute; top: -12px; left: 50%; width: 20px; height: 20px; transform: translateX(-50%) rotate(-10deg); z-index: 2; }
.player__badge {
  position: absolute; right: -6px; bottom: -4px; z-index: 2;
  width: 19px; height: 19px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--line);
  background: #fff;
}
.player__badge .icon { width: 11px; height: 11px; }
.player__badge--draw { background: var(--butter); }
.player__badge--got { background: var(--mint); }
.player__body { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.player__name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__you { font-style: normal; font-size: 10px; font-weight: 700; color: var(--pink-deep); margin-left: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.player__score { font-size: 12px; color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__score b { color: var(--ink); font-size: 13px; }
.player__tag {
  font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 99px; margin-left: 4px;
  background: #fff; border: 1.5px solid currentColor; white-space: nowrap;
}
.player__tag--draw { color: #b07c05; }
.player__tag--got { color: var(--mint-deep); }
.player__delta {
  position: absolute; right: 8px; top: -9px;
  font-size: 12px; font-weight: 700; color: #fff;
  background: var(--mint-deep); padding: 1px 7px; border-radius: 99px; border: 2px solid var(--line);
  animation: float-up 1.8s ease-out forwards;
}
@keyframes float-up {
  0% { transform: translateY(8px) scale(0.6); opacity: 0; }
  20% { transform: translateY(0) scale(1.1); opacity: 1; }
  75% { transform: translateY(-4px); opacity: 1; }
  100% { transform: translateY(-12px); opacity: 0; }
}
.player__kick {
  opacity: 0; width: 22px; height: 22px; border-radius: 8px; color: var(--ink-faint);
  display: grid; place-items: center; flex-shrink: 0;
  transition: opacity 0.15s ease;
}
.player__kick .icon { width: 13px; height: 13px; }
.player:hover .player__kick, .player__kick:focus-visible { opacity: 1; }
.player__kick:hover { color: #e5484d; background: #ffecec; }

/* -------------------------------------------------------------- stage ---- */

.stage {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center;
}

/* The drawing pad: spiral rings over an ink-outlined sheet. JS sets --board-w to
   the largest 4:3 box that fits; the CSS fallback is simply full width. */
.sketchbook {
  position: relative;
  width: var(--board-w, 100%);
  max-width: 100%;
  padding-top: 13px;
  flex-shrink: 0;
}
.sketchbook::before {
  content: '';
  position: absolute; top: 0; left: 4%; right: 4%; height: 30px; z-index: 3;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cellipse cx='15' cy='24.5' rx='4.2' ry='3' fill='%234b3a54' fill-opacity='.3'/%3E%3Crect x='11.6' y='1.5' width='6.8' height='23' rx='3.4' fill='%23f1ecf5' stroke='%234b3a54' stroke-width='2'/%3E%3Crect x='13.4' y='4' width='1.8' height='13' rx='.9' fill='%23fff'/%3E%3C/svg%3E") space no-repeat left top / 30px 30px;
}
.stage__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: var(--bw) solid var(--line);
  box-shadow: 7px 8px 0 var(--pink);
}
.stage__frame.can-draw { box-shadow: 7px 8px 0 var(--butter); }

#board { display: block; width: 100%; height: 100%; touch-action: none; }
.stage__frame.can-draw #board { cursor: none; }

.cursor-dot {
  position: absolute; top: 0; left: 0; pointer-events: none; opacity: 0;
  border-radius: 50%; border: 2px solid rgba(75, 58, 84, 0.65);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
  transform: translate(-50%, -50%); transition: opacity 0.15s ease;
  will-change: transform;
}
.stage__frame.can-draw .cursor-dot.is-on { opacity: 1; }

/* Full-window confetti: rains over the podium and bursts from the corners. */
.confetti { position: fixed; inset: 0; z-index: 30; width: 100%; height: 100%; pointer-events: none; }
.floaters { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.floater {
  position: absolute; bottom: 6%; font-size: 32px;
  animation: floaty 2.6s ease-out forwards;
  filter: drop-shadow(0 3px 0 rgba(75, 58, 84, 0.25));
}
@keyframes floaty {
  0% { transform: translateY(0) scale(0.4) rotate(0deg); opacity: 0; }
  15% { transform: translateY(-16px) scale(1.2) rotate(-8deg); opacity: 1; }
  100% { transform: translateY(-260px) scale(0.9) rotate(14deg); opacity: 0; }
}

/* "Mochi got it!" pops for everyone else's correct guesses */
.guess-pops {
  position: absolute; top: 10px; left: 0; right: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; z-index: 2;
}
.guess-pop {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 5px; border-radius: 99px;
  background: var(--mint); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line);
  font-weight: 700; font-size: 14px;
  animation: pop-in-out 2.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.guess-pop .icon { width: 16px; height: 16px; }
@keyframes pop-in-out {
  0% { transform: translateY(-20px) scale(0.6); opacity: 0; }
  12% { transform: none; opacity: 1; }
  82% { transform: none; opacity: 1; }
  100% { transform: translateY(-14px) scale(0.9); opacity: 0; }
}

/* ------------------------------------------------------------ overlay ---- */

.overlay {
  position: absolute; inset: 0; z-index: 5;
  border-radius: 22px;
  /* flex-start + margin:auto on the card centres it when it fits and lets it
     scroll from the top when it does not — plain `center` clips the top edge. */
  display: flex; align-items: flex-start; justify-content: center; padding: 16px 18px 18px;
  background: rgba(255, 245, 234, 0.62);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  animation: fade-in 0.24s ease both;
}
.overlay[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.overlay__card {
  --card-shadow: var(--pink);
  container-type: inline-size;
  position: relative;
  margin: auto;
  width: min(700px, 100%);
  background: var(--paper);
  border-radius: 26px;
  border: var(--bw) solid var(--line);
  box-shadow: 8px 9px 0 var(--card-shadow);
  padding: 26px 24px 24px;
  text-align: center;
}
.overlay__card.is-entering { animation: card-in 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.overlay__card.is-refresh * { animation-duration: 0s !important; animation-delay: 0s !important; }
.overlay__card[data-kind='lobby'] { --card-shadow: var(--sky); width: min(880px, 100%); padding-top: 20px; }
.overlay__card[data-kind='choose'] { --card-shadow: var(--butter); }
.overlay__card[data-kind='wait'] { --card-shadow: var(--lilac); width: min(520px, 100%); }
.overlay__card[data-kind='reveal'] { --card-shadow: var(--mint); width: min(740px, 100%); }
.overlay__card[data-kind='podium'] { --card-shadow: var(--butter); width: min(780px, 100%); padding-top: 20px; }
@keyframes card-in { from { transform: translateY(24px) scale(0.92) rotate(-1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }

.overlay__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 0; padding: 3px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: 0.1em;
  background: var(--cream); border: 2px solid var(--line-soft);
}
.overlay__eyebrow .icon { width: 15px; height: 15px; }
.overlay__title { margin: 8px 0 2px; font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; line-height: 1.12; }
.overlay__squiggle { display: block; width: 150px; height: 10px; margin: 2px auto 10px; fill: none; stroke: var(--pink-deep); stroke-width: 3.2; stroke-linecap: round; }
.overlay__sub { margin: 0 0 16px; color: var(--ink-soft); font-size: 14.5px; }

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

.lobby { display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); gap: 16px; text-align: left; align-items: start; margin-top: 4px; }
.lobby__side, .lobby__rules { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lobby__side .overlay__actions { margin-top: 2px; }
.lobby__side .btn--jumbo { width: 100%; }
.lobby__side .waiting-note { justify-content: center; padding: 8px 0; }

.rules { background: #fff; border: 2px solid var(--line-soft); border-radius: 16px; padding: 2px 12px; }
.rule { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.rule + .rule { border-top: 1.5px dashed var(--line-soft); }
.rule .setting__label { width: 104px; flex-shrink: 0; margin: 0; }

@container (max-width: 640px) {
  .lobby { grid-template-columns: minmax(0, 1fr); }
  .rule { flex-direction: column; align-items: flex-start; gap: 6px; }
  .rule .setting__label { width: auto; }
}

.invite {
  display: flex; flex-direction: column; align-items: stretch; gap: 10px;
  background: var(--butter-wash); border: var(--bw) solid var(--line); border-radius: 18px;
  padding: 12px 14px 14px; position: relative;
  box-shadow: 0 3px 0 var(--line);
}
.invite .btn { padding: 8px 16px; font-size: 15px; }
.invite::before { content: ''; position: absolute; inset: 4px; border-radius: 13px; border: 1.5px dashed rgba(75, 58, 84, 0.28); pointer-events: none; }
.invite__label { display: flex; flex-direction: column; align-items: center; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; gap: 6px; }
.code-tiles { display: flex; gap: 5px; }
.code-tiles b {
  width: 32px; height: 38px; display: grid; place-items: center;
  border-radius: 9px; background: #fff; border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line);
  font-size: 21px; color: var(--ink); letter-spacing: 0;
}
.code-tiles b:nth-child(odd) { transform: rotate(-3deg); }
.code-tiles b:nth-child(even) { transform: rotate(2.5deg); }

.lobby-seats { display: flex; flex-wrap: wrap; gap: 10px 6px; justify-content: center; padding: 12px 6px 10px; border-radius: 16px; background: #fff; border: 2px solid var(--line-soft); }
.lobby-face, .lobby-seat {
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: 66px;
  animation: seat-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.lobby-face .avatar { --size: 52px; }
.lobby-face__name { font-size: 12.5px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-face__pic { position: relative; }
.lobby-face__pic .player__crown { top: -13px; width: 22px; height: 22px; }
.lobby-face.is-you .lobby-face__name { color: var(--pink-deep); }
.lobby-seat__ring {
  width: 52px; height: 52px; border-radius: 50%;
  border: 2.5px dashed rgba(75, 58, 84, 0.3);
  display: grid; place-items: center; color: var(--ink-faint);
  transition: transform 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lobby-seat__ring .icon { width: 22px; height: 22px; }
.lobby-seat { font-size: 12px; font-weight: 600; color: var(--ink-faint); }
.lobby-seat:hover .lobby-seat__ring { transform: scale(1.06) rotate(8deg); color: var(--pink-deep); border-color: var(--pink-deep); }
@keyframes seat-in { from { transform: scale(0.4) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.setting { background: #fff; border-radius: 16px; padding: 9px 12px 11px; border: 2px solid var(--line-soft); }
.setting__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 8px;
}
.setting__label .icon { width: 16px; height: 16px; color: var(--pink-deep); }
.setting__options { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 999px; background: var(--cream); border: 2px solid transparent;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  transition: transform 0.1s ease, background 0.12s ease, border-color 0.12s ease;
}
.opt .icon { width: 15px; height: 15px; }
.opt:hover { transform: translateY(-2px); border-color: var(--line-soft); }
.opt[aria-pressed='true'] { background: var(--pink); border-color: var(--line); box-shadow: 0 2px 0 var(--line); }
.opt:disabled { cursor: default; transform: none; }
.opt:disabled:not([aria-pressed='true']) { opacity: 0.5; }
.opt--pack[aria-pressed='true'] { background: var(--mint); }

.custom-words { width: 100%; margin-top: 8px; }
.custom-words textarea {
  width: 100%; min-height: 46px; height: 46px; resize: vertical; border-radius: 14px;
  border: 2px solid var(--line-soft); background: var(--cream); padding: 9px 12px; font-size: 13.5px; outline: none;
}
.custom-words textarea:focus { border-color: var(--pink-deep); background: #fff; }

.waiting-note { display: inline-flex; align-items: center; gap: 10px; margin: 2px 0 0; color: var(--ink-soft); font-weight: 600; }

/* bouncing "…" */
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: dot 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ------------------------------------------------------- word choosing ---- */

.word-choices { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; margin: 8px 0 18px; }
.word-choice {
  --tilt: -2deg;
  position: relative;
  flex: 1 1 160px;
  max-width: 210px;
  min-height: 128px;
  padding: 30px 14px 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border-radius: 6px 6px 22px 6px;
  background: var(--note, var(--butter-wash));
  border: var(--bw) solid var(--line);
  box-shadow: 5px 6px 0 var(--line);
  font-size: 22px; font-weight: 700; line-height: 1.15;
  transform: rotate(var(--tilt));
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease;
  animation: note-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--i) * 80ms + 0.1s);
}
.word-choice::before {
  content: ''; position: absolute; top: -12px; left: 50%; width: 64px; height: 22px;
  transform: translateX(-50%) rotate(3deg);
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.45) 0 5px, transparent 5px 10px), var(--tape, #c9b7ff);
  opacity: 0.9;
}
.word-choice:nth-child(1) { --note: #fff3c4; --tilt: -3deg; --tape: #ffb3cf; }
.word-choice:nth-child(2) { --note: #ffe4ef; --tilt: 1.5deg; --tape: #a6ecd6; }
.word-choice:nth-child(3) { --note: #dff4ff; --tilt: -1deg; --tape: #ffd977; }
.word-choice:hover { transform: rotate(0) translateY(-6px) scale(1.04); box-shadow: 7px 10px 0 var(--line); }
.word-choice:active { transform: rotate(0) translateY(2px); box-shadow: 2px 2px 0 var(--line); }
.word-choice small {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  padding: 2px 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.7);
}
@keyframes note-in { from { transform: translateY(30px) rotate(10deg) scale(0.7); opacity: 0; } to { transform: rotate(var(--tilt)); opacity: 1; } }

.chooser { position: relative; display: block; width: fit-content; margin: 16px auto 6px; }
.chooser .avatar { --size: 104px; }
.chooser__pencil {
  position: absolute; right: -26px; bottom: 2px; width: 40px; height: 40px;
  color: var(--ink); background: var(--butter); border: 2.5px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; box-shadow: 0 3px 0 var(--line);
  animation: scribble 0.9s ease-in-out infinite;
}
.chooser__pencil .icon { width: 22px; height: 22px; }
@keyframes scribble {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-4px, 3px) rotate(-14deg); }
  50% { transform: translate(2px, -2px) rotate(6deg); }
  75% { transform: translate(-3px, -3px) rotate(-8deg); }
}

/* --------------------------------------------------------------- reveal ---- */

.reveal { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 22px; align-items: center; margin-top: 12px; text-align: left; }
@container (max-width: 560px) {
  .reveal { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .polaroid { width: min(260px, 80%); margin: 0 auto; }
  .reveal__side { text-align: center; }
}
.polaroid {
  position: relative; margin: 0;
  background: #fff; border: var(--bw) solid var(--line); border-radius: 8px;
  padding: 10px 10px 12px; box-shadow: 6px 7px 0 var(--pink);
  transform: rotate(-2.5deg);
  animation: polaroid-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.polaroid .tape { top: -12px; width: 80px; height: 22px; }
.polaroid__pic {
  aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden;
  border: 2px solid var(--line-soft); background: #fff;
  display: grid; place-items: center;
}
.polaroid__pic canvas { display: block; width: 100%; height: 100%; }
.polaroid__empty { color: var(--ink-faint); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.polaroid__empty .icon { width: 34px; height: 34px; }
.polaroid figcaption { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
@keyframes polaroid-in { from { transform: rotate(-14deg) translateY(30px) scale(0.8); opacity: 0; } to { transform: rotate(-2.5deg); opacity: 1; } }

.reveal__label { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.overlay__word {
  display: inline-block; padding: 6px 18px 8px; border-radius: 14px;
  background: var(--butter); border: var(--bw) solid var(--line); box-shadow: 0 4px 0 var(--line);
  font-size: clamp(24px, 3vw, 32px); font-weight: 700; margin: 0 0 14px; line-height: 1.1;
  transform: rotate(-1.5deg);
  animation: word-slam 0.55s 0.15s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes word-slam { from { transform: scale(1.8) rotate(-8deg); opacity: 0; } to { transform: rotate(-1.5deg); opacity: 1; } }

.summary { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; text-align: left; }
.summary li {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px 6px 6px; border-radius: 14px; background: #fff; font-size: 14px;
  border: 2px solid var(--line-soft);
  animation: row-in 0.35s ease both;
  animation-delay: calc(var(--i, 0) * 70ms + 0.25s);
}
.summary li > * { position: relative; }
.summary__bar {
  position: absolute !important; left: 0; top: 0; bottom: 0; width: var(--w, 0%);
  background: var(--mint-wash); border-right: 2px solid rgba(52, 185, 148, 0.25);
  transform-origin: left; animation: bar-grow 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms + 0.4s);
}
.summary li.is-zero { opacity: 0.6; }
.summary__name { flex: 1; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary__role { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--butter); border: 1.5px solid var(--line); }
.summary__delta { font-weight: 700; color: var(--mint-deep); font-size: 15px; }
.summary__delta.is-zero { color: var(--ink-faint); }
.summary__rank { width: 22px; text-align: center; font-weight: 700; color: var(--ink-soft); font-size: 13px; }
@keyframes row-in { from { transform: translateX(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.next-bar { margin: 18px auto 0; max-width: 260px; display: flex; flex-direction: column; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; color: var(--ink-faint); }
.next-bar__track { width: 100%; height: 7px; border-radius: 99px; background: var(--cream-deep); overflow: hidden; }
.next-bar__track span { display: block; height: 100%; width: 100%; background: var(--lilac-deep); border-radius: 99px; transform-origin: left; animation: drain linear forwards; }
@keyframes drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

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

.podium-stage { position: relative; margin: 6px -8px 0; padding-top: 10px; overflow: hidden; border-radius: 20px; }
.podium-stage::before {
  content: '';
  position: absolute; left: 50%; top: 58%; width: 900px; height: 900px; margin: -450px 0 0 -450px;
  background: repeating-conic-gradient(from 0deg, rgba(255, 217, 119, 0.32) 0deg 10deg, transparent 10deg 20deg);
  border-radius: 50%;
  animation: spin 40s linear infinite;
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 52%);
  mask-image: radial-gradient(circle, #000 18%, transparent 52%);
}
.podium { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 0 0 4px; padding: 0 8px; }
.podium__step { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; max-width: 160px; min-width: 0; animation: podium-arrive 0.75s cubic-bezier(0.18, 0.8, 0.28, 1.15) both; }
.podium__step--1 { animation-delay: 0.7s; }
.podium__step--2 { animation-delay: 0.35s; }
.podium__step--3 { animation-delay: 0.1s; }
.podium__who { position: relative; }
.podium__who .avatar { --size: 66px; }
.podium__step--1 .podium__who .avatar { --size: 84px; }
.podium__crown { position: absolute; top: -26px; left: 50%; width: 40px; height: 40px; transform: translateX(-50%) rotate(-8deg); animation: crown-bob 2s ease-in-out infinite; }
@keyframes crown-bob { 0%, 100% { transform: translateX(-50%) rotate(-8deg) translateY(0); } 50% { transform: translateX(-50%) rotate(6deg) translateY(-5px); } }
.podium__name { font-size: 15px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium__score { font-size: 12.5px; font-weight: 700; color: var(--ink); padding: 1px 10px; border-radius: 99px; background: #fff; border: 2px solid var(--line); }
.podium__block {
  width: 100%; margin-top: 4px;
  border-radius: 14px 14px 4px 4px;
  border: var(--bw) solid var(--line); border-bottom: none;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 10px;
  font-size: 40px; font-weight: 700; color: #fff;
  -webkit-text-stroke: 2px var(--line); paint-order: stroke fill;
  box-shadow: inset 0 6px 0 rgba(255, 255, 255, 0.55), inset -10px 0 0 rgba(75, 58, 84, 0.07);
  transform-origin: bottom;
  animation: rise 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: inherit;
}
.podium__step--1 .podium__block { height: 112px; background: #ffd977; font-size: 50px; }
.podium__step--2 .podium__block { height: 82px; background: #dcd8f0; }
.podium__step--3 .podium__block { height: 62px; background: #f7c29c; }
.podium-floor { position: relative; height: 10px; margin: 0 6px; border-radius: 6px; background: var(--line); }
@keyframes rise { from { transform: scaleY(0.1); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes podium-arrive { from { opacity: 0; transform: translateY(30px) scale(0.85); } to { opacity: 1; transform: none; } }

.podium-rest { margin-top: 14px; }

.gallery { margin-top: 14px; text-align: left; }
.gallery__title { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.07em; margin: 0 0 10px 4px; }
.gallery__title .icon { width: 17px; height: 17px; }
.gallery__strip { display: flex; gap: 14px; overflow-x: auto; padding: 6px 4px 12px; scroll-snap-type: x mandatory; }
.gallery__item {
  flex: 0 0 132px; scroll-snap-align: start;
  background: #fff; border: 2px solid var(--line); border-radius: 6px; padding: 6px 6px 7px;
  box-shadow: 3px 4px 0 var(--line-soft);
  transform: rotate(var(--tilt, -1.5deg));
  animation: note-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  animation-delay: calc(var(--i) * 70ms + 1s);
}
.gallery__item:nth-child(even) { --tilt: 1.5deg; }
.gallery__item canvas { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 3px; border: 1.5px solid var(--line-soft); }
.gallery__item figcaption { margin-top: 5px; font-size: 12.5px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery__item small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-soft); }

.overlay__actions { margin-top: 18px; display: flex; justify-content: center; }
.overlay__actions .btn--jumbo { width: min(420px, 100%); margin: 0; }

/* ------------------------------------------------------- celebration ---- */

.celebrate { position: absolute; inset: 0; z-index: 8; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
.stamp { position: relative; display: grid; place-items: center; animation: stamp-life 2.6s ease forwards; }
.stamp__burst {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 217, 119, 0.75) 0deg 9deg, transparent 9deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 62%);
  mask-image: radial-gradient(circle, #000 20%, transparent 62%);
  animation: burst-spin 2.6s linear forwards;
}
.stamp__badge {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 18px 34px 20px; border-radius: 28px;
  background: var(--mint); border: 3px solid var(--line); box-shadow: 0 7px 0 var(--line);
  animation: stamp-slam 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.stamp__badge::before {
  content: ''; position: absolute; inset: 6px; border-radius: 22px; border: 2px dashed rgba(75, 58, 84, 0.35);
}
.stamp__title { font-size: clamp(30px, 5vw, 46px); font-weight: 700; color: #fff; -webkit-text-stroke: 2.5px var(--line); paint-order: stroke fill; text-shadow: 0 4px 0 var(--line); line-height: 1; }
.stamp__word { font-size: 18px; font-weight: 700; padding: 2px 12px; border-radius: 99px; background: #fff; border: 2px solid var(--line); }
.stamp__pts { font-size: 26px; font-weight: 700; color: var(--ink); }
.stamp.is-static, .stamp.is-static * { animation: none !important; }
.stamp.is-leaving { animation: stamp-out 0.35s ease forwards !important; }
@keyframes stamp-out { to { opacity: 0; transform: translateY(-30px) scale(0.85); } }
@keyframes stamp-slam {
  0% { transform: scale(2.4) rotate(-14deg); opacity: 0; }
  55% { transform: scale(0.94) rotate(-5deg); opacity: 1; }
  100% { transform: scale(1) rotate(-4deg); opacity: 1; }
}
@keyframes stamp-life {
  0%, 80% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-40px) scale(0.9); }
}
@keyframes burst-spin { from { transform: rotate(0) scale(0.4); opacity: 0; } 15% { opacity: 1; transform: rotate(20deg) scale(1); } to { transform: rotate(90deg) scale(1.1); opacity: 0.6; } }

/* -------------------------------------------------------------- tools ---- */

.tools {
  flex-shrink: 0; width: max(var(--board-w, 100%), min(100%, 720px)); max-width: 100%;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px;
  background: var(--paper);
  border: var(--bw) solid var(--line); border-radius: 20px; padding: 9px 12px;
  box-shadow: 0 4px 0 var(--line);
}
.tools[hidden] { display: none; }
.tools__controls { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tools__row { display: flex; align-items: center; gap: 10px; justify-content: center; }
.tools__group { display: flex; gap: 6px; }
.tools__divider { width: 2px; height: 26px; border-radius: 2px; background: var(--line-soft); }

/* two rows of twelve paint pots */
.swatches { display: grid; grid-template-columns: repeat(12, 24px); gap: 4px; justify-content: center; }
.swatch {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--line);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.13), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.12s ease;
}
.swatch:hover { transform: translateY(-3px) scale(1.12); }
.swatch[aria-checked='true'] { transform: translateY(-3px) scale(1.18); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.13), 0 0 0 2.5px #fff, 0 0 0 4.5px var(--line); }

.sizes { display: flex; align-items: center; gap: 5px; padding: 3px; border-radius: 99px; background: var(--cream); }
.size {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%; background: transparent; border: 2px solid transparent;
  transition: transform 0.1s ease, background 0.12s ease;
}
.size:hover { background: #fff; }
.size[aria-checked='true'] { background: #fff; border-color: var(--line); box-shadow: 0 2px 0 var(--line); }
.size__dot { display: block; border-radius: 50%; background: var(--brush, var(--ink)); box-shadow: 0 0 0 1.5px rgba(75, 58, 84, 0.35); }

.tool {
  width: 38px; height: 38px; border-radius: 12px; background: #fff;
  border: 2px solid var(--line-soft);
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  transition: transform 0.08s ease, background 0.12s ease, box-shadow 0.08s ease, border-color 0.12s ease;
}
.tool .icon { width: 22px; height: 22px; }
.tool:hover { transform: translateY(-2px); border-color: var(--line); }
.tool:active { transform: translateY(2px); }
.tool[aria-pressed='true'] { background: var(--pink); border-color: var(--line); box-shadow: 0 3px 0 var(--line); transform: translateY(-2px); }
.tool--action { background: var(--cream); }
.tool--skip { width: auto; padding: 0 11px 0 8px; font-size: 13px; font-weight: 700; }
.tool--skip .icon { width: 18px; height: 18px; }

/* ---------------------------------------------------------- reactions ---- */

.reactions {
  display: flex; gap: 4px; flex-shrink: 0;
  padding: 4px 6px; border-radius: 99px;
  background: var(--paper); border: 2px solid var(--line-soft);
}
.reaction {
  width: 34px; height: 34px; border-radius: 50%; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.12s ease;
}
.reaction:hover { transform: translateY(-4px) scale(1.2); background: var(--pink-wash); }
.reaction:active { transform: scale(0.88); }

/* --------------------------------------------------------------- chat ---- */

.chat {
  list-style: none; margin: 0 0 10px; padding: 2px 4px;
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 7px;
}

.msg { display: flex; gap: 7px; align-items: flex-end; animation: msg-in 0.24s ease both; font-size: 14px; }
@keyframes msg-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.msg__bubble {
  position: relative;
  background: var(--cream); border-radius: 16px 16px 16px 5px;
  padding: 6px 12px 7px; min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; line-height: 1.3;
}
.msg__who { display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft); }
.msg--me { flex-direction: row-reverse; }
.msg--me .msg__bubble { background: var(--pink-wash); border-radius: 16px 16px 5px 16px; }
.msg--me .msg__who { text-align: right; }

.msg--system { justify-content: center; }
.msg__note {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-soft); font-size: 12.5px; font-weight: 600;
  text-align: center; padding: 3px 10px; border-radius: 99px;
  background: rgba(255, 245, 234, 0.9);
}
.msg__note .icon { width: 14px; height: 14px; color: var(--tone, var(--ink-faint)); }

.msg--correct { justify-content: center; }
.msg--correct .msg__bubble {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--mint); color: var(--ink); font-weight: 700;
  border: 2px solid var(--line); border-radius: 99px; box-shadow: 0 2px 0 var(--line);
  padding: 3px 12px 3px 4px;
  animation: correct-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.msg--correct .icon { width: 15px; height: 15px; }
@keyframes correct-pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.msg--team .msg__bubble { background: var(--mint-wash); border: 1.5px dashed var(--mint-deep); }
.msg__team { display: inline-flex; align-items: center; gap: 3px; color: var(--mint-deep); }
.msg__team .icon { width: 11px; height: 11px; }

.chat-form { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.input--chat { padding: 11px 16px; }
.chat-form.is-locked .input--chat { background: var(--cream); }

/* ------------------------------------------------------------- toasts ---- */

.toasts {
  position: fixed; z-index: 40; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px 9px 10px; border-radius: 999px; font-size: 14.5px; font-weight: 700;
  background: var(--paper); border: var(--bw) solid var(--line);
  box-shadow: 0 4px 0 var(--line);
  animation: toast-in 0.34s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.toast__icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sky); border: 2px solid var(--line); flex-shrink: 0; }
.toast__icon .icon { width: 14px; height: 14px; }
.toast--warn .toast__icon { background: var(--butter); }
.toast--close { background: var(--pink-wash); }
.toast--close .toast__icon { background: var(--pink); }
.toast--bad .toast__icon { background: var(--coral); }
.toast--good .toast__icon { background: var(--mint); }
.toast.is-out { animation: toast-out 0.28s ease forwards; }
@keyframes toast-in { from { transform: translateY(18px) scale(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateY(-8px) scale(0.94); opacity: 0; } }

/* --------------------------------------------------------- responsive ---- */

@media (max-width: 1180px) {
  .play { grid-template-columns: 206px minmax(0, 1fr) 260px; gap: 12px; }
  .player__tag { display: none; }
}

/* Short desktop windows: the drawer's emoji bar gives its height to the pad. */
@media (max-height: 820px) and (min-width: 901px) {
  .screen--room.can-draw .reactions { display: none; }
}

@media (max-height: 760px) and (min-width: 901px) {
  .screen--home { gap: 12px; }
  .parade { display: none; }
  .how { display: none; }
}

@media (max-width: 900px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .home-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .how { grid-template-columns: minmax(0, 1fr); gap: 10px; }

  /* One screen while playing (the guess box stays in view), a scrolling page for the big cards. */
  .screen--room { height: 100vh; height: 100dvh; padding: 8px 10px 12px; gap: 10px; }
  .screen--room.has-overlay { height: auto; min-height: 100vh; min-height: 100dvh; }

  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'left right' 'word word';
    gap: 8px 8px;
    padding: 8px 10px;
    border-radius: 20px;
  }
  .topbar__left { grid-area: left; gap: 7px; }
  .topbar__right { grid-area: right; gap: 8px; }
  .wordbar { grid-area: word; max-width: none; }
  .wordbar__tiles { min-height: 34px; gap: 5px 10px; }
  .iconbtn { width: 38px; height: 38px; border-radius: 12px; }
  .round-badge { min-width: 0; padding: 4px 10px 5px; }
  .round-badge strong { font-size: 15px; }
  .timer { width: 48px; height: 48px; }
  .timer__count { font-size: 16px; }
  .ticket { padding: 5px 28px 6px 11px; }
  .ticket__code { font-size: 15px; letter-spacing: 0.12em; }
  .ticket__icon { right: 8px; width: 15px; height: 15px; }

  .play {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(200px, 1fr);
    grid-template-areas: 'stage' 'players' 'chat';
    gap: 12px;
  }
  .screen--room.can-draw .play { grid-template-rows: auto auto minmax(130px, 1fr); }
  /* Content-sized rows: the board and the player strip never get squeezed. */
  .panel--stage { grid-area: stage; padding: 0; min-height: auto; }
  .panel--players { grid-area: players; padding: 8px 10px; min-height: auto; }
  .panel--chat { grid-area: chat; }
  .panel--players .panel__title { display: none; }

  .stage { gap: 8px; flex: none; justify-content: flex-start; }
  .tools { width: 100%; }
  .players { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 10px 2px 4px; gap: 8px; }
  .player { min-width: 0; padding: 5px 10px 5px 6px; }
  .player__rank, .player__kick, .player__tag { display: none; }
  .player__name { max-width: 92px; }

  /* Overlays become part of the page instead of a box over a tiny board. */
  .screen--room.has-overlay .stage { display: none; }
  .screen--room.has-overlay .overlay {
    position: relative; inset: auto; padding: 14px 4px 10px; background: none; backdrop-filter: none; overflow: visible;
  }
  .screen--room.has-overlay .panel--stage { min-height: 0; }
  .screen--room.can-draw .reactions { display: none; }
}

@media (max-width: 560px) {
  .screen--home { padding: 14px 16px 18px; }
  .card { padding: 22px 16px 18px; box-shadow: 5px 6px 0 var(--card-shadow, var(--pink)); }
  .me { gap: 14px; }
  .avatar--xl { --size: 92px; }
  .picker--avatars { gap: 5px; }
  .picker--colors { gap: 8px; }
  .picker--colors button { width: 32px; height: 32px; }
  .parade__pal { width: 42px; height: 42px; }
  .parade__pal:nth-child(odd) { width: 36px; height: 36px; }
  .parade { height: 46px; margin-bottom: -20px; }
  .parade__pal:nth-child(n + 8) { display: none; }
  .btn--jumbo { font-size: 17px; }
  .home-foot__note { width: 100%; text-align: center; }

  .round-badge .topbar__label { display: none; }
  .turn-dots { display: none; }
  .tile { min-width: 24px; height: 32px; font-size: 17px; border-radius: 7px; padding: 0 3px; }
  .tile-word { gap: 3px; }
  .wordbar__hint { font-size: 11px; }

  .overlay__card { padding: 22px 14px 18px; box-shadow: 5px 6px 0 var(--card-shadow); }
  .code-tiles b { width: 28px; height: 34px; font-size: 18px; }
  .lobby-face, .lobby-seat { width: 64px; }
  .lobby-face .avatar, .lobby-seat__ring { --size: 48px; width: 48px; height: 48px; }

  .word-choices { gap: 14px; }
  .word-choice { max-width: none; min-height: 84px; flex-basis: 100%; padding: 22px 12px 12px; }
  .word-choice:nth-child(n) { --tilt: 0deg; }
  .word-choice:nth-child(odd) { --tilt: -1deg; }

  .podium { gap: 6px; padding: 0; }
  .podium__who .avatar { --size: 52px; }
  .podium__step--1 .podium__who .avatar { --size: 70px; }
  .podium__name { font-size: 13px; }
  .podium__step--1 .podium__block { height: 100px; font-size: 40px; }
  .podium__step--2 .podium__block { height: 76px; font-size: 32px; }
  .podium__step--3 .podium__block { height: 58px; font-size: 30px; }
  .gallery__item { flex-basis: 130px; }

  .tools { padding: 8px; gap: 7px; flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .swatches { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
  .swatch { width: 100%; height: auto; aspect-ratio: 1; }
  .tools__controls { gap: 7px; }
  .tools__row { gap: 6px; }
  .tools__divider { display: none; }
  .size { width: 30px; height: 30px; }
  .tool { width: 36px; height: 36px; border-radius: 11px; }
  .tool .icon { width: 20px; height: 20px; }
  .tool--skip span { display: none; }
  .tool--skip { width: 36px; padding: 0; }
  .reaction { width: 31px; height: 31px; font-size: 16px; }

  .stamp__badge { padding: 14px 22px 16px; }
  .stamp__burst { width: 380px; height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  .brand__squiggle { stroke-dashoffset: 0; }
}
