/*
 * OnlineQuiz styles — "Boardwalk" skin.
 *
 * Desktop only, 1024px minimum, no breakpoints (SPEC.md section 8).
 * Teal ground, coral plates, cream stock. Two physical idioms, and the split
 * between them is the whole design:
 *
 *   FLAPS SHOW STATE   — board cells are hinged cards on cream stock. A spent
 *                        cell flips to blank. Hover brightens but never moves:
 *                        a flap is not something you push.
 *   KEYS TAKE FORCE    — every control is a three-layer keycap: a recessed
 *                        socket (::after), a moulded skirt (::before), and a
 *                        domed face (.key-top) that travels into the skirt on
 *                        press. Only the face moves; the socket stays put.
 *
 * Keycap anatomy after Nicolas Jesenberger's CSS button (uiverse.io, MIT).
 *
 * Three rules here are load-bearing rather than decorative:
 *   1. the global [hidden] override;
 *   2. .buzzer .key-top carries no transition, in any state;
 *   3. a disabled control is drawn as its empty socket, never as a faded cap.
 */

:root {
  /*
   * Animation durations, gathered here on purpose. After one real game night the
   * likely verdict is "good but slightly too slow" — this is where that gets
   * fixed, in one place, rather than hunting through the stylesheet.
   */
  --anim-stand-in: 620ms;    /* once per game, at the start */
  --anim-stand-return: 230ms; /* every podium between clues */
  --anim-cell-in: 380ms;     /* grid cascade, once per game */
  --anim-cell-return: 220ms; /* every board between clues */
  --anim-cell-expand: 420ms; /* cell growing into the clue screen */
  --anim-turn: 260ms;
  --anim-celebrate: 900ms;   /* taking the lead */
  --anim-score-tint: 700ms;
  --anim-item-drop: 340ms;

  --bg: #04181c;
  --tray-top: #0d3239;
  --tray-bottom: #061e23;
  --socket: #03120f;
  --raised: #0d3239;
  --edge: #155048;
  --text: #eefbf8;
  --text-dim: #8fbdb5;
  --text-faint: #5b8a83;

  --accent: #ffd166;
  --accent-glow: rgba(255, 209, 102, 0.4);
  --coral: #ff5c4d;
  --magenta: #ff3ddb;   /* the numeral, and nothing else */
  --coral-ink: #2a0904;
  --bulb: #fff0d0;

  --ok: #3ddc97;
  --ok-deep: #08301f;
  --bad: #ff7a6b;
  --bad-deep: #33110c;

  /* cream keycap */
  --key-face: radial-gradient(#fff4dd, #e8bf85);
  --key-ink: #3d2a12;
  --key-skirt: #8a6537;
  --key-hi: #fff4dd;

  /* flap stock */
  --flap: linear-gradient(180deg, #fff6e6 0 49.2%, #8a6537 49.2% 50.8%, #efd7ae 50.8%);
  --flap-lit: linear-gradient(180deg, #fffdf6 0 49.2%, #8a6537 49.2% 50.8%, #f8e6c6 50.8%);
  --flap-spent: linear-gradient(180deg, #0a2a2c 0 49.2%, #021012 49.2% 50.8%, #07211f 50.8%);

  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: Impact, Haettenschweiler, "Franklin Gothic Bold", "Arial Narrow Bold", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

/*
 * The browser's own [hidden] rule is display:none, but any author rule that sets
 * display — .buzzer, .winner-banner, .clue-controls, .link-row — outranks it and
 * the element stays visible. Without this, the host sees a buzzer.
 */
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 92, 77, 0.16), transparent 60%),
    radial-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: auto, 7px 7px;
  color: var(--text);
  font-family: var(--font);
  display: grid;
  place-items: center;
}

#app { width: 100%; min-width: 1024px; display: grid; place-items: center; }

.screen { text-align: center; padding: 2.5rem; max-width: 560px; }
.screen.wide { max-width: 1100px; width: 100%; }

/* A rail of marquee bulbs, used as a decorative ::before on a few surfaces. */
.screen h1::before,
.stand::before,
.cat-head::before,
.code-card::before {
  content: "";
  display: block;
  height: 10px;
  background-image: radial-gradient(circle, var(--bulb) 0 2px, rgba(255, 240, 208, 0.12) 2.6px, transparent 3.2px);
  background-size: 16px 10px;
  animation: bulb-chase 1.1s steps(4) infinite;
}

@keyframes bulb-chase { to { background-position: 16px 0; } }

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 3.9rem;
  line-height: 0.95;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 26px var(--accent-glow), 4px 4px 0 #7a1c11;

  /* One line, always. The numeral is part of the name, not an afterthought that
     drops to its own row when the title outgrows the column. */
  white-space: nowrap;
}

.screen h1::before { margin-bottom: 0.6rem; }

h2 {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* The numeral, in magenta. Nothing else in the palette is anywhere near it,
   which is the point. */
.numeral { color: var(--magenta); text-shadow: 0 0 26px rgba(255, 61, 219, 0.55), 4px 4px 0 #4a0d3c; }

.tagline {
  margin: 0.35rem 0 2.5rem;
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.85rem;
  font-weight: 700;
}

.hint { margin-top: 1.5rem; color: var(--text-dim); font-size: 0.95rem; line-height: 1.5; }

.label {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
}

/* ============================================================== KEYCAPS ====
 * Three layers on one element: ::after is the socket sunk into the surface,
 * ::before is the moulded skirt, and .key-top is the domed face. The button
 * itself never transforms — only the face travels — so the socket and skirt
 * stay put and the press reads as a key moving inside its housing.
 */

.btn {
  position: relative;
  isolation: isolate;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  padding: 0 4px 10px;
  margin: 0.3rem;
  color: var(--key-ink);
  cursor: pointer;
}

.key-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  z-index: 2;
  padding: 0.7rem 1.4rem;
  border-radius: 4px;
  background-image: var(--key-face);
  color: var(--key-ink);
  text-shadow: 0 -1px rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 1px 2px 1px rgba(255, 255, 255, 0.2);
  transition: transform 0.2s;
  user-select: none;
}

.btn:active .key-top { transform: translateY(6px); }

/*
 * A bare .btn with no .key-top — app.js rewrites #copy-link's textContent, so
 * that one cannot hold a face element. Give the button itself the face, and put
 * the skirt and socket behind it.
 */
.btn:not(:has(.key-top)) {
  z-index: 2;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  background-image: var(--key-face);
  color: var(--key-ink);
  text-shadow: 0 -1px rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 1px 2px 1px rgba(255, 255, 255, 0.2);
}

.btn:not(:has(.key-top))::before { z-index: -1; bottom: -6px; height: 100%; }
.btn:not(:has(.key-top))::after { z-index: -2; top: -2px; height: calc(100% + 8px); }

/* skirt */
.btn::before {
  content: "";
  position: absolute;
  z-index: 1;
  bottom: 4px;
  left: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 10px);
  border-radius: 8px / 16px 16px 8px 8px;
  background-color: var(--key-skirt);
  background-image:
    radial-gradient(4px 8px at 4px calc(100% - 8px), rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(4px 8px at calc(100% - 4px) calc(100% - 8px), rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(16px at -4px 0, var(--key-hi), transparent),
    radial-gradient(16px at calc(100% + 4px) 0, var(--key-hi), transparent);
  box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5), inset 0 -1px 3px 3px rgba(0, 0, 0, 0.4);
}

/* socket */
.btn::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 0;
  width: 100%;
  height: calc(100% - 4px);
  border-radius: 12px;
  background-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 1px 0 rgba(255, 255, 255, 0.5), inset 0 2px 2px rgba(0, 0, 0, 0.35);
}

.btn:hover:not(:disabled) .key-top { background-image: radial-gradient(#fffaf0, #f0cd97); }

/*
 * Disabled is the empty socket: the cap is gone, not dimmed. A greyed cap still
 * reads as a control you could press; a hole does not.
 */
.btn:disabled { cursor: not-allowed; }
.btn:disabled::before { display: none; }

.btn:disabled .key-top {
  background-image: none;
  background-color: var(--socket);
  color: var(--text-faint);
  text-shadow: none;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: none;
}

/* Colour variants: face, skirt and highlight move together. */
.btn-primary { --key-face: radial-gradient(#ffe9a8, #e8a72c); --key-skirt: #8a5c00; --key-hi: #ffe9a8; }
.btn-primary:hover:not(:disabled) .key-top { background-image: radial-gradient(#fff1c4, #f0b53c); }
.btn-good { --key-face: radial-gradient(#7ff0b6, #1c7a4a); --key-skirt: #0c3a21; --key-hi: #9df7bd; --key-ink: #04240f; }
.btn-good:hover:not(:disabled) .key-top { background-image: radial-gradient(#a2f7cc, #26935a); }
.btn-bad { --key-face: radial-gradient(#ffa79b, #b8382c); --key-skirt: #6b1810; --key-hi: #ffc4ae; --key-ink: #2e0308; }
.btn-bad:hover:not(:disabled) .key-top { background-image: radial-gradient(#ffbfb5, #cc4335); }

/* Display face on every full-size cap, so a row of controls reads as one set. */
.btn-primary .key-top,
.btn-good .key-top,
.btn-bad .key-top,
.clue-controls .key-top,
.player-actions .key-top {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-good .key-top,
.btn-bad .key-top { color: #fff; text-shadow: 0 -1px rgba(0, 0, 0, 0.3); }

.btn-small { padding: 0 3px 8px; }
.btn-small .key-top { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-small:active .key-top { transform: translateY(4px); }

.adjust-row .key-top,
.debug-bar .key-top { font-family: var(--font); font-weight: 700; text-transform: none; letter-spacing: 0; }

/* The action three of the four people are taking, so it gets the weight. */
.btn-hero { display: block; width: 100%; max-width: 360px; margin: 0 auto; padding: 0 8px 16px; }

.btn-hero .key-top {
  padding: 1.1rem 1.5rem;
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.btn-hero:active .key-top { transform: translateY(9px); }

.choice-row { display: flex; gap: 0.5rem; justify-content: center; }

.link-stack { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-top: 1.4rem; }

.link-btn {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  background: none;
  border: none;
  padding: 0.2rem 0.25rem;
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover { color: var(--coral); }

/*
 * The subtitle wobbles. This is on purpose and it is meant to be annoying.
 *
 * Landing screen only — nobody has to endure it while actually playing.
 */
.tagline {
  display: inline-block;
  transform-origin: 50% 60%;
  animation: tagline-wobble 0.42s ease-in-out infinite;
}

@keyframes tagline-wobble {
  0%   { transform: rotate(-3.5deg) skewX(4deg) translateY(0); }
  25%  { transform: rotate(2.5deg) skewX(-3deg) translateY(-2px); }
  50%  { transform: rotate(-2deg) skewX(5deg) translateY(1px); }
  75%  { transform: rotate(3.5deg) skewX(-2deg) translateY(-1px); }
  100% { transform: rotate(-3.5deg) skewX(4deg) translateY(0); }
}

/* The podium heading now carries whose turn it is, so it gets the accent when
   that turn is yours. */
#podium-title[data-you="true"] { color: var(--accent); }

/* Marks the inert power-up placeholders as unfinished rather than broken. */
.soon {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.8;
}

/* ------------------------------------------------------------- board list */

.board-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.board-list li { margin-bottom: 0.5rem; }

/*
 * Generated by app.js as a bare button, so it gets the flat treatment rather
 * than a keycap — the cap needs a face element to travel.
 */
.board-item {
  display: block;
  width: 100%;
  font: inherit;
  font-weight: 600;
  text-align: left;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border: 2px solid var(--edge);
  background: var(--raised);
  color: var(--text);
  cursor: pointer;
}

button.board-item:hover { border-color: var(--accent); background: #10404a; }

.board-item.bad {
  cursor: default;
  border-color: #7a3028;
  background: repeating-linear-gradient(45deg, #2d0f0a 0 7px, #260d09 7px 14px);
}

.board-error { display: block; margin-top: 0.35rem; color: var(--bad); font-size: 0.85rem; }

/* ------------------------------------------------------------------ forms */

.field { display: block; text-align: left; margin-bottom: 1.25rem; }

.field span {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.field input, .link-row input {
  width: 100%;
  font: inherit;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  border: 2px solid var(--edge);
  background: var(--socket);
  color: var(--text);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6);
}

.field input:focus, .link-row input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }

.field-label {
  text-align: left;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.code-input { text-transform: uppercase; letter-spacing: 0.35em; font-weight: 700; font-size: 1.25rem; }

.checkbox-field {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  text-align: left;
  background: var(--raised);
  border: 2px solid var(--edge);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.checkbox-field input { margin-top: 0.2rem; width: 16px; height: 16px; accent-color: var(--coral); }
.checkbox-field strong { display: block; font-size: 0.95rem; }

.checkbox-field em {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* --------------------------------------------------------------- debug bar */

.debug-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 0.6rem 1rem;
  border: 2px dashed var(--edge);
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, var(--socket) 0 8px, #061c1a 8px 16px);
}

.debug-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--text-faint);
}

.debug-bar .btn { margin: 0; }

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

.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 1.5rem; }

.avatar-choice {
  padding: 0.4rem;
  border-radius: 12px;
  border: 3px solid var(--edge);
  background: var(--raised);
  cursor: pointer;
}

.avatar-choice:hover:not(:disabled) { border-color: var(--coral); }
.avatar-choice img { width: 100%; display: block; }

.avatar-choice.picked {
  border-color: var(--accent);
  background: #10404a;
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.2);
}

.avatar-choice.taken {
  opacity: 0.35;
  cursor: not-allowed;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 6px, transparent 6px 12px);
}

/* ------------------------------------------------------------ sound picker */

.sound-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.sound-choice {
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 3px solid var(--edge);
  background: var(--socket);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.sound-choice:hover:not(:disabled) { border-color: var(--coral); }

.sound-choice.picked {
  border-color: var(--accent);
  background: #10404a;
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.2);
}

.sound-choice.taken {
  opacity: 0.35;
  cursor: not-allowed;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 6px, transparent 6px 12px);
}

.sound-status { margin: 0 0 1rem; font-size: 0.8rem; color: var(--text-faint); }
.sound-status[data-ready="true"] { color: var(--ok); }

/*
 * The volume button. It does not adjust the volume; it relocates.
 *
 * No transition on purpose — it should be somewhere else before you have finished
 * clicking, not glide over and let you follow it.
 */
.mute-toggle {
  position: fixed;
  z-index: 45;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--raised);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;

  /* Default corner, before it has been provoked. */
  top: 1rem;
  right: 1rem;
  bottom: auto;
  left: auto;
}

.mute-toggle[data-corner="tr"] { top: 1rem; right: 1rem; bottom: auto; left: auto; }
.mute-toggle[data-corner="tl"] { top: 1rem; left: 1rem; bottom: auto; right: auto; }
.mute-toggle[data-corner="bl"] { bottom: 1rem; left: 1rem; top: auto; right: auto; }
.mute-toggle[data-corner="br"] { bottom: 1rem; right: 1rem; top: auto; left: auto; }

.mute-toggle:hover { border-color: var(--accent); }

/* ------------------------------------------------------- commercial break */

.break-label {
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0 0 1rem;
}

.break-frame {
  position: relative;
  max-width: 900px;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--edge);
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}

#break-video { display: block; width: 100%; height: auto; }

/* Only appears when the browser refuses to autoplay with sound. */
.break-unblock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(4, 24, 28, 0.85);
  color: var(--text);
  font: inherit;
  font-family: var(--display);
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
}

/* Host's trigger row on the podium. */
.break-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.break-label-small {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  margin-right: 0.2rem;
}

.break-picker .btn { margin: 0; }
.break-picker .btn.played { opacity: 0.55; }

/* ------------------------------------------------------------------ rules */

/*
 * Every rule gets its own animation, and they are meant to fight each other. This
 * screen is a joke and reading it should be mildly unpleasant.
 *
 * Each line is inline-block so transforms actually apply, and each has its own
 * period so they never sync up into something that looks intentional.
 */

.rules-head {
  font-family: var(--display);
  font-size: 3.2rem;
  color: var(--accent);
  text-transform: none;
  margin-bottom: 1.5rem;
  animation: rules-head-pulse 1.7s ease-in-out infinite;
}

@keyframes rules-head-pulse {
  0%, 100% { text-shadow: 0 0 12px var(--accent-glow); transform: scale(1); }
  50%      { text-shadow: 0 0 40px var(--accent-glow); transform: scale(1.06); }
}

.rules {
  max-width: 780px;
  margin: 0 auto 2rem;
  padding: 0;
  text-align: left;
  font-size: 1.3rem;
  line-height: 2.4;
}

/* No numbering. The <li> still needs to stay a block-level list item, though —
   that is what puts one rule per line. Only the span inside it moves. */
.rules li { list-style: none; }

.rule {
  display: inline-block;
  transform-origin: 50% 60%;
  will-change: transform;
}

/* 1. creeps sideways, never settling */
.rule-1 { animation: r-creep 3.1s ease-in-out infinite; }
@keyframes r-creep {
  0%, 100% { transform: translateX(-14px); }
  50%      { transform: translateX(14px); }
}

/* 2. blinks, like it is 1997 */
.rule-2 { animation: r-blink 0.9s steps(1) infinite; }
@keyframes r-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0.15; }
}

/* 3. cycles through every colour it can find */
.rule-3 { animation: r-rainbow 2.3s linear infinite; }
@keyframes r-rainbow {
  0%   { color: #ff5c4d; }
  25%  { color: #ffd166; }
  50%  { color: #3ddc97; }
  75%  { color: var(--magenta); }
  100% { color: #ff5c4d; }
}

/* 4. shakes, appropriately for a rule about punishment */
.rule-4 { animation: r-shake 0.28s ease-in-out infinite; }
@keyframes r-shake {
  0%, 100% { transform: translate(-2px, 1px) rotate(-0.8deg); }
  50%      { transform: translate(2px, -1px) rotate(0.8deg); }
}

/* 5. stretches its letters apart and back, slowly */
.rule-5 { animation: r-stretch 2.6s ease-in-out infinite; }
@keyframes r-stretch {
  0%, 100% { letter-spacing: 0; }
  50%      { letter-spacing: 0.22em; }
}

/* 6. red, and refuses to sit still — the rule about red questions */
.rule-6 { color: var(--bad); animation: r-bounce 0.7s cubic-bezier(0.3, 0, 0.4, 1) infinite; }
@keyframes r-bounce {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-11px); }
  60%      { transform: translateY(3px); }
}

/* 7. tilts back and forth like a shop sign in wind */
.rule-7 { animation: r-tilt 1.45s ease-in-out infinite; }
@keyframes r-tilt {
  0%, 100% { transform: rotate(-4deg) skewX(3deg); }
  50%      { transform: rotate(4deg) skewX(-3deg); }
}

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

.code-card {
  background: var(--raised);
  border: 3px solid var(--accent);
  border-radius: 14px;
  padding: 0 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 40px rgba(255, 209, 102, 0.16);
  overflow: hidden;
}

.code-card::before { margin: 0 -1.25rem 1rem; }

.code {
  display: block;
  font-family: var(--display);
  font-size: 4.5rem;
  line-height: 1;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--accent);
  margin-top: 0.35rem;
  text-shadow: 0 0 30px var(--accent-glow);
}

.link-row { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; align-items: center; }
.link-row .btn { margin: 0; flex: none; }

.player-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }

.player-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: var(--raised);
  border: 2px solid var(--edge);
  margin-bottom: 0.4rem;
}

.player-row.empty {
  color: var(--text-faint);
  font-style: italic;
  justify-content: center;
  background: transparent;
  border-style: dashed;
}

.player-name { flex: 1; text-align: left; font-weight: 600; }

.avatar-sm { width: 28px; height: 28px; }
.avatar-lg { width: 84px; height: 84px; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.dot.on { background: var(--ok); box-shadow: 0 0 10px rgba(61, 220, 151, 0.6); }

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

/* stretch, not flex-end: every stand is the height of the tallest one, so a
 * disconnect tag or a long name can't make one box shorter than its neighbours */
.podium { display: flex; justify-content: center; align-items: stretch; gap: 1.25rem; margin-bottom: 2rem; }

/*
 * Stands are flat panels with a chasing bulb rail, the same construction as the
 * room-code card. Nothing about a stand is pressable, so it gets no skirt.
 */
.stand {
  position: relative;
  flex: 0 0 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-radius: 14px 14px 4px 4px;
  padding: 0 1rem 1.5rem;
  background: var(--raised);
  border: 3px solid var(--edge);
  overflow: hidden;

  /* The turn lift. Both stands share this, so the highlight reads as one
     movement passing between them rather than two independent jumps. */
  transition:
    transform var(--anim-turn) cubic-bezier(0.2, 0.8, 0.3, 1.1),
    border-color var(--anim-turn) ease-out,
    box-shadow var(--anim-turn) ease-out,
    opacity var(--anim-turn) ease-out;
}

.stand::before { transition: opacity var(--anim-turn) ease-out; }

/*
 * The leader's crown.
 *
 * Sits in flow order just above the avatar, but with no height of its own and a
 * negative offset, so a stand does not change shape when the crown arrives or
 * moves to someone else. Everything on the podium keeps the same footprint
 * whatever happens to it — that rule is why the inventory row and the away tag
 * are built the way they are too.
 */
.crown {
  height: 0;
  line-height: 0;
  font-size: 1.35rem;
  transform: translateY(-6px);
  pointer-events: none;
  animation: crown-land var(--anim-item-drop) cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes crown-land {
  0%   { opacity: 0; transform: translateY(-26px) rotate(-18deg); }
  100% { opacity: 1; transform: translateY(-6px) rotate(0); }
}

/* fixed portrait block: same footprint whatever the SVG's own proportions */
.stand .avatar-lg {
  width: 84px;
  height: 84px;
  object-fit: contain;
  flex: none;
}

.stand::before { width: calc(100% + 2rem); margin: 0 -1rem 1rem; opacity: 0.4; }

/*
 * The turn visibly travels rather than teleporting: the outgoing stand settles
 * and dims while the incoming one lifts and brightens. Both directions are the
 * same transition, so it reads as one movement passing between them.
 */
.stand.active {
  border-color: var(--accent);
  transform: translateY(-12px);
  box-shadow: 0 0 40px rgba(255, 209, 102, 0.18), 0 0 0 3px rgba(255, 209, 102, 0.14);
}

.stand.active::before { opacity: 1; }
.stand.away { opacity: 0.5; }

/*
 * Two different arrivals, on purpose.
 *
 * `entering` fires once per stand, when its node is created at the start of a
 * game. It is the opening flourish and can afford to take its time — you only see
 * it when you are ready to be impressed.
 *
 * `returning` fires every time the podium comes back between clues, roughly two
 * dozen times a game. It has to be quick: the full entrance repeated that often
 * would put three quarters of a second in front of the scores every single clue.
 */
.stand.entering {
  animation: stand-in var(--anim-stand-in) cubic-bezier(0.16, 1.1, 0.3, 1.25) backwards;
  animation-delay: var(--stagger, 0ms);
}

@keyframes stand-in {
  from { opacity: 0; transform: translateY(72px) scale(0.9); }
  60%  { opacity: 1; }
  to   { opacity: 1; transform: none; }
}

.stand.returning {
  animation: stand-return var(--anim-stand-return) ease-out backwards;
  animation-delay: var(--stagger, 0ms);
}

@keyframes stand-return {
  from { opacity: 0.55; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/*
 * Taking the lead. Queued when it happens — usually on the clue screen, where no
 * stands are visible — and played on the next podium.
 */
.stand.took-lead { animation: took-lead var(--anim-celebrate) ease-out; }

.stand.took-lead::before {
  animation: bulb-chase 0.3s steps(4) infinite;
  opacity: 1;
}

@keyframes took-lead {
  0%   { transform: none; }
  25%  { transform: translateY(-26px) scale(1.04); box-shadow: 0 0 60px rgba(255, 209, 102, 0.5); }
  60%  { transform: translateY(-6px) scale(1); }
  100% { transform: none; }
}

/* The winner on the final scores screen. Nothing subtle about it. */
.stand.winner {
  border-color: var(--accent);
  transform: translateY(-26px);
  box-shadow: 0 0 70px rgba(255, 209, 102, 0.35), 0 0 0 4px rgba(255, 209, 102, 0.2);
}

.stand.winner::before { animation: bulb-chase 0.42s steps(4) infinite; opacity: 1; }
.stand.winner .stand-score { font-size: 3.8rem; }

/* two lines reserved, so a wrapped name never shifts the score line */
.stand-name {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  margin-top: 0.5rem;
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.05;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* pushes the score to the bottom edge, so scores line up across the row */
.stand-score {
  margin-top: auto;
  padding-top: 0.3rem;
  font-family: var(--display);
  font-size: 3.1rem;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/*
 * Tint while a score is travelling. Tabular numerals mean the digits never change
 * width as they count, so nothing around them jitters.
 */
.stand-score.rising { animation: score-rising var(--anim-score-tint) ease-out; }
.stand-score.falling { animation: score-falling var(--anim-score-tint) ease-out; }

@keyframes score-rising {
  0%   { color: var(--ok); transform: scale(1.12); }
  100% { color: var(--accent); transform: none; }
}

@keyframes score-falling {
  0%   { color: var(--bad); transform: scale(0.92); }
  100% { color: var(--accent); transform: none; }
}

/* An item lands in the row rather than blinking into existence. */
.item-chip.dropping { animation: item-drop var(--anim-item-drop) cubic-bezier(0.2, 0.9, 0.3, 1.3); }

@keyframes item-drop {
  0%   { opacity: 0; transform: translateY(-18px) scale(0.6); }
  100% { opacity: 1; transform: none; }
}

/* A tag appearing mid-game is the moment a player needs to notice something. */
.double-tag, .blackout-tag, .away-tag { animation: tag-stamp var(--anim-item-drop) ease-out; }

@keyframes tag-stamp {
  0%   { opacity: 0; transform: scale(1.6); }
  60%  { opacity: 1; transform: scale(0.94); }
  100% { opacity: 1; transform: none; }
}

/* a badge on the stand, not a row in the stack — an away player's stand stays
 * the same shape as everyone else's */
.away-tag {
  position: absolute;
  top: 1.1rem;
  right: 0.5rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--bad);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  background: var(--bg);
}

.player-actions { display: flex; justify-content: center; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }

/* ------------------------------------------------------------- inventory */

/*
 * Always rendered, even when empty, so a stand does not jump in height the moment
 * somebody buys something. Flat — items are possessions, not controls, so no
 * skirt (SKIN-NOTES.md).
 */
.inventory {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  min-height: 30px;
  margin-bottom: 0.4rem;
}

.item-chip {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--edge);
  background: var(--socket);
  font-size: 1rem;
  line-height: 1;
}

.item-chip.removable {
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  color: inherit;
  padding: 0;
}

.item-chip.removable:hover { border-color: var(--bad); background: var(--bad-deep); }

/* ------------------------------------------------- targeting and doubles */

.stand.targetable { cursor: pointer; outline: 2px dashed var(--accent); outline-offset: 4px; }
.stand.targetable:hover { background: #143c44; }

.stand.on-double { border-color: var(--coral); }

.double-tag,
.blackout-tag {
  margin-top: 0.35rem;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
}

.double-tag { color: var(--coral); }
.blackout-tag { color: var(--text-faint); }

/* ------------------------------------------------------------------ shop */

.shop {
  max-width: 660px;
  margin: 0 auto 1.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--raised);
  text-align: left;
}

.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
}

.shop-wallet { font-family: var(--display); font-size: 1.2rem; color: var(--accent); }

.shop-items { display: flex; flex-direction: column; gap: 0.5rem; }

.shop-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: var(--socket);
  border: 1px solid var(--edge);
}

.shop-icon { font-size: 1.4rem; width: 1.8rem; text-align: center; }
.shop-text { flex: 1; }
.shop-name { font-weight: 700; }
.shop-blurb { font-size: 0.8rem; color: var(--text-dim); line-height: 1.35; margin-top: 0.1rem; }

.shop-give { display: flex; gap: 0.3rem; }
.shop-item .btn, .shop-give .btn { margin: 0; flex-shrink: 0; }

.shop-note { margin: 0.75rem 0 0; font-size: 0.78rem; color: var(--text-faint); }

/* ------------------------------------------------------------------ board */

.turn-banner {
  display: inline-block;
  font-family: var(--display);
  font-size: 1.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 1.1rem;
}

.turn-banner[data-you="true"] { color: var(--accent); text-shadow: 0 0 24px var(--accent-glow); }

/* The board is a recessed tray; the cards sit down inside it. */
.board {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--tray-top), var(--tray-bottom));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.07), inset 0 -4px 12px rgba(0, 0, 0, 0.65);
}

/* Category names are not pressable, so they stay flat. */
.cat-head {
  background: var(--coral);
  color: var(--coral-ink);
  border-radius: 6px 6px 2px 2px;
  padding: 0 0.5rem 0.7rem;
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.05;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  display: grid;
  align-content: start;
  justify-items: center;
  min-height: 74px;
  overflow: hidden;
}

.cat-head::before {
  width: calc(100% + 1rem);
  margin: 0 -0.5rem 0.55rem;
  background-image: radial-gradient(circle, #fff0d0 0 2px, rgba(42, 9, 4, 0.25) 2.6px, transparent 3.2px);
}

/*
 * Value cells are flap cards: hinge across the middle, card edge below it.
 * Hover brightens without moving, because a flap is not something you push.
 */
.cell {
  font-family: var(--display);
  font-size: 2.3rem;
  letter-spacing: 0.02em;
  color: var(--key-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  background: var(--flap);
  border: 0;
  border-radius: 3px;
  min-height: 78px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 3px 0 rgba(0, 0, 0, 0.45);
  transition: background 0.12s;
}

.cell:hover:not(:disabled) { background: var(--flap-lit); }
.cell:disabled { cursor: default; }

/*
 * Same two-tier arrival as the stands. `entering` cascades the grid into place
 * once, when the cells are created; `returning` is the quick settle on coming
 * back from a clue, roughly two dozen times a game.
 *
 * Both stagger by diagonal — a wave crossing the grid corner to corner reads far
 * better than one marching along each row.
 */
.cell.entering {
  animation: cell-in var(--anim-cell-in) cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
  animation-delay: var(--stagger, 0ms);
}

@keyframes cell-in {
  from { opacity: 0; transform: translateY(-22px) rotateX(50deg); }
  to   { opacity: 1; transform: none; }
}

.cell.returning {
  animation: cell-return var(--anim-cell-return) ease-out backwards;
  animation-delay: var(--stagger, 0ms);
}

@keyframes cell-return {
  from { opacity: 0.4; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/*
 * The panel that grows from a clicked cell to cover the screen.
 *
 * pointer-events: none is load-bearing — the clue screen renders underneath and
 * must be clickable the instant it arrives. This is decoration over a live
 * screen, never something in front of it.
 */
.cell-expand {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  border-radius: 3px;
  background: var(--flap-lit);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  transition:
    left var(--anim-cell-expand) cubic-bezier(0.4, 0, 0.2, 1),
    top var(--anim-cell-expand) cubic-bezier(0.4, 0, 0.2, 1),
    width var(--anim-cell-expand) cubic-bezier(0.4, 0, 0.2, 1),
    height var(--anim-cell-expand) cubic-bezier(0.4, 0, 0.2, 1),
    opacity var(--anim-cell-expand) ease-in;
}

/* -------------------------------------------------------- clue screen */

/*
 * Everything here uses transform and opacity only. Nothing on this screen may
 * change layout while a clue is live: a banner that grows or shrinks above the
 * buzzer moves the buzzer, and moving the buzzer decides a reaction-time race on
 * cursor position (SKIN-NOTES.md).
 *
 * The buzzer itself has no transitions in any state and is not touched below.
 */

/*
 * --clue-delay holds these back until the expanding panel has mostly cleared.
 * Set per arrival in app.js, and zeroed for a client with no panel to wait for.
 * `backwards` keeps them invisible during the wait rather than showing and then
 * animating.
 */
.clue-value.arriving { animation: clue-in 320ms ease-out var(--clue-delay, 0ms) backwards; }

.clue-text.arriving {
  animation: clue-in 380ms ease-out calc(var(--clue-delay, 0ms) + 60ms) backwards;
}

@keyframes clue-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* Fades once decoded rather than appearing mid-download. */
.clue-image { opacity: 0; transition: opacity 260ms ease-out; }
.clue-image.loaded { opacity: 1; }

/* Banners arrive and leave rather than blinking in and out. The transient ones
   expire on a timer, and something vanishing between blinks is oddly harder to
   notice than something fading. */
.winner-banner.arriving,
.miss-banner.arriving,
.item-banner.arriving,
.passed-banner.arriving { animation: banner-arrive 200ms ease-out; }

.miss-banner.leaving,
.item-banner.leaving,
.passed-banner.leaving { animation: banner-leave 200ms ease-in forwards; }

@keyframes banner-arrive {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@keyframes banner-leave {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(-6px); }
}

/* The payoff moment. Lands harder than anything else on the screen. */
.verdict-chip { animation: verdict-land 260ms cubic-bezier(0.2, 0.9, 0.3, 1.5); }

@keyframes verdict-land {
  0%   { opacity: 0; transform: scale(2.1) rotate(-6deg); }
  70%  { opacity: 1; transform: scale(0.94) rotate(0); }
  100% { opacity: 1; transform: none; }
}

/* Drifts slowly, so five seconds feels like five seconds to whoever is in it. */
.blackout { background-size: 40px 40px; animation: blackout-drift 3s linear infinite; }

@keyframes blackout-drift {
  from { background-position: 0 0; }
  to   { background-position: 40px 40px; }
}

/* The turn banner fades between pickers rather than swapping words silently. */
.turn-banner.swapping { animation: banner-swap var(--anim-turn) ease-out; }

@keyframes banner-swap {
  0%   { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: none; }
}

/* A spent cell flips to blank rather than fading out. */
.cell.spent {
  background: var(--flap-spent);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), 0 2px 0 rgba(0, 0, 0, 0.4);
  animation: flap-flip 0.26s ease-in-out;
}

@keyframes flap-flip {
  0% { transform: rotateX(0deg); }
  49% { transform: rotateX(-90deg); }
  51% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

.score-strip { display: flex; justify-content: center; gap: 0.6rem; }

.chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem 0.35rem 0.4rem;
  border-radius: 999px;
  background: var(--raised);
  border: 2px solid var(--edge);
  font-size: 0.95rem;
  font-weight: 600;
}

.chip.active { border-color: var(--accent); color: var(--accent); }
.chip.away { opacity: 0.5; }

/* --------------------------------------------------------- resume offer */

.resume-card {
  background: var(--raised);
  border: 3px solid var(--accent);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.resume-card p { margin: 0 0 0.9rem; }
.resume-list { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }

/* Generated by app.js, so flat rather than a keycap. */
.resume-option {
  margin: 0;
  padding: 0.5rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 8px;
  border: 2px solid var(--edge);
  background: var(--socket);
  color: var(--text);
  font-weight: 700;
}

.resume-option::before, .resume-option::after { display: none; }
.resume-option:hover { border-color: var(--accent); }
.resume-option.picked { border-color: var(--accent); }
.resume-option.in-use { opacity: 0.75; }

.in-use-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--bad);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
}

.host-key-prompt {
  max-width: 360px;
  margin: 1.25rem auto 0;
  padding: 1rem 1.25rem;
  border: 2px solid var(--edge);
  border-radius: 10px;
  background: var(--raised);
}

.host-key-prompt p { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--text-dim); }

.host-key-prompt input {
  width: 100%;
  font: inherit;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  border: 2px solid var(--edge);
  background: var(--socket);
  color: var(--text);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.6);
}

/* ------------------------------------------------------------------- clue */

.clue-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1rem;
  border-bottom: 3px solid var(--edge);
  padding-bottom: 0.9rem;
  margin-bottom: 1.6rem;
}

.clue-value {
  font-family: var(--display);
  font-size: 2.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--coral);
  margin: 0;
}

/* One column: clue and rulings, then the buzzer centred beneath them. */
.clue-stage { display: grid; justify-items: center; gap: 2.25rem; text-align: left; }
.clue-main { width: 100%; }

.clue-text { font-size: 2.3rem; line-height: 1.32; margin: 0 0 1.5rem; text-wrap: pretty; }

/*
 * Clue image. A flat surface, not a control — no skirt, no socket (SKIN-NOTES.md).
 *
 * Height is capped in viewport units so a tall image cannot push the buzzer off
 * screen. The buzzer must stay reachable without scrolling on every clue.
 */
.clue-image {
  display: block;
  max-width: 100%;
  max-height: 44vh;
  margin: 0 auto 1.5rem;
  border-radius: 10px;
  border: 2px solid var(--edge);
  background: var(--socket);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  object-fit: contain;
}

.answer-box {
  background: #3a2a05;
  border: 2px solid var(--accent);
  border-radius: 10px;
  padding: 0.9rem 1.4rem;
  margin: 0 0 1.2rem;
}

.answer-box p { margin: 0.3rem 0 0; font-family: var(--display); font-size: 1.9rem; color: var(--accent); }

/* ---------------------------------------------------------------- buzzer */

/*
 * The heaviest key on the screen: deepest socket, tallest skirt. Fixed size and
 * position, always present during a clue, so arming is a colour change and
 * nobody has to move their mouse (SPEC.md section 8).
 *
 * The face carries NO transition in any state. Nothing may sit between the
 * button going live and the click landing — the 0.2s ease that makes the board
 * keys feel good would be 200ms of lie on a race.
 */
.buzzer {
  position: relative;
  isolation: isolate;
  display: block;
  width: 400px;
  padding: 0 10px 20px;
  margin: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: not-allowed;
  --key-face: radial-gradient(#ff9a7d, #d63a2a);
  --key-skirt: #7a1c11;
  --key-hi: #ffc4ae;
}

.buzzer .key-top {
  height: 150px;
  padding: 0;
  border-radius: 6px;
  font-family: var(--display);
  font-size: 3.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 -1px rgba(0, 0, 0, 0.3);
  transition: none;
}

.buzzer::before {
  content: "";
  position: absolute;
  z-index: 1;
  bottom: 4px;
  left: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 10px);
  border-radius: 8px / 16px 16px 8px 8px;
  background-color: var(--key-skirt);
  background-image:
    radial-gradient(4px 8px at 4px calc(100% - 8px), rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(4px 8px at calc(100% - 4px) calc(100% - 8px), rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(16px at -4px 0, var(--key-hi), transparent),
    radial-gradient(16px at calc(100% + 4px) 0, var(--key-hi), transparent);
  box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.5), inset 0 -1px 3px 3px rgba(0, 0, 0, 0.4);
}

.buzzer::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 4px;
  left: 0;
  width: 100%;
  height: calc(100% - 4px);
  border-radius: 16px;
  background-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 1px 0 rgba(255, 255, 255, 0.5), inset 0 2px 2px rgba(0, 0, 0, 0.35);
}

/*
 * Idle: a dark, banked red. The cap is fully formed and sitting proud of its
 * socket — it is a live control that simply is not open yet, so it must not read
 * as disabled the way the locked state does.
 *
 * This exists so that arming is a change you catch in peripheral vision. Idle and
 * live originally shared one red and were separated only by an outer glow, which
 * is too quiet for the one moment in the game that has to be unmissable.
 */
.buzzer[data-mode="idle"] {
  --key-face: radial-gradient(#8e3226, #571509);
  --key-skirt: #3d0f07;
  --key-hi: #a54b36;
}

.buzzer[data-mode="idle"] .key-top { color: #e7b3a6; }

/* Frozen: iced over. Still a formed cap — the buzzer exists and is coming back,
   which is different from the locked state's empty socket. */
.buzzer[data-mode="frozen"] {
  --key-face: radial-gradient(#bfeaff, #5aa8d6);
  --key-skirt: #2b6382;
  --key-hi: #e6f7ff;
}

.buzzer[data-mode="frozen"] .key-top {
  color: #10394f;
  text-shadow: 0 1px rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 40px rgba(120, 200, 240, 0.35);
}

/* Armed. Only the colour changes: same size, same place, same cap height. */
.buzzer[data-mode="live"] { cursor: pointer; }
.buzzer[data-mode="live"] .key-top { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 50px rgba(214, 58, 42, 0.5); }
.buzzer[data-mode="live"]:active .key-top { transform: translateY(10px); }

/* Sent: a brass cap, still proud of its socket — your buzz is in. */
.buzzer[data-mode="sent"] { --key-face: radial-gradient(#ffdc85, #dfa11c); --key-skirt: #8a5c00; --key-hi: #ffe9a8; }
.buzzer[data-mode="sent"] .key-top { color: var(--key-ink); text-shadow: 0 -1px rgba(255, 255, 255, 0.35); }

/* Locked: the empty socket. Nothing to press, and it looks it. */
.buzzer[data-mode="locked"]::before { display: none; }

.buzzer[data-mode="locked"] .key-top {
  background-image: none;
  background-color: var(--socket);
  color: #2f5c56;
  text-shadow: none;
  font-size: 2.1rem;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.9);
}

/*
 * Item strip. Fixed height whether or not it holds anything, so the buzzer above
 * it never moves — its position is a fairness property, not a layout preference.
 */
.item-strip {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  min-height: 46px;
  margin-top: 0.9rem;
}

.item-strip .btn { margin: 0; }

.target-prompt {
  align-self: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-right: 0.2rem;
}

/* ---------------------------------------------------------------- blackout */

/*
 * Occupies the space the clue would have used. The clue is never sent to a
 * blacked-out player, so there is nothing here to reveal by inspecting the page.
 */
.blackout {
  display: grid;
  place-items: center;
  gap: 0.4rem;
  min-height: 190px;
  margin: 0 0 1.5rem;
  border-radius: 12px;
  border: 2px dashed var(--edge);
  background: repeating-linear-gradient(
    45deg,
    #071c20,
    #071c20 14px,
    #05161a 14px,
    #05161a 28px
  );
}

.blackout-word {
  font-family: var(--display);
  font-size: 2.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.blackout-sub { font-size: 0.9rem; color: var(--text-faint); }

.item-banner {
  max-width: 620px;
  margin: 0 auto 1.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: #3a2a05;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
}

/* --------------------------------------------------------- winner banner */

.winner-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--raised);
  border: 3px solid var(--accent);
  border-radius: 12px;
  padding: 0.9rem 1.4rem;
  margin: 0 0 0.7rem;
  animation: banner-in 0.14s ease-out;
}

@keyframes banner-in {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.winner-banner .avatar-lg { width: 54px; height: 54px; }

.winner-name {
  font-family: var(--display);
  font-size: 1.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Settled states get their own colour so a ruling reads from across the room. */
.winner-banner[data-verdict="correct"] { border-color: var(--ok); background: var(--ok-deep); }
.winner-banner[data-verdict="correct"] .winner-name { color: var(--ok); }

.verdict-chip {
  margin-left: auto;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  background: var(--ok);
  color: var(--ok-deep);
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: verdict-stamp 0.12s ease-out;
}

@keyframes verdict-stamp {
  from { transform: scale(1.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.winner-timer { font-size: 1.05rem; color: var(--text-dim); font-variant-numeric: tabular-nums; font-weight: 600; }

.miss-banner, .passed-banner {
  margin: 0 0 0.7rem;
  padding: 0.75rem 1.3rem;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
}

.miss-banner { background: var(--bad-deep); border: 2px solid var(--bad); color: #ffd8d2; }

.passed-banner {
  background: repeating-linear-gradient(45deg, var(--socket) 0 8px, #061c1a 8px 16px);
  border: 2px solid var(--edge);
  color: var(--text-dim);
}

/* -------------------------------------------------------- host judge row */

.clue-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin: 1.6rem 0 1rem;
  padding-top: 1.2rem;
  border-top: 2px dashed var(--edge);
}

.reactions { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1rem; }

.reaction {
  background: var(--raised);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.adjust-row { display: flex; gap: 0.3rem; justify-content: center; margin-top: 0.6rem; }
.adjust-row .btn { margin: 0; padding: 0 2px 6px; }
.adjust-row .key-top { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
.adjust-row .btn:active .key-top { transform: translateY(3px); }

/* --------------------------------------------------------------- dev panel */

.dev-panel {
  margin: 2rem auto 0;
  max-width: 560px;
  padding: 1rem 1.25rem;
  border: 2px dashed var(--edge);
  border-radius: 10px;
  background: repeating-linear-gradient(45deg, var(--socket) 0 8px, #061c1a 8px 16px);
  text-align: left;
}

.dev-note { color: var(--text-dim); font-size: 0.8rem; margin: 0.4rem 0 0.9rem; line-height: 1.4; }
.dev-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.dev-name { flex: 0 0 90px; font-size: 0.85rem; font-weight: 600; }
.dev-unit { color: var(--text-faint); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; }

.dev-row input {
  width: 74px;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: var(--socket);
  color: var(--text);
}

/* ---------------------------------------------------------------- problem */

.problem {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bad-deep);
  border: 2px solid var(--bad);
  color: #ffe0da;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 50;
}
