/* ── Reset & Base ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --dn-bg: #f7f2e7;
  --dn-text: #3a5743;
  --dn-sub: #9bb5a0;
  --dn-accent: #c25b56;
  --dn-heading-font: 'Quicksand', sans-serif;
  --dn-btn-bg: rgba(255,252,245,0.7);
  --dn-btn-border: #c2b8a3;
  --dn-btn-radius: 14px;
  --dn-btn-text: #3a5743;
  --dn-input-bg: rgba(255,252,245,0.5);
  --dn-input-border: #c2b8a3;
  --dn-input-text: #3a5743;
  --dn-home-btn-bg: rgba(255,252,245,0.7);
  --dn-home-btn-border: #c2b8a3;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--dn-bg);
  color: var(--dn-text);
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
  transition: background 1.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.lights-off {
  background: #0a0a12;
}

/* ── ROOM GATE ── */
.room-gate {
  position: fixed;
  inset: 0;
  background: var(--dn-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.room-gate.gate-unlock {
  opacity: 0;
  transform: scale(1.05);
}

.room-content {
  text-align: center;
  padding: 2rem;
}

.room-title {
  font-family: var(--dn-heading-font);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 600;
  color: var(--dn-text);
  margin-bottom: 0.3em;
  cursor: pointer;
  transition: color 0.6s ease, font-family 0.3s ease;
  user-select: none;
}

.room-hint {
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: var(--dn-sub);
  font-weight: 300;
  margin-bottom: 2em;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.room-code-display {
  margin-bottom: 1.5rem;
}

.room-code-input {
  font-family: var(--dn-heading-font);
  font-size: 2.4rem;
  text-align: center;
  border: none;
  border-bottom: 3px solid var(--dn-input-border);
  background: transparent;
  padding: 0.3em 0.5em;
  outline: none;
  color: var(--dn-input-text);
  width: 6em;
  letter-spacing: 0.3em;
  transition: border-color 0.3s ease;
}

.room-code-input:focus {
  border-bottom-color: var(--dn-accent);
}

.room-code-input::placeholder {
  color: #ddd;
  letter-spacing: 0.3em;
}

.room-buttons {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.room-btn {
  font-family: var(--dn-heading-font);
  font-size: 1.2rem;
  background: var(--dn-btn-bg);
  border: 1.5px solid var(--dn-btn-border);
  border-radius: var(--dn-btn-radius);
  padding: 0.5em 1.8em;
  cursor: pointer;
  color: var(--dn-btn-text);
  transition: all 0.3s ease;
}

.room-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border-color: var(--dn-accent);
}

.room-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.room-btn-alt {
  background: transparent;
  color: var(--dn-sub);
}

.room-status {
  font-family: var(--dn-heading-font);
  font-size: 1.1rem;
  color: var(--dn-sub);
  margin-top: 1.2rem;
  min-height: 1.5em;
}

.room-error {
  color: #d4726a;
}

.room-info {
  font-family: var(--dn-heading-font);
  font-size: 0.95rem;
  color: var(--dn-sub);
  margin-top: 2rem;
}

/* ── CONGRATS BANNER ── */
.room-congrats {
  margin-bottom: 1.2em;
  padding: 0.8em 1.5em;
  background: color-mix(in srgb, var(--dn-accent) 8%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--dn-accent) 20%, transparent);
  border-radius: 14px;
  display: inline-block;
}

.congrats-text {
  font-family: 'Caveat', cursive;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--dn-accent);
  font-style: italic;
}

/* ── PARTNER CURSOR ── */
.partner-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  display: none;
  transition: left 0.08s linear, top 0.08s linear;
}

.partner-label {
  font-family: var(--dn-heading-font);
  font-size: 0.8rem;
  color: var(--dn-accent);
  position: absolute;
  left: 18px;
  top: 14px;
  white-space: nowrap;
  opacity: 0.7;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ── Waiting Banner ── */
.waiting-banner {
  font-family: 'Caveat', cursive;
  font-size: 0.85rem;
  color: var(--dn-sub);
  opacity: 0.6;
  margin-bottom: 1em;
}

.waiting-banner span {
  font-weight: 600;
  color: var(--dn-accent);
  letter-spacing: 0.12em;
}

/* ── Home Characters Row ── */
.home-chars-row {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 1.5em;
}

.home-char-slot {
  text-align: center;
  transition: opacity 0.5s ease;
}

.home-char {
  position: relative;
  width: 72px;
  height: 108px;
  margin: 0 auto;
  animation: char-idle 2s ease-in-out infinite;
}

@keyframes char-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.home-char .hc-hair {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 42px; height: 24px; border-radius: 50% 50% 30% 30%; z-index: 3;
}
.home-char .hc-face {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 36px; border-radius: 50%; z-index: 2;
}
.home-char .hc-eyes {
  position: absolute; top: 25px; left: 50%; transform: translateX(-50%);
  width: 20px; display: flex; justify-content: space-between; z-index: 4;
}
.home-char .hc-eye {
  width: 5px; height: 6px; background: #1a1a1a; border-radius: 50%;
}
.home-char .hc-mouth {
  position: absolute; top: 35px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 5px; border-bottom: 2px solid #c0756b; border-radius: 0 0 50% 50%; z-index: 4;
}
.home-char .hc-body {
  position: absolute; top: 45px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 30px; border-radius: 8px 8px 4px 4px; z-index: 1;
}
.home-char .hc-legs {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
}
.home-char .hc-leg {
  width: 12px; height: 24px; border-radius: 4px 4px 6px 6px;
}

.home-char-name {
  font-family: var(--dn-heading-font);
  font-size: 1.1rem;
  color: var(--dn-text);
  margin-top: 0.4rem;
}

/* ── Action Buttons ── */
.home-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5em;
}

.home-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 120px;
  padding: 1.4rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.home-action-create {
  background: var(--dn-btn-bg);
  border: 2px dashed var(--dn-btn-border);
  color: var(--dn-btn-text);
}

.home-action-go {
  background: var(--dn-accent);
  border: 2px solid var(--dn-accent);
  color: #fff;
}

.home-action-btn:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.home-action-go:hover {
  box-shadow: 0 10px 30px rgba(232, 93, 117, 0.3);
}

.home-action-secondary {
  background: var(--dn-btn-bg);
  border: 1.5px solid var(--dn-btn-border);
  color: var(--dn-btn-text);
  width: 95px;
  padding: 1rem 0.6rem;
}

.ha-icon {
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ha-label {
  font-family: var(--dn-heading-font);
  font-size: 1rem;
}

/* ── Floating Sparkles ── */
.home-sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  bottom: -10%;
  color: var(--dn-accent);
  opacity: 0;
  animation: sparkle-float linear infinite;
}

@keyframes sparkle-float {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  15% { opacity: 0.5; }
  85% { opacity: 0.3; }
  100% { opacity: 0; transform: translateY(-100vh) rotate(360deg); }
}

/* ── BACK BUTTON ── */
.back-btn {
  position: fixed;
  top: 1.5rem;
  left: 1.5rem;
  background: none;
  border: none;
  font-family: var(--dn-heading-font);
  font-size: 1.2rem;
  color: var(--dn-sub);
  cursor: pointer;
  z-index: 100;
  transition: color 0.3s;
  text-decoration: none;
}

.back-btn:hover {
  color: var(--dn-text);
}

.back-btn-dark {
  color: rgba(255,255,255,0.3);
}

.back-btn-dark:hover {
  color: rgba(255,255,255,0.6);
}

/* ── JAR STATES ── */
.jar-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
  opacity: 0;
  pointer-events: none;
}

.jar-state.active {
  opacity: 1;
  pointer-events: all;
}

.lights-on-content {
  text-align: center;
}

.jar-prompt {
  font-family: var(--dn-heading-font);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: var(--dn-text);
  line-height: 1.4;
  margin-bottom: 2.5rem;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

/* ── TENT TOGGLE SWITCH (uiverse.io/m1her) ── */
.tent-switch {
  width: 192px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #ebe6ef;
  border: 4px solid #121331;
  margin: 0 auto;
}

.tent-switch:has(:checked) {
  background: #3a3347;
}

.tent-switch-inner {
  display: flex;
  height: 100%;
  width: 100%;
  padding: 0 8px;
  align-items: center;
  gap: 8px;
}

.tent-dot {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 4px solid #121331;
}

.tent-label {
  flex: 1;
  height: 40px;
  border: 4px solid #121331;
  border-radius: 4px;
  cursor: pointer;
  transform: scaleX(1);
  display: block;
}

.tent-label input {
  display: none;
}

.tent-label:has(:checked) {
  transform: scaleX(-1);
}

.tent {
  width: 100%;
  height: 100%;
  background: #f24c00;
  position: relative;
  overflow: visible;
}

.tent-top {
  width: 0;
  height: 0;
  border-left: 24px solid transparent;
  border-right: 24px solid transparent;
  border-top: 20px solid #121331;
  position: relative;
  z-index: 20;
}

.tent-top-inner {
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 15px solid #e44901;
  position: absolute;
  top: -20px;
  left: -18px;
}

.tent-left {
  width: 24px;
  height: 36px;
  position: absolute;
  z-index: 10;
  top: 9px;
  left: 0;
  background: #f24c00;
  border-right: 2px solid #121331;
  border-bottom: 4px solid #121331;
  transform: skewY(39deg);
}

.tent-right {
  width: 25px;
  height: 36px;
  position: absolute;
  z-index: 10;
  top: 9px;
  left: 24px;
  background: #c44002;
  border-right: 4px solid #121331;
  border-left: 2px solid #121331;
  border-bottom: 4px solid #121331;
  transform: skewY(-39deg);
}

.tent-line {
  width: 24px;
  height: 4px;
  flex-shrink: 0;
  background: #121331;
  border-radius: 9999px;
}

/* ── Vertical rotation ── */
.tent-switch.vertical {
  transform: rotate(180deg);
}

/* ── Scared corner (bottom-right in dark mode) ── */
.scared-corner {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  z-index: 30;
  opacity: 0;
  transition: opacity 1s ease 0.5s;
}

.scared-corner.visible {
  opacity: 1;
}

.scared-text {
  font-family: 'Caveat', cursive;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.25);
  text-align: center;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s;
}

.scared-text:visited,
.scared-text:hover {
  text-decoration: none;
}

.scared-text:hover {
  color: rgba(255, 255, 255, 0.5);
}

/* ── TRANSITION ANIMATIONS ── */
.jar-prompt.fade-out {
  opacity: 0;
  transform: translateY(-20px);
}

/* ── LIGHTS OFF / CAMPFIRE STATE ── */
#lights-off {
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
  background: #0a0a12;
}

.campfire-scene {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  position: relative;
  width: 100%;
  padding-bottom: 2rem;
}

/* ── CAMPFIRE ── */
.campfire {
  position: relative;
  width: 120px;
  height: 100px;
}

.flame-wrapper {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 70px;
}

.flame {
  position: absolute;
  bottom: 0;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flicker 0.4s infinite alternate;
}

.flame-1 {
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 55px;
  background: linear-gradient(to top, #ff6b35, #ff9a56, #ffd700);
  opacity: 0.9;
  animation-duration: 0.3s;
}

.flame-2 {
  left: 30%;
  transform: translateX(-50%);
  width: 22px;
  height: 40px;
  background: linear-gradient(to top, #ff4500, #ff6b35, #ffa500);
  opacity: 0.7;
  animation-duration: 0.5s;
  animation-delay: 0.1s;
}

.flame-3 {
  left: 70%;
  transform: translateX(-50%);
  width: 20px;
  height: 35px;
  background: linear-gradient(to top, #ff4500, #ff6b35, #ff8c00);
  opacity: 0.7;
  animation-duration: 0.45s;
  animation-delay: 0.2s;
}

.flame-inner {
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 30px;
  background: linear-gradient(to top, #fff8dc, #ffd700, #ffa500);
  opacity: 0.9;
  animation-duration: 0.35s;
}

@keyframes flicker {
  0% {
    transform: translateX(-50%) scaleY(1) scaleX(1) rotate(-1deg);
  }
  50% {
    transform: translateX(-50%) scaleY(1.05) scaleX(0.95) rotate(1deg);
  }
  100% {
    transform: translateX(-50%) scaleY(0.95) scaleX(1.05) rotate(-0.5deg);
  }
}

.logs {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.log {
  position: absolute;
  width: 60px;
  height: 14px;
  background: linear-gradient(to right, #5c3317, #8b4513, #5c3317);
  border-radius: 7px;
  bottom: 0;
}

.log-1 {
  transform: rotate(-20deg);
  left: -35px;
}

.log-2 {
  transform: rotate(20deg);
  left: -25px;
}

.fire-glow {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 350px;
  height: 350px;
  background: radial-gradient(ellipse, rgba(255, 140, 0, 0.2) 0%, rgba(255, 69, 0, 0.08) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: glow-pulse 2s infinite alternate;
}

@keyframes glow-pulse {
  0% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* ── JAR GRID (one jar per category) ── */
.jar-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 1.4rem 1.6rem;
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 500px;
  padding: 0 1rem;
  z-index: 10;
}

/* ── SINGLE JAR ── */
.jar-prompt-text {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  color: rgba(255, 200, 120, 0.7);
  text-align: center;
  z-index: 10;
  pointer-events: none;
}

.single-jar {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.3s ease;
  z-index: 10;
}

.single-jar:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.single-jar .jar {
  width: 110px;
  height: 150px;
}

.single-jar .jar-lid {
  width: 68px;
  height: 18px;
}

.single-jar .jar-lid::after {
  bottom: -5px;
  left: -6px;
  right: -6px;
  height: 7px;
}

.single-jar .jar-body {
  width: 90px;
  height: 118px;
  top: 20px;
}

.single-jar .paper {
  width: 30px;
}

.single-jar .paper-1 { height: 52px; bottom: 10px; left: 10px; }
.single-jar .paper-2 { height: 44px; bottom: 8px; left: 30px; }
.single-jar .paper-3 { height: 48px; bottom: 12px; right: 10px; }

.deck-jar {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.deck-jar:hover {
  transform: scale(1.1);
}

.deck-jar .jar {
  width: 85px;
  height: 115px;
}

.deck-jar .jar-lid {
  width: 52px;
  height: 14px;
}

.deck-jar .jar-lid::after {
  bottom: -4px;
  left: -5px;
  right: -5px;
  height: 6px;
}

.deck-jar .jar-body {
  width: 70px;
  height: 90px;
  top: 16px;
}

.deck-jar .paper {
  width: 24px;
}

.deck-jar .paper-1 { height: 42px; bottom: 8px; left: 8px; }
.deck-jar .paper-2 { height: 36px; bottom: 6px; left: 24px; }
.deck-jar .paper-3 { height: 40px; bottom: 10px; right: 8px; }

.deck-jar.active .jar-body {
  border-color: rgba(255, 200, 100, 0.45);
  box-shadow: 0 0 10px rgba(255, 160, 50, 0.2);
}

/* ── MASKING TAPE LABEL ── */
.tape-label {
  position: absolute;
  top: 58%;
  left: -4px;
  right: -4px;
  text-align: center;
  background: rgba(235, 225, 195, 0.82);
  padding: 1px 2px;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 0.9rem;
  color: #111;
  letter-spacing: 0.02em;
  z-index: 5;
  transform: rotate(-2deg);
  border-top: 1px solid rgba(210, 200, 170, 0.3);
  border-bottom: 1px solid rgba(210, 200, 170, 0.3);
  pointer-events: none;
}

/* Vary tape rotation per jar for organic feel */
.deck-jar:nth-child(2) .tape-label { transform: rotate(1.5deg); }
.deck-jar:nth-child(3) .tape-label { transform: rotate(-1deg); }
.deck-jar:nth-child(4) .tape-label { transform: rotate(2deg); }
.deck-jar:nth-child(5) .tape-label { transform: rotate(-0.5deg); }
.deck-jar:nth-child(6) .tape-label { transform: rotate(1deg); }
.deck-jar:nth-child(7) .tape-label { transform: rotate(-1.5deg); }

/* ── THE JAR ── */
.jar-container {
  cursor: pointer;
  transition: transform 0.3s ease;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.jar-container:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.jar-container:hover .jar-label {
  opacity: 1;
}

.jar {
  position: relative;
  width: 100px;
  height: 130px;
}

.jar-lid {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 16px;
  background: linear-gradient(to bottom, #b8860b, #8b6914);
  border-radius: 4px 4px 0 0;
  z-index: 3;
}

.jar-lid::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: -5px;
  right: -5px;
  height: 6px;
  background: linear-gradient(to bottom, #daa520, #b8860b);
  border-radius: 2px;
}

.jar-body {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 105px;
  background: rgba(200, 220, 240, 0.12);
  border: 2px solid rgba(200, 220, 240, 0.2);
  border-radius: 5px 5px 20px 20px;
  overflow: hidden;
  backdrop-filter: blur(2px);
}

/* Papers inside the jar */
.paper {
  position: absolute;
  width: 28px;
  border-radius: 2px;
  transform-origin: bottom center;
}

.paper-1 {
  height: 45px;
  background: #ffecd2;
  bottom: 10px;
  left: 10px;
  transform: rotate(-12deg);
}

.paper-2 {
  height: 40px;
  background: #ffe4c9;
  bottom: 8px;
  left: 28px;
  transform: rotate(5deg);
}

.paper-3 {
  height: 42px;
  background: #fff3e0;
  bottom: 12px;
  right: 10px;
  transform: rotate(15deg);
}

.paper-4 {
  height: 38px;
  background: #fce4d6;
  bottom: 5px;
  left: 18px;
  transform: rotate(-5deg);
}

.paper-5 {
  height: 35px;
  background: #ffecd2;
  bottom: 8px;
  right: 18px;
  transform: rotate(10deg);
}

.jar-label {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Caveat', cursive;
  font-size: 1rem;
  color: rgba(255, 200, 100, 0.5);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
}

/* ── FIREFLIES ── */
#fireflies {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd700;
  box-shadow: 0 0 8px 3px rgba(255, 215, 0, 0.4),
              0 0 20px 6px rgba(255, 215, 0, 0.15);
  animation: firefly-float linear infinite,
             firefly-glow 2s ease-in-out infinite alternate;
}

@keyframes firefly-glow {
  0% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.3; transform: scale(0.6); }
}

/* ── QUESTION DISPLAY ── */
.question-display {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  background: rgba(5, 5, 10, 0.85);
  backdrop-filter: blur(6px);
  padding: 2rem;
}

.question-display.visible {
  opacity: 1;
  pointer-events: all;
}

.paper-unfurl {
  position: relative;
  max-width: 420px;
  width: 90%;
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.question-display.visible .paper-unfurl {
  transform: scaleY(1);
}

.paper-scroll {
  background: linear-gradient(135deg, #ffecd2, #fff8ef, #ffecd2);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  box-shadow:
    0 4px 30px rgba(255, 180, 80, 0.15),
    inset 0 0 30px rgba(200, 160, 100, 0.08);
  position: relative;
  overflow: hidden;
}

/* Subtle paper texture lines */
.paper-scroll::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 28px,
    rgba(180, 150, 100, 0.08) 28px,
    rgba(180, 150, 100, 0.08) 29px
  );
  pointer-events: none;
}

/* Fold crease */
.paper-scroll::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  background: rgba(180, 150, 100, 0.12);
  pointer-events: none;
}

.question-text {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  color: #5c4033;
  text-align: center;
  line-height: 1.5;
}

.next-btn, .close-btn {
  background: none;
  border: none;
  font-family: 'Caveat', cursive;
  cursor: pointer;
  transition: all 0.3s ease;
}

.next-btn {
  margin-top: 2rem;
  font-size: 1.3rem;
  color: rgba(255, 200, 100, 0.7);
  padding: 0.5em 1.5em;
  border: 1px solid rgba(255, 200, 100, 0.2);
  border-radius: 30px;
}

.next-btn:hover {
  color: rgba(255, 200, 100, 1);
  border-color: rgba(255, 200, 100, 0.5);
}

.close-btn {
  margin-top: 1rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.3);
}

.close-btn:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* ── PEOPLE ── */
.person {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 5;
}

.person-left {
  margin-right: -10px;
  margin-bottom: 10px;
}

.person-right {
  margin-left: -10px;
  margin-bottom: 10px;
}

.person-head {
  position: relative;
  width: 36px;
  height: 36px;
}

.face {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 28px;
  border-radius: 50%;
  z-index: 2;
}

.face-brown {
  background: #c68642;
}

.face-dark {
  background: #5c3a1e;
}

/* ── Indian girl: curly black hair ── */
.hair-curly-black {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 30px;
  z-index: 3;
}

.curl {
  position: absolute;
  border-radius: 50%;
  background: #1a1a1a;
}

.curl-1 {
  width: 14px;
  height: 14px;
  top: 0;
  left: 4px;
}

.curl-2 {
  width: 16px;
  height: 14px;
  top: -2px;
  left: 12px;
}

.curl-3 {
  width: 13px;
  height: 13px;
  top: 1px;
  right: 2px;
}

.curl-4 {
  width: 12px;
  height: 14px;
  top: 10px;
  left: 0;
}

.curl-5 {
  width: 12px;
  height: 14px;
  top: 10px;
  right: 0;
}

.curl-6 {
  width: 14px;
  height: 12px;
  top: 8px;
  left: 12px;
}

/* ── Black man: afro with blond tips ── */
.hair-afro {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 36px;
  z-index: 3;
}

.afro-base {
  position: absolute;
  inset: 0;
  border-radius: 50% 50% 45% 45%;
  background: #1a1a1a;
}

.afro-tips {
  position: absolute;
  top: 0;
  left: 2px;
  right: 2px;
  height: 14px;
  border-radius: 50% 50% 40% 40%;
  background: linear-gradient(to bottom, #d4a843, #c49a38, transparent);
  opacity: 0.85;
}

/* ── Bodies ── */
.person-body {
  width: 30px;
  height: 28px;
  border-radius: 8px 8px 0 0;
  margin-top: -2px;
}

.body-left {
  background: #e85d75;
}

.body-right {
  background: #4a7c9b;
}

/* ── Marshmallow sticks ── */
.marshmallow-stick {
  position: absolute;
  bottom: 12px;
  z-index: 4;
}

.stick-left {
  right: -45px;
  transform: rotate(30deg);
  transform-origin: left center;
}

.stick-right {
  left: -45px;
  transform: rotate(-30deg);
  transform-origin: right center;
}

.stick {
  width: 55px;
  height: 3px;
  background: linear-gradient(to right, #8b7355, #a0896b);
  border-radius: 2px;
}

.marshmallow {
  position: absolute;
  right: -6px;
  top: -5px;
  width: 12px;
  height: 14px;
  background: linear-gradient(135deg, #fff5e6, #f5e6d0);
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(255, 180, 80, 0.3);
}

.stick-right .marshmallow {
  left: -6px;
  right: auto;
}

/* ── AMBIENT BODY GLOW ── */
body.lights-off::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 60%;
  background: radial-gradient(ellipse at center bottom, rgba(255, 120, 30, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Responsive ── */
@media (max-width: 500px) {
  .room-content {
    padding: 1.5rem 1rem;
  }

  .room-code-input {
    font-size: 2rem;
    width: 5.5em;
  }

  .room-btn {
    font-size: 1.1rem;
    padding: 0.55em 1.5em;
    min-height: 44px;
  }

  .home-action-btn {
    width: 110px;
    padding: 1.2rem 0.8rem;
  }

  .back-btn {
    top: 1rem;
    left: 1rem;
    font-size: 1.1rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .scared-corner {
    bottom: 1rem;
    right: 1rem;
  }

  .jar {
    width: 80px;
    height: 110px;
  }

  .jar-lid {
    width: 50px;
    height: 14px;
  }

  .jar-body {
    width: 65px;
    height: 90px;
  }

  .campfire {
    width: 100px;
    height: 80px;
  }

  .paper-scroll {
    padding: 2rem 1.5rem;
  }

  .tent-switch {
    width: 150px;
  }

  .jar-grid {
    gap: 1rem 1.2rem;
    max-width: 380px;
    top: 38%;
  }

  .deck-jar .jar {
    width: 70px;
    height: 95px;
  }

  .deck-jar .jar-lid {
    width: 44px;
    height: 12px;
  }

  .deck-jar .jar-body {
    width: 58px;
    height: 74px;
    top: 14px;
  }

  .deck-jar .paper {
    width: 20px;
  }

  .tape-label {
    font-size: 0.75rem;
  }

  .question-display {
    padding: 1.2rem;
  }

  .fire-glow {
    width: 250px;
    height: 250px;
  }
}

@media (max-width: 360px) {
  .home-actions {
    gap: 0.7rem;
  }

  .home-action-btn {
    width: 100px;
    padding: 1rem 0.6rem;
  }

  .ha-label {
    font-size: 0.9rem;
  }

  .jar-grid {
    gap: 0.8rem 1rem;
    max-width: 320px;
  }

  .deck-jar .jar {
    width: 60px;
    height: 82px;
  }

  .deck-jar .jar-lid {
    width: 38px;
    height: 10px;
  }

  .deck-jar .jar-body {
    width: 50px;
    height: 64px;
    top: 12px;
  }

  .deck-jar .paper {
    width: 16px;
  }

  .tape-label {
    font-size: 0.65rem;
  }
}
