/* ─────────────────────────────────────────────────────────────
   den — everything reads like it's playing on the old tv:
   amber phosphor, scanlines, glowing outlined boxes.
   ───────────────────────────────────────────────────────────── */

:root {
  --bg: #0c0702;
  --panel: rgba(20, 12, 5, 0.88);
  --ink: #ffc878;          /* amber phosphor */
  --ink-bright: #ffe9bf;
  --ink-mid: #c9a065;
  --ink-dim: #8f6c3e;
  --ink-err: #ff9468;
  --amber: #ffb163;
  --line: rgba(255, 177, 99, 0.22);
  --line-strong: rgba(255, 177, 99, 0.5);
  --glow: 0 0 9px rgba(255, 190, 110, 0.55);
  --glow-strong: 0 0 14px rgba(255, 200, 120, 0.8);
  --scanlines: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.28) 0px,
    rgba(0, 0, 0, 0.28) 1px,
    transparent 1px,
    transparent 3px
  );
  --font-crt: "VT323", monospace;
  --font-ui: "Outfit", system-ui, sans-serif;
  --font-hand: "Caveat", cursive;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-crt);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

::selection { background: rgba(255, 177, 99, 0.4); color: #1a0e02; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 177, 99, 0.25);
  border-radius: 2px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 177, 99, 0.45); background-clip: content-box; }

/* ── backdrop ─────────────────────────────────────────────── */

#scene-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 1;
  transition: opacity 1s ease;
}
#scene-container canvas { display: block; width: 100%; height: 100%; }

body.in-room #scene-container { opacity: 0; pointer-events: none; }

#vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 42%, transparent 55%, rgba(6, 3, 0, 0.62) 100%);
}

body.in-room {
  background:
    radial-gradient(ellipse 110% 90% at 50% 30%, #19100a 0%, #0c0702 70%);
}

#tv-hidden-input {
  position: fixed;
  bottom: 4px;
  left: 50%;
  width: 12px;
  height: 12px;
  opacity: 0.01;
  border: 0;
  padding: 0;
  background: transparent;
  color: transparent;
  pointer-events: none;
  z-index: 0;
}

/* ── screens ──────────────────────────────────────────────── */

#ui { position: relative; z-index: 2; height: 100%; pointer-events: none; }
#ui .screen.visible { pointer-events: auto; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease, visibility 0.7s;
  padding: 22px;
}
.screen.visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* ── crt widgets ──────────────────────────────────────────── */

.btn {
  background: rgba(255, 177, 99, 0.06);
  border: 2px solid var(--line-strong);
  border-radius: 4px;
  color: var(--ink);
  padding: 9px 20px 7px;
  font-size: 1.18rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: var(--glow);
  box-shadow: inset 0 0 12px rgba(255, 170, 90, 0.07);
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}
.btn:hover {
  background: rgba(255, 177, 99, 0.16);
  color: var(--ink-bright);
  border-color: var(--ink);
  box-shadow: inset 0 0 16px rgba(255, 170, 90, 0.12), 0 0 18px rgba(255, 170, 90, 0.25);
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  color: var(--ink-bright);
  border-color: var(--ink);
  background: rgba(255, 177, 99, 0.14);
}
.btn-ghost { border-color: var(--line); color: var(--ink-mid); }
.btn-ghost:hover { color: var(--ink); }
.btn-amber { border-color: var(--ink); color: var(--ink-bright); }
.btn-small { padding: 6px 13px 5px; font-size: 1rem; }

.icon-btn {
  background: rgba(255, 177, 99, 0.06);
  border: 1px solid var(--line);
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex: none;
  transition: background 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: rgba(255, 177, 99, 0.16); border-color: var(--line-strong); }

.text-input {
  width: 100%;
  background: rgba(8, 4, 1, 0.8);
  border: 2px solid var(--line);
  border-radius: 4px;
  color: var(--ink-bright);
  caret-color: var(--amber);
  padding: 9px 14px 7px;
  font-size: 1.22rem;
  line-height: 1.2;
  outline: none;
  text-shadow: var(--glow);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.text-input::placeholder { color: var(--ink-dim); text-shadow: none; }
.text-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px rgba(255, 177, 99, 0.3), 0 0 18px rgba(255, 170, 90, 0.18);
}

.crt-panel {
  background:
    var(--scanlines),
    linear-gradient(180deg, rgba(26, 16, 7, 0.92), rgba(14, 8, 3, 0.94));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow:
    inset 0 0 46px rgba(0, 0, 0, 0.55),
    0 10px 36px rgba(0, 0, 0, 0.55);
}

/* ── loading — like the set warming up ────────────────────── */

.loading-inner { text-align: center; max-width: 480px; width: 100%; }

.brand-title {
  font-family: var(--font-crt);
  font-weight: 400;
  font-size: clamp(4.4rem, 12vw, 7rem);
  margin: 0;
  color: var(--ink-bright);
  text-shadow:
    0 0 12px rgba(255, 200, 120, 0.9),
    0 0 46px rgba(255, 170, 90, 0.45);
  animation: phosphor 3.2s ease-in-out infinite;
}
@keyframes phosphor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.86; }
}

.brand-sub {
  font-size: 1.4rem;
  color: var(--ink-dim);
  margin: 2px 0 40px;
  letter-spacing: 0.06em;
}

.loading-bar {
  height: 8px;
  border-radius: 2px;
  background: rgba(255, 200, 140, 0.08);
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 0 auto;
  max-width: 300px;
}
.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--amber);
  box-shadow: 0 0 16px rgba(255, 177, 99, 0.9);
  transition: width 0.15s linear;
}

.loading-status {
  margin-top: 18px;
  color: var(--ink-dim);
  font-size: 1.1rem;
}

.loading-sound-hint {
  margin-top: 36px;
  font-size: 1rem;
  color: var(--ink-dim);
}

/* ── tv hint + sound toggle ───────────────────────────────── */

#tv-hint {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(20, 12, 5, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 10px 22px;
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--ink-bright);
  pointer-events: none;
  animation: hintBob 2.8s ease-in-out infinite;
}
#tv-hint[hidden] { display: none; }
@keyframes hintBob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.85; }
  50% { transform: translateX(-50%) translateY(-7px); opacity: 1; }
}

#sound-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  width: 46px;
  height: 46px;
  border-radius: 6px;
  background: rgba(20, 12, 5, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  font-size: 1.2rem;
  transition: transform 0.15s, border-color 0.15s, opacity 0.15s;
}
#sound-toggle:hover { transform: scale(1.08); border-color: var(--line-strong); }
#sound-toggle.muted { opacity: 0.5; }
body.in-room #sound-toggle { display: none; } /* the room belongs to the movie */

/* ── room — the watch ui, broadcast in the same band ──────── */

.room-screen {
  justify-content: stretch;
  align-items: stretch;
  padding: 0;
}

.room-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background:
    var(--scanlines),
    linear-gradient(180deg, rgba(22, 13, 5, 0.9), rgba(14, 8, 3, 0.9));
}

.room-head-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.room-head-right { display: flex; align-items: center; gap: 10px; }

.brand-small {
  font-family: var(--font-crt);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--ink-bright);
  text-shadow: var(--glow-strong);
}

.room-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 177, 99, 0.07);
  border: 2px solid var(--line-strong);
  color: var(--ink-bright);
  border-radius: 4px;
  padding: 5px 13px 4px;
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 0.22em;
  text-shadow: var(--glow);
  transition: background 0.15s, border-color 0.15s;
}
.room-code-pill::before { content: "CH▸"; font-size: 0.85rem; color: var(--ink-dim); letter-spacing: 0.08em; text-shadow: none; }
.room-code-pill:hover { background: rgba(255, 177, 99, 0.16); border-color: var(--ink); }
.room-code-pill svg { opacity: 0.6; }

.room-members { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 3px 8px;
  border-radius: 4px;
  background: rgba(255, 230, 195, 0.05);
  border: 1px solid var(--mc, var(--amber));
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--ink-bright);
  box-shadow: 0 0 10px color-mix(in srgb, var(--mc, var(--amber)) 35%, transparent);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.member-chip:hover { background: rgba(255, 230, 195, 0.11); }
.member-chip.me { opacity: 0.92; cursor: default; }
.member-chip.armed {
  color: #ffd9cc;
  animation: armedPulse 0.55s ease-in-out infinite alternate;
}
@keyframes armedPulse {
  from { box-shadow: 0 0 8px rgba(255, 106, 74, 0.45); }
  to { box-shadow: 0 0 18px rgba(255, 106, 74, 0.9); }
}
.member-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.room-body {
  flex: 1;
  display: flex;
  gap: 14px;
  padding: 14px;
  min-height: 0;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* the player sits in its own little set */
.player-shell {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #050301;
  border-radius: 10px;
  border: 2px solid rgba(255, 177, 99, 0.28);
  overflow: hidden;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.6),
    0 0 0 6px rgba(60, 34, 14, 0.55),
    0 14px 44px rgba(0, 0, 0, 0.6);
}

#player-mount, .player-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
#player-mount iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
#player-mount video { object-fit: contain; background: #000; }

.player-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink-mid);
  text-align: center;
  padding: 20px;
  background: var(--scanlines);
}
.player-empty p { margin: 2px 0; font-size: 1.25rem; text-shadow: var(--glow); }
.player-empty-emoji { font-size: 2.6rem; margin-bottom: 8px; animation: bob 3.4s ease-in-out infinite; }
.player-empty-hint { font-size: 1rem !important; color: var(--ink-dim); text-shadow: none !important; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.embed-wrap { position: absolute; inset: 0; }
.embed-banner {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(14, 8, 3, 0.92);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 10px 7px 16px;
  font-size: 1.02rem;
  color: var(--ink-mid);
  max-width: min(92%, 660px);
  z-index: 5;
}
.embed-banner-x {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 0.9rem;
  padding: 4px 8px;
}
.embed-banner-x:hover { color: var(--ink-bright); }

.companion {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    var(--scanlines),
    radial-gradient(ellipse 90% 70% at 50% 30%, rgba(86, 48, 20, 0.45), transparent 70%),
    #080401;
}
.companion-inner { text-align: center; padding: 28px; max-width: 520px; }
.companion-emoji { font-size: 2.8rem; margin-bottom: 12px; }
.companion h3 {
  font-size: 1.9rem;
  font-weight: 400;
  margin: 0 0 10px;
  color: var(--ink-bright);
  text-shadow: var(--glow-strong);
}
.companion p { color: var(--ink-mid); line-height: 1.5; margin: 0 0 22px; font-size: 1.15rem; }
.companion-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.companion-hint {
  margin-top: 20px !important;
  font-family: var(--font-hand);
  font-size: 1.2rem !important;
  color: var(--ink-dim) !important;
}

.sync-toast {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  background: rgba(14, 8, 3, 0.9);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 6px 13px 5px;
  font-size: 1.05rem;
  color: var(--ink-bright);
  text-shadow: var(--glow);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.sync-toast.show { opacity: 1; transform: none; }

.reaction-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}
.float-reaction {
  position: absolute;
  bottom: -40px;
  font-size: 2rem;
  animation: floatUp var(--dur, 2.6s) ease-out forwards;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}
@keyframes floatUp {
  0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
  12% { opacity: 1; transform: translate(calc(var(--drift) * 0.15), -8vh) scale(1.15); }
  100% { transform: translate(var(--drift), -78vh) scale(0.95); opacity: 0; }
}

.under-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 36px;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 1.18rem;
}
.np-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  flex: none;
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.np-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-bright);
  text-shadow: var(--glow);
}
.np-type {
  flex: none;
  font-size: 0.95rem;
  color: var(--ink-dim);
  padding: 2px 0;
  letter-spacing: 0.05em;
}
.np-type::before { content: "[ "; }
.np-type::after { content: " ]"; }

.reaction-bar { display: flex; gap: 6px; }
.reaction-btn {
  background: rgba(255, 230, 195, 0.05);
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 1.15rem;
  padding: 5px 10px;
  transition: transform 0.14s, background 0.14s, border-color 0.14s;
}
.reaction-btn:hover { transform: scale(1.15) rotate(-5deg); background: rgba(255, 230, 195, 0.12); border-color: var(--line); }
.reaction-btn:active { transform: scale(0.92); }

.media-bar { display: flex; gap: 10px; }
.media-input { flex: 1; min-width: 0; }

/* ── sidebar ──────────────────────────────────────────────── */

.sidebar {
  width: 340px;
  flex: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar.crt, aside.sidebar {
  background:
    var(--scanlines),
    linear-gradient(180deg, rgba(24, 14, 6, 0.92), rgba(13, 7, 3, 0.94));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 0 46px rgba(0, 0, 0, 0.5), 0 10px 36px rgba(0, 0, 0, 0.5);
}

.side-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.side-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 1.25rem;
  padding: 11px 0 9px;
  letter-spacing: 0.08em;
  transition: color 0.15s, text-shadow 0.15s;
  position: relative;
}
.side-tab:hover { color: var(--ink-mid); }
.side-tab.active { color: var(--ink-bright); text-shadow: var(--glow); }
.side-tab.active::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  bottom: -1px;
  height: 2px;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

.queue-count {
  display: inline-block;
  min-width: 18px;
  font-size: 0.95rem;
  color: var(--ink-bright);
  margin-left: 2px;
}
.queue-count:not(:empty)::before { content: "["; color: var(--ink-dim); }
.queue-count:not(:empty)::after { content: "]"; color: var(--ink-dim); }

.side-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.side-panel[hidden] { display: none; }

.chat-scroll, .queue-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.chat-msg { max-width: 90%; }
.chat-msg.continued { margin-top: -4px; }
.chat-msg.mine { align-self: flex-end; }
.chat-msg.pop { animation: msgPop 0.3s ease; }
@keyframes msgPop {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.chat-author {
  font-size: 1rem;
  margin: 4px 2px 3px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 8px currentColor;
}
.chat-msg.mine .chat-author { text-align: right; }

.chat-bubble {
  background: rgba(255, 200, 140, 0.05);
  border: 1px solid rgba(255, 200, 140, 0.16);
  border-radius: 2px 6px 6px 6px;
  padding: 7px 12px 6px;
  font-size: 1.16rem;
  line-height: 1.35;
  color: var(--ink-bright);
  overflow-wrap: anywhere;
}
.chat-msg.mine .chat-bubble {
  background: rgba(255, 177, 99, 0.11);
  border-color: rgba(255, 177, 99, 0.3);
  border-radius: 6px 2px 6px 6px;
}

.chat-msg.system {
  align-self: center;
  text-align: center;
  font-size: 1rem;
  color: var(--ink-dim);
  padding: 1px 8px;
}
.chat-msg.system::before { content: "· "; }
.chat-msg.system::after { content: " ·"; }

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}
.chat-input { flex: 1; min-width: 0; padding: 8px 12px 6px; font-size: 1.12rem; }
.btn-send { padding: 0 16px; flex: none; }

.queue-empty {
  color: var(--ink-dim);
  text-align: center;
  font-size: 1.1rem;
  margin-top: 30px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 200, 140, 0.04);
  border: 1px solid rgba(255, 200, 140, 0.14);
  border-radius: 4px;
  padding: 9px 11px 8px;
  transition: background 0.15s, border-color 0.15s;
}
.queue-item:hover { background: rgba(255, 200, 140, 0.09); border-color: var(--line-strong); }
.queue-item-main { flex: 1; min-width: 0; }
.queue-item-title {
  font-size: 1.12rem;
  color: var(--ink-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-item-sub {
  font-size: 0.95rem;
  color: var(--ink-dim);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-item .icon-btn { width: 30px; height: 30px; font-size: 0.85rem; }

/* ── announce: big text across the screen ─────────────────── */

#announce-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 5vw;
  pointer-events: none;
  background:
    var(--scanlines),
    radial-gradient(ellipse at center, rgba(20, 12, 5, 0.82), rgba(6, 3, 0, 0.92));
  opacity: 0;
  transition: opacity 0.4s ease;
}
#announce-overlay.show { opacity: 1; }
#announce-overlay[hidden] { display: none; }

.announce-text {
  font-family: var(--font-crt);
  font-size: clamp(2.6rem, 9vw, 7.5rem);
  line-height: 1.05;
  text-align: center;
  color: var(--ink-bright);
  text-shadow:
    0 0 16px rgba(255, 200, 120, 0.9),
    0 0 70px rgba(255, 170, 90, 0.5);
  overflow-wrap: anywhere;
  max-width: 100%;
  animation: phosphor 2.4s ease-in-out infinite;
}
.announce-text.pop { animation: announceIn 0.55s cubic-bezier(0.16, 1.3, 0.4, 1), phosphor 2.4s ease-in-out 0.55s infinite; }
@keyframes announceIn {
  0% { transform: scale(1.6); opacity: 0; filter: blur(6px); }
  60% { opacity: 1; }
  100% { transform: scale(1); filter: blur(0); }
}

.announce-by {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--ink-mid);
}

/* ── countdown overlay ────────────────────────────────────── */

#countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    var(--scanlines),
    radial-gradient(ellipse at center, rgba(26, 15, 6, 0.9), rgba(8, 4, 1, 0.97));
}
#countdown-overlay[hidden] { display: none; }

.countdown-number {
  font-family: var(--font-crt);
  font-size: clamp(7rem, 24vw, 14rem);
  color: var(--ink-bright);
  text-shadow: 0 0 18px rgba(255, 200, 120, 0.9), 0 0 70px rgba(255, 170, 90, 0.45);
  line-height: 1;
}
.countdown-number.bump { animation: bump 0.5s cubic-bezier(0.18, 1.4, 0.4, 1); }
@keyframes bump {
  0% { transform: scale(1.45); opacity: 0.2; }
  100% { transform: scale(1); opacity: 1; }
}

.countdown-by {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--ink-mid);
}

/* ── toasts ───────────────────────────────────────────────── */

#toasts {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(20, 12, 5, 0.94);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 9px 20px 7px;
  font-size: 1.12rem;
  color: var(--ink-bright);
  text-shadow: var(--glow);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 18px rgba(255, 170, 90, 0.12);
  animation: toastIn 0.35s cubic-bezier(0.18, 1.2, 0.4, 1);
}
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 0.45s, transform 0.45s; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to { opacity: 1; transform: none; }
}

/* ── responsive ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .room-body { flex-direction: column; padding: 10px; gap: 10px; }
  .sidebar { width: 100%; flex: none; height: 38vh; min-height: 240px; }
  .player-shell { min-height: 38vh; }
  .stage { flex: none; }
  .room-head { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .room-members { order: 3; width: 100%; justify-content: flex-start; }
  .member-name { max-width: 72px; }
  .under-player { flex-wrap: wrap; }
  .media-bar { flex-wrap: wrap; }
  .media-input { flex-basis: 100%; }
  body.in-room { overflow: auto; }
  .room-screen { position: relative; min-height: 100dvh; }
  #tv-hint { bottom: 26px; font-size: 1.15rem; }
}

@media (max-width: 520px) {
  .reaction-bar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .float-reaction, .player-empty-emoji, .np-dot, #tv-hint, .brand-title { animation: none; }
  .screen { transition: opacity 0.3s; transform: none; }
}
