/* Press Your Luck - "Marquee Nights" theme (reskin plan: RESKIN_PLAN.md under docs/plans)
 *
 * Linked AFTER style.css and voting-panel.css, so equal-specificity rules here win.
 * voting-panel.css is a synced copy and is never edited: it picks the palette up through the
 * --color-* aliases that style.css :root now points at the --pyl-* tokens below.
 *
 * Rule (D7): no hex literal below the :root block. Colours come from tokens, rgba() or color-mix().
 * The kept scoreboard box colours and board colours (D3/D4) stay in style.css and big-board.js.
 *
 * Fonts (D8, self-hosted in fonts/, SIL OFL, latin subset; CSP is font-src 'self'):
 *   @fontsource/anton 5.3.0 (anton-latin-400-normal.woff2)
 *   @fontsource-variable/figtree 5.3.0 (figtree-latin-wght-normal.woff2)
 */

/* ===== Tokens ===== */
:root {
  --pyl-bg: #0b0507;  --pyl-panel: #1a0b0f;  --pyl-panel-2: #26111a;  --pyl-line: #4a2128;
  --pyl-text: #fff3d6;  --pyl-muted: #c9a9a4;
  --pyl-brand: #d7263d;  --pyl-brand-deep: #7a0d1c;
  --pyl-cta: #ffc23d;  --pyl-cta-deep: #b9800c;  --pyl-cta-ink: #2a1600;
  --pyl-info: #59c8ff;  --pyl-cash: #3ddc84;  --pyl-bad: #ff4d5e;
  --pyl-f-display: 'Anton', Impact, sans-serif;  --pyl-f-body: 'Figtree', system-ui, sans-serif;
  --pyl-r: 10px;  --pyl-r-lg: 16px;  --pyl-ease: cubic-bezier(.22,.61,.36,1);
  --pyl-confetti: #ffc23d, #d7263d, #fff3d6, #3ddc84, #59c8ff;

  /* Supporting tokens used by the rules below (not part of the aliased palette) */
  --pyl-field: #0d0507;      /* text-input well */
  --pyl-cta-hi: #ffe08a;     /* top of the gold plate gradient */
  --pyl-cta-edge: #6b4504;   /* the plate's lower lip */
  --pyl-dim: #8a6f6b;        /* tertiary text */
  --pyl-ink: #050203;        /* deepest wells: timer track, answer keys */
  --pyl-warn: #fb923c;       /* timer warning */
  --pyl-warn-deep: #c2410c;
  --pyl-brand-hi: #ff6b7a;   /* top of the red buzz plate */
  --pyl-brand-lip: #4a0710;  /* the red plate's lower lip */

  /* Avatar picker (vendor/avatar-picker, never edited) mapped onto the palette (Task 5.2) */
  --avp-surface: var(--pyl-panel);
  --avp-raised: var(--pyl-panel-2);
  --avp-text: var(--pyl-text);
  --avp-dim: var(--pyl-muted);
  --avp-line: var(--pyl-line);
  --avp-accent: var(--pyl-cta);
  --avp-accent-tint: rgba(255, 194, 61, .14);
  --avp-focus: var(--pyl-cta);
  --avp-ink: var(--pyl-ink);
}

/* ===== Fonts ===== */
@font-face {
  font-family: 'Anton';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/anton-latin-400-normal.woff2) format('woff2');
}

@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(fonts/figtree-latin-wght-normal.woff2) format('woff2-variations');
}

/* ===== Base ===== */
html {
  /* Anton has one weight. Without this a bold heading is faux-bolded and smears. */
  font-synthesis-weight: none;
}

body {
  background-color: var(--pyl-bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 50% -5%, rgba(215, 38, 61, 0.30), transparent 70%),
    radial-gradient(ellipse 40% 30% at 15% 100%, rgba(255, 194, 61, 0.08), transparent 70%);
  background-attachment: fixed;
  color: var(--pyl-text);
  font-family: var(--pyl-f-body);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* One focus ring for every control: 3px gold, 4px off the edge. Board cells keep their own tooltip focus. */
:is(button, a, select, summary, [role="button"]):focus-visible {
  outline: 3px solid var(--pyl-cta);
  outline-offset: 4px;
}

:is(input, textarea):focus-visible {
  outline: 3px solid var(--pyl-cta);
  outline-offset: 2px;
}

/* ===== Primitives: buttons =====
 * Plates are slanted on ::before so the focusable element itself is never clipped. The in-board
 * buttons (Spin / Stop / Spin Again / Pass Spins) and Buzz keep their own shapes (D4, D5). */
.btn {
  font-family: var(--pyl-f-display);
  font-weight: 400;
}

.btn:is(.btn-primary, .btn-secondary):not(.btn-pass-spins) {
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  min-height: 44px;
  letter-spacing: 0.06em;
}

.btn:is(.btn-primary, .btn-secondary):not(.btn-pass-spins)::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: skewX(-12deg);
  border-radius: 6px;
}

.btn.btn-primary:not(.btn-pass-spins) {
  color: var(--pyl-cta-ink);
}

.btn.btn-primary:not(.btn-pass-spins)::before {
  background: linear-gradient(180deg, var(--pyl-cta-hi), var(--pyl-cta) 45%, var(--pyl-cta-deep));
  box-shadow: 0 4px 0 var(--pyl-cta-edge), 0 0 24px rgba(255, 194, 61, 0.35);
}

.btn.btn-secondary:not(.btn-pass-spins) {
  color: var(--pyl-text);
}

.btn.btn-secondary:not(.btn-pass-spins)::before {
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid var(--pyl-line);
}

@media (hover: hover) and (pointer: fine) {
  .btn.btn-primary:not(.btn-pass-spins):hover:not(:disabled)::before {
    filter: brightness(1.08);
  }

  .btn.btn-secondary:not(.btn-pass-spins):hover:not(:disabled)::before {
    border-color: var(--pyl-cta);
  }
}

.btn-large {
  font-size: 1.5rem;
  min-height: 60px;
  padding: 0 var(--space-2xl);
}

.btn-small {
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  min-height: 40px;
  padding: 0 var(--space-md);
}

.btn-link {
  color: var(--pyl-cta);
}

/* ===== Primitives: forms ===== */
.form-card {
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border: 1px solid var(--pyl-line);
  border-radius: var(--pyl-r-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.form-label {
  font-family: var(--pyl-f-body);
  font-weight: 800;
  letter-spacing: 0.1em;
}

.form-input {
  min-height: 48px;
  background: var(--pyl-field);
  border: 2px solid var(--pyl-line);
  border-radius: var(--pyl-r);
  font-family: var(--pyl-f-body);
  font-weight: 600;
}

.form-input::placeholder {
  color: var(--pyl-dim);
}

.form-input:focus {
  border-color: var(--pyl-cta);
  box-shadow: none;
}

.form-hint {
  color: var(--pyl-muted);
}

/* ===== Primitives: modal ===== */
.modal-overlay {
  background: rgba(5, 2, 3, 0.7);
}

.modal-box {
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border: 2px solid var(--pyl-cta-deep);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.modal-close {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid var(--pyl-line);
  border-radius: 50%;
  background: var(--pyl-panel);
  color: var(--pyl-text);
}

@media (hover: hover) and (pointer: fine) {
  .modal-close:hover {
    border-color: var(--pyl-cta);
    color: var(--pyl-cta);
  }
}

.settings-title,
.htp-title {
  font-family: var(--pyl-f-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: none;
}

/* ===== Primitives: tabs (the stacked-grid rule in style.css is untouched) ===== */
.host-panel-tabs .tab-btn,
.settings-tab-bar .tab-btn {
  min-height: 44px;
  padding: 0 var(--space-md);
  border-bottom-width: 3px;
  font-family: var(--pyl-f-display);
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ===== Primitives: toasts ===== */
.toast {
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border: 1px solid var(--pyl-line);
  border-left: 4px solid var(--pyl-cta);
  border-radius: var(--pyl-r);
  color: var(--pyl-text);
  font-family: var(--pyl-f-body);
  font-weight: 700;
}

.toast.toast-positive {
  border-left-color: var(--pyl-cash);
  background: color-mix(in srgb, var(--pyl-cash) 14%, var(--pyl-panel));
  color: var(--pyl-text);
}

.toast.toast-negative,
.toast.toast-whammy,
.toast.toast-error {
  border-left-color: var(--pyl-bad);
  background: color-mix(in srgb, var(--pyl-bad) 16%, var(--pyl-panel));
  color: var(--pyl-text);
}

.toast.toast-info {
  border-left-color: var(--pyl-cta);
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  color: var(--pyl-text);
}

.toast.toast-spin-award {
  border-left-color: var(--pyl-cta);
  background: color-mix(in srgb, var(--pyl-cta) 14%, var(--pyl-panel));
  color: var(--pyl-text);
}

.toast.toast-join {
  border-left-color: var(--pyl-info);
  background: color-mix(in srgb, var(--pyl-info) 12%, var(--pyl-panel));
  color: var(--pyl-text);
}

.toast.toast-error .toast-close-btn {
  color: var(--pyl-text);
}

/* ===== Primitives: banners and confirm dialog ===== */
.reconnect-banner,
.host-away-banner {
  background: var(--pyl-brand-deep);
  border-bottom: 2px solid var(--pyl-cta-deep);
  color: var(--pyl-text);
}

.update-banner,
.sound-unlock-pill {
  background: var(--pyl-panel-2);
  border-color: var(--pyl-cta-deep);
  color: var(--pyl-text);
}

#confirm-overlay .settings-footer {
  gap: var(--space-md);
}

/* ===== Coarse pointers: 44px targets (the invisible .hit-target expansion still applies) ===== */
@media (pointer: coarse) {
  .btn:not(.btn-pass-spins),
  .form-input,
  select,
  .tab-btn {
    min-height: 44px;
  }
}

/* ===== Avatars (src/avatars.js; kit stylesheet is linked before this file) ===== */
.pyl-av { flex: none; }
.pyl-av-xs { --avk-size: 20px; }
.pyl-av-sm { --avk-size: 28px; }
.pyl-av-md { --avk-size: 36px; }
.pyl-av-lg { --avk-size: 52px; }
.pyl-av-xl { --avk-size: 76px; }

/* ===== Shared bits: icons, kicker labels, tags, cards ===== */
.ico {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: none;
}

.k {
  font: 600 11px/1 var(--pyl-f-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pyl-muted);
  margin: 0;
}

.tag {
  display: inline-block;
  font: 800 10px/1 var(--pyl-f-body);
  font-style: normal;
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--pyl-panel-2);
  color: var(--pyl-muted);
  vertical-align: middle;
}

.tag-host {
  background: var(--pyl-cta);
  color: var(--pyl-cta-ink);
}

.tag-you {
  background: var(--pyl-brand);
  color: white;
}

.card {
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border: 1px solid var(--pyl-line);
  border-radius: var(--pyl-r-lg);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ===== HUD (game, lobby and voting share it) =====
 * --pyl-hud-h is the sticky HUD height; the voting band sticks just below it.
 * Brand + room, the round / whose-turn line, then the ? / sound / crown / gear buttons. There is no
 * "You" score box (D10): the scoreboard right below shows every score. */
:root {
  --pyl-hud-h: 56px;
}

.hud {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: var(--pyl-hud-h);
  padding: 6px 16px;
  background: linear-gradient(180deg, rgba(26, 11, 15, 0.97), rgba(11, 5, 7, 0.94));
  border-bottom: 2px solid var(--pyl-brand);
  box-shadow: 0 2px 0 var(--pyl-cta-deep), 0 8px 24px rgba(0, 0, 0, 0.5);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hud-logo {
  display: block;
  height: 40px;
  width: auto;
}

.hud-room {
  margin: 0;
  font: 400 16px/1 var(--pyl-f-display);
  letter-spacing: 0.05em;
  color: var(--pyl-muted);
  white-space: nowrap;
  text-transform: uppercase;
}

.hud-room strong {
  font-weight: 400;
  color: var(--pyl-text);
}

.hud-round {
  margin: 0;
  min-width: 0;
  justify-self: center;
  text-align: center;
  font: 400 18px/1.1 var(--pyl-f-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pyl-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hud-btns {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.hud-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--pyl-line);
  border-radius: var(--pyl-r);
  background: var(--pyl-panel);
  color: var(--pyl-text);
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .hud-btn:hover {
    border-color: var(--pyl-cta);
  }
}

.hud-host {
  color: var(--pyl-cta);
  border-color: var(--pyl-cta-deep);
}

/* Sound off reads as a struck-through speaker, not only a dimmer one */
.hud-sound[aria-pressed="false"] {
  color: var(--pyl-dim);
}

.hud-sound[aria-pressed="false"]::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 2px;
  background: var(--pyl-bad);
  transform: rotate(-45deg);
}

.hud .btn-small {
  min-height: 40px;
}

@media (max-width: 760px) {
  :root {
    --pyl-hud-h: 52px;
  }

  .hud {
    gap: 8px;
    padding: 4px 10px;
  }

  .hud-logo {
    height: 34px;
  }

  .hud-room {
    display: none;
  }

  .hud-round {
    justify-self: end;
    text-align: right;
    font-size: 14px;
  }

  /* ? and sound move into the settings sheet; host, QR and gear stay */
  .hud-btns .hud-btn:not(.hud-keep) {
    display: none;
  }

  .hud-btns {
    gap: 4px;
  }

  .hud .btn-small {
    padding: 0 10px;
    font-size: 13px;
  }
}

/* ===== Entry screens: landing and join ===== */
.screen-solo {
  justify-content: center;
}

.hero {
  max-width: 560px;
  gap: 18px;
  align-items: stretch;
  text-align: center;
}

.hero-logo {
  width: min(420px, 90%);
  margin: 0 auto;
  filter: drop-shadow(0 12px 30px rgba(215, 38, 61, 0.45));
}

.hero-logo.sm {
  width: min(240px, 60%);
}

.hero-tag {
  margin: 0;
  font: 400 20px/1.2 var(--pyl-f-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pyl-cta);
}

.hero .form-card {
  text-align: left;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.how-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.how-strip li {
  background: var(--pyl-panel);
  border: 1px solid var(--pyl-line);
  border-radius: var(--pyl-r);
  padding: 10px;
  font-size: 13px;
  color: var(--pyl-muted);
  text-align: left;
}

.how-strip b {
  display: block;
  font: 400 26px/1.1 var(--pyl-f-display);
  color: var(--pyl-brand);
}

.btn-how-to-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--pyl-line);
  border-radius: var(--pyl-r);
  background: var(--pyl-panel);
  color: var(--pyl-cta);
  font: 700 14px/1 var(--pyl-f-body);
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .btn-how-to-play:hover {
    border-color: var(--pyl-cta);
    color: var(--pyl-cta);
  }
}

.room-plate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.room-plate .room-label {
  margin: 0;
  font: 400 28px/1 var(--pyl-f-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pyl-muted);
}

.room-plate .room-label strong {
  margin-left: 0.3em;
  font-weight: 400;
  color: var(--pyl-text);
}

.btn-qr-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--pyl-line);
  border-radius: 50%;
  background: var(--pyl-panel);
  color: var(--pyl-text);
  opacity: 1;
  line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
  .btn-qr-icon:hover {
    border-color: var(--pyl-cta);
    color: var(--pyl-cta);
  }
}

/* Rows that were forced onto one line squeezed the input to nothing at 390px */
.form-inline-row {
  flex-wrap: wrap;
}

.form-input-inline {
  flex: 1 1 160px;
}

.join-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.join-row .form-input {
  flex: 1 1 0;
  min-width: 0;
}

.join-avatar {
  display: grid;
  place-items: center;
  flex: none;
  /* A button (tap to change your avatar, Task 5.2): no native chrome around the disc */
  background: none;
  color: inherit;
  border-radius: 50%;
}

/* Your own lobby seat avatar is editable (role=button); the picker CSS draws the pencil */
.seat .avk[data-avatar-edit] {
  border-radius: 50%;
}

@media (max-width: 760px) {
  .how-strip {
    grid-template-columns: 1fr;
  }

  .join-row {
    flex-wrap: wrap;
  }

  .join-row .form-input {
    flex-basis: 60%;
  }

  .join-row .btn {
    flex: 1 1 100%;
    width: 100%;
  }
}

/* Waiting players on the join screen: avatar chips in their seat colour */
.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.chips > .chip {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 4px;
  border-radius: 99px;
  background: var(--pyl-panel-2);
  border: 1px solid var(--pyl-line);
  border-left: 4px solid var(--seat, var(--pyl-line));
  font-size: 1rem;
  font-weight: 700;
}

.player-list-card {
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border-color: var(--pyl-line);
  border-radius: var(--pyl-r-lg);
}

.player-list-title {
  font-family: var(--pyl-f-display);
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--pyl-text);
}

.player-count {
  font-family: var(--pyl-f-display);
  font-size: 1.1rem;
  color: var(--pyl-cta);
}

/* ===== Lobby: invite card, 12 seats, sticky dock ===== */
.screen-hud {
  padding: 0 0 var(--space-lg);
  gap: 0;
  align-items: stretch;
  justify-content: flex-start;
}

.lobby-layout {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 18px 0;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  align-items: start;
}

.lobby-layout > .first-game-banner {
  grid-column: 1 / -1;
  margin: 0;
  background: rgba(255, 194, 61, 0.08);
  border: 1px dashed var(--pyl-cta-deep);
  box-shadow: none;
}

.lobby-invite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.room-code {
  margin: 0;
  max-width: 100%;
  font: 400 40px/1 var(--pyl-f-display);
  letter-spacing: 0.06em;
  color: var(--pyl-cta);
  overflow-wrap: anywhere;
}

.qr-box {
  padding: 10px;
  border-radius: var(--pyl-r);
  background: white;
  box-shadow: 0 0 0 4px var(--pyl-cta-deep);
  line-height: 0;
}

.qr-box:empty {
  display: none;
}

.qr-box canvas,
.qr-box img {
  width: 150px;
  height: 150px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.lobby-link-field {
  font-size: 0.85rem;
  min-height: 44px;
}

.rules-chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.rules-chips li {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--pyl-bg);
  border: 1px solid var(--pyl-line);
  color: var(--pyl-muted);
  font-size: 12px;
  font-weight: 700;
}

.rules-chips li.edit {
  padding: 0;
  border-color: var(--pyl-cta-deep);
}

.rules-edit {
  min-height: 26px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--pyl-cta);
  font: 700 12px/1 var(--pyl-f-body);
  cursor: pointer;
}

.lobby-seats .player-list-header {
  margin-bottom: 12px;
}

.seats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.seat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 10px;
  border-radius: 12px;
  background: var(--pyl-bg);
  border: 1px solid var(--pyl-line);
  border-top: 4px solid var(--seat, var(--pyl-line));
  text-align: center;
  min-width: 0;
}

.seat-name {
  max-width: 100%;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-tags {
  display: flex;
  gap: 4px;
}

.seat-ok {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
}

.seat-ok .ico {
  width: 14px;
  height: 14px;
}

.pending-badge {
  color: var(--pyl-muted);
}

.seats .seat-x {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 32px;
  min-height: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pyl-muted);
  font-size: 0.9rem;
}

.seat-empty {
  justify-content: center;
  min-height: 112px;
  border-style: dashed;
  border-top: 4px dashed var(--pyl-line);
  color: var(--pyl-dim);
}

.pool-line {
  margin: 12px 0 0;
  color: var(--pyl-muted);
  font-size: 13px;
}

.dock {
  grid-column: 1 / -1;
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin: 0 -18px;
  padding: 14px 18px;
  background: linear-gradient(0deg, var(--pyl-bg) 60%, transparent);
}

.dock-msg {
  margin: 0 auto 0 0;
  text-align: left;
  color: var(--pyl-muted);
}

.dock .host-controls {
  width: auto;
  gap: 6px;
}

@media (max-width: 760px) {
  .lobby-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 12px 0;
  }

  .lobby-invite .qr-box {
    display: none;
  }

  .seats {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .seat {
    padding: 10px 4px 8px;
  }

  .seat .pyl-av-lg {
    --avk-size: 36px;
  }

  .seat-empty {
    min-height: 92px;
  }

  .dock {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin: 0 -12px;
    padding: 12px;
  }

  .dock-msg {
    margin: 0;
    text-align: center;
    font-size: 13px;
  }

  .dock .host-controls,
  .dock .host-controls .btn {
    width: 100%;
  }
}

/* ===== Category voting: HUD offset, cut line (the panel itself is themed through --color-*) ===== */
#screen-category-voting .voting-container {
  margin: 0 auto;
  padding: 14px 16px 24px;
}

#screen-category-voting .vp-band {
  top: var(--pyl-hud-h, 56px);
}

#screen-category-voting .vp-logo {
  display: none;
}

#voting-clarification {
  width: min(100%, 900px);
  margin: 12px 0;
  padding: 14px;
  background: var(--pyl-panel);
  border: 1px solid var(--pyl-line);
  border-radius: 8px;
}

#voting-clarification-label {
  margin: 0 0 8px;
  font-size: 1rem;
}

#voting-clarification-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 8px;
}

.voting-clarification-choice {
  min-width: 0;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--pyl-line);
  border-radius: 6px;
  background: var(--pyl-panel-2);
  color: var(--pyl-text);
  cursor: pointer;
  font: 700 .9rem/1.35 var(--pyl-f-body);
  text-align: left;
  overflow-wrap: anywhere;
}

.voting-clarification-choice .vp-ai-label {
  margin-inline-start: 6px;
}

.voting-clarification-choice:focus-visible {
  outline: 2px solid var(--pyl-cta);
  outline-offset: 2px;
}

.voting-clarification-choice:disabled {
  cursor: wait;
}

@media (hover: hover) and (pointer: fine) {
  .voting-clarification-choice:hover {
    border-color: var(--pyl-cta);
  }
}

/* ===== Scoreboard surface (D3): lacquer card, fonts and one avatar only =====
 * The score box, spins box, whammy icon, Away, ELIMINATED, currentTurnGlow, widths, wrapping and
 * order are the kept design and stay in style.css. */
.player-slot {
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border-color: var(--pyl-line);
}

.player-name-row .player-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.player-name {
  font-family: var(--pyl-f-body);
  font-weight: 800;
}

.player-score,
.player-spins {
  font-family: var(--pyl-f-display);
  font-weight: 400;
}

/* ===== Board page (D4): fonts and the tooltip surface only; no markup or position change ===== */
.board-amount,
.board-result-text {
  font-family: var(--pyl-f-display);
  font-weight: 400;
}

.board-label {
  font-family: var(--pyl-f-body);
  font-weight: 900;
}

.board-tooltip {
  font-family: var(--pyl-f-body);
  background: linear-gradient(145deg, var(--pyl-panel-2), var(--pyl-bg));
  border-color: var(--pyl-cta-deep);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55), 0 0 20px rgba(255, 194, 61, 0.14);
}

.board-tooltip::after {
  background: var(--pyl-bg);
  border-color: var(--pyl-cta-deep);
}

.board-tooltip-label {
  color: var(--pyl-cta);
}

.board-tooltip-description {
  color: var(--pyl-text);
}

/* Last 5 Spins and the All Spins modal, restyled in place */
.spin-history {
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border: 1px solid var(--pyl-line);
  border-radius: var(--pyl-r-lg);
}

.spin-history-title,
.spin-history-modal-title {
  color: var(--pyl-cta);
}

.spin-history-row {
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--pyl-f-body);
}

.spin-history-who {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.spin-history-who-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spin-history-effect,
.spin-history-round {
  font-family: var(--pyl-f-display);
  font-weight: 400;
}

/* ===== Special choices: the overlay stays fixed and full-screen; the buttons become choice cards ===== */
#phase-special {
  background: rgba(11, 5, 7, 0.9);
}

.special-container {
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border: 2px solid var(--pyl-cta-deep);
  border-radius: var(--pyl-r-lg);
  padding: clamp(16px, 4vw, 36px);
}

.special-title {
  color: var(--pyl-cta);
  font-weight: 400;
}

.corner-choices,
.money-or-whammy-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 12px;
  width: 100%;
}

.special-container .btn.btn-choice:not(.btn-pass-spins) {
  min-width: 0;
  width: 100%;
  min-height: 96px;
  padding: 14px 12px;
  border-radius: var(--pyl-r-lg);
  font-size: 1.35rem;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: anywhere;
}

.special-container .btn.btn-choice:not(.btn-pass-spins)::before {
  transform: none;
  border-radius: var(--pyl-r-lg);
}

.special-container .btn.btn-secondary.btn-choice:not(.btn-pass-spins)::before {
  background: var(--pyl-panel-2);
  border: 2px solid var(--pyl-line);
}

.special-container .btn.btn-choice .choice-hint {
  color: inherit;
  opacity: 0.8;
  font-family: var(--pyl-f-body);
}

.special-container .btn.btn-choice .choice-amount {
  color: var(--pyl-cta-ink);
  font-size: 1.6rem;
}

/* The whammy corner is a word first, never colour alone */
.special-container .btn.btn-choice.choice-whammy {
  color: var(--pyl-bad);
}

.special-container .btn.btn-choice.choice-whammy::before {
  border-color: var(--pyl-bad);
}

.special-container .btn.btn-choice:not(.btn-pass-spins) {
  white-space: normal;
}

.special-container .btn.btn-choice .choice-hint {
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
}

/* ===== Stage effects (src/stage-fx.js): stinger, Whammy, big win, confetti =====
 * A fixed, aria-hidden layer over the page. It is tap-to-dismiss, so it takes taps only while a
 * moment is showing. Nothing here flashes more than 3 times a second (D13). Durations are capped
 * in stage-fx.js (D12); under reduced motion the layer is a plain opacity flash (D15). */
.stage-fx {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(11, 5, 7, 0.55);
}

.stage-fx[hidden] {
  display: none;
}

.sfx-plate {
  text-align: center;
  padding: 18px 40px;
  border-radius: var(--pyl-r-lg);
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border: 3px solid var(--pyl-cta);
  box-shadow: 0 0 40px rgba(255, 194, 61, 0.45);
  animation: sfxPlateIn 0.32s var(--pyl-ease) both;
}

.sfx-title {
  font: 400 clamp(2rem, 9vw, 4.5rem)/1 var(--pyl-f-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pyl-cta);
}

.sfx-sub {
  margin-top: 8px;
  font: 700 clamp(0.95rem, 3.4vw, 1.3rem)/1.2 var(--pyl-f-body);
  color: var(--pyl-text);
}

.sfx-amount {
  margin-top: 6px;
  font: 400 clamp(2rem, 8vw, 3.8rem)/1 var(--pyl-f-display);
  color: var(--pyl-cash);
}

.sfx-whammy {
  background: rgba(122, 13, 28, 0.6);
}

.sfx-whammy .sfx-plate {
  border-color: var(--pyl-bad);
  box-shadow: 0 0 40px rgba(255, 77, 94, 0.55);
  animation: sfxPlateIn 0.32s var(--pyl-ease) both, sfxShake 0.5s 0.2s linear 2;
}

.sfx-whammy .sfx-title {
  color: var(--pyl-bad);
}

.sfx-confetti {
  position: absolute;
  top: -14px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: sfxFall 1.7s linear both;
}

.sfx-confetti-0 { background: var(--pyl-cta); }
.sfx-confetti-1 { background: var(--pyl-brand); }
.sfx-confetti-2 { background: var(--pyl-text); }
.sfx-confetti-3 { background: var(--pyl-cash); }
.sfx-confetti-4 { background: var(--pyl-info); }

@keyframes sfxPlateIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: none; }
}

@keyframes sfxShake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-8px); }
  75%      { transform: translateX(8px); }
}

@keyframes sfxFall {
  from { transform: translateY(0) rotate(0deg); opacity: 1; }
  to   { transform: translateY(105vh) rotate(540deg); opacity: 0.9; }
}

@keyframes sfxFlash {
  from { opacity: 0; }
  to   { opacity: 1; }
}

html[data-reduced-motion="true"] .stage-fx,
html[data-reduced-motion="true"] .sfx-plate {
  animation: sfxFlash 0.18s linear both;
  transform: none;
}

html[data-reduced-motion="true"] .sfx-confetti {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .stage-fx .sfx-plate { animation: sfxFlash 0.18s linear both; }
  .sfx-confetti { display: none; }
}

/* ===== Question phase: timer, plates, the buzz zone (D5) and the answers =====
 * LOST-BUZZ-CLICK RULE (2026-09-08 playtest). Players rattle Buzz; when it disappears the next click
 * must not land on an answer.
 *   1. #buzz-in-area is a reserved zone with ONE fixed height for the whole question phase.
 *   2. When buzzing closes the button is hidden and an inert plate shows in the same zone
 *      (#buzz-in-area.is-closed: pointer-events none).
 *   3. #mc-options-area is always below the zone, at least 24px clear of it. No negative margins,
 *      no absolute positioning.
 *   4. Answers fade 35% -> 100% over MC_INPUT_LOCKOUT_MS (.arming); question-round.js still ignores
 *      clicks inside that window, and style.css keeps .btn-buzz:disabled { pointer-events: none }.
 *   5. Nothing clickable ever goes in the zone. scripts/shoot.mjs --assert checks 2 and 3. */
.question-container {
  max-width: 860px;
  gap: 16px;
}

.q-timer {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px; /* the seconds number is blank until a timer starts; the zone below must not move */
}

.q-timer .timer-bar-container {
  flex: 1;
  height: 12px;
  background: var(--pyl-ink);
  border: 1px solid var(--pyl-line);
  border-radius: 6px;
}

.q-timer .timer-bar {
  background: linear-gradient(90deg, var(--pyl-cta-deep), var(--pyl-cta));
  border-radius: 6px;
  animation: none;
}

.q-timer .timer-num {
  font: 400 22px/1 var(--pyl-f-display);
  color: var(--pyl-cta);
  min-width: 3ch;
  text-align: right;
}

.q-timer[data-urgency="warning"] .timer-bar {
  background: linear-gradient(90deg, var(--pyl-warn-deep), var(--pyl-warn));
}

.q-timer[data-urgency="warning"] .timer-num {
  color: var(--pyl-warn);
}

/* 1 Hz, well under the 3 flashes a second limit (D13). */
.q-timer[data-urgency="final"] .timer-bar {
  background: var(--pyl-bad);
  animation: pylTimerPulse 1s steps(2) infinite;
}

.q-timer[data-urgency="final"] .timer-num {
  color: var(--pyl-bad);
}

@keyframes pylTimerPulse {
  50% { opacity: 0.55; }
}

/* Category plate: a red slanted plate with a gold edge */
.question-category {
  position: relative;
  isolation: isolate;
  align-self: center;
  margin: 0;
  padding: 8px 22px 8px 16px;
  font: 400 22px/1.1 var(--pyl-f-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pyl-text);
}

.question-category:empty {
  display: none;
}

.question-category::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--pyl-brand);
  transform: skewX(-12deg);
  border-radius: 4px;
  box-shadow: 6px 0 0 var(--pyl-cta);
}

.question-text {
  margin: 0;
  padding: 28px 24px;
  font: 800 clamp(20px, 3.2vw, 30px)/1.25 var(--pyl-f-body);
  background: linear-gradient(180deg, var(--pyl-panel-2), var(--pyl-panel));
  border: 2px solid var(--pyl-cta-deep);
  border-radius: var(--pyl-r-lg);
  box-shadow: 0 0 0 4px var(--pyl-ink), 0 0 40px rgba(215, 38, 61, 0.25);
}

/* The reserved zone (rules 1 and 2) */
.buzz-in-area {
  position: relative;
  height: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.buzz-open {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.buzz-open[hidden],
.buzz-plate[hidden] {
  display: none;
}

#buzz-in-area.is-closed {
  pointer-events: none;
}

.buzz-in-area .btn-buzz {
  width: min(300px, 80%);
  height: 120px;
  padding: 0 24px;
  font: 400 44px/1 var(--pyl-f-display);
  letter-spacing: 0.08em;
  color: white;
  border: 6px solid var(--pyl-cta);
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 30%, var(--pyl-brand-hi), var(--pyl-brand) 55%, var(--pyl-brand-deep));
  box-shadow: 0 8px 0 var(--pyl-brand-lip), 0 0 50px rgba(215, 38, 61, 0.6);
}

.buzz-in-area .btn-buzz:disabled {
  opacity: 0.85;
}

.buzz-status {
  margin: 0;
  min-height: 1.2em;
}

.buzz-plate {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 14px;
  align-items: center;
  width: min(560px, 100%);
  padding: 16px 20px;
  border-radius: var(--pyl-r-lg);
  background: radial-gradient(ellipse at 10% 50%, rgba(255, 194, 61, 0.16), transparent 60%), var(--pyl-panel);
  border: 1px solid var(--pyl-line);
  border-left: 6px solid var(--seat, var(--pyl-cta));
}

.buzz-plate-avatar:empty {
  display: none;
}

.buzz-plate-who {
  margin: 0;
}

.buzz-plate-who b {
  display: block;
  margin-top: 4px;
  font: 400 26px/1 var(--pyl-f-display);
  letter-spacing: 0.04em;
}

.buzz-plate-hint {
  margin: 0;
  justify-self: end;
  text-align: right;
  font: 400 18px/1.1 var(--pyl-f-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pyl-cta);
}

/* Rule 3: the answers start 24px below the zone, always */
.mc-options-area {
  margin-top: 24px;
  gap: 12px;
}

.mc-instructions {
  margin: 0;
  color: var(--pyl-muted);
  font-weight: 700;
}

.mc-options-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mc-options-list li {
  position: relative;
  min-height: 64px;
  padding: 10px 14px;
  gap: 12px;
  border: 2px solid var(--pyl-line);
  border-radius: 12px;
  background: var(--pyl-panel);
  color: var(--pyl-text);
  font: 800 18px/1.25 var(--pyl-f-body);
  text-align: left;
}

.mc-options-list .ch-key {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--pyl-brand);
  color: white;
  font: 400 20px/1 var(--pyl-f-display);
}

.mc-options-list .ch-key-1 { background: var(--pyl-info); color: var(--pyl-ink); }
.mc-options-list .ch-key-2 { background: var(--pyl-cta); color: var(--pyl-cta-ink); }
.mc-options-list .ch-key-3 { background: var(--pyl-cash); color: var(--pyl-ink); }

.mc-options-list .ch-txt {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mc-options-list .ch-lock {
  display: none;
  flex: none;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--pyl-cta);
  color: var(--pyl-cta-ink);
  font: 800 11px/1 var(--pyl-f-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mc-options-list li.selected {
  border-color: var(--pyl-cta);
  background: var(--pyl-panel-2);
  color: var(--pyl-text);
  box-shadow: 0 0 0 2px var(--pyl-cta), 0 0 24px rgba(255, 194, 61, 0.3);
}

.mc-options-list li.selected .ch-lock {
  display: inline-block;
}

.mc-options-list li.disabled:not(.selected) {
  opacity: 0.5;
}

/* Rule 4: fade in over the input lockout so an early tap visibly does not count */
.mc-options-list.arming li {
  animation: pylArm 0.5s linear both;
}

@keyframes pylArm {
  from { opacity: 0.35; }
  to   { opacity: 1; }
}

/* Who has answered (D16): presence only */
.answered-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.answered-row[hidden] {
  display: none;
}

.answered-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.answered-list li {
  border-radius: 50%;
  padding: 2px;
  border: 2px dashed var(--pyl-line);
  opacity: 0.45;
  line-height: 0;
}

.answered-list li.done {
  opacity: 1;
  border: 2px solid var(--seat, var(--pyl-cta));
}

.answered-n {
  font: 400 18px/1 var(--pyl-f-display);
  color: var(--pyl-cta);
}

.buzz-waiting-area {
  min-height: 1.5em;
}

@media (max-width: 760px) {
  .buzz-in-area {
    height: 168px;
  }

  .buzz-in-area .btn-buzz {
    height: 100px;
    font-size: 36px;
  }

  .buzz-plate {
    grid-template-columns: auto 1fr;
    padding: 12px;
  }

  .buzz-plate-hint {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
    font-size: 15px;
  }

  .question-text {
    padding: 18px 14px;
  }

  .mc-options-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .mc-options-list li {
    min-height: 56px;
    font-size: 16px;
  }
}

/* D15: under reduced motion the answers appear at once, and Buzz stops pulsing */
html[data-reduced-motion="true"] .mc-options-list.arming li,
html[data-reduced-motion="true"] .q-timer .timer-bar,
html[data-reduced-motion="true"] .buzz-in-area .btn-buzz {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .mc-options-list.arming li,
  .q-timer .timer-bar,
  .buzz-in-area .btn-buzz {
    animation: none;
  }
}

/* ===== Results: verdict plate, staggered rows (D12: 80 ms per row, D15: at once under reduced motion) ===== */
.results-container {
  max-width: 760px;
  gap: 14px;
}

.verdict-plate {
  align-self: center;
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: 100%;
  padding: 12px 26px;
  border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--pyl-cash) 22%, var(--pyl-ink)), color-mix(in srgb, var(--pyl-cash) 9%, var(--pyl-ink)));
  border: 2px solid var(--pyl-cash);
}

.verdict-plate[data-verdict="none"] {
  background: var(--pyl-panel);
  border-color: var(--pyl-line);
}

.verdict-plate > .ico {
  width: 40px;
  height: 40px;
  fill: var(--pyl-cash);
}

.verdict-plate[data-verdict="none"] > .ico {
  fill: var(--pyl-muted);
}

.verdict-text {
  min-width: 0;
}

.verdict-plate .results-title {
  margin: 0;
  font: 600 11px/1 var(--pyl-f-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pyl-muted);
}

.verdict-plate .results-correct-answer {
  margin: 4px 0 0;
  font: 400 clamp(1.5rem, 5vw, 2.25rem)/1.05 var(--pyl-f-display);
  letter-spacing: 0.04em;
  color: var(--pyl-text);
  overflow-wrap: anywhere;
}

.results-content {
  padding: 0;
  background: none;
  border: 0;
}

.res-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.res-row {
  display: grid;
  grid-template-columns: auto 1fr auto 96px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--pyl-panel);
  border: 1px solid var(--pyl-line);
  border-left: 5px solid var(--seat, var(--pyl-cta));
  animation: pylRowIn 0.4s var(--pyl-ease) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

@keyframes pylRowIn {
  from { opacity: 0; transform: translateX(-16px); }
}

.res-name {
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}

.res-v {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--pyl-muted);
}

.res-v .ico {
  width: 18px;
  height: 18px;
}

.res-row.right .res-v {
  color: var(--pyl-cash);
}

.res-row.wrong .res-v {
  color: var(--pyl-bad);
}

.res-award {
  font: 400 20px/1 var(--pyl-f-display);
  color: var(--pyl-info);
  text-align: right;
}

.res-row.wrong .res-award {
  color: var(--pyl-bad);
}

@media (max-width: 760px) {
  .verdict-plate {
    padding: 10px 16px;
  }

  .res-row {
    grid-template-columns: auto 1fr auto;
    gap: 2px 10px;
  }

  .res-row > .pyl-av {
    grid-row: span 2;
  }

  .res-award {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .res-v {
    grid-column: 2;
    grid-row: 2;
    font-size: 12px;
  }
}

html[data-reduced-motion="true"] .res-row {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .res-row {
    animation: none;
  }
}

/* ===== Game over: headline, podium (staged once, <= 2.2 s), award tiles, standings, host dock ===== */
.gameover {
  max-width: 900px;
  width: 100%;
  gap: 18px;
}

.game-over-title {
  margin: 0;
  font: 400 clamp(2.5rem, 9vw, 3.5rem)/1 var(--pyl-f-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pyl-cta);
  text-shadow: 0 0 30px rgba(255, 194, 61, 0.45);
}

.game-over-winner {
  margin: 0;
}

.winner-declaration {
  margin: 0;
  font: 400 clamp(1.3rem, 4vw, 1.8rem)/1.15 var(--pyl-f-display);
  letter-spacing: 0.05em;
  color: var(--pyl-text);
  text-shadow: none;
  overflow-wrap: anywhere;
}

.podium {
  display: grid;
  grid-template-columns: repeat(var(--pod-n, 3), 1fr);
  align-items: end;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
  width: 100%;
}

.podium[hidden],
.awards[hidden] {
  display: none;
}

.pod {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.pod-crown {
  line-height: 0;
  color: var(--pyl-cta);
}

.pod-crown .ico {
  width: 28px;
  height: 28px;
}

.pod-name {
  max-width: 100%;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.pod-score {
  font: 400 22px/1 var(--pyl-f-display);
  color: var(--pyl-cta);
}

.pod-step {
  width: 100%;
  display: grid;
  place-items: center;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, var(--pyl-brand), var(--pyl-brand-deep));
  border-top: 4px solid var(--seat, var(--pyl-cta));
  font: 400 40px/1 var(--pyl-f-display);
  color: white;
}

.pod-1 .pod-step {
  height: 150px;
  background: linear-gradient(180deg, var(--pyl-cta), var(--pyl-cta-deep));
  color: var(--pyl-cta-ink);
}

.pod-2 .pod-step {
  height: 110px;
}

.pod-3 .pod-step {
  height: 80px;
}

/* Staging: 3rd at 0.1 s, 2nd at 0.7 s, 1st at 1.4 s (+0.6 s) = 2.0 s, inside the 2.2 s budget (D12). */
.podium.play .pod-3 { animation: pylPodRise 0.5s var(--pyl-ease) both 0.1s; }
.podium.play .pod-2 { animation: pylPodRise 0.5s var(--pyl-ease) both 0.7s; }
.podium.play .pod-1 { animation: pylPodRise 0.6s var(--pyl-ease) both 1.4s; }

@keyframes pylPodRise {
  from { transform: translateY(40px); opacity: 0; }
}

.awards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}

.award {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--pyl-panel);
  border: 1px solid var(--pyl-cta-deep);
  border-left: 5px solid var(--seat, var(--pyl-cta));
  min-width: 0;
}

.award-title {
  font: 400 15px/1.1 var(--pyl-f-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pyl-cta);
}

.award-name {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.award-detail {
  color: var(--pyl-muted);
  font-size: 13px;
}

.final-scores {
  display: block;
  max-width: none;
}

.standings {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  width: 100%;
}

.st-row {
  display: grid;
  grid-template-columns: 32px auto 1fr auto 110px;
  gap: 10px;
  align-items: center;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--pyl-panel);
  border: 1px solid var(--pyl-line);
  border-left: 4px solid var(--seat, var(--pyl-cta));
}

.st-row.winner {
  border-color: var(--pyl-cta);
}

.st-rank {
  font: 400 20px/1 var(--pyl-f-display);
  color: var(--pyl-muted);
}

.st-name {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.wh-pips {
  display: flex;
  gap: 2px;
}

.st-amount {
  font: 400 20px/1 var(--pyl-f-display);
  color: var(--pyl-cta);
  text-align: right;
}

.game-recap {
  max-width: none;
  text-align: center;
  background: none;
  border: 0;
  padding: 0;
}

.game-recap .recap-line {
  border: 0;
  color: var(--pyl-muted);
}

/* The host buttons sit in a docked bar, like the lobby's Start button */
#game-over-host-controls {
  position: sticky;
  bottom: 0;
  z-index: 10;
  width: auto;
  margin: 0 -18px -18px;
  padding: 14px 18px;
  justify-content: center;
  background: linear-gradient(0deg, var(--pyl-bg) 60%, transparent);
}

#game-over-host-controls[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .awards {
    grid-template-columns: 1fr;
  }

  .st-row {
    grid-template-columns: 26px auto 1fr 76px;
  }

  .st-row .wh-pips {
    display: none;
  }

  .pod-1 .pod-step { height: 120px; }
  .pod-2 .pod-step { height: 88px; }
  .pod-3 .pod-step { height: 64px; }
  .pod-score { font-size: 18px; }

  #game-over-host-controls {
    margin: 0 -12px -12px;
    padding: 12px;
  }
}

html[data-reduced-motion="true"] .podium.play .pod {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .podium.play .pod {
    animation: none;
  }
}
