:root {
  color-scheme: light;
  --bg: #0a120d;
  --bg-soft: #0f1a14;
  --ink: #d7f2d0;
  --muted: #6c8a73;
  --accent: #7edb6d;
  --accent-2: #5fbf5a;
  --card: #122018;
  --surface: #16261c;
  --surface-2: #1b2f22;
  --surface-3: #0b150f;
  --glow: 0 0 0 2px rgba(0, 0, 0, 0.75), 6px 6px 0 rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #0f1a14, var(--bg) 55%, #07100b);
  min-height: 100vh;
  min-height: 100svh;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

body::before {
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.22) 0,
    rgba(0, 0, 0, 0.22) 2px,
    rgba(0, 0, 0, 0) 3px,
    rgba(0, 0, 0, 0) 6px
  );
  mix-blend-mode: multiply;
  opacity: 0.3;
  filter: blur(0.2px);
  animation: scan 8s linear infinite;
}

body::after {
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.25), transparent 65%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.12));
  mix-blend-mode: multiply;
  opacity: 0.28;
  animation: flicker 4s ease-in-out infinite;
}

@keyframes scan {
  0% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(4px);
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.48;
  }
  50% {
    opacity: 0.62;
  }
}

.join {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 10;
}

.join__card {
  width: min(420px, 90vw);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 28px;
  border: 2px solid #000;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
}

.join__tag {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.join__copy {
  color: var(--muted);
  margin: 0 0 18px;
}

.join__form {
  display: grid;
  gap: 12px;
}

.join__form input {
  border-radius: 10px;
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  font-size: 1rem;
}

.join__form button {
  border: 2px solid #000;
  border-radius: 10px;
  padding: 12px 16px;
  background: #000;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.7);
}

.join__status {
  min-height: 1.2em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

body.is-joined .join {
  display: none;
}

.room {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 24px 16px;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}


.room__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.room__tag {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 12px;
}

h1 {
  margin: 0;
  font-family: "Rubik Mono One", sans-serif;
  font-size: clamp(1.1rem, 2.1vw, 1.8rem);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.room__back {
  text-decoration: none;
  color: var(--ink);
  border: 2px solid #000;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

.room__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room__actions button {
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

.scene {
  position: relative;
  padding: 0;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
  border: 2px solid #000;
  box-shadow: var(--glow);
  overflow: hidden;
  height: 100%;
  z-index: 0;
}

.scene__canvas {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

.scene__hud {
  display: none;
}

.scene__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.scene__youtube {
  position: absolute;
  left: 50%;
  top: 22%;
  width: min(32vw, 340px);
  aspect-ratio: 16 / 9;
  --frame: 10px;
  --drag-x: 0px;
  --drag-y: 0px;
  padding: var(--frame);
  background: linear-gradient(160deg, #0b0f10, #11191a);
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid #050707;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 30px rgba(74, 220, 180, 0.15),
    inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  display: none;
  transform: translate(-50%, -50%) translate(var(--drag-x), var(--drag-y))
    perspective(1600px) rotateX(2deg) rotateY(0deg) scale(0.8);
  transform-origin: 50% 50%;
  z-index: 2;
}

.scene__youtube.is-active {
  display: block;
}

.scene__youtube iframe,
.scene__youtube #yt-player {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  filter: saturate(1.15) contrast(1.08) brightness(1.05);
}

.scene__youtube-handle {
  position: absolute;
  left: var(--frame);
  right: var(--frame);
  top: var(--frame);
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(20, 40, 32, 0.9), rgba(10, 18, 16, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(200, 255, 235, 0.8);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  z-index: 3;
  user-select: none;
  touch-action: none;
  mix-blend-mode: screen;
}

.scene__youtube-handle:active {
  cursor: grabbing;
}

.scene__youtube::before,
.scene__youtube::after {
  content: "";
  position: absolute;
  inset: var(--frame);
  pointer-events: none;
  z-index: 2;
}

.scene__youtube::before {
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0) 6%,
      rgba(0, 0, 0, 0.15) 50%,
      rgba(255, 255, 255, 0.04) 100%
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.2) 0px,
      rgba(0, 0, 0, 0.2) 1px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0) 3px
    );
  mix-blend-mode: screen;
  opacity: 0.35;
  animation: crt-scan 6s linear infinite;
}

.scene__youtube::after {
  background: radial-gradient(
    circle at 50% 45%,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(0, 0, 0, 0.2) 45%,
    rgba(0, 0, 0, 0.6) 100%
  );
  opacity: 0.55;
  animation: crt-flicker 2.8s infinite;
}

.scene__debug {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--ink);
  font-size: 0.75rem;
  z-index: 5;
}


.room__layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr) minmax(220px, 280px);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.room__layout .columns {
  display: grid;
  gap: 16px;
  position: sticky;
  top: 0;
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  max-height: 100%;
  overflow: auto;
}

.room__layout .panel {
  padding: 18px;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel__close {
  display: none;
  border: 2px solid #000;
  background: #000;
  color: var(--accent);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.65);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.room__layout .chat {
  height: 160px;
}

.room__layout .scene {
  grid-column: 2;
  grid-row: 1;
}

.room__layout .panel--vibe {
  grid-column: 3;
  grid-row: 1;
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100%;
  overflow: auto;
}

.scene__stage {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 2;
  overflow: visible;
}

.speaker-stack {
  width: 110px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
}

.speaker {
  width: 96px;
  border-radius: 18px;
  background: linear-gradient(160deg, #17251c, #0b140f);
  border: 2px solid rgba(0, 0, 0, 0.6);
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.speaker::before,
.speaker::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #0b150f 30%, #23402f 70%);
  border: 3px solid rgba(0, 0, 0, 0.6);
}

.speaker::before {
  width: 48px;
  height: 48px;
  top: 18px;
}

.speaker::after {
  width: 64px;
  height: 64px;
  bottom: 14px;
}

.speaker--tall {
  height: 160px;
}

.speaker--short {
  height: 108px;
}

.booth {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.booth__djs {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 18px;
  margin-bottom: -18px;
  overflow: visible;
}

.dj {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.dj__name {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
}

.dj__slot {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  border: 2px dashed #000;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  background: var(--surface);
}

.dj__card {
  width: 140px;
  display: grid;
  gap: 6px;
  justify-items: center;
}

.dj__model {
  width: 140px;
  height: 110px;
  background: transparent;
  border-radius: 18px;
  padding: 6px;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.dj__card {
  padding-top: 6px;
}

.dj__model .meebit-vrm {
  width: 100%;
  height: 100%;
}

.booth__console {
  width: min(560px, 100%);
  background: linear-gradient(180deg, var(--surface-2), var(--surface-3));
  border-radius: 14px;
  padding: 18px 20px;
  border: 2px solid #000;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
  transform: perspective(900px) rotateX(1.2deg);
  filter: saturate(1.2) contrast(1.05);
}

.booth__console::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.3), transparent 50%),
    repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.12) 0px,
      rgba(0, 0, 0, 0.12) 2px,
      rgba(0, 0, 0, 0) 3px,
      rgba(0, 0, 0, 0) 6px
    );
  opacity: 0.5;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: scan 7s linear infinite;
}

.booth__console::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.28) 0px,
      rgba(0, 0, 0, 0.28) 2px,
      rgba(0, 0, 0, 0) 3px,
      rgba(0, 0, 0, 0) 6px
    ),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.15), transparent 60%);
  opacity: 0.2;
  mix-blend-mode: multiply;
  pointer-events: none;
  animation: scan 7s linear infinite;
}

@keyframes crt-flicker {
  0%,
  100% {
    opacity: 0.88;
  }
  50% {
    opacity: 0.96;
  }
}

@keyframes crt-scan {
  0% {
    transform: translateY(-6%);
  }
  100% {
    transform: translateY(6%);
  }
}

.console__screen {
  background: var(--surface-3);
  color: var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  border: 2px solid #000;
  font-family: "Rubik Mono One", sans-serif;
  text-transform: lowercase;
  max-width: 100%;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  min-height: 64px;
  font-size: 0.7rem;
  text-shadow: 0 0 8px rgba(126, 219, 109, 0.35);
}

.console__decks {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 10px;
}

.console-deck {
  width: 132px;
  height: 92px;
  border-radius: 16px;
  background: linear-gradient(180deg, #2a4a35 0%, #14261c 100%);
  border: 1px solid rgba(0, 0, 0, 0.25);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2),
    inset 0 -10px 20px rgba(0, 0, 0, 0.25);
}

.console-deck__platter {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle, #1b1b1b 0%, #101010 55%, #2c2c2c 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2),
    inset 0 0 0 8px rgba(0, 0, 0, 0.35);
  position: relative;
}

.console-deck__platter::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.5);
}

.console-deck__platter::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-2);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.4);
}

.console-deck__arm {
  position: absolute;
  width: 44px;
  height: 6px;
  background: linear-gradient(90deg, #d6d6d6, #9a9a9a);
  right: 10px;
  top: 14px;
  transform: rotate(18deg);
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

.console-deck__arm::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #dcdcdc;
  top: -6px;
  right: -6px;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.25);
}

.booth__console.is-playing .console-deck__platter {
  animation: spin 1.2s linear infinite;
}

.screen__marquee {
  letter-spacing: 0.04em;
  font-size: 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  line-height: 1.15;
}

.screen__meta {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.65rem;
  margin-top: 8px;
}

.screen__bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(126, 219, 109, 0.2);
  overflow: hidden;
}

.screen__bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.audio__status {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  min-height: 1em;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
}

.room-actions button {
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

.connect-sc {
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
  display: none;
}

.connect-sc.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.invite-link {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid #000;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
}

.console__knobs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 12px 0 6px;
}

.knob {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(0, 0, 0, 0.4));
  border: 2px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}

.knob--amber {
  background: radial-gradient(circle at 30% 30%, #b7ff9e, #4b9b58);
  box-shadow: 0 0 18px rgba(126, 219, 109, 0.4);
}

.knob--magenta {
  background: radial-gradient(circle at 30% 30%, #b0ffd9, #2e7f67);
  box-shadow: 0 0 18px rgba(95, 191, 90, 0.4);
}

.console__speakers {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.console__speakers span {
  flex: 1;
  height: 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.05);
}

.scene__lights {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 90px;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
  --light-left: 0.4;
  --light-mid: 0.4;
  --light-right: 0.4;
  --light-bloom: 0.4;
}

.light {
  width: 120px;
  height: 200px;
  background: radial-gradient(circle at 50% 0%, rgba(126, 219, 109, 0.6), transparent 65%);
  filter: blur(calc(2px + 6px * var(--light-bloom))) brightness(calc(0.6 + 1.2 * var(--light-bloom)));
  opacity: calc(0.2 + 0.7 * var(--light-left));
  transform: translateY(calc(-8px * var(--light-bloom))) scaleY(calc(0.9 + 0.4 * var(--light-bloom)));
  transition: filter 120ms ease-out, opacity 120ms ease-out, transform 120ms ease-out;
}

.light--mid {
  background: radial-gradient(circle at 50% 0%, rgba(95, 191, 90, 0.55), transparent 65%);
  opacity: calc(0.2 + 0.7 * var(--light-mid));
}

.light--right {
  background: radial-gradient(circle at 50% 0%, rgba(70, 150, 90, 0.5), transparent 65%);
  opacity: calc(0.2 + 0.7 * var(--light-right));
}

.scene__crowd {
  position: relative;
  z-index: 2;
  margin-top: 28px;
  height: 220px;
  overflow: hidden;
}

.scene__floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  background: var(--surface-3);
}

.glowstick {
  position: absolute;
  left: var(--glow-x);
  bottom: var(--glow-y);
  width: 52px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(95, 191, 90, 0.2), rgba(126, 219, 109, 0.95));
  box-shadow: 0 0 14px rgba(126, 219, 109, 0.8);
  transform: translate(-50%, 0) rotate(var(--glow-rot));
  animation: glowstick-throw 1.4s ease-out forwards;
  animation-delay: var(--glow-delay);
  pointer-events: none;
  z-index: 3;
}

@keyframes glowstick-throw {
  0% {
    transform: translate(-50%, 0) rotate(var(--glow-rot)) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, 140px) rotate(calc(var(--glow-rot) - 40deg)) scale(0.9);
    opacity: 0;
  }
}

.glow-particle {
  position: fixed;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 255, 120, 0.95), rgba(126, 219, 109, 0.1));
  box-shadow: 0 0 18px rgba(126, 219, 109, 0.9), 0 0 36px rgba(126, 219, 109, 0.45);
  pointer-events: none;
  z-index: 30;
}

.glow-particle.is-fading {
  opacity: 0;
  transition: opacity 0.4s ease-out;
}

.egg-projectile {
  position: fixed;
  width: 18px;
  height: 24px;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 35% 30%, #fff8d8, #d9d2b0);
  border: 2px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
  left: 0;
  top: 0;
  transform: translate(var(--egg-start-x), var(--egg-start-y));
  animation: egg-throw 0.65s ease-in forwards;
  z-index: 30;
  pointer-events: none;
}

.egg-projectile.is-splat {
  background: radial-gradient(circle at 50% 50%, #fff1b5, #c7b980);
  border-radius: 50%;
  width: 32px;
  height: 14px;
  transform: translate(var(--egg-end-x), var(--egg-end-y)) scale(1.1);
  animation: egg-splat 0.5s ease-out forwards;
}

@keyframes egg-throw {
  0% {
    transform: translate(var(--egg-start-x), var(--egg-start-y)) scale(1);
  }
  100% {
    transform: translate(var(--egg-end-x), var(--egg-end-y)) scale(0.9);
  }
}

@keyframes egg-splat {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.stage {
  background: var(--surface-2);
  border-radius: 24px;
  padding: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  box-shadow: var(--glow);
  margin-bottom: 32px;
}

.stage__crowd {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 18px;
  min-height: 140px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(160deg, #7edb6d, #3f8f5a);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.meebit-bop {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bob 2.2s ease-in-out infinite;
}

.meebit-bop--dj {
  width: 110px;
  height: 132px;
  background: rgba(10, 16, 12, 0.75);
  border-radius: 18px;
  padding: 6px;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.35);
}

.meebit-bop--crowd {
  width: 110px;
  height: 170px;
  background: transparent;
  border-radius: 16px;
  padding: 6px;
  overflow: visible;
  position: absolute;
}

.crowd-member {
  padding-top: 6px;
}

.crowd-member {
  display: grid;
  gap: 6px;
  justify-items: center;
  width: 100%;
  height: 100%;
  position: relative;
}

.chat-bubble {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  background: #000;
  color: var(--accent);
  border: 2px solid #000;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.8rem;
  max-width: 260px;
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: center;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.65);
  opacity: 0.95;
  animation: bubble-pop 0.18s ease-out;
  pointer-events: none;
  z-index: 2;
  text-shadow: 0 0 6px rgba(126, 219, 109, 0.35);
}

.chat-bubble.is-fading {
  opacity: 0;
  transition: opacity 0.25s ease-out;
}

.chat-bubble--below {
  transform: translate(-50%, 8px);
}

@keyframes bubble-pop {
  from {
    transform: translate(-50%, -2px) scale(0.92);
  }
  to {
    transform: translate(-50%, -8px) scale(1);
  }
}

.crowd-name {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.meebit-vrm {
  width: 100%;
  height: 100%;
  display: block;
}

.is-dancing .meebit-vrm {
  animation: dance-bop 0.35s ease-in-out infinite;
  transform-origin: center bottom;
}

.is-cheering .meebit-vrm {
  animation: cheer-pop 0.28s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes dance-bop {
  0% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-6px) rotate(3deg) scale(1.02);
  }
  100% {
    transform: translateY(0) rotate(-2deg);
  }
}

@keyframes cheer-pop {
  0% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-8px) scale(1.03);
  }
  60% {
    transform: translateY(0) scale(0.98);
  }
  100% {
    transform: translateY(-6px) scale(1.02);
  }
}

.meebit-vrm.is-hidden {
  display: none;
}

.meebit-bop--two {
  animation-delay: 0.3s;
}

.meebit-bop--three {
  animation-delay: 0.6s;
}

.meebit {
  width: 100%;
  height: 100%;
  --poster-color: transparent;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .meebit-bop {
    animation: none;
  }
}

.stage__booth {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  position: relative;
}

.deck {
  background: var(--surface-3);
  border-radius: 14px;
  padding: 18px;
  position: relative;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.deck__platter {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 6px solid rgba(126, 219, 109, 0.3);
  box-shadow: inset 0 0 0 10px rgba(0, 0, 0, 0.4);
  background: radial-gradient(circle, #111 0%, #1b1b1b 60%, #3a3a3a 100%);
}

.deck__arm {
  position: absolute;
  width: 70px;
  height: 4px;
  background: var(--accent-2);
  right: 20px;
  top: 24px;
  transform: rotate(18deg);
  border-radius: 999px;
}

.eq {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 6px;
}

.eq span {
  width: 8px;
  height: 28px;
  background: var(--accent-2);
  border-radius: 6px;
  animation: bounce 1.1s ease-in-out infinite;
}

.eq span:nth-child(2) {
  animation-delay: 0.2s;
}

.eq span:nth-child(3) {
  animation-delay: 0.4s;
  background: var(--accent);
}

.eq span:nth-child(4) {
  animation-delay: 0.1s;
}

.eq span:nth-child(5) {
  animation-delay: 0.3s;
}

.stage__now .label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.stage__now h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.stage__now .meta {
  margin: 0;
  color: var(--muted);
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.flow {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.flow__card {
  background: var(--card);
  border-radius: 12px;
  padding: 18px;
  border: 2px solid #000;
  box-shadow: var(--glow);
  display: none;
}

.flow__card.is-active {
  display: block;
}

.flow__card h3 {
  margin-top: 0;
}

.flow__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.flow__card button {
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.65);
}

.panel {
  background: var(--card);
  border-radius: 12px;
  padding: 22px;
  border: 2px solid #000;
  box-shadow: var(--glow);
}

.panel h3 {
  margin-top: 0;
}

.panel ul {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  color: var(--muted);
}

.panel li + li {
  margin-top: 8px;
}

.panel--queue {
  display: grid;
  gap: 12px;
}

.panel--chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(320px, 92vw);
  z-index: 2000;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
}

.now-playing {
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 2px solid #000;
}

.now-playing .label {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0 0 6px;
}

.now-playing .meta {
  margin: 0;
  color: var(--ink);
}

.now-controls {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.now-controls button {
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

.vote__status {
  font-size: 0.75rem;
  color: var(--muted);
}

.vibe__votes {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.vibe__votes button {
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
  font-size: 1rem;
}

.now-controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search--youtube input {
  background: rgba(10, 16, 12, 0.7);
}

.search input,
.search button {
  border-radius: 8px;
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 10px;
}

.search button {
  cursor: pointer;
}

.search__results,
.queue {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
}

.search__results--youtube {
  margin-top: 8px;
  max-height: 220px;
}

.search--youtube-url {
  margin-top: 6px;
}

.queue__item,
.result__item {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 2px solid #000;
}

.result__item {
  grid-template-columns: 72px 1fr;
  align-items: center;
}

.result__media img {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #000;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
}

.result__body {
  display: grid;
  gap: 6px;
}

.result__title,
.queue__title {
  font-weight: 600;
}

.result__meta,
.queue__meta {
  color: var(--muted);
  font-size: 0.85rem;
}

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

.result__actions button {
  border: 2px solid #000;
  border-radius: 8px;
  padding: 6px 10px;
  background: #000;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

.queue__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.cta {
  border: 2px solid #000;
  padding: 12px 16px;
  border-radius: 12px;
  background: #000;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.7);
}

.chat {
  background: var(--surface);
  border-radius: 10px;
  padding: 12px;
  height: 180px;
  overflow: auto;
  font-size: 0.95rem;
  border: 2px solid #000;
}

.chat p {
  margin: 0 0 10px;
}

.chat p:last-child {
  margin-bottom: 0;
}

.chat__input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.chat__input input,
.chat__input button {
  border-radius: 8px;
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 10px;
}

.chat__input button {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

.chat__input button.is-ready {
  cursor: pointer;
  opacity: 1;
  background: #000;
  color: var(--accent);
}

.vibe {
  display: grid;
  gap: 12px;
}

.vibe__meter {
  height: 14px;
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid #000;
}

.vibe__meter span {
  display: block;
  height: 100%;
  width: var(--level);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: var(--glow);
}

.vibe__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vibe__actions button {
  border: 2px solid #000;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

@keyframes bounce {
  0%,
  100% {
    transform: scaleY(0.5);
  }
  50% {
    transform: scaleY(1.3);
  }
}

@media (max-width: 1100px) {
  .room__layout {
    grid-template-columns: 1fr;
  }

  .room__layout .columns {
    position: static;
    grid-column: 1;
    grid-row: 2;
  }

  .room__layout .panel--vibe {
    position: static;
    grid-column: auto;
    grid-row: 3;
  }

  .panel--chat {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(320px, 92vw);
    z-index: 2000;
  }

  .room__layout .scene {
    grid-column: 1;
    grid-row: 1;
  }

  .scene__youtube {
    width: min(80vw, 560px);
    top: 44%;
    transform: translate(-50%, -50%) translate(var(--drag-x), var(--drag-y))
      perspective(900px) rotateX(6deg) rotateY(-6deg) scale(0.9);
  }
}

@media (max-width: 720px) {
  body.is-panel-open {
    overflow: hidden;
  }

  .scene {
    touch-action: none;
  }

  .room__header {
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 12px;
  }

  .room__header > div:first-child {
    min-width: 0;
  }

  .room__tag {
    display: none;
  }

  h1 {
    font-size: 1.1rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .room__controls {
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: flex-end;
  }

  .room__actions {
    width: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .room__actions button,
  .room__back {
    padding: 8px 10px;
    font-size: 0.9rem;
    line-height: 1;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
  }

  .room__layout {
    grid-template-columns: 1fr;
  }

  .room__layout .columns {
    position: static;
  }

  .scene {
    padding: 0;
  }

  .scene__canvas {
    height: 100%;
  }

  .room {
    padding: 16px;
  }

  .panel {
    padding: 16px;
  }

  /* Mobile panel system: panels become bottom sheets controlled by the dock. */
  .room__layout .columns,
  .room__layout .panel--vibe {
    position: static;
  }

  .room__layout .columns,
  .room__layout .panel--vibe {
    display: block;
  }

  .panel--chat {
    position: static;
    right: auto;
    bottom: auto;
    width: auto;
    z-index: auto;
  }

  .panel[data-panel] {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(74px + max(env(safe-area-inset-bottom), 0px));
    max-height: min(72svh, 620px);
    overflow: auto;
    z-index: 3001;
    transform: translateY(calc(100% + 24px));
    transition: transform 180ms ease;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.7);
    pointer-events: none;
  }

  .panel[data-panel].is-open {
    transform: translateY(0);
    pointer-events: auto;
  }

  .panel__close {
    display: inline-flex;
  }

  .room__layout .chat {
    height: min(34svh, 280px);
  }

  .mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    z-index: 3000;
  }

  body.is-panel-open .mobile-backdrop {
    display: block;
  }

  .mobile-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 4000;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 18px;
    border: 2px solid #000;
    background: linear-gradient(180deg, rgba(22, 38, 28, 0.98), rgba(11, 21, 15, 0.98));
    box-shadow: 6px 10px 0 rgba(0, 0, 0, 0.55);
  }

  .mobile-dock button {
    border: 2px solid #000;
    background: var(--surface);
    color: var(--ink);
    padding: 10px 10px;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
    font-weight: 700;
  }

  .mobile-dock button.is-active {
    background: #000;
    color: var(--accent);
  }

  .scene__youtube-handle {
    display: none;
  }

  .booth__console {
    padding: 14px;
  }

  .scene__stage {
    flex-direction: column;
    align-items: center;
  }

  .scene__crowd {
    height: 180px;
  }

  .speaker-stack {
    width: 100%;
    flex-direction: row;
    justify-content: center;
  }

  .speaker {
    width: 72px;
  }

  .speaker--tall {
    height: 120px;
  }

  .scene__youtube {
    width: min(78vw, 420px);
    top: 10%;
    --frame: 8px;
    transform: translate(-50%, 0%) translate(var(--drag-x), var(--drag-y))
      perspective(800px) rotateX(4deg) rotateY(-3deg) scale(0.84);
  }

  .speaker--short {
    height: 90px;
  }

  /* Mobile: keep "Room Vibe" lightweight (no voting UI). */
  .panel--vibe .vibe__votes,
  .panel--vibe .vote__status {
    display: none;
  }

  .booth__djs {
    flex-wrap: wrap;
  }

  .scene__lights {
    bottom: 70px;
  }

  .meebit-bop--dj {
    width: 88px;
    height: 110px;
  }

  .meebit-bop--crowd {
    width: 62px;
    height: 76px;
  }
}

@media (min-width: 721px) {
  .mobile-dock,
  .mobile-backdrop {
    display: none;
  }
}
