/* ── Variables ───────────────────────────────────────────────────── */
:root {
  --purple: #7c3aed;
  --purple-hover: #6d28d9;
}

/* ── Base ────────────────────────────────────────────────────────── */
body {
  background: #0f0a1e;
  color: #f0eaff;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* ── Purple primary buttons ──────────────────────────────────────── */
.btn-primary {
  background-color: var(--purple) !important;
  border-color: var(--purple) !important;
  color: #fff !important;
}
.btn-primary:hover {
  background-color: var(--purple-hover) !important;
  border-color: var(--purple-hover) !important;
}
.btn-primary:disabled,
.btn-primary.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-outline-primary {
  border-color: var(--purple) !important;
  color: var(--purple) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary.active,
.btn-outline-primary:active {
  background-color: var(--purple) !important;
  color: #fff !important;
}
.text-primary { color: var(--purple) !important; }
.border-purple { border-color: var(--purple) !important; }
.title-accent { color: #7dd3fc !important; }
.text-muted { color: #a78bfa !important; }
.bg-primary    { background-color: var(--purple) !important; }
.badge.bg-primary { background-color: var(--purple) !important; }

/* ── Host screens ────────────────────────────────────────────────── */
.host-screen {
  padding: 3rem 4rem;
  min-height: 100vh;
}
.join-url {
  font-size: 2rem;
  color: var(--purple);
  word-break: break-all;
}
.qr-code {
  border-radius: 12px;
  background: white;
  padding: 16px;
  max-width: 330px;
}
.timer-display {
  font-size: 5rem;
  font-weight: 900;
  color: var(--purple);
  min-width: 160px;
  text-align: right;
  line-height: 1;
}
.host-timer-controls { display: flex; gap: 0.5rem; }
.host-control-feedback {
  position: fixed;
  top: 3.2rem;
  right: 0.75rem;
  z-index: 1100;
  max-width: 18rem;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  background: rgba(15, 10, 30, 0.94);
  border: 1px solid #60a5fa;
  color: #dbeafe;
  font-size: 0.9rem;
}
.wildcard-reveal-next { min-width: 10rem; }

/* ── Player bubbles — host ───────────────────────────────────────── */
.player-bubble-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}
.player-bubble {
  padding: 0.75rem 1.5rem;
  background: var(--purple);
  border-radius: 999px;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}
.player-bubble.bubble-disconnected { opacity: 0.35; }
.player-bubble.bubble-lead {
  background: #9333ea;
  border: 3px solid #d8b4fe;
}
.lead-badge { font-size: 0.85rem; }
.zippy-score { font-size: 0.8em; font-weight: 600; color: #d8b4fe; margin-left: 0.2rem; }

.host-lobby {
  height: 100vh;
  min-height: 0;
  padding: 1.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.host-lobby[style*="display: none"] { display: none !important; }
.host-lobby .lobby-header { flex: none; }
.host-lobby .qr-code { width: min(57vh, 540px); max-width: 100%; height: auto; padding: 8px; }
.host-lobby .join-url { font-size: clamp(1.1rem, 2vw, 1.7rem); }
.lobby-roster {
  margin: 0 0 0.6rem;
  gap: 0.35rem;
  align-content: start;
  flex: none;
}
.lobby-player {
  padding: 0.25rem 0.65rem;
  gap: 0.3rem;
  font-size: clamp(0.75rem, 1.2vw, 1rem);
  border-width: 2px !important;
}
.lobby-player .avatar-sm { width: 20px; height: 20px; }
.lobby-leaderboards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  flex: 1;
  min-height: 0;
}
.lobby-leaderboard {
  min-height: 0;
  overflow: hidden;
  background: rgba(36, 27, 65, 0.9);
  border: 1px solid #705797;
  border-radius: 16px;
  padding: 0.75rem 1rem;
}
.lobby-leaderboard h2 { font-size: clamp(1.25rem, 2vw, 1.8rem); margin: 0 0 0.5rem; }
.lobby-board-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  height: 38px;
  border-top: 1px solid #514169;
  font-size: clamp(0.9rem, 1.35vw, 1.2rem);
}
.lobby-board-rank { color: #fbbf24; font-weight: 800; }
.lobby-board-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lobby-board-more, .lobby-board-empty { margin: 0.4rem 0 0; color: #c4b5fd; }
@media (max-height: 720px) {
  .host-lobby { padding: 1rem 2rem; }
  .host-lobby .lobby-header h1 { font-size: 2.4rem; margin-bottom: 0; }
  .host-lobby .qr-code { width: 345px; }
  .host-lobby .lobby-header p { margin-bottom: 0; }
}

/* ── Player bubbles — player screen ─────────────────────────────── */
.player-bubble-sm {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: var(--purple);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  margin: 0.25rem;
}
.player-bubble-sm.bubble-lead {
  background: #9333ea;
  border: 2px solid #d8b4fe;
}

/* ── Doodle avatars (W2-3) ───────────────────────────────────────
   White ink on transparent PNG, so they pop against the dark theme with
   just a colored ring + drop shadow — no extra background fill needed. */
.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  background: #1e1535;
  border: 2px solid var(--purple);
}
.avatar-sm  { width: 24px; height: 24px; }
.avatar-md  { width: 34px; height: 34px; }
.avatar-lg  { width: 44px; height: 44px; }
.avatar-podium          { width: 48px; height: 48px; border-width: 2px; }
.avatar-podium-champion { width: 64px; height: 64px; border-width: 3px; border-color: #fbbf24; }

/* Player join-screen drawing surface: 200x200 CSS px, downscaled to 64x64 on export. */
.avatar-draw-canvas {
  width: 200px;
  height: 200px;
  border-radius: 16px;
  border: 2px solid var(--purple);
  background: rgba(255, 255, 255, 0.04);
  touch-action: none;
  cursor: crosshair;
  margin: 0 auto;
  display: block;
}

.avatar-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
}
.avatar-color-swatch.active {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* ── "Who's submitted" roster (host, input phases) ──────────────── */
.roster-chip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.roster-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: #1e1535;
  color: var(--text-muted, #b8a9d9);
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.45;
  transition: opacity 0.2s, background 0.2s;
}
.roster-chip.roster-chip-done {
  opacity: 1;
  background: var(--purple);
  color: white;
}
.roster-chip-check {
  font-size: 0.85em;
}

/* ── Game cards (host game selection) ───────────────────────────── */
.game-card {
  background: #1e1535;
  border: 2px solid var(--purple) !important;
  border-radius: 12px !important;
  color: white;
}
.game-card-unavailable {
  border-color: #64748b !important;
  filter: saturate(0.35);
  opacity: 0.72;
}
.game-unavailable-reason {
  color: #fca5a5;
  font-weight: 700;
}

.host-audio-controls {
  max-width: 34rem;
  padding: 0.8rem 1rem;
  border: 1px solid #4c3b70;
  border-radius: 12px;
  background: rgba(30, 21, 53, 0.8);
}
.host-audio-controls summary { cursor: pointer; }
.host-audio-grid {
  display: grid;
  grid-template-columns: 7.5rem minmax(10rem, 1fr) 3.5rem;
  gap: 0.75rem 1rem;
  align-items: center;
}
.host-audio-grid label { font-weight: 650; }
.host-audio-grid input[type="range"] { width: 100%; accent-color: var(--purple); }
.host-audio-grid output { color: #c4b5fd; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Choice display cards (host game phase) ─────────────────────── */
.choice-display-card {
  background: #1e1535;
  border: 2px solid var(--purple);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
}

/* ── Results ─────────────────────────────────────────────────────── */
.result-row {
  display: grid;
  grid-template-columns: 200px 1fr 110px;
  align-items: center;
  gap: 1rem;
}
.result-label { font-size: 1.5rem; font-weight: 600; }
.result-bar-wrap {
  background: #1e1535;
  border-radius: 8px;
  height: 44px;
  overflow: hidden;
}
.result-bar {
  height: 100%;
  border-radius: 8px;
  transition: width 0.5s ease;
  min-width: 4px;
}
.result-count { font-size: 1.25rem; font-weight: 600; text-align: right; }
.result-row.result-winner .result-label { color: #fbbf24; }
.result-row.result-winner .result-bar   { background: #fbbf24 !important; }

/* ── Player app ──────────────────────────────────────────────────── */
.player-app {
  max-width: 480px;
  margin: 0 auto;
}
.player-screen {
  padding: 2rem 1.25rem;
  min-height: 100vh;
}
.lobby-games { margin-top: 2rem; }
.lobby-games h3 { margin: 0 0 0.75rem; font-size: 1rem; color: #c4b5fd; }
.lobby-game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.lobby-game-card {
  display: flex; flex-direction: column; min-width: 0; aspect-ratio: 1;
  padding: 0; overflow: hidden; text-align: left; color: #fff; cursor: pointer;
  background: #201936; border: 1px solid #705797; border-radius: 14px;
}
.lobby-game-card:hover { border-color: #a78bfa; }
.lobby-game-card:focus-visible { outline: 3px solid #ffe381; outline-offset: 3px; }
.lobby-game-heading {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 0 0.35rem; padding: 0.55rem 0.7rem; line-height: 1.2;
}
.lobby-game-heading strong { font-size: clamp(0.85rem, 4vw, 1rem); }
.lobby-game-heading small { color: #d8c8ff; font-size: 0.7rem; }
.lobby-game-preview { position: relative; display: block; flex: 1; min-height: 0; overflow: hidden; }
.lobby-preview-zippy {
  background: #18dce6 url('/zippy-bird/Background/Background2.png') center bottom / cover no-repeat;
  image-rendering: pixelated;
}
.preview-pipe { position: absolute; right: 20%; width: 15%; background: #46a34b; border: 3px solid #247635; }
.preview-pipe::after { content: ''; position: absolute; left: -15%; width: 130%; height: 9px; background: #65bd58; border: 2px solid #247635; }
.preview-pipe-top { top: 0; height: 27%; }
.preview-pipe-top::after { bottom: -3px; }
.preview-pipe-bottom { bottom: 10%; height: 28%; }
.preview-pipe-bottom::after { top: -3px; }
.preview-bird { position: absolute; left: 24%; top: 40%; width: 32px; height: 32px; background: url('/zippy-bird/Player/StyleBird1/Bird1-1.png') left top / 128px 32px no-repeat; }
.preview-ground { position: absolute; inset: auto 0 0; height: 10%; background: url('/zippy-bird/Tiles/Style%201/Ground1.png') left top / 32px 32px repeat-x; }
.lobby-preview-sky { background: linear-gradient(#263b79, #527fc1 65%, #b4c7e9); }
.lobby-preview-sky::before, .lobby-preview-sky::after {
  content: ''; position: absolute; width: 34%; height: 8%; border-radius: 50%;
  background: #edf5ff38; box-shadow: 10px -5px 0 #edf5ff38;
}
.lobby-preview-sky::before { top: 32%; right: 8%; }
.lobby-preview-sky::after { top: 54%; left: 5%; width: 23%; }
.preview-crane { position: absolute; left: 37%; top: 0; height: 22%; border-left: 2px solid #d6bcfa; }
.preview-block { position: absolute; width: 35%; height: 12%; left: 33%; border-radius: 2px; box-shadow: inset 0 3px #ffffff55; }
.preview-block-moving { top: 20%; left: 20%; background: #6ee7b7; }
.preview-block-one { bottom: 39%; left: 36%; background: #f9a8d4; transform: rotate(-3deg); }
.preview-block-two { bottom: 27%; left: 34%; background: #c4b5fd; }
.preview-block-three { bottom: 15%; background: #67e8f9; }
.preview-base { position: absolute; bottom: 5%; left: 18%; width: 64%; height: 10%; background: #463765; border-top: 4px solid #a78bfa; }
.preview-play { position: absolute; right: 0.5rem; bottom: 0.5rem; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #17132bd9; color: #fff; font-size: 0.75rem; }
.timer-badge {
  background: var(--purple);
  color: white;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
}
.choice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.75rem;
  font-size: 1.2rem;
  padding: 1rem;
  border-radius: 12px;
}

/* ── Trivia board ────────────────────────────────────────────────── */
.trivia-cell {
  background: #1e1535;
  border: 2px solid var(--purple);
  border-radius: 10px;
  padding: 1.25rem 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.trivia-cell:hover:not(.trivia-cell-answered) {
  background: #2d1f50;
  border-color: #a78bfa;
}
.trivia-cell-answered {
  background: #0d1f2d;
  border-color: #334155;
  color: #22c55e;
  cursor: default;
  opacity: 0.6;
}
/* Fixed-height column headers so 1-line vs 2-line names never stagger the cells below. */
.trivia-col-head,
.trivia-col-head-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  overflow: hidden;
}
.trivia-col-head    { height: 3.5rem; }  /* host (fs-5), fits ~2 lines */
.trivia-col-head-sm { height: 2.4rem; }  /* player (small), fits ~2 lines */

/* ── Pause overlay ───────────────────────────────────────────────── */
.pause-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.pause-message {
  color: white;
  font-size: 3rem;
  font-weight: 900;
  text-align: center;
  line-height: 1.3;
}

/* ── Zippy Bird ──────────────────────────────────────────────────── */
.zippy-bird-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, #283d72, #100d29 72%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  touch-action: none;
}
body.lobby-mini-game-open { overflow: hidden; }
.zippy-bird-shell {
  width: min(320px, calc(100vw - 24px), calc((100dvh - 100px) * 2 / 3));
}
.zippy-bird-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  padding: 0 2px 8px;
}
.zippy-bird-header strong { display: block; color: #ffe381; font: 900 1.15rem monospace; letter-spacing: .08em; }
.zippy-bird-header span { display: block; font-size: .78rem; color: #c7d5f7; }
.zippy-bird-close {
  border: 1px solid #a8b8dc;
  border-radius: 9px;
  background: #202c4d;
  color: #fff;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  line-height: 1;
}
.zippy-bird-close:hover, .zippy-bird-close:focus-visible { background: #384b7b; }
.zippy-bird-stage {
  position: relative;
  aspect-ratio: 2 / 3;
  border: 4px solid #ffe381;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 12px 0 #634c36, 0 22px 45px rgba(0, 0, 0, .55);
}
#zippy-bird-canvas, #sky-stack-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #18dce6;
  image-rendering: pixelated;
  touch-action: none;
}
.lobby-game-best {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 4px 7px;
  border-radius: 6px;
  color: #fff;
  background: rgba(19, 23, 51, .9);
  font: 700 .75rem monospace;
  pointer-events: none;
}
.lobby-game-best b { color: #ffe381; }
.zippy-bird-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zippy-bird-gameover {
  width: calc(100% - 30px);
  max-width: 260px;
  padding: 20px 16px;
  text-align: center;
  color: #fff;
  background: rgba(19, 23, 51, .95);
  border: 2px solid #ffe381;
  border-radius: 14px;
  pointer-events: auto;
  box-shadow: 0 12px 25px rgba(0, 0, 0, .45);
}
.zippy-bird-result-kicker { color: #ffe381; font: 800 .85rem monospace; letter-spacing: .05em; }
.zippy-bird-gameover h2 { font: 900 4rem monospace; line-height: 1; margin: 12px 0 0; }
.zippy-bird-gameover p { margin: 0 0 18px; color: #c7d5f7; }
.zippy-bird-controls { color: #d1ddf9; text-align: center; font-size: .78rem; margin: 21px 0 0; }
@media (max-height: 560px) {
  .zippy-bird-header { padding-bottom: 4px; }
  .zippy-bird-gameover { padding: 10px 8px; }
  .zippy-bird-result-kicker { font-size: .7rem; }
  .zippy-bird-gameover h2 { font-size: 2.8rem; margin-top: 4px; }
  .zippy-bird-gameover p { font-size: .75rem; margin-bottom: 8px; }
  .zippy-bird-gameover .btn { padding: .25rem .4rem; font-size: .8rem; }
  .zippy-bird-controls { margin-top: 14px; font-size: .7rem; }
}

/* ── Juice ──────────────────────────────────────────────────────── */

.btn:not(:disabled):active {
  transform: scale(0.93);
  transition: transform 60ms ease;
}

@keyframes choice-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(124,58,237,0.35); }
  100% { transform: scale(1); box-shadow: none; }
}
.choice-btn.btn-primary, .choice-btn.btn-success,
.select-pop.btn-primary, .select-pop.btn-success {
  animation: choice-pop 0.25s ease-out;
}

@keyframes timer-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}
.timer-urgent {
  animation: timer-pulse 0.55s ease-in-out infinite !important;
  color: #ef4444 !important;
}
.timer-badge.timer-urgent { background: #ef4444 !important; color: white !important; }

@keyframes confirm-pop {
  0%   { opacity: 0; transform: scale(0.82) translateY(6px); }
  65%  { transform: scale(1.04) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}
.alert-success, .submitted-confirm { animation: confirm-pop 0.35s ease-out both; }

@keyframes score-slide {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: none; }
}
.score-event-row { animation: score-slide 0.3s ease-out both; }
.score-event-row:nth-child(1) { animation-delay:   0ms; }
.score-event-row:nth-child(2) { animation-delay:  90ms; }
.score-event-row:nth-child(3) { animation-delay: 180ms; }
.score-event-row:nth-child(4) { animation-delay: 270ms; }
.score-event-row:nth-child(5) { animation-delay: 360ms; }
.score-event-row:nth-child(6) { animation-delay: 450ms; }
.score-event-row:nth-child(7) { animation-delay: 540ms; }
.score-event-row:nth-child(8) { animation-delay: 630ms; }

@keyframes card-reveal {
  from { opacity: 0; transform: scale(0.82) translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.vibes-reveal-card { animation: card-reveal 0.28s ease-out both; }

@keyframes content-reveal {
  from { opacity: 0; transform: scale(0.88); }
  60%  { transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}
.vibes-reveal-card > div {
  animation: content-reveal 0.25s ease-out both;
  animation-delay: 0.55s;
}

/* Voter attribution on reveal cards — secondary to the role itself; must fit up to 18 names */
.vibes-voter-strip {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.55rem;
  row-gap: 0.1rem;
  margin-top: 0.35rem;
  opacity: 0.75;
}
.vibes-voter-chip {
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
}

@keyframes phase-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.host-screen, .player-screen { animation: phase-enter 0.3s ease-out both; }

@keyframes reveal-pop {
  0%   { transform: scale(0.4) rotate(-4deg); opacity: 0; }
  70%  { transform: scale(1.08) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes reveal-slide {
  from { transform: translateX(-18px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
.reveal-answer-pop { animation: reveal-pop   0.45s cubic-bezier(0.34,1.56,0.64,1) both; }
.reveal-player-row { animation: reveal-slide 0.25s ease-out both; }

/* Split tall reveal/score lists into two balanced columns (many players). Each row stays
   whole (break-inside) so a flex row never splits across the column gap. */
.trivia-2col {
  column-count: 2;
  column-gap: 2rem;
}
.trivia-2col > * {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Score delta badges ──────────────────────────────────────────── */
.score-delta-badge {
  color: #4ade80;
  font-size: 0.8em;
  font-weight: bold;
  margin-left: 6px;
  display: inline-block;
  animation: deltaPop 3.5s ease-out forwards;
}
@keyframes deltaPop {
  0%   { opacity: 0; transform: translateY(6px); }
  15%  { opacity: 1; transform: translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-8px); }
}

/* ── Wildcard winning-answer "stamp" ─────────────────────────────── */
/* Each chosen answer slams into the sentence like an inked rubber stamp:
   condensed bold caps, warm ink color, slight lean, overshoot bounce. */
.wildcard-stamp {
  display: inline-block;
  font-family: 'Impact', 'Haettenschweiler', 'Franklin Gothic Bold', 'Arial Narrow', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ff5470;
  padding: 0 0.12em;
  transform: rotate(-3deg);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
  animation: stamp-in 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

/* Wildcard story ballots and results: collect choices in parallel, then give the
   completed joke and its points a clear visual hierarchy. */
.wildcard-ballot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.wildcard-ballot-blank {
  background: rgba(30, 21, 53, 0.92);
  border: 1px solid #4c3b70;
  border-radius: 14px;
  padding: 1rem;
}
.wildcard-vote-option {
  font-size: 1.3rem;
  padding: 1rem;
  height: 100%;
}
.wildcard-completed-story {
  white-space: normal;
  line-height: 1.35;
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(15, 10, 30, 0.88);
  border: 1px solid rgba(255, 84, 112, 0.35);
}
.wildcard-result-card { max-width: 72rem; margin-inline: auto; }
.wildcard-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
}
.wildcard-result-winner {
  background: rgba(34, 197, 94, 0.14);
  border: 2px solid #4ade80;
  margin-bottom: 0.65rem;
}
.wildcard-result-secondary {
  opacity: 0.72;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}
.wildcard-result-answer { color: #f8fafc; font-size: 1.15rem; font-weight: 650; }
.wildcard-result-winner .wildcard-result-answer { color: #86efac; font-size: 1.65rem; font-weight: 850; }
.wildcard-result-author { color: #c4b5fd; font-size: 0.95rem; }
.wildcard-result-winner .wildcard-result-author { color: #fde68a; font-size: 1.1rem; }
.wildcard-result-metrics { display: flex; align-items: baseline; gap: 0.75rem; white-space: nowrap; }
.wildcard-result-votes { color: #fbbf24; font-weight: 750; }
.wildcard-result-points { color: #4ade80; font-weight: 850; font-size: 1.2rem; }
.wildcard-result-winner .wildcard-result-points { font-size: 1.55rem; }
.wildcard-score-movement {
  display: grid;
  grid-template-columns: 2.75rem minmax(8rem, 1fr) auto minmax(4.5rem, auto);
  gap: 0.65rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.35rem;
  border-radius: 8px;
  background: rgba(30, 21, 53, 0.75);
}
.wildcard-score-rank { color: #c4b5fd; font-weight: 800; }
.wildcard-score-player { min-width: 0; font-size: 1.1rem; font-weight: 700; }
.wildcard-score-equation { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wildcard-rank-movement { min-width: 4.5rem; text-align: right; font-size: 0.85rem; }
.wildcard-authored-wait { padding: 0.7rem; border-radius: 10px; background: rgba(251, 191, 36, 0.08); }
.wildcard-my-result { padding: 0.9rem; border-radius: 12px; background: #1e1535; border: 1px solid #4c3b70; }
.wildcard-my-result-winner { border: 2px solid #4ade80; background: rgba(34, 197, 94, 0.12); }
.wildcard-my-result-metrics { display: flex; flex-wrap: wrap; gap: 0.65rem; align-items: center; color: #fbbf24; }
.wildcard-my-result-metrics strong { color: #4ade80; }
.wildcard-all-results summary { color: #c4b5fd; cursor: pointer; padding: 0.5rem; }
.wildcard-phone-result-row { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.35rem 0.2rem; color: #a8a0b8; }
.wildcard-phone-result-winner { color: #86efac; font-weight: 750; }

.wildcard-vote-option,
.player-wildcard-ballot-blank .btn,
.wildcard-completed-story,
.wildcard-result-answer,
.wildcard-result-author,
.wildcard-my-result,
.wildcard-phone-result-row > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.wildcard-phone-result-row > :last-child { flex-shrink: 0; }

@media (max-width: 640px) {
  .wildcard-result-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .wildcard-result-metrics { justify-content: space-between; }
  .wildcard-score-movement { grid-template-columns: 2.5rem 1fr auto; }
  .wildcard-rank-movement { grid-column: 2 / -1; text-align: left; }
}
@keyframes stamp-in {
  0%   { opacity: 0; transform: scale(1.8) rotate(-12deg); }
  55%  { opacity: 1; transform: scale(0.9) rotate(-3deg); }
  100% { opacity: 1; transform: scale(1) rotate(-3deg); }
}

/* ── Animated per-game background ─────────────────────────────────── */
/* Backdrop hue shifts per game (keyed by a `theme-*` class on #app) so a glance
   tells you which activity you're in — like each game's own music track. The
   dark base and ALL foreground colors stay constant across themes; only the
   orb/gradient tint changes, so readability never degrades. Decorative layer:
   aria-hidden, pointer-events:none, sits behind content (below confetti z500,
   pause z9999, zippy z10000). Under prefers-reduced-motion the drift/float stop
   and a clean static tinted gradient remains. */
:root            { --fx-a: #7c3aed; --fx-b: #7dd3fc; }  /* theme-home (default) */
.theme-trivia    { --fx-a: #3b82f6; --fx-b: #7dd3fc; }  /* cool / quiz */
.theme-vibes     { --fx-a: #ec4899; --fx-b: #f59e0b; }  /* warm / social */
.theme-wildcard  { --fx-a: #22c55e; --fx-b: #ff5470; }  /* chaotic / playful */

.bg-fx {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.bg-fx::before {                                  /* slow-drifting gradient wash */
  content: ""; position: absolute; inset: -25%;
  background: linear-gradient(120deg,
      color-mix(in srgb, var(--fx-a) 20%, transparent) 0%,
      transparent 45%,
      color-mix(in srgb, var(--fx-b) 16%, transparent) 100%);
  background-size: 200% 200%;
  animation: bg-drift 32s ease-in-out infinite;
}
@keyframes bg-drift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.bg-orb {                                         /* soft radial orbs (no blur filter) */
  position: absolute; border-radius: 50%;
  width: 40vw; height: 40vw; opacity: 0.12;
  background: radial-gradient(circle at 30% 30%, var(--fx-a), transparent 70%);
  animation: orb-float 30s ease-in-out infinite;
  will-change: transform;
}
.bg-orb:nth-child(1) { top: -10%; left: -8%; animation-duration: 30s; }
.bg-orb:nth-child(2) { bottom: -12%; right: -10%; width: 48vw; height: 48vw;
  background: radial-gradient(circle at 30% 30%, var(--fx-b), transparent 70%);
  animation-duration: 38s; animation-delay: -8s; }
.bg-orb:nth-child(3) { top: 30%; left: 50%; width: 32vw; height: 32vw;
  animation-duration: 34s; animation-delay: -16s; }
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(5vw, -4vh) scale(1.08); }
  66%      { transform: translate(-4vw, 3vh) scale(0.95); }
}
/* Lighter on phones (battery / weak GPUs): fewer, fainter orbs. */
.player-app .bg-orb { opacity: 0.10; }
.player-app .bg-orb:nth-child(3) { display: none; }

/* Real content sits above the backdrop layer. */
.host-screen, .player-screen { position: relative; z-index: 1; }

/* ── Staggered child entrance ─────────────────────────────────────── */
/* Add `stagger` to a foreach/grid container; its direct children cascade in
   when the parent screen un-hides (display:none→block restarts the animation).
   Reuses the card-reveal keyframe. Cascade is capped so long lists don't drag. */
.stagger > * { animation: card-reveal 0.3s ease-out both; }
.stagger > *:nth-child(1) { animation-delay:   0ms; }
.stagger > *:nth-child(2) { animation-delay:  60ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 180ms; }
.stagger > *:nth-child(5) { animation-delay: 240ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }
.stagger > *:nth-child(7) { animation-delay: 360ms; }
.stagger > *:nth-child(8) { animation-delay: 420ms; }
.stagger > *:nth-child(n+9) { animation-delay: 480ms; }

/* ── Low-timer edge vignette ──────────────────────────────────────── */
/* Toggled by the existing isTimerUrgent() computed. Pointer-events:none so it
   never blocks taps. Under reduced-motion the pulse stops but the static red
   edge still signals urgency. */
.timer-vignette {
  position: fixed; inset: 0; z-index: 50;
  pointer-events: none; opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(ellipse at center,
      transparent 55%, rgba(239, 68, 68, 0.45) 100%);
}
.timer-vignette.vignette-on {
  opacity: 1;
  animation: vignette-pulse 0.9s ease-in-out infinite;
}
@keyframes vignette-pulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.9; }
}

/* ── Leader / winner glow ─────────────────────────────────────────── */
.player-bubble.bubble-lead { animation: lead-glow 1.8s ease-in-out infinite; }
@keyframes lead-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 180, 254, 0); }
  50%      { box-shadow: 0 0 18px 2px rgba(216, 180, 254, 0.55); }
}
.result-row.result-winner .result-bar-wrap { animation: winner-glow 1.8s ease-in-out infinite; }
@keyframes winner-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
  50%      { box-shadow: 0 0 22px 3px rgba(251, 191, 36, 0.6); }
}

/* ── Connection status banner ────────────────────────────────────────── */
.conn-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1500;
  background: var(--purple);
  color: white;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
}
.conn-banner.conn-banner-lost {
  background: #ef4444;
}

/* ── Trivia reveal row: bonus icons + points alignment ───────────────── */
.reveal-bonus { white-space: nowrap; }
.reveal-mark  { width: 1.4em; text-align: center; }

/* ── Reaction bar (player, passive phases) ───────────────────────────── */
.reaction-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 900;
  display: flex;
  justify-content: space-evenly;
  gap: 0.4rem;
  padding: 0.6rem 0.6rem calc(0.6rem + env(safe-area-inset-bottom));
  background: rgba(15, 10, 30, 0.92);
  border-top: 1px solid var(--purple);
  backdrop-filter: blur(4px);
}
.reaction-btn {
  flex: 1 1 0;
  font-size: 1.8rem;
  line-height: 1;
  padding: 0.5rem 0;
  background: transparent;
  border: none;
  border-radius: 0.75rem;
  transition: transform 0.1s ease, background 0.15s ease;
}
.reaction-btn:active { transform: scale(1.25); }
.reaction-btn.reaction-btn-cooling {
  opacity: 0.4;
  transform: scale(0.9);
}

/* ── Host reaction particles ─────────────────────────────────────────── */
.reaction-layer {
  position: fixed; inset: 0;
  z-index: 600;
  pointer-events: none;
  overflow: hidden;
}
.reaction-particle {
  position: absolute;
  bottom: -3rem;
  font-size: 2.4rem;
  line-height: 1;
  animation: reaction-float 2.5s ease-in forwards;
  will-change: transform, opacity;
}
@keyframes reaction-float {
  0%   { transform: translate(0, 0) rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--drift, 0px), -100vh) rotate(var(--spin, 12deg)); opacity: 0; }
}
.reveal-pts   { min-width: 3.2em; text-align: right; }

/* ── GameResults winner ceremony: staged podium ──────────────────────── */
.podium-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  min-height: 9rem;
}
.podium-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem 0.75rem 0 0;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid var(--purple);
  min-width: 7rem;
}
.podium-col-second  { order: 1; padding-bottom: 1.5rem; }
.podium-col-third   { order: 3; padding-bottom: 0.75rem; }
.podium-col-champion {
  order: 2;
  padding: 1.25rem 1.75rem 2.5rem;
  background: rgba(251, 191, 36, 0.15);
  border-color: #fbbf24;
}
.podium-rank { font-size: 1.6rem; opacity: 0.75; }
.podium-col-champion .podium-rank { font-size: 2.6rem; opacity: 1; }
.podium-name { font-weight: 700; margin-top: 0.25rem; }
.podium-col-champion .podium-name { font-size: 1.7rem; }
.podium-score { color: #4ade80; font-weight: 700; margin-top: 0.15rem; }
.podium-col-champion .podium-score { font-size: 1.35rem; }

.podium-pop-in {
  animation: podium-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes podium-pop {
  0%   { transform: scale(0.3); opacity: 0; }
  70%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}
.podium-champion-slam {
  animation: podium-slam 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
@keyframes podium-slam {
  0%   { transform: scale(2.2) rotate(-6deg); opacity: 0; }
  55%  { transform: scale(0.92) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg);    opacity: 1; }
}

/* ── Announcer bar (host, snarky one-liner on game beats) ────────────── */
.announcer-bar {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  transform: translateX(-50%);
  z-index: 950;
  max-width: 60vw;
  padding: 0.65rem 1.75rem;
  background: rgba(15, 10, 30, 0.92);
  border: 1px solid var(--purple);
  border-radius: 999px;
  color: #f0eaff;
  font-weight: 700;
  font-size: 1.15rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.4);
  animation: announcer-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes announcer-in {
  0%   { clip-path: inset(0 100% 0 0); opacity: 0; }
  15%  { opacity: 1; }
  100% { clip-path: inset(0 0 0 0); opacity: 1; }
}

/* ── Champion confetti burst (fires once, on the podium's final stage) ──── */
.podium-confetti-layer {
  position: fixed; inset: 0;
  z-index: 620;
  pointer-events: none;
  overflow: hidden;
}
.podium-confetti-piece {
  position: absolute;
  top: -1rem;
  width: 0.5rem;
  height: 0.9rem;
  opacity: 0.9;
  animation: podium-confetti-fall 3s ease-in forwards;
}
@keyframes podium-confetti-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.9; }
  100% { transform: translateY(110vh) rotate(var(--rot, 360deg)); opacity: 0.15; }
}

/* ── Vibes final round: DOUBLE VIBES (gold/amber, subtle pulse) ─────────── */
.double-vibes-banner {
  display: inline-block;
  color: #fbbf24;
  border: 2px solid #fbbf24;
  border-radius: 10px;
  padding: 0.35rem 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 1.1rem;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.25);
  animation: double-vibes-pulse 1.6s ease-in-out infinite;
}
@keyframes double-vibes-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.2); }
  50%      { box-shadow: 0 0 22px rgba(251, 191, 36, 0.55); }
}
.double-vibes-badge {
  display: inline-block;
  color: #fbbf24;
  border: 1.5px solid #fbbf24;
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

/* ── Trivia hot streak (🔥N badge next to a scoreboard name) ─────────────── */
.streak-badge {
  color: #fbbf24;
  font-size: 0.78em;
  font-weight: 700;
  margin-right: 0.35em;
  white-space: nowrap;
}

/* â”€â”€ Sinking Ship: endless realtime shouting game â”€â”€ */
.theme-sinking-ship {
  --fx-a: #0891b2; --fx-b: #f59e0b;
  /* Shared by both the phone panel and the host spectacle screen. */
  --ship-brass: #f6bd4b;
  --ship-brass-dark: #8b5717;
  --ship-wood: #382014;
  --ship-wood-light: #68402b;
  --ship-sea: #0e7490;
}
.ship-intro-copy {
  max-width: 48rem;
  margin-inline: auto;
  color: #e8f7f4;
}
.sinking-ship-mount { max-width: none; }

/* Phone panel */
.player-app.theme-sinking-ship {
  max-width: 40rem;
  background: #07171c;
}
.sinking-ship-panel {
  position: relative;
  min-height: 100dvh;
  padding: max(.75rem, env(safe-area-inset-top)) .75rem max(1.25rem, env(safe-area-inset-bottom));
  color: #f4f7f5;
  background:
    radial-gradient(circle at 88% 2%, rgba(45,212,191,.13), transparent 24rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(165deg, #102a31, #07171c 48%, #081217);
  background-size: auto, 28px 28px, 28px 28px, auto;
  border: 0;
  touch-action: pan-y;
  overscroll-behavior: contain;
  user-select: none;
  overflow: hidden auto;
}
.sinking-ship-panel::before {
  content: ""; position: absolute; inset: 0 0 auto; height: .25rem; pointer-events: none;
  background: linear-gradient(90deg, #f5b942, #ffe29a 45%, #2dd4bf);
}
.ship-panel__status { position: relative; z-index: 3; }
.ship-run-progress {
  display: flex; justify-content: space-between; align-items: center;
  min-height: 2rem; margin-bottom: .5rem; padding: 0 .15rem; letter-spacing: .08em;
}
.ship-run-progress__leg { color: #ffe3a3; font-size: 1rem; letter-spacing: .14em; }
.ship-run-progress__leg::before { content: "\2693"; margin-right: .45rem; color: #f5b942; }
.ship-run-progress__best {
  padding: .28rem .55rem; border: 1px solid #5eead455; border-radius: 99px;
  color: #99f6e4; background: #0f3b3b88; font-size: .68rem;
}
.ship-water-gauge {
  position: relative; height: 1.8rem; overflow: hidden;
  border: 1px solid #5eead455; border-radius: .5rem;
  background: #020a0d; box-shadow: inset 0 0 12px #000a;
}
.ship-water-gauge::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), #d9ffff28 calc(25% - 1px) 25%);
}
.ship-water-gauge__fill {
  position: absolute; inset: 0;
  transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, #0e7490, #22d3ee 68%, #fb7185);
  transition: transform .22s linear;
}
.ship-water-gauge__text {
  position: relative; z-index: 2; display: grid; place-items: center; height: 100%;
  font-size: .7rem; letter-spacing: .14em; text-shadow: 0 1px 4px #001;
}
.ship-command-card {
  position: sticky; top: max(.45rem, env(safe-area-inset-top)); z-index: 20;
  display: grid; gap: .35rem; margin: .65rem 0 .75rem; padding: .8rem .85rem .7rem 1rem;
  border: 1px solid #f7c968aa; border-left: .35rem solid #f5b942; border-radius: .65rem;
  background: linear-gradient(135deg, rgba(31,37,36,.97), rgba(12,23,25,.98));
  box-shadow: 0 10px 28px #000a, inset 0 1px rgba(255,255,255,.06);
  backdrop-filter: blur(10px);
}
.ship-command-card__eyebrow { color: #5eead4; font-size: .65rem; font-weight: 800; letter-spacing: .16em; }
.ship-command-card__text { font-size: clamp(1.15rem, 5vw, 1.5rem); line-height: 1.12; letter-spacing: .015em; text-transform: uppercase; }
.ship-command-card__timer { height: .35rem; margin-top: .15rem; overflow: hidden; border-radius: 99px; background: #02090b; }
.ship-command-card__timer-fill {
  display: block; width: 100%; height: 100%; transform-origin: left;
  background: linear-gradient(90deg, #22c55e, #facc15 65%, #ef4444);
}
.ship-command-card__timer-text { justify-self: end; height: .7rem; color: #fcd34d; font: 800 .66rem/1 ui-monospace, monospace; }
.ship-command-card.is-hurry { animation: ship-command-panic .42s ease-in-out infinite alternate; }
.ship-command-card.is-ghost { border-color: #a78bfa; box-shadow: 0 0 24px #8b5cf688; }
.ship-command-card[data-outcome="done"], .ship-command-card[data-outcome="Done"] { border-color: #4ade80; }
.ship-command-card[data-outcome="expired"],
.ship-command-card[data-outcome="ghost"],
.ship-command-card[data-outcome="Expired"],
.ship-command-card[data-outcome="Ghost"] { border-color: #fb7185; }
@keyframes ship-command-panic { to { transform: scale(1.015) rotate(-.25deg); } }
.ship-command-card.is-procedure { gap: .35rem; }
.ship-command-card.is-procedure .ship-command-card__text { font-size: clamp(.9rem, 3.8vw, 1.15rem); color: #fde68a; }
.ship-command-card.has-step-success { animation: ship-step-success .5s ease-out; }
@keyframes ship-step-success { 45% { border-color: #4ade80; box-shadow: 0 0 0 5px #4ade8044, 0 5px 0 #166534; transform: scale(1.01); } }
.ship-procedure { display: grid; gap: .25rem; }
.ship-procedure[hidden] { display: none; }
.ship-procedure__heading { display: flex; justify-content: space-between; color: #67e8f9; font-size: .62rem; font-weight: 900; letter-spacing: .1em; }
.ship-procedure__progress { color: #fbbf24; }
.ship-procedure__steps { display: grid; gap: .22rem; margin: 0; padding: 0; list-style: none; }
.ship-procedure__steps li {
  display: grid; grid-template-columns: 1.45rem minmax(0, 1fr); align-items: center; gap: 0 .4rem;
  min-width: 0; padding: .25rem .35rem; border: 1px solid #f6bd4b44; border-radius: .35rem;
  color: #d6d3d1; background: #0004;
}
.ship-procedure__steps li > b { grid-row: 1 / 3; display: grid; place-items: center; width: 1.35rem; aspect-ratio: 1; border-radius: 50%; color: #21130f; background: #a8a29e; font-size: .7rem; }
.ship-procedure__steps li > span { min-width: 0; font-size: clamp(.72rem, 3vw, .88rem); font-weight: 900; line-height: 1.08; text-transform: uppercase; overflow-wrap: anywhere; }
.ship-procedure__steps li > small { color: #d6d3d1; font-size: .72rem; line-height: 1.15; text-transform: uppercase; }
.ship-procedure__steps li.is-active { color: #fff7df; border-color: #67e8f9; background: #083344bb; box-shadow: inset 3px 0 #22d3ee; }
.ship-procedure__steps li.is-active > b { background: #67e8f9; }
.ship-procedure__steps li.is-complete { opacity: .6; border-color: #4ade8066; }
.ship-procedure__steps li.is-complete > b { color: #052e16; background: #4ade80; }
.ship-procedure__steps li.is-complete > span { text-decoration: line-through; }
.ship-procedure__steps li.just-completed { animation: ship-step-pop .45s ease-out; }
@keyframes ship-step-pop { 50% { opacity: 1; transform: translateX(.35rem); background: #166534cc; } }

.ship-console-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin: .8rem .15rem .45rem; color: #ffe3a3;
}
.ship-console-heading span { font-size: .74rem; font-weight: 900; letter-spacing: .18em; }
.ship-console-heading small { color: #9db4b5; font-size: .68rem; letter-spacing: .03em; }
.ship-controls {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .65rem;
  padding-bottom: 1rem;
}
.sinking-ship-panel.has-emergency .ship-controls { padding-bottom: 12rem; }
.ship-widget {
  position: relative; min-height: 8.75rem; padding: .65rem;
  border: 1px solid #557077; border-radius: .7rem;
  background:
    radial-gradient(circle at 100% 0, rgba(245,185,66,.08), transparent 9rem),
    linear-gradient(145deg, #1c3035, #101f24);
  box-shadow: 0 7px 18px #0007, inset 0 1px rgba(255,255,255,.06);
  overflow: hidden;
}
.ship-widget button, .ship-widget input, .ship-wheel__face { touch-action: none; }
.ship-widget::after {
  content: ""; position: absolute; inset: .35rem; pointer-events: none;
  border: 1px solid #ffffff0a; border-radius: .45rem;
}
.ship-widget__procedure-tag {
  position: absolute; z-index: 7; right: .35rem; bottom: .35rem; padding: .18rem .35rem;
  border: 1px solid #67e8f9; border-radius: 99px; color: #cffafe; background: #083344e8;
  font-size: .55rem; font-weight: 1000; letter-spacing: .05em; pointer-events: none;
}
.ship-widget__plate {
  position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .6rem;
  align-items: center; margin: -.15rem -.15rem .65rem; padding: .35rem .45rem .5rem;
  border: 0; border-bottom: 1px solid #f5b94266; border-radius: 0;
  color: #fff4d6; background: transparent; box-shadow: none;
}
.ship-widget__plate::after {
  grid-column: 2; grid-row: 1 / 3; align-self: center; color: #f5b942; opacity: .85;
  font-size: 1.1rem; line-height: 1;
}
.ship-widget--lever .ship-widget__plate::after { content: "\2195"; }
.ship-widget--slider .ship-widget__plate::after { content: "\21C6"; }
.ship-widget--wheel .ship-widget__plate::after { content: "\25CE"; }
.ship-widget--sequence .ship-widget__plate::after { content: "1\00B72\00B73"; font-size: .65rem; font-weight: 900; }
.ship-widget--pump .ship-widget__plate::after { content: "\21A5"; }
.ship-widget--signal .ship-widget__plate::after { content: "\25B2"; }
.ship-widget__label { font-size: clamp(.82rem, 3.4vw, .95rem); font-weight: 900; line-height: 1.12; letter-spacing: .035em; text-transform: uppercase; overflow-wrap: break-word; }
.ship-widget__station { color: #85a3a6; font-size: .62rem; font-weight: 700; letter-spacing: .13em; opacity: 1; text-transform: uppercase; }
.ship-widget.is-locked { opacity: .38; filter: grayscale(.8); }
.ship-widget.is-locked::before {
  content: "TENTACLED!"; position: absolute; inset: 48% 0 auto; z-index: 8;
  color: #f0abfc; font-weight: 1000; font-size: 1.05rem; text-align: center; transform: rotate(-8deg);
}
.ship-widget__malfunction {
  position: absolute; z-index: 9; left: .3rem; right: .3rem; bottom: .3rem;
  padding: .2rem .3rem; border: 1px solid #fca5a5; border-radius: .3rem;
  color: #fff1f2; background: #7f1d1de6; font: 900 .58rem/1.1 ui-monospace, monospace;
  letter-spacing: .03em; text-align: center; touch-action: none;
}
.ship-widget.has-malfunction { box-shadow: 0 0 0 2px #fca5a599, 0 7px 18px #0008; }
.ship-widget.is-corrupted .ship-widget__label { color: #d8b4fe; font-style: italic; text-decoration: wavy underline #a78bfa88; }
.ship-widget.is-corrupted .ship-widget__plate { box-shadow: inset 0 0 0 2px #a78bfa77; }
.ship-widget.is-ghost-echo .ship-widget__label { color: #a5f3fc; opacity: .8; filter: blur(.2px); }
.ship-widget.is-ghost-echo .ship-widget__plate { box-shadow: inset 0 0 0 2px #67e8f966; }
.ship-widget.is-action-accepted { animation: ship-widget-accepted .46s ease-out; }
.ship-widget.is-action-wrong { animation: ship-widget-wrong .46s ease-out; }
@keyframes ship-widget-accepted {
  0%, 100% { box-shadow: 0 7px 18px #0007; }
  35% { box-shadow: 0 0 0 4px #4ade8099, 0 7px 18px #0008; background-color: #4ade8033; }
}
@keyframes ship-widget-wrong {
  0%, 100% { transform: translateX(0); box-shadow: 0 7px 18px #0007; }
  15% { transform: translateX(-6px); }
  30% { transform: translateX(5px); box-shadow: 0 0 0 4px #ef444499, 0 7px 18px #0008; background-color: #ef444433; }
  45% { transform: translateX(-4px); }
  60% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
}

.ship-lever__rail {
  position: relative; width: 1rem; height: 4rem; margin: .1rem auto .2rem;
  border: 1px solid #ffffff1a; border-radius: 99px; background: #050c0e; box-shadow: inset 0 0 6px #000;
}
.ship-lever__handle {
  position: absolute; left: 50%; width: 3.8rem; min-height: 48px;
  transform: translate(-50%, calc((1 - var(--ship-lever-position, .5)) * 3.1rem - .5rem));
  border: 2px solid #8b641c; border-radius: 99px; background: linear-gradient(#ffe29a, #d49a31);
  box-shadow: 0 3px 0 #49300b, 0 5px 10px #0008;
}
.ship-lever__positions { display: flex; justify-content: space-between; gap: .35rem; }
.ship-lever__position {
  appearance: none; flex: 1; min-width: 48px; min-height: 48px; padding: .15rem .3rem;
  border: 1px solid #527078; border-radius: .4rem; background: #081316;
  color: #d3e2e1; font-size: .6rem; font-weight: 800; text-align: center;
}
.ship-lever__position.is-current { border-color: #f5c35d; color: #fff2c9; background: #473512; }
.ship-lever__position.is-target { color: #67e8f9; border-color: #67e8f9; font-weight: 900; }

.ship-slider__input { width: 100%; min-height: 52px; accent-color: #f5b942; }
.ship-slider__notches { display: flex; justify-content: space-between; gap: .25rem; color: #b8cdcd; font-size: .58rem; font-weight: 700; }
.ship-slider__readout, .ship-wheel__readout,
.ship-sequence__readout, .ship-signal__entered {
  display: block; width: 100%; margin-top: .35rem; padding: .25rem;
  color: #99f6e4; background: #041315; border: 1px solid #2dd4bf55;
  border-radius: .35rem; font: 800 .68rem/1.2 ui-monospace, monospace; letter-spacing: .04em; text-align: center;
}
.ship-widget.is-drifting { animation: ship-widget-drift .22s ease-in-out infinite alternate; }
@keyframes ship-widget-drift { to { transform: translateX(var(--ship-drift, 2px)) rotate(.4deg); } }

.ship-wheel__face {
  position: relative; width: 5.35rem; aspect-ratio: 1; margin: .1rem auto;
  border: .55rem double #dca13d; border-radius: 50%; background: #101a1c;
  transform: rotate(var(--ship-wheel-angle, 0deg)); touch-action: none;
  box-shadow: 0 5px 14px #0009, inset 0 0 0 2px #ffffff0d;
}
.ship-wheel__hub { position: absolute; inset: 35%; border-radius: 50%; background: #f5bd4f; }
.ship-wheel__spoke { position: absolute; left: 47%; top: -15%; width: 6%; height: 130%; background: #d68a24; transform: rotate(calc(var(--i) * 45deg)); }

.ship-sequence__pad, .ship-signal__pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .28rem; }
.ship-sequence__button, .ship-signal__button, .ship-pump__handle {
  position: relative; z-index: 2; min-width: 48px; min-height: 48px;
  border: 1px solid #f6cb75; border-radius: .45rem;
  color: #171206; background: linear-gradient(#ffe6a8, #dca13d); font-weight: 900;
  box-shadow: 0 3px 0 #704a11, 0 5px 10px #0006; touch-action: manipulation;
}
.ship-sequence__button:active, .ship-signal__button:active, .ship-pump__handle:active { transform: translateY(3px); box-shadow: 0 1px 0 #68400f; }
.ship-sequence__button.is-next { outline: 3px solid #22d3ee; }
.ship-signal__order { min-height: 1.3rem; margin-bottom: .25rem; color: #f0abfc; font-weight: 900; text-align: center; }
.ship-signal__button { padding: .2rem; font-size: .65rem; overflow-wrap: anywhere; }

.ship-pump__handle { display: grid; place-items: center; width: 100%; font-size: .85rem; }
.ship-pump__handle span { font-size: 1.25rem; }
.ship-pump__gauge { height: .7rem; margin-top: .65rem; overflow: hidden; border-radius: 99px; background: #17100c; }
.ship-pump__fill { display: block; width: 100%; height: 100%; transform: scaleX(var(--ship-pump-fill, 0)); transform-origin: left; background: #22d3ee; }

.ship-alert-stack {
  position: relative; z-index: 24; display: grid; gap: .35rem;
}
.ship-hazard-banner {
  margin: 0 0 .15rem; padding: .55rem .7rem;
  border: 1px solid #fda4af; border-left: .3rem solid #fb7185; border-radius: .45rem; color: #fff;
  background: #5d1125ee; font-size: .8rem; font-weight: 1000; text-align: left; letter-spacing: .06em;
  animation: ship-hazard-slam .35s cubic-bezier(.2,1.5,.4,1);
}
@keyframes ship-hazard-slam { from { transform: translateY(-.6rem); opacity: 0; } }
.ship-hazard-banner--ghost-ship, .ship-hazard-banner--siren-song { background: #581c87dd; border-color: #d8b4fe; }
.ship-translator-card {
  margin: 0 0 .15rem; padding: .65rem .75rem;
  border: 1px solid #5eead4; border-left: .3rem solid #2dd4bf; border-radius: .45rem; color: #fff;
  background: #0c4f4aee; display: grid; gap: .15rem;
}
.ship-translator-card__eyebrow { font-size: .68rem; letter-spacing: .1em; color: #99f6e4; font-weight: 700; }
.ship-translator-card__code { font-size: 1.05rem; letter-spacing: .04em; }
.ship-translator-card__decode { font-size: .85rem; color: #f0fdfa; opacity: .9; }
.ship-damage-report {
  position: fixed; inset: 25% .8rem auto; z-index: 80; display: grid; gap: .5rem;
  padding: 1.2rem; border: 4px double var(--ship-brass); border-radius: .8rem;
  color: #fff7df; background: #17100cf2; text-align: center; box-shadow: 0 15px 50px #000;
}
.ship-damage-report strong { color: #fbbf24; font-size: 1.25rem; }
.ship-damage-report em { font-style: italic; color: #fde68a; font-size: .85rem; }
.ship-damage-report em:empty { display: none; }
.ship-paused-overlay { position: fixed; inset: 0; z-index: 95; place-content: center; gap: .5rem; padding: 2rem; background: #08161aee; text-align: center; }
.ship-paused-overlay:not([hidden]) { display: grid; }
.ship-paused-overlay strong { color: #fbbf24; font-size: 1.6rem; }
.ship-emergency-overlay {
  position: fixed; inset: auto .8rem max(1rem, env(safe-area-inset-bottom)); z-index: 90; display: grid; gap: .6rem; place-items: center;
  padding: 1.1rem; border: 3px solid #67e8f9; border-radius: .8rem; text-align: center;
  color: #ecfeff; background: #0e2a33f2; box-shadow: 0 15px 45px #000a;
  animation: ship-hazard-slam .3s cubic-bezier(.2,1.5,.4,1);
}
.ship-emergency-overlay__title { font-size: 1.15rem; font-weight: 1000; letter-spacing: .03em; color: #67e8f9; }
.ship-emergency-overlay__progress { width: 100%; height: .85rem; overflow: hidden; border-radius: 99px; background: #08161a; }
.ship-emergency-overlay__progress-fill { display: block; width: 100%; height: 100%; transform-origin: left; background: #22d3ee; transition: transform .25s ease-out; }
.ship-emergency-overlay__button {
  min-width: 60%; min-height: 52px; padding: .5rem 1.4rem; border: 2px solid var(--ship-sea); border-radius: .5rem;
  color: #032830; background: linear-gradient(#67e8f9, #22d3ee); font-weight: 1000; font-size: 1.05rem;
  letter-spacing: .04em; touch-action: manipulation;
}
.ship-emergency-overlay__button:active { transform: translateY(2px); }
.ship-emergency-overlay__button:disabled { opacity: .55; filter: grayscale(.4); }
.ship-widget button:focus-visible, .ship-widget input:focus-visible,
.ship-emergency-overlay__button:focus-visible {
  outline: 3px solid #67e8f9; outline-offset: 3px;
}
.sinking-ship-panel.is-critical { animation: ship-critical-pulse 1s ease-in-out infinite alternate; }
@keyframes ship-critical-pulse { to { box-shadow: inset 0 0 45px #ef444466; } }

/* Host spectacle */
.sinking-ship-host {
  position: fixed; inset: 0; z-index: 40; padding: 0; overflow: hidden;
  color: #eefcff; background: #03131e;
}
.ship-stage { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(#0a2540, #123a52 55%, #061b2b); }
.ship-stage::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 100px #000b; pointer-events: none; }
.ship-stage__sky { position: absolute; z-index: 1; inset: 0 0 55% 0; overflow: hidden; pointer-events: none; }
.ship-stage__sky i {
  position: absolute; width: .3rem; aspect-ratio: 1; border-radius: 50%;
  background: #ffffffcc; box-shadow: 0 0 6px #ffffff99; animation: ship-star-twinkle 3.4s ease-in-out infinite;
}
.ship-stage__sky i:nth-child(1) { top: 14%; left: 16%; animation-delay: 0s; }
.ship-stage__sky i:nth-child(2) { top: 24%; left: 64%; animation-delay: 1.1s; }
.ship-stage__sky i:nth-child(3) { top: 9%; left: 84%; animation-delay: 2.2s; }
@keyframes ship-star-twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.ship-stage__vessel {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: 10%; width: min(60vw, 780px);
  margin: 0 auto; filter: drop-shadow(0 14px 26px #000a); will-change: transform;
}
.ship-stage__ship-art { width: 100%; height: auto; display: block; overflow: visible; }
.ship-art__hull { fill: #6b4a2f; stroke: #3a2413; stroke-width: 5; }
.ship-art__rail { fill: none; stroke: #d8b46a; stroke-width: 3; opacity: .85; }
.ship-art__sail { fill: #f2ead8; stroke: #cbb98a; stroke-width: 2; }
.ship-art__sail--back { opacity: .82; }
.ship-art__mast { fill: #43301f; }
.ship-art__flag { fill: #ef4444; }
.ship-art__porthole { fill: #0b1220; stroke: #d8b46a; stroke-width: 3; }
.ship-art__eyes circle { fill: #0b1220; }
.ship-art__mouth { fill: none; stroke: #0b1220; stroke-width: 6; stroke-linecap: round; }
.ship-stage__vessel.is-hit { animation: ship-hit-flash .35s ease-out; }
@keyframes ship-hit-flash {
  0% { filter: drop-shadow(0 14px 26px #000a) brightness(2.3) saturate(1.6); }
  100% { filter: drop-shadow(0 14px 26px #000a) brightness(1) saturate(1); }
}
.ship-stage__water {
  position: absolute; z-index: 3; inset: 0; transform: translateY(100%);
  background: linear-gradient(#4ee1f0aa, #08758cdd 14%, #033b58f2);
  box-shadow: 0 -8px 18px #67e8f999; will-change: transform;
}
.ship-stage__water::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: -16px; height: 30px;
  background: radial-gradient(ellipse at 50% 100%, #e6ffff 0 28%, transparent 31%) 0 0/72px 28px repeat-x;
  animation: ship-foam-slide 2s linear infinite;
}
@keyframes ship-foam-slide { to { transform: translateX(72px); } }
.ship-stage__water-readout {
  position: absolute; z-index: 8; left: 1.25rem; top: 1.1rem;
  display: grid; padding: .55rem 1rem; border: 3px solid #f4bd4d; border-radius: .6rem;
  background: #07161ddd; text-align: center; box-shadow: 0 4px 20px #000a;
}
.ship-stage__water-readout strong { color: #67e8f9; font-size: 2rem; line-height: 1; }
.ship-stage__water-readout span { font-size: .65rem; letter-spacing: .16em; }
.ship-stage__hazard {
  position: absolute; z-index: 12; top: 6%; left: 50%; transform: translateX(-50%) rotate(-2deg);
  max-width: 75vw; padding: .55rem 1.8rem; border: 4px double #ffd37c; border-radius: .6rem;
  color: #fff5d5; background: #9f123ddd; font-size: clamp(1.5rem, 4vw, 3.8rem); font-weight: 1000;
  text-align: center; text-shadow: 3px 3px #3b0a18; box-shadow: 0 10px 30px #000a;
  animation: ship-host-hazard .45s cubic-bezier(.18,1.55,.35,1);
}
@keyframes ship-host-hazard { from { transform: translateX(-50%) scale(2.5) rotate(10deg); opacity: 0; } }
.ship-stage__hazard--ghost-ship, .ship-stage__hazard--siren-song { background: #581c87dd; }
.ship-stage__hazard--storm { background: #164e63e8; }
.ship-stage__hazard--kraken { background: #064e3bdd; }
.ship-stage__hazard--whirlpool { background: #1e3a8add; }
.ship-stage__hazard--navy-frigate { background: #7c2d12dd; }
.ship-stage__hazard-item::before { margin-right: .4rem; }
.ship-stage__hazard--kraken::before { content: "🐙"; }
.ship-stage__hazard--whirlpool::before { content: "🌀"; }
.ship-stage__hazard--navy-frigate::before { content: "⚓"; }
.ship-stage__hazard--storm::before { content: "⛈️"; }
.ship-stage__hazard--ghost-ship::before { content: "👻"; }
.ship-stage__hazard--siren-song::before { content: "🎵"; }
.ship-host-dashboard {
  position: absolute; z-index: 10; right: 1rem; bottom: 1rem; width: min(31vw, 30rem);
  max-height: 62vh; padding: .75rem; border: 3px solid #b7791f; border-radius: .75rem;
  background: #160e0bd9; box-shadow: 0 10px 35px #000b; overflow: hidden;
}
.ship-activity-pips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .55rem; }
.ship-activity-pip { display: flex; align-items: center; gap: .25rem; padding: .2rem .45rem; border-radius: 99px; background: #ffffff12; font-size: .7rem; }
.ship-activity-pip i { width: .65rem; aspect-ratio: 1; border-radius: 50%; background: var(--player-color); box-shadow: 0 0 10px var(--player-color); }
.ship-activity-pip.is-active { animation: ship-pip-pop .4s ease-out; }
.ship-activity-pip.is-disconnected { opacity: .35; }
@keyframes ship-pip-pop { 50% { transform: scale(1.35); background: #ffffff33; } }
.ship-command-feed { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.ship-command-feed__item { display: grid; padding: .35rem .5rem; border-left: 4px solid #4ade80; background: #ffffff0d; font-size: .78rem; animation: ship-feed-in .25s ease-out; }
.ship-command-feed__item--expired, .ship-command-feed__item--ghost,
.ship-command-feed__item--Expired, .ship-command-feed__item--Ghost { border-color: #fb7185; }
.ship-command-feed__item--flavor { border-color: #f4bd4d; font-style: italic; }
.ship-command-feed__item span { color: #cbd5e1; }
@keyframes ship-feed-in { from { transform: translateX(2rem); opacity: 0; } }
.ship-run-summary { margin-top: .6rem; padding-top: .6rem; border-top: 2px dashed #b7791f88; display: grid; gap: .4rem; }
.ship-run-summary__title { font-size: .72rem; letter-spacing: .12em; color: #fbbf24; }
.ship-run-summary__superlatives { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.ship-run-summary__superlatives li { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; }
.ship-run-summary__superlatives li strong { color: #cbd5e1; font-weight: 600; }
.ship-run-summary__superlatives li span { color: #fde68a; text-align: right; }
.sinking-ship-host.is-critical .ship-stage { filter: saturate(1.2) contrast(1.08); }
.sinking-ship-host.is-doomed::after { content: ""; position: absolute; z-index: 9; inset: 0; pointer-events: none; box-shadow: inset 0 0 12vw #ef444488; animation: ship-doomed 1s ease-in-out infinite alternate; }
@keyframes ship-doomed { to { opacity: .28; } }
.sinking-ship-host.is-sunk .ship-stage { filter: brightness(.45) saturate(.65); }
.sinking-ship-host.is-sunk .ship-stage::after { background: #02061766; animation: ship-doom-flash 1.1s ease-out; }
@keyframes ship-sink { to { transform: translateY(18vh) rotate(-4deg); filter: brightness(.5) saturate(.7); } }
@keyframes ship-doom-flash { 0% { background: #ef4444aa; } 100% { background: #02061766; } }

.ship-results-card {
  position: fixed; z-index: 30; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); width: min(42rem, calc(100% - 1.5rem));
  transform: translateX(-50%); display: grid; gap: .55rem; padding: 1rem 1.2rem;
  color: #fff7df; background: #21130fee; border: 3px solid var(--ship-brass); border-radius: 1rem;
  box-shadow: 0 12px 45px #000c; backdrop-filter: blur(8px);
}
.ship-results-card__title { color: #fbbf24; font-size: clamp(1.25rem, 3.5vw, 2.2rem); letter-spacing: .06em; }
.ship-results-card__tally { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; font-size: 1.25rem; }
.ship-results-card__tally small { flex-basis: 100%; color: #cbd5e1; }

.ship-countdown-badge {
  position: fixed; z-index: 85; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 5rem; aspect-ratio: 1; border-radius: 50%;
  border: 4px solid var(--ship-brass); background: #21130fee; color: #fff7df;
  font-size: 2.4rem; font-weight: 1000; box-shadow: 0 12px 40px #000c;
  animation: ship-countdown-pop .5s ease-out;
}
.ship-countdown-badge--urgent { border-color: #ef4444; color: #fecaca; animation: ship-countdown-pop .5s ease-out, ship-countdown-urgent .5s ease-in-out infinite alternate; }
@keyframes ship-countdown-pop { from { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
@keyframes ship-countdown-urgent { to { box-shadow: 0 12px 40px #ef444488; } }

@media (max-width: 640px) {
  .ship-controls { gap: .6rem; }
  .ship-command-card.is-procedure { position: relative; top: auto; }
  .ship-procedure__steps { max-height: 34dvh; overflow-y: auto; overscroll-behavior: contain; }
}
@media (min-width: 560px) {
  .ship-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ship-widget { min-height: 9rem; }
}
@media (max-width: 360px) {
  .sinking-ship-panel { padding-inline: .55rem; }
  .ship-command-card { padding-inline: .7rem; }
  .ship-console-heading small { display: none; }
  .ship-widget { padding-inline: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ship-command-card.is-hurry, .sinking-ship-panel.is-critical,
  .ship-widget.is-drifting, .ship-stage__water::before,
  .sinking-ship-host.is-doomed::after { animation: none !important; }
}

/* Pop Parade */
.lobby-preview-pop, .pop-field { background: radial-gradient(ellipse at 50% 110%, #3566a4, #151c48 72%); }
.lobby-preview-pop::before, .pop-field::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 20% 20%, #ffffff33 1px, transparent 2px), radial-gradient(circle at 75% 35%, #ffffff33 1px, transparent 2px); background-size: 65px 73px, 91px 89px; }
.pop-preview-bubble, .pop-bubble { border: 2px solid #b9f7ff; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #fff 0 5%, #b7f7ffbb 9%, #65dced88 38%, #7678e6bb 100%); box-shadow: inset -3px -4px 8px #5546bb77, 0 0 12px #81eaff77; }
.pop-preview-bubble { position: absolute; width: 25%; aspect-ratio: 1; }
.pop-preview-one { top: 19%; left: 18%; }
.pop-preview-two { top: 48%; left: 52%; width: 20%; }
.pop-preview-mine { position: absolute; top: 16%; right: 20%; color: #ffb067; font-size: 2.5rem; text-shadow: 0 0 12px #ff6748; }
.pop-field { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.pop-field:focus-visible { outline: 3px solid white; outline-offset: -3px; }
.pop-target { position: absolute; width: 13.75%; aspect-ratio: 1; padding: 0; transform: translate(-50%, -50%); cursor: pointer; touch-action: none; }
.pop-target:focus-visible { outline: 3px solid #fff; outline-offset: 3px; z-index: 2; }
.pop-mine { border: 0; background: #ff8f58; clip-path: polygon(50% 0%, 60% 23%, 80% 7%, 77% 30%, 100% 24%, 85% 45%, 100% 55%, 78% 62%, 84% 85%, 61% 77%, 50% 100%, 39% 77%, 16% 85%, 22% 62%, 0 55%, 15% 45%, 0 24%, 23% 30%, 20% 7%, 40% 23%); }
.pop-mine::after { content: ''; position: absolute; inset: 26%; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #ffe79f, #e74648 75%); }
 .pop-shell { width: min(320px, calc(100vw - 24px), calc((100dvh - 125px) * 2 / 3)); }
.pop-hud { display: flex; justify-content: space-between; align-items: baseline; min-height: 25px; gap: 8px; padding: 0 3px 4px; color: #d8e7ff; font-size: .78rem; }
.pop-hud strong { color: #ffe381; font: 900 1rem monospace; }
.pop-hud span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-burst { position: absolute; width: 13.75%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid #d7fbff; border-radius: 50%; pointer-events: none; animation: pop-burst .25s ease-out forwards; }
@keyframes pop-burst { to { transform: translate(-50%, -50%) scale(1.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pop-burst { animation-duration: .01ms; } }
