:root {
  --bg-deep: #120d10;
  --wood-bg: rgba(34, 25, 22, 0.93);
  --wood-bg-solid: rgba(34, 25, 22, 0.97);
  --wood-border: rgba(242, 214, 178, 0.24);
  --wood-highlight: rgba(255, 240, 214, 0.08);

  --paper-bg: #fcf5e7;
  --paper-bg-bottom: #f5e9d2;
  --paper-card: #fffdf8;
  --paper-border: #e1ceb0;
  --ink-dark: #34231b;
  --ink-sub: #745d4f;

  --accent-fire: #e56d49;
  --accent-fire-hover: #ee7955;
  --accent-fire-edge: #b74627;
  --accent-amber: #f0b357;
  --accent-sage: #73a87d;

  --text-main: #fbf2e3;
  --text-muted: #c8b6a2;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Gowun Dodum', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button, input, select {
  font-family: inherit;
}

#campfireCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1;
}

#fxOverlayCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 31;
}

#chatBubbleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  z-index: 32;
}

/* Warm Cabin Night Wood Surface (In-Room HUD) */
.glass-panel {
  background: var(--wood-bg);
  border: 1.5px solid var(--wood-border);
  box-shadow:
    0 12px 30px rgba(10, 6, 4, 0.48),
    inset 0 1px 0 var(--wood-highlight);
  border-radius: 20px;
}

/* Warm Cream Storybook Postcard Surface (Lobby & Modals) */
.storybook-card {
  background: linear-gradient(180deg, #fffaf0 0%, var(--paper-bg-bottom) 100%);
  border: 2px solid var(--paper-border);
  border-radius: 28px;
  color: var(--ink-dark);
  outline: 1.5px dashed rgba(176, 134, 90, 0.34);
  outline-offset: -10px;
  box-shadow:
    0 24px 56px rgba(10, 6, 4, 0.54),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
}

.hidden {
  display: none !important;
}

.mobile-only-btn {
  display: none !important;
}

/* ==========================================
   LOBBY OVERLAY & ANIMATED HERO ILLUSTRATION
   ========================================== */
.lobby-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
  background: radial-gradient(
    circle at 50% 62%,
    rgba(255, 165, 95, 0.08) 0%,
    rgba(16, 11, 10, 0.46) 65%,
    rgba(12, 8, 8, 0.64) 100%
  );
}

.lobby-card {
  width: 100%;
  max-width: 446px;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  padding: 24px 26px 22px;
  text-align: center;
  animation: cardSpringIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.lobby-card::-webkit-scrollbar {
  width: 5px;
}

.lobby-card::-webkit-scrollbar-thumb {
  background: rgba(138, 104, 72, 0.25);
  border-radius: 99px;
}

@keyframes cardSpringIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lobby-hero-art {
  width: 100%;
  max-width: 260px;
  margin: 0 auto 12px;
}

.lobby-scene-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 22px;
  box-shadow: 0 6px 16px rgba(48, 30, 18, 0.14);
}

/* Gentle SVG ambient animations matching the canvas campers */
.hero-flame-outer {
  transform-box: fill-box;
  transform-origin: 50% 92%;
  animation: svgFlameBreathe 2.3s ease-in-out infinite;
}

.hero-flame-mid {
  transform-box: fill-box;
  transform-origin: 50% 92%;
  animation: svgFlameBreathe 1.85s ease-in-out infinite reverse;
}

.hero-flame-core {
  transform-box: fill-box;
  transform-origin: 50% 92%;
  animation: svgFlameCore 1.5s ease-in-out infinite;
}

.hero-camper-left {
  animation: cozyCamperBob 3.2s ease-in-out infinite;
}

.hero-camper-right {
  animation: cozyCamperBob 3.5s ease-in-out infinite 0.5s;
}

.hero-marshmallow-stick {
  transform-box: fill-box;
  transform-origin: right center;
  animation: cozyStickTilt 2.8s ease-in-out infinite;
}

.hero-ember-1 {
  animation: svgEmberFloat 2.6s ease-out infinite;
}

.hero-ember-2 {
  animation: svgEmberFloat 3.1s ease-out infinite 0.9s;
}

.hero-ember-3 {
  animation: svgEmberFloat 2.4s ease-out infinite 1.6s;
}

.hero-star-1 {
  animation: svgStarTwinkle 2.8s ease-in-out infinite;
}

.hero-star-2 {
  animation: svgStarTwinkle 3.4s ease-in-out infinite 0.7s;
}

.hero-star-3 {
  animation: svgStarTwinkle 2.5s ease-in-out infinite 1.3s;
}

@keyframes svgFlameBreathe {
  0%, 100% { transform: scaleY(1) scaleX(1) skewX(-1deg); }
  50% { transform: scaleY(1.09) scaleX(0.95) skewX(1.5deg); }
}

@keyframes svgFlameCore {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1, 1.15); }
}

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

@keyframes cozyStickTilt {
  0%, 100% { transform: rotate(-1.5deg); }
  50% { transform: rotate(2.2deg); }
}

@keyframes svgEmberFloat {
  0% { opacity: 0; transform: translateY(4px) scale(0.7); }
  25% { opacity: 0.95; }
  100% { opacity: 0; transform: translateY(-16px) scale(0.35); }
}

@keyframes svgStarTwinkle {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.lobby-title {
  font-family: 'Gowun Batang', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink-dark);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.lobby-subtitle {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-sub);
  margin-bottom: 18px;
  word-break: keep-all;
}

.lobby-form {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.input-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: #4f382c;
  margin-bottom: 5px;
}

.label-optional {
  font-weight: 400;
  font-size: 11px;
  color: #937b6b;
}

/* Segmented Pill Tabs in Lobby */
.lobby-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border-radius: 15px;
  background: #ecdec4;
  border: 1.5px solid #decba9;
}

.lobby-tab {
  border: none;
  background: transparent;
  color: #7c6252;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lobby-tab:hover:not(.active) {
  color: var(--ink-dark);
}

.lobby-tab.active {
  background: var(--paper-card);
  color: var(--ink-dark);
  box-shadow: 0 2px 7px rgba(72, 46, 28, 0.12), inset 0 -2px 0 #e2d0b4;
}

.link-switch-btn {
  margin-top: 6px;
  width: 100%;
  background: transparent;
  border: none;
  color: #b75130;
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
  opacity: 0.9;
}

.link-switch-btn:hover {
  opacity: 1;
}

.storybook-card .text-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 2px solid var(--paper-border);
  background: var(--paper-card);
  color: var(--ink-dark);
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.storybook-card .text-input::placeholder {
  color: #aa9685;
}

.storybook-card .text-input:focus {
  border-color: var(--accent-fire);
  box-shadow: 0 0 0 3.5px rgba(229, 109, 73, 0.16);
}

.lobby-actions {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 15px;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 18px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s, box-shadow 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-primary {
  width: 100%;
  background: var(--accent-fire);
  color: #fffaf2;
  border-bottom: 4px solid var(--accent-fire-edge);
  box-shadow: 0 6px 14px rgba(183, 70, 39, 0.24);
}

.btn-primary:hover {
  background: var(--accent-fire-hover);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.btn-secondary {
  background: #efe2ca;
  color: #543b2e;
  border: 1.5px solid #d6c09d;
  border-bottom: 3px solid #c6ac84;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: #e9d8b9;
  transform: translateY(-1px);
}

.join-row {
  display: flex;
  gap: 8px;
  animation: softReveal 0.25s ease-out;
}

@keyframes softReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.join-row .btn-primary {
  width: auto;
  flex-shrink: 0;
  padding: 11px 20px;
}

.code-input {
  text-transform: uppercase;
  letter-spacing: 2.5px;
  font-weight: 700;
  text-align: center;
}

.lobby-footer-tips {
  margin-top: 14px;
  font-size: 11.5px;
  color: #8b7464;
}

/* ACTIVE ROOMS EXPLORE TICKET BUTTON */
.btn-outline-rooms {
  width: 100%;
  padding: 10px 14px;
  background: #f4e6ce;
  border: 1.5px solid #d9c29e;
  border-bottom: 3px solid #cbb088;
  border-radius: 14px;
  color: #533a2c;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s;
}

.rooms-btn-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-outline-rooms:hover {
  background: #eedbb9;
  transform: translateY(-1.5px);
}

.btn-outline-rooms:active {
  transform: translateY(1px);
}

.room-count-badge {
  background: var(--accent-fire);
  color: #fffaf2;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}

/* ==========================================
   IN-ROOM HUD (COZY NIGHT CABIN WOOD STYLE)
   ========================================== */
.room-hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.room-hud > * {
  pointer-events: auto;
}

.chip-svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  display: block;
}

.chip-svg.flame-tint {
  color: #f3a159;
}

.top-bar {
  position: absolute;
  top: 14px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100 !important;
  pointer-events: none;
}

.top-bar > * {
  pointer-events: auto;
  flex-shrink: 0;
}

.room-info-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  flex-shrink: 1;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.fire-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-fire);
  box-shadow: 0 0 8px rgba(229, 109, 73, 0.75);
  animation: pulseDot 1.8s infinite ease-in-out;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.25); opacity: 1; }
}

.room-title-text {
  font-family: 'Gowun Batang', serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff4e2;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-label {
  font-size: 12px;
  color: var(--text-muted);
}

.room-code-text {
  font-size: 14.5px;
  letter-spacing: 1.8px;
  color: var(--accent-amber);
  user-select: text;
  flex-shrink: 0;
}

.room-pw-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #fbe3c2;
  background: rgba(240, 179, 87, 0.16);
  border: 1px solid rgba(240, 179, 87, 0.34);
  padding: 2px 9px;
  border-radius: 999px;
  user-select: text;
  flex-shrink: 0;
  white-space: nowrap;
}

.icon-chip {
  background: rgba(255, 240, 218, 0.1);
  border: 1px solid rgba(242, 214, 178, 0.26);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.icon-chip:hover {
  background: rgba(240, 179, 87, 0.22);
  transform: translateY(-1px);
}

.icon-chip.leave-chip {
  background: rgba(255, 118, 118, 0.14);
  border-color: rgba(255, 138, 128, 0.34);
  color: #ffd5cf;
}

.icon-chip.leave-chip:hover {
  background: rgba(255, 118, 118, 0.28);
  border-color: rgba(255, 138, 128, 0.55);
}

.fire-meter-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 7px 15px;
  border-radius: 18px;
  flex-shrink: 0;
  max-width: 100%;
  white-space: nowrap;
}

.fire-meter-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
}

.fire-meter-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fce8cd;
  font-weight: 600;
}

.meter-track {
  width: 102px;
  height: 8.5px;
  background: rgba(255, 240, 218, 0.12);
  border: 1px solid rgba(255, 232, 200, 0.14);
  border-radius: 99px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #f3ba61, #e56d49);
  border-radius: 99px;
  transition: width 0.35s ease;
}

.temp-label {
  font-size: 12px;
  color: var(--accent-amber);
  font-weight: 600;
  min-width: 54px;
}

.keep-fire-btn {
  background: rgba(255, 240, 218, 0.09);
  border: 1px solid rgba(242, 214, 178, 0.28);
  color: #ecdcc6;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.keep-fire-btn:hover {
  background: rgba(240, 179, 87, 0.2);
  border-color: rgba(240, 179, 87, 0.45);
}

.keep-fire-btn.active {
  background: rgba(240, 179, 87, 0.25);
  border-color: #f0b357;
  color: #fff6e6;
}

.fire-decay-notice {
  font-size: 11px;
  color: rgba(245, 224, 196, 0.74);
  letter-spacing: -0.2px;
  transition: color 0.3s;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  max-width: 100%;
}

.fire-decay-notice.danger {
  color: #ff9c8f;
  font-weight: 600;
  animation: pulseWarning 1.2s infinite alternate;
}

@keyframes pulseWarning {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.select-pill {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.select-label {
  font-size: 9.5px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.35px;
  color: rgba(242, 214, 178, 0.8);
  padding-left: 8px;
  pointer-events: none;
}

.hud-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: rgba(240, 179, 87, 0.15);
  border: 1px solid rgba(240, 179, 87, 0.34);
  color: #fde9cc;
  padding: 4.5px 26px 4.5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  background-image: linear-gradient(45deg, transparent 50%, #f0b357 50%),
    linear-gradient(135deg, #f0b357 50%, transparent 50%);
  background-position: calc(100% - 13px) 52%, calc(100% - 8px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 136px;
  max-width: 185px;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.hud-select:hover {
  background-color: rgba(240, 179, 87, 0.24);
}

.hud-select option {
  background: #241b18;
  color: #fbf2e3;
}

.control-btn {
  background: rgba(255, 240, 218, 0.08);
  border: 1px solid rgba(242, 214, 178, 0.2);
  color: var(--text-main);
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}

.control-btn:hover {
  background: rgba(255, 240, 218, 0.15);
  transform: translateY(-1px);
}

.mic-icon-wrap {
  display: inline-flex;
  align-items: center;
}

.control-btn.mic-off .mic-svg-on {
  display: none;
}

.control-btn.mic-on .mic-svg-off {
  display: none;
}

.control-btn.mic-on {
  background: rgba(115, 168, 125, 0.28);
  border-color: rgba(145, 200, 155, 0.6);
  color: #d6f5db;
}

.control-btn.mic-off {
  background: rgba(255, 240, 218, 0.07);
  color: #d8c8b6;
}

.volume-slider {
  width: 64px;
  accent-color: var(--accent-fire);
  cursor: pointer;
}

.v-sep {
  width: 1px;
  height: 18px;
  background: rgba(242, 214, 178, 0.18);
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef6f58;
  box-shadow: 0 0 6px rgba(239, 111, 88, 0.75);
}

/* LEFT PANEL: CAMPERS */
.campers-panel {
  position: absolute;
  top: var(--top-hud-bottom, 90px);
  left: 20px;
  width: 265px;
  padding: 15px;
  max-height: calc(100dvh - var(--top-hud-bottom, 90px) - var(--drawer-bottom, 120px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 15;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h3 {
  font-family: 'Gowun Batang', serif;
  font-size: 14.5px;
  font-weight: 700;
  color: #fce8cc;
}

.panel-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.panel-svg {
  width: 16px;
  height: 16px;
  color: var(--accent-amber);
  flex-shrink: 0;
}

.panel-close-btn {
  background: rgba(255, 240, 218, 0.1);
  border: 1px solid rgba(242, 214, 178, 0.22);
  color: var(--text-main);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.panel-close-btn:hover {
  background: rgba(255, 240, 218, 0.22);
  color: var(--accent-amber);
}

.panel-close-btn svg {
  display: block;
  pointer-events: none;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-filter-btn {
  background: rgba(255, 240, 218, 0.08);
  border: 1px solid rgba(240, 179, 87, 0.3);
  color: #fadbb0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.chat-filter-btn:hover {
  background: rgba(240, 179, 87, 0.2);
  color: #fff;
}

.chat-filter-btn .filter-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transition: all 0.2s ease;
}

.chat-filter-btn .filter-dot.active {
  background: var(--accent-sage);
}

.chat-filter-btn.chat-only-active {
  background: rgba(135, 180, 214, 0.18);
  border-color: rgba(154, 198, 232, 0.5);
  color: #cbe4f8;
}

.chat-filter-btn.chat-only-active .filter-dot {
  background: #8cc2eb;
}

#chatMessages.chat-only .msg-item.system {
  display: none !important;
}

.user-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 13px;
  background: rgba(255, 240, 218, 0.05);
  border: 1px solid rgba(242, 214, 178, 0.1);
  transition: all 0.2s;
  white-space: nowrap;
}

.user-item.speaking {
  border-color: var(--accent-sage);
  background: rgba(115, 168, 125, 0.16);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.user-info span:not(.avatar-dot) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.voice-badge {
  font-size: 11px;
  opacity: 0.92;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 240, 218, 0.07);
  border: 1px solid rgba(242, 214, 178, 0.14);
}

.user-item.speaking .voice-badge {
  background: rgba(115, 168, 125, 0.26);
  border-color: rgba(145, 200, 155, 0.6);
  color: #d7f5dc;
  font-weight: 600;
}

.voice-hint {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
  border-top: 1px solid rgba(242, 214, 178, 0.12);
  padding-top: 10px;
  word-break: keep-all;
}

/* RIGHT PANEL: CHAT HISTORY LOG */
.chat-panel {
  position: absolute;
  top: var(--top-hud-bottom, 86px);
  right: 20px;
  width: 325px;
  max-width: calc(100vw - 32px);
  height: calc(100dvh - var(--top-hud-bottom, 86px) - var(--drawer-bottom, 120px));
  max-height: 540px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border-radius: 20px;
  background: var(--wood-bg);
  box-shadow: 0 14px 34px rgba(10, 6, 4, 0.56), inset 0 1px 0 var(--wood-highlight);
  border: 1.5px solid var(--wood-border);
  z-index: 25;
  animation: fadeInDown 0.22s ease-out;
}

.chat-panel .panel-close-btn {
  display: none !important;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  margin: 8px 0 0 0;
  user-select: text;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(242, 214, 178, 0.22);
  border-radius: 99px;
}

.msg-item {
  font-size: 13px;
  line-height: 1.45;
  padding: 8px 11px;
  border-radius: 13px;
  background: rgba(255, 240, 218, 0.06);
  word-break: break-word;
}

.msg-item.system {
  background: rgba(240, 179, 87, 0.12);
  border: 1px solid rgba(240, 179, 87, 0.22);
  color: #fce2b6;
  font-size: 12px;
}

.msg-author {
  font-weight: 700;
  margin-right: 6px;
}

/* ==========================================
   BOTTOM FLOATING CHAT INPUT BAR
   ========================================== */
.bottom-chat-bar {
  position: absolute;
  bottom: var(--chat-bar-bottom, 116px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 15px;
  border-radius: 999px;
  width: min(460px, calc(100vw - 24px));
  max-width: calc(100vw - 16px);
  z-index: 35;
  background: rgba(36, 27, 23, 0.94);
  border: 1.5px solid rgba(242, 214, 178, 0.28);
  box-shadow: 0 8px 24px rgba(10, 6, 4, 0.45);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bottom-chat-bar:focus-within {
  border-color: var(--accent-amber);
  box-shadow: 0 8px 28px rgba(10, 6, 4, 0.6), 0 0 0 3px rgba(240, 179, 87, 0.18);
}

.bottom-chat-form {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.bottom-chat-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13.5px;
  padding: 6px 4px;
  min-width: 0;
}

.bottom-chat-form input::placeholder {
  color: rgba(242, 214, 178, 0.45);
}

.btn-chat-send {
  background: var(--accent-fire);
  border: none;
  border-bottom: 3px solid var(--accent-fire-edge);
  color: #fffaf2;
  font-weight: 700;
  font-size: 12.5px;
  padding: 6px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap !important;
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s;
}

.btn-chat-send:hover {
  background: var(--accent-fire-hover);
  transform: translateY(-1.5px);
}

.btn-chat-send:active {
  transform: translateY(1px);
}

/* ==========================================
   BOTTOM INTERACTION DOCK
   ========================================== */
.interaction-dock {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 22px;
  z-index: 12;
  max-width: calc(100vw - 16px);
  overflow-x: auto;
  scrollbar-width: none;
}

.interaction-dock::-webkit-scrollbar {
  display: none;
}

.dock-btn {
  background: rgba(255, 240, 218, 0.06);
  border: 1.5px solid rgba(242, 214, 178, 0.16);
  border-bottom: 3px solid rgba(20, 13, 10, 0.55);
  color: var(--text-main);
  padding: 8px 13px;
  border-radius: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s, border-color 0.18s;
  white-space: nowrap !important;
  flex-shrink: 0;
}

.dock-btn:hover {
  background: rgba(240, 179, 87, 0.16);
  border-color: rgba(240, 179, 87, 0.42);
  transform: translateY(-3px);
}

.dock-btn:active {
  transform: translateY(1px);
}

.dock-emoji {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dock-svg {
  width: 26px;
  height: 26px;
  display: block;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dock-btn:hover .dock-svg {
  transform: scale(1.14) rotate(-6deg);
}

#btnToggleLights .light-svg-off,
#btnTogglePubLights .pub-light-svg-off,
#btnTogglePartyLights .party-light-svg-off {
  display: none;
}

#btnToggleLights.lights-off .light-svg-on,
#btnTogglePubLights.lights-off .pub-light-svg-on,
#btnTogglePartyLights.lights-off .party-light-svg-on {
  display: none;
}

#btnToggleLights.lights-off .light-svg-off,
#btnTogglePubLights.lights-off .pub-light-svg-off,
#btnTogglePartyLights.lights-off .party-light-svg-off {
  display: block;
}

.dock-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap !important;
}

.dock-text strong {
  font-size: 13px;
  color: #fff3df;
  white-space: nowrap !important;
}

.dock-text small {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap !important;
}

/* MARSHMALLOW INTERACTIVE OVERLAY AROUND FIRE */
.marshmallow-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 11;
}

.marshmallow-widget {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.marshmallow-widget:hover {
  transform: translate(-50%, -55%) scale(1.07);
}

.m-bubble {
  background: rgba(34, 25, 22, 0.92);
  border: 1.5px solid rgba(242, 214, 178, 0.36);
  padding: 6px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(10, 6, 4, 0.45);
  white-space: nowrap;
}

.m-bubble.golden {
  border-color: #f3c669;
  box-shadow: 0 0 14px rgba(243, 198, 105, 0.45);
  animation: bounceGlow 0.9s infinite alternate;
}

.m-bubble.burnt {
  border-color: #df6c5e;
  background: rgba(46, 20, 18, 0.94);
}

@keyframes bounceGlow {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

.m-owner {
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 2px;
}

.m-stage {
  font-size: 10.5px;
  color: #fce4bf;
}

.m-progress-bar {
  width: 68px;
  height: 4.5px;
  background: rgba(255, 240, 218, 0.15);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 4px;
}

.m-progress-fill {
  height: 100%;
  transition: width 0.4s linear, background-color 0.3s;
}

/* ==========================================
   OUTDOOR DRIVE-IN & INDOOR HOME CINEMA STAGE
   ========================================== */
.cinema-stage {
  position: fixed;
  top: var(--cinema-top, 86px);
  left: 50%;
  transform: translateX(-50%);
  width: var(--cinema-width, min(calc(100vw - 650px), calc((100dvh - 280px) * 1.777)));
  max-width: calc(100vw - 16px);
  min-width: 220px;
  z-index: 11;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
}

.cinema-roof-header {
  width: calc(100% + 22px);
  background: linear-gradient(180deg, #4b3830 0%, #2f231e 100%);
  border: 2px solid #705548;
  border-bottom: none;
  border-radius: 14px 14px 3px 3px;
  padding: 5px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 16px rgba(10, 6, 4, 0.48);
}

.cinema-stage.indoor-mode .cinema-roof-header {
  background: linear-gradient(180deg, #593b31 0%, #37231c 100%);
  border-color: #825b4b;
}

.cinema-marquee-title {
  font-family: 'Gowun Batang', serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fce2a6;
}

.roof-truss-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f5cd79;
  box-shadow: 0 0 7px rgba(245, 205, 121, 0.7);
}

.projector-screen-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #100c0b;
  border: 8px solid #3c2e28;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(10, 6, 4, 0.78);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.45s ease, border-color 0.45s ease;
}

.cinema-stage.indoor-mode .projector-screen-frame {
  border-color: #4c3329;
  border-radius: 12px;
}

.cinema-stage.partyroom-mode .projector-screen-frame {
  border-color: #2c334a;
  border-width: 7px;
  border-radius: 14px;
  background: #0d101b;
}

.cinema-stage.partyroom-mode .screen-wooden-bar {
  display: none;
}

.projector-screen-frame.lit {
  border-color: #6b5347;
  box-shadow:
    0 18px 46px rgba(10, 6, 4, 0.8),
    0 0 65px rgba(255, 214, 156, 0.26);
}

.cinema-stage.indoor-mode .projector-screen-frame.lit {
  border-color: #7c5849;
  box-shadow:
    0 18px 46px rgba(10, 6, 4, 0.8),
    0 0 65px rgba(255, 200, 140, 0.3);
}

.cinema-stage.partyroom-mode .projector-screen-frame.lit {
  border-color: #5ce1e6;
  box-shadow:
    0 18px 46px rgba(10, 6, 4, 0.85),
    0 0 64px rgba(92, 225, 230, 0.28),
    0 0 34px rgba(195, 115, 255, 0.22);
}

.projector-screen-frame.drag-over {
  border-color: var(--accent-amber) !important;
  box-shadow: 0 0 36px rgba(240, 179, 87, 0.55) !important;
  transform: scale(1.012);
}

.screen-wooden-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #4b3126, #7a5443, #4b3126);
  z-index: 3;
}

.projector-viewport {
  width: 100%;
  height: 100%;
  background: #120e0d;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.projector-idle {
  text-align: center;
  padding: 20px;
  color: rgba(251, 242, 227, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.idle-projector-svg {
  width: 56px;
  height: 42px;
  opacity: 0.85;
  margin-bottom: 2px;
}

.projector-idle p {
  font-family: 'Gowun Batang', serif;
  font-size: 14.5px;
  font-weight: 700;
  color: rgba(251, 242, 227, 0.8);
}

.projector-idle small {
  font-size: 11.5px;
  max-width: 340px;
  line-height: 1.45;
  color: rgba(235, 217, 194, 0.56);
}

.projector-media-content {
  width: 100%;
  height: 100%;
  background: #000;
}

.projector-media-content iframe,
.projector-media-content img {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
  display: block;
}

.cinema-control-bar {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 14px;
}

.cinema-control-bar input {
  flex: 1;
  min-width: 0;
  background: rgba(20, 14, 12, 0.78);
  border: 1.5px solid rgba(242, 214, 178, 0.2);
  color: var(--text-main);
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  outline: none;
}

.cinema-control-bar input:focus {
  border-color: var(--accent-amber);
}

.btn-project {
  background: var(--accent-fire);
  border: none;
  border-bottom: 3px solid var(--accent-fire-edge);
  color: #fffaf2;
  font-weight: 700;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-project:hover {
  background: var(--accent-fire-hover);
  transform: translateY(-1px);
}

.btn-file-cinema {
  background: rgba(255, 240, 218, 0.1);
  border: 1.5px solid rgba(242, 214, 178, 0.28);
  color: #fce2b6;
  font-weight: 600;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s;
  user-select: none;
}

.btn-file-cinema:hover {
  background: rgba(240, 179, 87, 0.22);
  color: #fff;
}

.btn-clear-cinema {
  background: rgba(255, 240, 218, 0.08);
  border: 1.5px solid rgba(242, 214, 178, 0.2);
  color: #e4d4be;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-clear-cinema:hover {
  background: rgba(255, 240, 218, 0.16);
}

.btn-text-short {
  display: none;
}

.btn-text-full {
  display: inline;
}

.cinema-stage.compact-controls .cinema-vol-wrap {
  display: none !important;
}

.cinema-stage.compact-controls .cinema-control-bar {
  gap: 5px;
  padding: 5px 6px;
}

.cinema-stage.narrow-controls .btn-text-full {
  display: none;
}

.cinema-stage.narrow-controls .btn-text-short {
  display: inline;
}

.cinema-stage.narrow-controls .cinema-control-bar input {
  font-size: 11.5px;
  padding: 6px 8px;
}

.cinema-stage.narrow-controls .btn-project,
.cinema-stage.narrow-controls .btn-file-cinema,
.cinema-stage.narrow-controls .btn-clear-cinema {
  font-size: 11px;
  padding: 6px 7px;
  flex-shrink: 0;
}

.cinema-vol-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 240, 218, 0.06);
  border: 1px solid rgba(242, 214, 178, 0.16);
  padding: 5px 9px;
  border-radius: 10px;
  white-space: nowrap;
}

.cinema-vol-label {
  font-size: 11px;
  color: #fce2b6;
  font-weight: 600;
}

.cinema-vol-slider {
  width: 60px;
  accent-color: var(--accent-amber);
  cursor: pointer;
}

.cinema-vol-val {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 28px;
  text-align: right;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  top: var(--toast-top, 76px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}

.toast {
  background: var(--paper-bg);
  border: 2px solid var(--paper-border);
  color: var(--ink-dark);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 26px rgba(10, 6, 4, 0.42);
  animation: fadeToast 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeToast {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================
   RESPONSIVE INTERMEDIATE, TABLET & MOBILE LAYOUT
   ========================================== */

/* 0) Wide-to-Medium Desktop Bridge (1421px ~ 1640px) */
@media (max-width: 1640px) {
  .top-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .interaction-dock {
    gap: 6px;
    padding: 7px 10px;
  }

  .dock-btn {
    padding: 7px 11px;
    gap: 6px;
  }

  .dock-text strong {
    font-size: 12px;
  }

  .dock-text small {
    display: none;
  }
}

/* 1) Intermediate Laptop, Tablet & Compact Desktop (769px ~ 1420px) */
@media (max-width: 1420px) {
  .mobile-only-btn {
    display: inline-flex !important;
  }

  .top-bar {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    z-index: 100 !important;
  }

  .room-info-pill {
    order: 1;
    padding: 6px 12px;
    gap: 7px;
  }

  .room-code-text {
    font-size: 13.5px;
  }

  .icon-chip {
    padding: 4px 8px;
    font-size: 11px;
  }

  .fire-meter-box {
    order: 2;
    padding: 6px 13px;
    border-radius: 15px;
    gap: 3px;
  }

  .fire-meter-row {
    font-size: 11.5px;
    gap: 5px;
  }

  .meter-track {
    width: 70px;
    height: 6.5px;
  }

  .temp-label {
    font-size: 11px;
    min-width: 44px;
  }

  .fire-decay-notice {
    font-size: 9.5px;
  }

  .audio-controls {
    order: 3;
    width: auto;
    max-width: 100%;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 16px;
    gap: 6px;
  }

  .select-pill {
    flex-shrink: 0;
  }

  .hud-select {
    min-width: 130px !important;
    max-width: 165px !important;
    font-size: 11px;
    padding: 5px 22px 5px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .volume-slider {
    width: 45px;
  }

  .control-btn {
    padding: 5px 8px;
    font-size: 11px;
    white-space: nowrap;
  }

  .bottom-chat-bar {
    bottom: var(--chat-bar-bottom, 74px);
    width: min(460px, calc(100vw - 20px));
  }

  .campers-panel {
    top: auto;
    bottom: var(--drawer-bottom, 116px);
    left: 12px;
    width: min(320px, calc(100vw - 24px));
    max-height: calc(100dvh - var(--top-hud-bottom, 120px) - var(--drawer-bottom, 116px) - 10px);
    display: none;
    background: var(--wood-bg-solid);
    z-index: 80;
  }

  .campers-panel.mobile-open {
    display: flex;
  }

  .chat-panel {
    top: auto;
    bottom: var(--drawer-bottom, 116px);
    right: 12px;
    width: min(360px, calc(100vw - 24px));
    height: min(44dvh, calc(100dvh - var(--top-hud-bottom, 120px) - var(--drawer-bottom, 116px) - 10px));
    max-height: calc(100dvh - var(--top-hud-bottom, 120px) - var(--drawer-bottom, 116px) - 10px);
    display: none !important;
    background: var(--wood-bg-solid);
    z-index: 80;
  }

  .chat-panel.mobile-open {
    display: flex !important;
  }

  .chat-panel .panel-close-btn {
    display: inline-flex !important;
  }

  .cinema-stage {
    top: var(--cinema-top, 134px);
    width: var(--cinema-width, min(calc(100vw - 24px), calc((100dvh - 230px) * 1.777)));
    z-index: 30;
  }

  .interaction-dock {
    bottom: 12px;
    padding: 6px 10px;
    gap: 6px;
    border-radius: 17px;
    max-width: calc(100vw - 16px);
  }

  .dock-btn {
    padding: 6px 11px;
    gap: 6px;
    border-radius: 12px;
    white-space: nowrap !important;
    flex-shrink: 0;
  }

  .dock-emoji {
    width: 22px;
    height: 22px;
  }

  .dock-svg {
    width: 21px;
    height: 21px;
  }

  .dock-text strong {
    font-size: 11.5px;
    white-space: nowrap !important;
  }

  .dock-text small {
    display: none !important;
  }

  .toast-container {
    top: var(--toast-top, 110px);
  }
}

/* 2) Phone & Small Portrait Screens (<= 768px) */
@media (max-width: 768px) {
  .top-bar {
    top: 6px;
    left: 6px;
    right: 6px;
    gap: 5px;
    z-index: 100 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .room-label {
    display: none;
  }

  .room-info-pill {
    padding: 5px 9px !important;
    font-size: 11.5px !important;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .fire-meter-box {
    padding: 4px 8px !important;
    max-width: 100%;
  }

  .audio-controls {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 5px 7px !important;
    border-radius: 15px !important;
    justify-content: space-between !important;
  }

  .audio-controls .select-pill {
    flex: 1 1 calc(50% - 3px) !important;
    max-width: calc(50% - 2px) !important;
    min-width: 0 !important;
  }

  .audio-controls .select-label {
    font-size: 8.5px !important;
    padding-left: 6px !important;
  }

  .audio-controls .hud-select {
    font-size: 11px !important;
    padding: 5px 22px 5px 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  .audio-controls .control-btn {
    flex: 1 1 calc(25% - 4px) !important;
    max-width: calc(25% - 3px) !important;
    min-width: 0 !important;
    padding: 5px 2px !important;
    font-size: clamp(9.5px, 2.7vw, 10.5px) !important;
    flex-shrink: 1 !important;
    white-space: nowrap !important;
    justify-content: center !important;
    gap: 3px !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
  }

  .volume-slider {
    display: none !important;
  }

  .v-sep {
    display: none !important;
  }

  .bottom-chat-bar {
    bottom: var(--chat-bar-bottom, 78px);
    left: 6px;
    right: 6px;
    transform: none;
    width: auto;
    max-width: none;
    padding: 4px 5px 4px 10px;
    gap: 5px;
    border-radius: 15px;
    z-index: 45;
  }

  .bottom-chat-form input {
    font-size: 12.5px;
    padding: 5px 2px;
  }

  .btn-chat-send {
    padding: 5px 12px;
    font-size: 11.5px;
  }

  .campers-panel,
  .chat-panel {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: var(--drawer-bottom, 128px);
    max-height: calc(100dvh - var(--top-hud-bottom, 130px) - var(--drawer-bottom, 128px) - 8px);
  }

  .interaction-dock {
    bottom: 8px;
    left: 5px;
    right: 5px;
    transform: none;
    width: auto;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
    border-radius: 15px;
    z-index: 40;
    overflow: visible;
  }

  .interaction-dock.indoor-dock {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dock-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5px 1px;
    gap: 2px;
    border-radius: 11px;
    min-width: 0;
    overflow: hidden;
  }

  .dock-emoji {
    width: 21px;
    height: 21px;
  }

  .dock-svg {
    width: 20px;
    height: 20px;
  }

  .dock-text {
    width: 100%;
    overflow: hidden;
  }

  .dock-text strong {
    font-size: 9.5px;
    white-space: nowrap !important;
    text-overflow: ellipsis;
    overflow: hidden;
    display: block;
    width: 100%;
  }

  .dock-text small {
    display: none !important;
  }

  .m-bubble {
    padding: 4px 6px;
    font-size: 9.5px;
  }

  .cinema-stage {
    top: var(--cinema-top, 130px);
    width: var(--cinema-width, calc(100vw - 12px));
    z-index: 30;
  }

  .cinema-vol-wrap {
    display: none !important;
  }

  .projector-idle small {
    display: none;
  }

  .btn-text-full {
    display: none !important;
  }

  .btn-text-short {
    display: inline !important;
  }

  .cinema-control-bar {
    width: 100% !important;
    padding: 4px 6px !important;
    gap: 4px !important;
    box-sizing: border-box !important;
  }

  .cinema-control-bar input {
    font-size: 11px !important;
    padding: 6px 7px !important;
    min-width: 0 !important;
    flex: 1 1 0% !important;
  }

  .btn-file-cinema,
  .btn-project,
  .btn-clear-cinema {
    padding: 6px 7px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
  }

  .lobby-card {
    padding: 20px 16px 18px;
  }

  .lobby-hero-art {
    max-width: 224px;
    margin-bottom: 10px;
  }

  .lobby-title {
    font-size: 21px;
  }
}

/* 3) Ultra-narrow Phone Safety (<= 400px) */
@media (max-width: 400px) {
  .room-info-pill {
    padding: 4px 7px !important;
    gap: 5px !important;
  }

  .room-code-text {
    font-size: 12px !important;
  }

  .audio-controls .control-btn {
    font-size: 9.5px !important;
  }

  .dock-btn {
    padding: 4px 1px;
  }

  .dock-text strong {
    font-size: 9px;
  }

  .cinema-control-bar {
    gap: 3px !important;
    padding: 4px 5px !important;
  }

  .btn-file-cinema,
  .btn-project,
  .btn-clear-cinema {
    padding: 5px 5px !important;
    font-size: 10.5px !important;
  }

  .lobby-hero-art {
    max-width: 205px;
  }
}

/* 4) Short Landscape Desktop/Laptop Height Safety (<= 740px height) */
@media (min-width: 769px) and (max-height: 740px) {
  .cinema-stage {
    top: var(--cinema-top, 92px);
    width: var(--cinema-width, min(calc(100vw - 24px), calc((100dvh - 200px) * 1.777)));
  }

  .interaction-dock {
    bottom: 6px;
    padding: 5px 8px;
  }

  .dock-btn {
    padding: 5px 8px;
    white-space: nowrap !important;
    flex-shrink: 0;
  }

  .dock-emoji {
    width: 20px;
    height: 20px;
  }

  .dock-svg {
    width: 19px;
    height: 19px;
  }

  .dock-text strong {
    font-size: 11px;
    white-space: nowrap !important;
  }

  .dock-text small {
    display: none !important;
  }
}

/* 5) Short Viewport Lobby Card Safety (<= 700px height) */
@media (max-height: 700px) {
  .lobby-card {
    padding: 18px 20px;
  }

  .lobby-hero-art {
    max-width: 215px;
    margin-bottom: 8px;
  }

  .lobby-subtitle {
    margin-bottom: 12px;
  }

  .lobby-form {
    gap: 8px;
  }
}

/* 6) Ultra-Short Mobile Landscape Safety (<= 460px height) */
@media (max-height: 460px) {
  .fire-decay-notice {
    display: none;
  }

  .cinema-roof-header {
    display: none;
  }
}

/* ==========================================
   ONBOARDING GUIDE MODAL (STORYBOOK CARD)
   ========================================== */
.guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 10, 9, 0.72);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.guide-modal {
  width: min(880px, 96vw);
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  padding: 24px 26px;
  overflow: hidden;
  animation: cardSpringIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.guide-header {
  text-align: center;
  margin-bottom: 16px;
}

.guide-header h2 {
  font-size: 22px;
  color: var(--ink-dark);
  margin: 0 0 5px 0;
  font-family: 'Gowun Batang', serif;
}

.guide-desc {
  font-size: 13px;
  color: var(--ink-sub);
  margin: 0;
}

.guide-body {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 2px;
}

@media (max-width: 768px), (orientation: portrait) {
  .guide-body {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .guide-modal {
    padding: 18px 15px;
    max-height: 92dvh;
  }
  .guide-header h2 {
    font-size: 19px;
  }
}

.guide-card {
  background: var(--paper-card);
  border: 1.5px solid var(--paper-border);
  border-radius: 18px;
  padding: 13px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.guide-card:hover {
  border-color: #cca97a;
  transform: translateY(-1px);
}

.guide-card-icon {
  width: 40px;
  height: 40px;
  padding: 6px;
  background: #f5ead4;
  border: 1.5px solid #e1ceb0;
  border-radius: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-card-icon svg {
  width: 100%;
  height: 100%;
}

.guide-card-text {
  flex: 1;
}

.guide-card-text h4 {
  font-family: 'Gowun Batang', serif;
  font-size: 14px;
  font-weight: 700;
  color: #a84828;
  margin: 0 0 5px 0;
}

.guide-card-text p {
  font-size: 12px;
  color: #4f3a2e;
  margin: 0 0 3px 0;
  line-height: 1.48;
  word-break: keep-all;
}

.guide-card-text p:last-child {
  margin-bottom: 0;
}

.text-gold {
  color: #b77416;
  font-weight: 700;
}

.guide-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.guide-dont-show {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ink-sub);
  cursor: pointer;
  user-select: none;
}

.guide-dont-show input[type="checkbox"] {
  accent-color: var(--accent-fire);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.btn-close-guide {
  width: auto !important;
  padding: 9px 22px;
  font-size: 13.5px;
  border-radius: 13px;
}

/* ==========================================
   ACTIVE ROOMS DIRECTORY MODAL (STORYBOOK)
   ========================================== */
.rooms-modal {
  width: 90%;
  max-width: 560px;
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  padding: 24px 26px;
  animation: cardSpringIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.rooms-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.rooms-modal-title-wrap {
  flex: 1;
}

.rooms-modal-title {
  font-family: 'Gowun Batang', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-dark);
  margin: 0 0 4px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.inline-title-svg {
  width: 20px;
  height: 20px;
  color: var(--accent-fire);
  flex-shrink: 0;
}

.rooms-modal-desc {
  font-size: 12.5px;
  color: var(--ink-sub);
  line-height: 1.45;
  margin: 0;
  word-break: keep-all;
}

.btn-modal-close {
  background: #f1e3ca;
  border: 1.5px solid #dac49f;
  color: var(--ink-dark);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-modal-close:hover {
  background: #e9d2ae;
  transform: scale(1.06);
}

.rooms-modal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
  background: #f4e7cf;
  border: 1.5px solid #e1ceb0;
  border-radius: 13px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: #5a4235;
}

.rooms-modal-toolbar strong {
  color: #b74828;
}

.btn-chip-refresh {
  background: var(--paper-card);
  border: 1.5px solid #dac49f;
  color: #5a3d2d;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s, transform 0.2s;
}

.btn-chip-refresh:hover {
  background: #fff4df;
  transform: translateY(-1px);
}

.rooms-list-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  max-height: 52dvh;
}

.rooms-list-container::-webkit-scrollbar {
  width: 5px;
}

.rooms-list-container::-webkit-scrollbar-thumb {
  background: rgba(154, 120, 86, 0.3);
  border-radius: 4px;
}

.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px;
  background: var(--paper-card);
  border: 1.5px solid var(--paper-border);
  border-radius: 16px;
  transition: all 0.2s ease;
  gap: 12px;
}

.room-card:hover {
  background: #fff9ee;
  border-color: #d6b687;
  transform: translateY(-1.5px);
}

.room-card-info {
  flex: 1;
  min-width: 0;
}

.room-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.room-card-title {
  font-family: 'Gowun Batang', serif;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-card-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #8f5716;
  background: #f6e7cb;
  padding: 2px 7px;
  border-radius: 7px;
  border: 1px solid #dec69a;
  flex-shrink: 0;
}

.room-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--ink-sub);
}

.room-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.room-badge-users {
  background: #e9f3f8;
  color: #356680;
  border: 1px solid #c3dce9;
}

.room-badge-fire {
  background: #fdece6;
  color: #ad492a;
  border: 1px solid #efc6b8;
}

.room-badge-keep {
  background: #fef5e0;
  color: #936116;
  border: 1px solid #ecd39e;
}

.room-badge-locked {
  background: #fbf1d8;
  color: #8a5e17;
  border: 1px solid #e6cfa0;
}

.room-badge-cinema {
  background: #f2ebf8;
  color: #6a478a;
  border: 1px solid #d7c4ea;
}

.btn-room-join {
  background: var(--accent-fire);
  color: #fffaf2;
  border: none;
  border-bottom: 3px solid var(--accent-fire-edge);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 15px;
  border-radius: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.18s;
  flex-shrink: 0;
}

.btn-room-join:hover {
  background: var(--accent-fire-hover);
  transform: translateY(-1.5px);
}

.btn-room-join:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.rooms-empty-state {
  text-align: center;
  padding: 34px 16px;
  color: var(--ink-sub);
  font-size: 13.5px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .room-title-text {
    max-width: 110px;
  }
  .rooms-modal {
    width: 95%;
    padding: 18px 16px;
  }
}

@media (max-width: 480px) {
  .room-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .btn-room-join {
    width: 100%;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-flame-outer,
  .hero-flame-mid,
  .hero-flame-core,
  .hero-camper-left,
  .hero-camper-right,
  .hero-marshmallow-stick,
  .hero-ember-1,
  .hero-ember-2,
  .hero-ember-3,
  .hero-star-1,
  .hero-star-2,
  .hero-star-3 {
    animation: none !important;
  }
}
