/*
 * StewardOS Party-Game Foundry (`web/party/party.css`)
 * Visual Identity: "Midnight Velvet" (hairlines-not-shadows) & Zero-Blue "Night Amber"
 * Touch targets: Phone 48–56px, Tablet/Stage 56px.
 * Reduced motion: 120 ms crossfades (`@media (prefers-reduced-motion: reduce)`).
 */

:root {
  color-scheme: dark;
  --bg: #0D0B12;
  --card: #171421;
  --plinth: #221D30;
  --well: #14121C;
  --border: #2A2438;
  --text: #ECE8F4;
  --soft: #9A93AB;
  --violet: #B8A4F8;
  --violet-deep: #342952;
  --rose: #F284A7;
  --footlight: #E5A93C;
  --danger: #F04D5E;
  --radius-card: 12px;
  --radius-pill: 999px;
  --touch-phone: 50px;
  --touch-stage: 56px;
  --fade-dur: 220ms;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --fade-dur: 120ms;
  }
}

/* Strict Zero-Blue Night Amber Mode (A5 Werewolves Night Phase) */
body.night-amber {
  --bg: #000000;
  --card: #0C0503;
  --plinth: #120700;
  --well: #080300;
  --border: #3A1600;
  --text: #B4442A;
  --soft: #6E2A1A;
  --violet: #9A3A22;
  --violet-deep: #240B00;
  --rose: #B4442A;
  --footlight: #9A3A22;
  background-color: #000000;
  color: #B4442A;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* `display: flex` on a class beats the browser's rule for `hidden`, so this one has to be said */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--fade-dur) ease, color var(--fade-dur) ease;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Modern Web Guidance: Native <dialog> & Scroll Containment ---------- */
dialog {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  max-width: min(520px, 94vw);
  width: 100%;
  max-height: 88vh;
  overflow: auto;
}

dialog[open] {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: velvetCrossfade var(--fade-dur) ease-out;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(7, 5, 11, 0.76);
  overflow: hidden;
  overscroll-behavior: contain;
}

@keyframes velvetCrossfade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  @keyframes velvetCrossfade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* ---------- Buttons, Inputs & Crisp 1px Hairline Surfaces ---------- */
.velvet-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-heading, h2, h3, h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.soft-note {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.velvet-input,
.velvet-textarea,
.velvet-select {
  width: 100%;
  min-height: var(--touch-phone);
  background: var(--well);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
}

.velvet-input:focus-visible,
.velvet-textarea:focus-visible,
.btn:focus-visible,
.color-swatch-btn:focus-visible,
.neighbor-fan-segment:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}

.btn {
  min-height: var(--touch-phone);
  min-width: var(--touch-phone);
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color var(--fade-dur) ease, border-color var(--fade-dur) ease, opacity var(--fade-dur) ease;
}

.stage-body .btn,
.stage-body .pill-btn {
  min-height: var(--touch-stage);
  min-width: var(--touch-stage);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--violet);
  color: #0D0B12;
  border-color: var(--violet);
}

body.night-amber .btn-primary {
  background: #9A3A22;
  color: #000000;
  border-color: #B4442A;
}

.btn-secondary {
  background: var(--plinth);
  border-color: var(--border);
}

.btn-plinth {
  background: var(--plinth);
  border-color: var(--border);
  justify-content: flex-start;
  text-align: left;
}

.btn-plinth.is-selected {
  border-color: var(--violet);
  background: var(--violet-deep);
}

.btn-footlight {
  background: var(--footlight);
  color: #0D0B12;
  border-color: var(--footlight);
  font-weight: 700;
}

.btn-accent {
  background: var(--rose);
  color: #0D0B12;
  border-color: var(--rose);
  font-weight: 700;
}

.btn-ghost {
  background: transparent;
}

.btn-chip {
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
}

.btn-chip.is-active {
  background: var(--violet);
  color: #0D0B12;
  border-color: var(--violet);
}

.btn-icon {
  width: var(--touch-phone);
  padding: 0;
  border-radius: var(--radius-pill);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn-row > .btn {
  flex: 1 1 130px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.84rem;
  font-weight: 600;
}

.pill-violet {
  border-color: var(--violet);
  color: var(--violet);
}

.pill-rose {
  border-color: var(--rose);
  color: var(--rose);
}

.pill-family {
  border-color: var(--footlight);
  color: var(--footlight);
}

.segmented-tabs {
  display: flex;
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--soft);
  font: inherit;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
}

.tab-btn.is-active {
  background: var(--plinth);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ---------- Phone Controller Layout (`index.html`) ---------- */
.phone-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 12px 14px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phone-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.brand-star {
  color: var(--rose);
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- A1: 16-Color Swatch Grid + Red X + Arched OKLCH Neighbor Fan ---------- */
.color-picker-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.swatch-grid-16 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.color-swatch-btn {
  forced-color-adjust: none;
  position: relative;
  min-height: 52px;
  border-radius: 11px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--fade-dur) ease, border-color var(--fade-dur) ease;
}

.color-swatch-btn.is-mine,
.neighbor-fan-segment.is-mine {
  border: 3px solid #FFFFFF;
}

.color-swatch-btn.is-taken {
  opacity: 0.72;
}

.swatch-red-x {
  color: #FF3B52;
  background: rgba(13, 11, 18, 0.82);
  border: 1px solid #FF3B52;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
}

.swatch-mine-dot {
  color: #0D0B12;
  background: rgba(255, 255, 255, 0.9);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.neighbor-fan-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.neighbor-fan-arc {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding: 6px 10px;
}

.neighbor-fan-segment {
  forced-color-adjust: none;
  width: 72px;
  height: 54px;
  border-radius: 26px 26px 10px 10px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--fade-dur) ease;
}

.neighbor-fan-segment.seg-0 { transform: rotate(-11deg) translateY(4px); }
.neighbor-fan-segment.seg-1 { transform: translateY(-2px); }
.neighbor-fan-segment.seg-2 { transform: rotate(11deg) translateY(4px); }

@media (prefers-reduced-motion: reduce) {
  .neighbor-fan-segment.seg-0,
  .neighbor-fan-segment.seg-1,
  .neighbor-fan-segment.seg-2 {
    transform: none;
  }
}

.neighbor-fan-label {
  font-size: 0.82rem;
  color: var(--soft);
}

/* ---------- A2: Wardrobe, Selfie & Doodle ---------- */
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wardrobe-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--well);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
}

.wardrobe-preview-canvas {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  background: #0D0B12;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.wardrobe-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.doodle-canvas {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  touch-action: none;
  overscroll-behavior: none;
}

/* ---------- A4: Mixer & Low-Vision Stage Mirror ---------- */
.mixer-slider-row {
  display: grid;
  grid-template-columns: 88px 1fr 48px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.velvet-slider {
  width: 100%;
  accent-color: var(--violet);
  min-height: 36px;
}

.mixer-pct {
  text-align: right;
  color: var(--soft);
  font-size: 0.86rem;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 4px 0;
  cursor: pointer;
}

.switch-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--violet);
}

.low-vision-mirror {
  background: #000000;
  color: #FFFFFF;
  border: 2px solid #FFE066;
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mirror-head {
  display: flex;
  justify-content: space-between;
  color: #FFE066;
  font-size: 1.05rem;
}

.mirror-phase {
  font-size: 1.2rem;
  font-weight: 700;
}

.mirror-prompt {
  font-size: 1.15rem;
  background: #141414;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #FFFFFF;
}

.mirror-subtitle {
  font-size: 1.05rem;
  color: #FFE066;
}

.mirror-seats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mirror-seat-chip {
  border: 1px solid #FFFFFF;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.9rem;
}

/* ---------- A5: Night Amber Zero-Blue Constellation Ring ---------- */
.night-amber-card {
  background: #0C0500;
  color: #B44400;
  border: 1px solid #3A1600;
  border-radius: 16px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.night-amber-header {
  border: 1px solid #6E2A00;
  background: #140800;
  color: #B44400;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.night-amber-sub,
.night-amber-status {
  color: #9A3A00;
  text-align: center;
  font-size: 0.92rem;
  margin: 0;
}

.constellation-ring {
  position: relative;
  width: min(300px, 78vw);
  height: min(300px, 78vw);
  border-radius: 50%;
  border: 1px solid #6E2A00;
  background: radial-gradient(circle, #180900 0%, #070200 72%, #000000 100%);
}

.constellation-node {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 54px;
  min-height: 54px;
  padding: 4px 8px;
  border-radius: 50%;
  border: 1px solid #9A3A00;
  background: #0C0500;
  color: #B44400;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.constellation-node.is-lit {
  background: #6E2A00;
  color: #000000;
  border-color: #B44400;
}

/* ---------- A6: 60 fps Spline Sketchpad & CAH Cards ---------- */
.sketchpad-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  touch-action: none;
  overscroll-behavior: none;
}

.sketch-canvas-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--well);
  touch-action: none;
  overscroll-behavior: none;
}

.sketch-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  touch-action: none;
  overscroll-behavior: none;
  cursor: crosshair;
}

.sketch-swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

.sketch-swatch-btn {
  forced-color-adjust: none;
  min-height: 38px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
}

.sketch-swatch-btn.is-selected {
  border-color: #FFFFFF;
}

.sketch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.cah-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cah-black-card {
  background: #09070D;
  color: #ECE8F4;
  border: 1px solid var(--violet);
  border-radius: 14px;
  padding: 18px;
  font-size: 1.1rem;
  font-weight: 700;
}

.cah-hand {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.cah-white-card {
  min-height: 92px;
  padding: 14px;
  border-radius: 12px;
  background: #ECE8F4;
  color: #0D0B12;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cah-white-card.is-selected {
  border-color: var(--rose);
  background: #FFFFFF;
}

.writein-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ---------- C5: Uno, Kerst & Target Grids ---------- */
.target-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 8px;
}

.uno-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uno-hand-fan {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.uno-card {
  forced-color-adjust: none;
  width: 78px;
  min-height: 112px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #FFFFFF;
  font: inherit;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.uno-card strong {
  font-size: 1.55rem;
}

.uno-card.is-playable {
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2px var(--footlight);
}

.uno-color-red { background: #C93545; }
.uno-color-yellow { background: #C9961A; color: #0D0B12; }
.uno-color-green { background: #2D9454; }
.uno-color-blue { background: #356AC9; }
.uno-color-wild { background: linear-gradient(135deg, #C93545, #C9961A, #2D9454, #356AC9); }

.uno-wild-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.kerst-buzzer {
  min-height: 76px;
  font-size: 1.2rem;
  border-radius: 16px;
}

/* ---------- A7, B2, C4, C6: Director, Bumper, Ticket & Survey ---------- */
.director-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.director-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.rewind-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.director-seat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
}

.seat-mini-actions {
  display: flex;
  gap: 6px;
}

.bumper-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.bumper-canvas {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.bumper-thumb-pad {
  position: relative;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: var(--well);
  border: 2px solid var(--violet);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  overscroll-behavior: none;
}

.bumper-thumb-knob {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--violet);
  border: 2px solid #FFFFFF;
  pointer-events: none;
}

.sandbox-banner-card {
  background: var(--violet-deep);
  border: 1px solid var(--violet);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.velvet-theatre-ticket {
  background: radial-gradient(circle at top left, transparent 14px, #1B162B 15px) top left,
              radial-gradient(circle at top right, transparent 14px, #1B162B 15px) top right,
              radial-gradient(circle at bottom left, transparent 14px, #1B162B 15px) bottom left,
              radial-gradient(circle at bottom right, transparent 14px, #1B162B 15px) bottom right;
  background-size: 51% 51%;
  background-repeat: no-repeat;
  border: 1px solid var(--footlight);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.ticket-ornament-title {
  color: var(--footlight);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(229, 169, 60, 0.4);
  padding-bottom: 6px;
  width: 100%;
}

.ticket-qr-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ticket-share-link {
  color: var(--violet);
  font-size: 0.82rem;
  word-break: break-all;
}

.survey-thumbs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.survey-thumb-btn {
  min-height: 54px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
}

.survey-thumb-btn.is-active {
  background: var(--violet);
  color: #0D0B12;
  border-color: var(--violet);
}

.survey-detail-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.star-question-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.star-buttons {
  display: flex;
  gap: 2px;
}

.star-btn {
  min-width: 38px;
  min-height: 44px;
  background: transparent;
  border: 0;
  color: var(--border);
  font-size: 1.35rem;
  cursor: pointer;
}

.star-btn.is-lit {
  color: var(--footlight);
}

/* ---------- 1280×800 Tablet / TV / Desktop Stage (`stage.html`) ---------- */
.stage-body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #07060A;
  padding: 8px;
}

.stage-frame {
  position: relative;
  width: min(1280px, 100vw);
  aspect-ratio: 16 / 10;
  max-height: 98dvh;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stage-webgl-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.stage-hud-top,
.stage-hud-center,
.stage-hud-bottom {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.stage-hud-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
}

.stage-hud-top > *,
.stage-hud-center .interactive-plinth,
.stage-hud-bottom .interactive-plinth {
  pointer-events: auto;
}

.qr-join-plinth {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(23, 20, 33, 0.92);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
}

.qr-code-num {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
}

.stage-pills-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stage-hud-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

.stage-center-card {
  max-width: 720px;
  width: 100%;
  background: rgba(23, 20, 33, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  text-align: center;
}

.stage-easel-canvas {
  width: min(560px, 68vw);
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  border: 1px solid var(--violet);
  background: #14121C;
}

.intermission-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(13, 11, 18, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
}

.intermission-overlay[hidden] {
  display: none;
}

.intermission-banner {
  background: linear-gradient(90deg, #3A150F, #5C2214, #3A150F);
  border-top: 1px solid var(--footlight);
  border-bottom: 1px solid var(--footlight);
  color: #ECE8F4;
  padding: 12px 28px;
  width: 100%;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
}

.clockwork-progress-track {
  width: min(540px, 84%);
  height: 16px;
  background: #0D0B12;
  border: 1px solid var(--footlight);
  border-radius: 999px;
  overflow: hidden;
}

.clockwork-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--footlight), var(--rose));
  transition: width var(--fade-dur) ease;
}

.stage-corner-bumper {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
}

.stage-floating-mixer {
  position: absolute;
  top: 82px;
  right: 20px;
  z-index: 5;
  width: 310px;
  background: rgba(23, 20, 33, 0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.stage-floating-mixer[hidden] {
  display: none;
}

.stage-hud-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 24px 18px;
}

.stage-subtitle-ribbon {
  max-width: 860px;
  background: rgba(13, 11, 18, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  font-size: 1.08rem;
  text-align: center;
}

.stage-subtitle-ribbon:empty {
  display: none;
}

.stage-seats-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.stage-seat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(23, 20, 33, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: 0.88rem;
}

.seat-color-dot {
  forced-color-adjust: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

/* ---------- The fit to the real server (party-fit) ---------- */
.night-amber-step { color: #9A3A00; font-size: 0.86rem; }
/* The night screen is one layout for every role: the note and the secret each get a box that never changes size. */
.night-note {
  width: 100%;
  height: 5.6em;
  overflow-y: auto;
  padding: 8px 12px;
  border: 1px solid #3A1600;
  border-radius: 10px;
  background: #080300;
  color: #B44400;
  text-align: center;
  font-size: 0.95rem;
}
.night-amber-status { min-height: 1.5em; }
.peek-box { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.peek-facts {
  height: 3.2em;
  overflow-y: auto;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text);
}
.constellation-ring .constellation-node {
  width: 66px;
  height: 66px;
  padding: 2px;
  line-height: 1.1;
  overflow: hidden;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}
.constellation-ring.is-dense .constellation-node { width: 52px; height: 52px; min-width: 52px; min-height: 52px; font-size: 0.68rem; }
.constellation-ring { width: min(340px, 86vw); height: min(340px, 86vw); }
.score-box { display: flex; flex-direction: column; gap: 6px; }
.score-strip { display: flex; flex-wrap: wrap; gap: 6px; }
.kid-hint { color: var(--footlight); font-size: 0.92rem; }
.prompt-banner { background: var(--plinth); border: 1px solid var(--footlight); border-radius: 10px; padding: 10px 14px; font-weight: 650; }
.drawing-controller { display: flex; flex-direction: column; gap: 10px; }
.guess-canvas { width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 12px; border: 1px solid var(--border); display: block; }
.uno-top-bar { display: flex; align-items: center; gap: 14px; }
.uno-top-bar .uno-card { cursor: default; justify-content: center; flex-shrink: 0; }
.uno-turn { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.uno-hand-fan .uno-card { justify-content: center; width: 64px; min-height: 92px; }
.uno-card:disabled { opacity: 0.45; cursor: default; }
.uno-card.is-playable { opacity: 1; }
.uno-buzzer-btn.is-armed { outline: 3px solid #FFFFFF; }
.uno-wild-picker { display: flex; flex-direction: column; gap: 6px; }
.uno-wild-btn { color: #FFFFFF; }
.kerst-shell .btn-plinth.is-correct { border-color: #2FA84F; background: #143A22; }
.gift-grid { display: flex; flex-direction: column; gap: 8px; }
.gift-btn { justify-content: flex-start; text-align: left; padding: 10px 14px; min-height: 56px; }
.gift-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; color: var(--soft); }
.cah-white-card.is-blank { background: var(--plinth); color: var(--text); border: 2px dashed var(--violet); }
.cah-white-card:disabled { cursor: default; opacity: 1; }
.party-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 30;
  max-width: 92vw;
  padding: 10px 18px;
  background: var(--plinth);
  border: 1px solid var(--rose);
  border-radius: 12px;
  color: var(--text);
}
.pause-veil {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(7, 5, 11, 0.84);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
}
.stage-frame .pause-veil { position: absolute; }
.stage-timer {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: 6px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--footlight);
  background: rgba(13, 11, 18, 0.88);
  font-size: 1.5rem;
  font-weight: 800;
}
.stage-center-card h2 { font-size: 1.5rem; line-height: 1.25; margin-bottom: 10px; }
.stage-answers { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; text-align: left; }
.stage-answer { background: #ECE8F4; color: #0D0B12; border-radius: 10px; padding: 10px 12px; font-weight: 650; }
.stage-answer.is-winner { outline: 3px solid var(--footlight); }
.stage-option { background: var(--plinth); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stage-option.is-correct { border-color: #2FA84F; background: #143A22; }
.stage-uno-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.stage-uno-row .uno-card { cursor: default; justify-content: center; }
.stage-drawing { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.stage-drawing .stage-easel-canvas { width: min(470px, 40vw); }
.stage-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.finale-list { display: flex; flex-direction: column; gap: 4px; }
.sandbox-badge { font-weight: 700; }
#stage-qr-canvas { display: block; border-radius: 8px; }
/* the figures and the lantern stand in the upper half: what a game shows sits on the empty floor in front of them */
.stage-hud-center { align-items: flex-end; padding-bottom: 8px; }
