/* The big-screen stage (projector display + local mode).
   Sized with container query units (cqw/cqh/cqmin) so it scales to any screen,
   readable from the back of the room at 16:9. */

.display-shell {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  container-type: size;
  display: flex;
}
.stage-local {
  min-height: 0;
}
.local-panel {
  flex: none;
  max-height: 48dvh;
  overflow: auto;
}
.is-display .scene {
  padding-bottom: 7cqh;
}
.display-corner {
  position: fixed;
  bottom: calc(0.5rem + var(--safe-bottom));
  right: calc(0.6rem + var(--safe-right));
  z-index: 20;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  opacity: 0.55;
  transition: opacity 0.3s;
}
.display-corner:hover,
.display-corner:focus-within {
  opacity: 1;
}
.corner-code {
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--champagne);
  font-size: clamp(0.8rem, 1.3vw, 1.3rem);
  padding: 0.3em 0.8em;
  border-radius: 999px;
  background: rgba(18, 6, 15, 0.6);
}
.corner-code:empty {
  display: none;
}
.host-hint {
  position: fixed;
  left: calc(0.6rem + var(--safe-left));
  bottom: calc(0.8rem + var(--safe-bottom));
  z-index: 20;
  font-size: 0.85rem;
  padding: 0.35em 1em;
  border-radius: 999px;
  background: rgba(18, 6, 15, 0.55);
  color: var(--muted);
  opacity: 0.6;
  white-space: nowrap;
}
.sound-hint {
  position: fixed;
  left: 50%;
  top: calc(0.7rem + var(--safe-top));
  transform: translateX(-50%);
  z-index: 30;
  padding: 0.5em 1.1em;
  border-radius: 999px;
  border: 1px solid rgba(244, 213, 141, 0.45);
  background: rgba(18, 6, 15, 0.8);
  color: var(--champagne);
  font-weight: 700;
  cursor: pointer;
}
.display-shell > .error-banner {
  position: fixed;
  left: 50%;
  bottom: 3rem;
  transform: translateX(-50%);
  z-index: 25;
}

/* ---------------------------------------------------------------- scenes */
.scene {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.2cqh;
  padding: 3.5cqh 4cqw;
  text-align: center;
  animation: sceneIn 0.5s ease both;
}
@keyframes sceneIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}
.q-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: max(14px, 2.4cqmin);
  letter-spacing: 0.06em;
}
.q-count {
  color: var(--champagne);
  padding: 0.3em 0.9em;
  border-radius: 999px;
  border: 1px solid rgba(244, 213, 141, 0.45);
}
.q-game {
  color: var(--blush);
  font-family: var(--font-display);
  font-style: italic;
}
.q-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4cqw;
}
.q-text {
  margin: 0;
  flex: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(18px, 5.6cqmin, 4.8rem);
  line-height: 1.15;
  text-wrap: balance;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}
.q-text-sm {
  flex: none;
  font-size: clamp(16px, 4cqmin, 3.2rem);
  opacity: 0.95;
}
.q-status,
.q-hint {
  font-size: max(14px, 2.6cqmin);
  color: var(--muted);
  font-weight: 700;
}
.q-hint {
  font-weight: 500;
  opacity: 0.85;
}
.q-choices {
  width: 100%;
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
}
.lead-in {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 6cqmin;
  font-style: italic;
  color: var(--champagne);
  animation: pulseText 1s ease-in-out infinite alternate;
}
.scene-question.is-open .lead-in {
  display: none;
}
.scene-question.game-trivia:not(.is-open) .choice-grid {
  opacity: 0;
  transform: translateY(3cqh);
}
@keyframes pulseText {
  to {
    transform: scale(1.06);
    opacity: 0.7;
  }
}

/* timer ring */
.timer-ring {
  position: relative;
  flex: none;
  width: 16cqmin;
  aspect-ratio: 1;
  min-width: 64px;
}
.timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.tr-bg {
  fill: rgba(18, 6, 15, 0.6);
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 8;
}
.tr-fg {
  fill: none;
  stroke: var(--champagne);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke 0.3s;
  filter: drop-shadow(0 0 6px rgba(244, 213, 141, 0.7));
}
.tr-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 7cqmin;
}
.timer-ring.is-urgent .tr-fg {
  stroke: var(--bad);
}
.timer-ring.is-urgent .tr-num {
  color: #ffd0d0;
  animation: urgent 0.5s ease-in-out infinite alternate;
}
.timer-ring.is-lead .tr-num {
  color: var(--blush);
}
@keyframes urgent {
  to {
    transform: scale(1.15);
  }
}

/* trivia choice tiles */
.choice-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2cqmin;
  transition: opacity 0.4s, transform 0.4s;
}
.choice-grid.n3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.choice-grid.n2 {
  grid-template-columns: 1fr 1fr;
}
.choice-tile {
  --fill: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 2cqmin;
  padding: 2cqmin 3cqmin;
  border-radius: 2.4cqmin;
  font-weight: 800;
  font-size: clamp(14px, 3.8cqmin, 3.2rem);
  color: #fff;
  text-align: left;
  box-shadow: 0 0.8cqmin 0 rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition: opacity 0.5s, filter 0.5s, transform 0.5s;
  min-height: 9cqh;
}
.choice-shape {
  font-size: 1.2em;
  flex: none;
}
.choice-tile .choice-letter {
  flex: none;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.75em;
}
.choice-text {
  flex: 1;
  line-height: 1.15;
}
.choice-count {
  display: none;
  align-items: center;
  gap: 0.4em;
  font-size: 0.8em;
  min-width: 3.2em;
  justify-content: flex-end;
}
.cc-bar {
  position: absolute;
  inset: auto 0 0 0;
  height: 0.6cqmin;
  min-height: 4px;
  background: rgba(255, 255, 255, 0.85);
  transform-origin: left;
  transform: scaleX(var(--fill));
  transition: transform 1.1s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.cc-num {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1em 0.5em;
  border-radius: 999px;
}
.show-counts .choice-count {
  display: flex;
}
.choice-tile.is-wrong {
  opacity: 0.32;
  filter: grayscale(0.7);
  animation: shake 0.45s ease;
}
.choice-tile.is-correct {
  transform: scale(1.04);
  box-shadow: 0 0 0 0.5cqmin #fff, 0 0 5cqmin rgba(244, 213, 141, 0.9);
  animation: glow 1.2s ease-in-out infinite alternate;
  z-index: 1;
}
.choice-tile.is-correct::after {
  content: '✓';
  position: absolute;
  right: 1.5cqmin;
  top: 0.6cqmin;
  font-size: 0.8em;
}
@keyframes shake {
  20%,
  60% {
    transform: translateX(-1.2cqmin);
  }
  40%,
  80% {
    transform: translateX(1.2cqmin);
  }
}
@keyframes glow {
  from {
    box-shadow: 0 0 0 0.4cqmin #fff, 0 0 3cqmin rgba(244, 213, 141, 0.7);
  }
  to {
    box-shadow: 0 0 0 0.6cqmin #fff, 0 0 7cqmin rgba(244, 213, 141, 1);
  }
}
.reveal-foot {
  width: 100%;
  display: grid;
  gap: 1.5cqh;
  justify-items: center;
}
.reveal-summary {
  font-size: max(16px, 3.2cqmin);
  font-weight: 800;
  color: var(--champagne);
}

/* commentary aside */
.commentary-aside {
  max-width: 80cqw;
  padding: 1.6cqmin 3cqmin;
  border-radius: 3cqmin 3cqmin 3cqmin 0.6cqmin;
  background: linear-gradient(135deg, rgba(255, 194, 217, 0.95), rgba(255, 240, 246, 0.95));
  color: var(--plum-800);
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.3em;
  text-align: left;
  opacity: 0;
  transform: translateX(-6cqw) rotate(-2deg);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.commentary-aside.is-in {
  opacity: 1;
  transform: translateX(0) rotate(-1deg);
}
.aside-label {
  font-size: max(12px, 1.8cqmin);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 800;
  color: var(--rose);
}
.aside-quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: max(16px, 3.6cqmin);
}
.aside-text.is-typing::after {
  content: '▌';
  animation: blink 0.7s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------------------------------------------------------------- lobby */
.scene-lobby {
  justify-content: center;
  gap: 2.4cqh;
}
.scene-lobby .wordmark {
  font-size: clamp(32px, 11cqmin, 9rem);
}
.lobby-game {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(18px, 4.6cqmin, 4rem);
  font-style: italic;
  color: var(--blush);
}
.join-box {
  display: flex;
  align-items: center;
  gap: 4cqw;
  padding: 2.4cqmin 3.4cqmin;
  border-radius: 3cqmin;
  background: rgba(18, 6, 15, 0.6);
  border: 2px solid rgba(244, 213, 141, 0.55);
  box-shadow: var(--glow-gold);
}
.join-qr {
  width: 26cqmin;
  aspect-ratio: 1;
  flex: none;
}
.join-qr svg {
  width: 100%;
  height: 100%;
  border-radius: 1.4cqmin;
}
.join-text {
  display: grid;
  gap: 0.6cqh;
  text-align: left;
}
.join-step {
  font-size: max(14px, 2.6cqmin);
  color: var(--muted);
  font-weight: 700;
}
.join-url {
  font-size: max(16px, 4cqmin);
  font-weight: 800;
  color: var(--cream);
}
.join-code {
  display: flex;
  gap: 1.2cqmin;
}
.join-code span {
  display: grid;
  place-items: center;
  width: 1.3em;
  height: 1.5em;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: max(28px, 9cqmin);
  border-radius: 0.2em;
  background: var(--grad-gold);
  color: var(--plum-900);
  box-shadow: 0 0.6cqmin 0 var(--gold-deep);
}
.lobby-count {
  font-size: max(16px, 3.2cqmin);
  font-weight: 800;
  color: var(--champagne);
}
.scene-lobby .player-chips {
  max-width: 90cqw;
  font-size: max(14px, 2.8cqmin);
}
.lobby-hint {
  color: var(--muted);
  opacity: 0.8;
  font-size: max(12px, 2cqmin);
}

/* ---------------------------------------------------------------- bride or groom */
.vs-row {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3cqmin;
}
.vs-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5cqh;
  border-radius: 3cqmin;
  padding: 2cqmin;
  box-shadow: 0 1cqmin 0 rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  animation: floaty 3s ease-in-out infinite alternate;
}
.vs-card:nth-child(2) {
  animation-delay: -1s;
}
.vs-card:nth-child(3) {
  animation-delay: -2s;
}
@keyframes floaty {
  to {
    transform: translateY(-1.2cqh);
  }
}
.vs-card .vs-icon {
  font-size: max(32px, 11cqmin);
}
.vs-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: max(20px, 6cqmin);
}
.vs-card.small {
  padding: 1.2cqmin 2.4cqmin;
  animation: none;
}
.vs-card.small .vs-icon {
  font-size: 6cqmin;
}
.vs-card.small .vs-name {
  font-size: 4cqmin;
}

/* dramatic reveal */
.scene-reveal.game-bog {
  position: relative;
  overflow: hidden;
}
.spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--sx, 50%) 55%, transparent 0, transparent 18cqmin, rgba(5, 0, 6, 0.88) 42cqmin);
  opacity: 0;
  transition: opacity 0.6s;
  z-index: 0;
}
.stage-drumroll .spotlight {
  opacity: 1;
  animation: sweep 1.25s ease-in-out infinite alternate;
}
@property --sx {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 50%;
}
@keyframes sweep {
  from {
    --sx: 28%;
  }
  to {
    --sx: 72%;
  }
}
.scene-reveal.game-bog > * {
  position: relative;
  z-index: 1;
}
.scene-reveal.game-bog > .spotlight {
  position: absolute;
}
.reveal-center {
  position: relative;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 2cqh;
}
.drum-names {
  display: flex;
  gap: 3cqmin;
}
.stage-drumroll .drum-names .vs-card {
  animation: flash 0.75s steps(1) infinite;
}
.stage-drumroll .drum-names .vs-card:nth-child(2) {
  animation-delay: 0.25s;
}
.stage-drumroll .drum-names .vs-card:nth-child(3) {
  animation-delay: 0.5s;
}
@keyframes flash {
  0% {
    opacity: 1;
    transform: scale(1.12);
    filter: brightness(1.3);
  }
  33% {
    opacity: 0.25;
    transform: scale(0.95);
    filter: brightness(0.7);
  }
}
.stage-flip .drum-names {
  display: none;
}
.flip-card {
  width: 46cqmin;
  aspect-ratio: 1.45;
  perspective: 1200px;
}
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.stage-drumroll .flip-inner {
  animation: wobble 0.3s ease-in-out infinite alternate;
}
@keyframes wobble {
  from {
    transform: rotateZ(-2deg) scale(0.98);
  }
  to {
    transform: rotateZ(2deg) scale(1.02);
  }
}
.stage-flip .flip-inner {
  transform: rotateY(180deg);
}
.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  border-radius: 3cqmin;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1cqh;
  box-shadow: var(--shadow), 0 0 6cqmin rgba(244, 213, 141, 0.45);
}
.flip-front {
  background: repeating-linear-gradient(45deg, #3d1442 0 2cqmin, #4a1a50 2cqmin 4cqmin);
  border: 0.6cqmin solid var(--champagne);
}
.flip-q {
  font-family: var(--font-display);
  font-size: 22cqmin;
  font-weight: 900;
  color: var(--champagne);
}
.flip-back {
  transform: rotateY(180deg);
  border: 0.6cqmin solid #fff;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.flip-back .vs-icon {
  font-size: 13cqmin;
}
.flip-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 9cqmin;
}
.drum-caption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: max(18px, 4.4cqmin);
  color: var(--champagne);
}
.stage-drumroll .drum-caption {
  animation: pulseText 0.4s ease-in-out infinite alternate;
}
.tally-wrap {
  width: min(100%, 120cqh);
  display: grid;
  gap: 1cqh;
  opacity: 0;
  transform: translateY(3cqh);
  transition: opacity 0.5s, transform 0.5s;
}
.stage-tally .tally-wrap {
  opacity: 1;
  transform: none;
}
.tally-head {
  font-weight: 800;
  font-size: max(14px, 3cqmin);
  color: var(--champagne);
}
.tally-bars {
  display: grid;
  gap: 1cqh;
}
.bar-row {
  display: grid;
  grid-template-columns: 22cqmin 1fr 18cqmin;
  align-items: center;
  gap: 2cqmin;
  font-weight: 800;
  font-size: max(14px, 3cqmin);
  background: none !important;
}
.bar-label {
  display: flex;
  align-items: center;
  gap: 0.4em;
  justify-content: flex-end;
}
.bar-track {
  height: 4.4cqmin;
  min-height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.bar-row.v-bride .bar-fill {
  background: linear-gradient(90deg, var(--bride-deep), var(--bride));
}
.bar-row.v-groom .bar-fill {
  background: linear-gradient(90deg, var(--groom-deep), var(--groom));
}
.bar-row.v-neither .bar-fill {
  background: linear-gradient(90deg, var(--neither-deep), var(--neither));
}
.bar-row.is-correct .bar-label::after {
  content: ' ✓';
  color: var(--ok);
}
.bar-num {
  text-align: left;
}
.bar-pct {
  color: var(--muted);
  font-weight: 600;
}
.bar-voters {
  grid-column: 2 / -1;
  text-align: left;
  font-size: 0.6em;
  color: var(--muted);
  font-weight: 500;
}

/* ---------------------------------------------------------------- scoreboard */
.scene-scoreboard {
  justify-content: center;
}
.scoreboard {
  width: min(100%, 150cqh);
  display: grid;
  gap: 2cqh;
}
.sb-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: max(22px, 6cqmin);
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.scoreboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.sb-row {
  display: grid;
  grid-template-columns: 9cqmin 1fr 7cqmin 12cqmin auto auto;
  align-items: center;
  gap: 2cqmin;
  padding: 1.6cqmin 3cqmin;
  border-radius: 2cqmin;
  background: linear-gradient(90deg, rgba(90, 33, 96, 0.9), rgba(42, 11, 46, 0.9));
  border: 1px solid rgba(244, 213, 141, 0.3);
  font-size: max(16px, 4cqmin);
  font-weight: 800;
  text-align: left;
}
.sb-row.is-first {
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.45), rgba(90, 33, 96, 0.9));
  border-color: var(--champagne);
  box-shadow: var(--glow-gold);
}
.sb-row.is-me {
  outline: 3px solid var(--blush-strong);
}
.sb-rank {
  color: var(--champagne);
}
.sb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-move {
  font-size: 0.6em;
}
.sb-move.up {
  color: var(--ok);
}
.sb-move.down {
  color: var(--bad);
}
.sb-delta {
  font-size: 0.65em;
  color: var(--ok);
  text-align: right;
}
.sb-score {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.sb-unit {
  font-size: 0.5em;
  color: var(--muted);
}
.sb-empty {
  color: var(--muted);
}

/* ---------------------------------------------------------------- final */
.scene-final {
  gap: 1.5cqh;
}
.final-head {
  display: grid;
  gap: 0.5cqh;
}
.final-head .wordmark.small {
  font-size: max(22px, 6cqmin);
}
.final-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: max(18px, 4.2cqmin);
  color: var(--blush);
  font-style: italic;
}
.final-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 3cqw;
  align-items: end;
}
.final-body:has(.final-side:empty) {
  grid-template-columns: 1fr;
}
.final-side {
  align-self: stretch;
  display: grid;
  gap: 2cqh;
  align-content: center;
  min-height: 0;
  overflow: auto;
}
.final-side:empty {
  display: none;
}
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 1.5cqmin;
  height: 100%;
  min-height: 40cqh;
}
.podium-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  height: 100%;
}
.podium-who {
  display: grid;
  gap: 0.4cqh;
  justify-items: center;
  padding-bottom: 1cqh;
  opacity: 0;
  transform: translateY(2cqh);
  transition: opacity 0.5s 0.4s, transform 0.5s 0.4s;
}
.podium-crown {
  font-size: max(24px, 7cqmin);
}
.podium-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: max(16px, 4.4cqmin);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podium-score {
  color: var(--champagne);
  font-weight: 800;
  font-size: max(12px, 2.6cqmin);
}
.podium-block {
  border-radius: 2cqmin 2cqmin 0 0;
  display: grid;
  place-items: start center;
  padding-top: 1.5cqh;
  height: 0;
  overflow: hidden;
  transition: height 0.9s cubic-bezier(0.2, 1.3, 0.4, 1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.podium-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: max(24px, 9cqmin);
  color: rgba(26, 10, 31, 0.75);
}
.place-1 .podium-block {
  background: var(--grad-gold);
}
.place-2 .podium-block {
  background: linear-gradient(160deg, #ffffff, #c9c4d6);
}
.place-3 .podium-block {
  background: linear-gradient(160deg, #ffc2d9, #c2336f);
}
.podium-col.is-up .podium-who {
  opacity: 1;
  transform: none;
}
.place-1.is-up .podium-block {
  height: 30cqh;
}
.place-2.is-up .podium-block {
  height: 21cqh;
}
.place-3.is-up .podium-block {
  height: 14cqh;
}
.place-1.is-up .podium-crown {
  animation: bounce 1s ease-in-out infinite alternate;
}
@keyframes bounce {
  to {
    transform: translateY(-1.2cqh) rotate(6deg);
  }
}
.podium-col.is-empty {
  opacity: 0.35;
}
.final-list h2 {
  margin: 0 0 1cqh;
  font-family: var(--font-display);
  font-size: max(16px, 3cqmin);
}
.rank-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: max(13px, 2.4cqmin);
  max-height: 40cqh;
  overflow: auto;
}
.rank-list li {
  display: grid;
  grid-template-columns: 6ch 1fr auto;
  gap: 1cqmin;
  padding: 0.5cqmin 1.5cqmin;
  border-radius: 1cqmin;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}
.rl-rank {
  color: var(--champagne);
  font-weight: 800;
}
.rl-score {
  font-weight: 700;
}

/* crowd perception battle */
.crowd-battle {
  padding: 2cqmin;
  border-radius: 2.4cqmin;
  background: rgba(18, 6, 15, 0.55);
  border: 1px solid rgba(244, 213, 141, 0.4);
  display: grid;
  gap: 1.2cqh;
}
.crowd-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: max(16px, 3.4cqmin);
  color: var(--champagne);
}
.crowd-sides {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.5cqmin;
}
.crowd-side {
  padding: 1.6cqmin;
  border-radius: 2cqmin;
  display: grid;
  gap: 0.3cqh;
  font-size: max(12px, 2cqmin);
  color: #fff;
  opacity: 0.85;
}
.crowd-side.is-winner {
  opacity: 1;
  box-shadow: 0 0 0 0.4cqmin #fff, 0 0 5cqmin rgba(244, 213, 141, 0.8);
  animation: glow 1.2s ease-in-out infinite alternate;
}
.crowd-icon {
  font-size: max(20px, 5cqmin);
}
.crowd-label {
  font-weight: 800;
}
.crowd-pct {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: max(22px, 6cqmin);
}
.crowd-sub {
  opacity: 0.9;
}
.crowd-vs {
  font-family: var(--font-script);
  font-size: max(20px, 5cqmin);
  color: var(--champagne);
}
.crowd-headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: max(16px, 3.6cqmin);
  color: var(--blush);
}
.crowd-neither {
  color: var(--muted);
  font-size: max(12px, 2cqmin);
}

/* local mode lobby: no join box */
.scene-lobby.is-local .wordmark {
  font-size: clamp(28px, 9cqmin, 6rem);
}

/* narrow/portrait stages (local mode on a phone) */
@container (max-aspect-ratio: 1/1) {
  .q-main {
    flex-direction: column-reverse;
    gap: 2cqh;
  }
  .choice-grid,
  .choice-grid.n3 {
    grid-template-columns: 1fr;
  }
  .final-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .podium {
    min-height: 30cqh;
  }
  .join-box {
    flex-direction: column;
  }
  .sb-row {
    grid-template-columns: 12cqw 1fr auto auto;
  }
  .sb-delta,
  .sb-move {
    display: none;
  }
  .bar-row {
    grid-template-columns: 26cqw 1fr 18cqw;
  }
  .flip-card {
    width: 60cqw;
  }
}
