/* ============================================
   MIMI'S HAUNTED HOUSE ESCAPE - STYLES
   Aesthetic: Sixth Sense × Dia de los Muertos × Wednesday Addams
   ============================================ */

:root {
  --bg-dark: #0d0221;
  --bg-purple: #1a0a2e;
  --bg-mid: #2d1854;
  --purple: #7b2d8e;
  --purple-light: #a855c7;
  --marigold: #f4a261;
  --marigold-bright: #ffb347;
  --orange-red: #e76f51;
  --teal: #2a9d8f;
  --teal-light: #40c9b8;
  --red: #e63946;
  --pink: #ff6b9d;
  --bone: #f0e6d3;
  --bone-dim: #c4b5a0;
  --gold: #ffd700;
  --green-glow: #39ff14;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: 'Patrick Hand', cursive, sans-serif;
  background: var(--bg-dark); color: var(--bone);
}
body {
  display: flex; justify-content: center; align-items: center;
  background: radial-gradient(ellipse at 50% 0%, #1a0a3e 0%, var(--bg-dark) 70%), var(--bg-dark);
}

/* ===== SCREENS ===== */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity 0.6s ease;
  overflow-y: auto; padding: 20px;
}
.screen.active { opacity: 1; pointer-events: all; }
.screen-content { max-width: 700px; width: 100%; text-align: center; padding: 20px; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 { font-family: 'Creepster', cursive; letter-spacing: 2px; }
h2 {
  font-size: 2.5rem; color: var(--marigold);
  text-shadow: 0 0 20px rgba(244,162,97,0.5), 0 2px 4px rgba(0,0,0,0.8);
  margin-bottom: 0.5rem;
}
.subtitle { font-size: 1.2rem; color: var(--bone-dim); margin-bottom: 1.5rem; }

/* ===== BUTTONS ===== */
.spooky-btn {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  border: 2px solid var(--marigold); color: var(--bone);
  font-family: 'Creepster', cursive; font-size: 1.5rem; letter-spacing: 2px;
  padding: 15px 40px; border-radius: 12px; cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(123,45,142,0.4), 0 0 30px rgba(244,162,97,0.1);
  margin-top: 1rem;
}
.spooky-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 6px 25px rgba(123,45,142,0.6), 0 0 40px rgba(244,162,97,0.3);
  border-color: var(--marigold-bright);
}
.spooky-btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.spooky-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.spooky-btn.small { font-size: 1.1rem; padding: 10px 25px; }
.spooky-btn.secondary { background: linear-gradient(135deg, #333, #555); border-color: var(--bone-dim); }
.link-btn {
  background: none; border: none; color: var(--teal-light);
  font-family: 'Patrick Hand', cursive; font-size: 1.1rem;
  cursor: pointer; text-decoration: underline; transition: color 0.3s; padding: 8px;
}
.link-btn:hover { color: var(--marigold); }

/* ===== TITLE SCREEN ===== */
.title-container { text-align: center; z-index: 2; position: relative; }
.game-title { margin-bottom: 1rem; }
.title-line { display: block; color: var(--bone); font-size: 2rem; text-shadow: 0 0 10px rgba(244,162,97,0.3); }
.title-main {
  font-size: 4rem; color: var(--marigold);
  text-shadow: 0 0 20px rgba(244,162,97,0.6), 0 0 40px rgba(244,162,97,0.3), 0 4px 8px rgba(0,0,0,0.8);
  animation: titlePulse 3s ease-in-out infinite;
}
@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 20px rgba(244,162,97,0.6), 0 0 40px rgba(244,162,97,0.3), 0 4px 8px rgba(0,0,0,0.8); }
  50% { text-shadow: 0 0 30px rgba(244,162,97,0.8), 0 0 60px rgba(244,162,97,0.5), 0 4px 8px rgba(0,0,0,0.8); }
}
.sugar-skull-divider { font-size: 1.5rem; margin: 0.5rem 0; display: flex; justify-content: center; gap: 0.5rem; }
.tagline { font-size: 1.3rem; color: var(--teal-light); margin-bottom: 1rem; font-style: italic; }
.title-footer { margin-top: 1rem; }
.floating-ghosts, .floating-bats { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.ghost { position: absolute; font-size: 2.5rem; opacity: 0.3; animation: ghostFloat 8s ease-in-out infinite; }
.ghost-1 { top: 15%; left: 5%; animation-delay: 0s; }
.ghost-2 { top: 60%; right: 8%; animation-delay: 2.5s; }
.ghost-3 { top: 35%; left: 80%; animation-delay: 5s; }
@keyframes ghostFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); opacity: 0.2; }
  25% { transform: translateY(-30px) rotate(5deg); opacity: 0.4; }
  50% { transform: translateY(-15px) rotate(-3deg); opacity: 0.3; }
  75% { transform: translateY(-40px) rotate(4deg); opacity: 0.35; }
}
.bat { position: absolute; font-size: 1.8rem; opacity: 0.25; animation: batFly 12s linear infinite; }
.bat-1 { top: 10%; } .bat-2 { top: 25%; animation-delay: 6s; }
@keyframes batFly {
  0% { left: -10%; transform: scaleX(1); } 49% { transform: scaleX(1); }
  50% { left: 110%; transform: scaleX(-1); } 99% { transform: scaleX(-1); }
  100% { left: -10%; transform: scaleX(1); }
}
.cobweb { position: fixed; width: 150px; height: 150px; z-index: 10; pointer-events: none; opacity: 0.15; }
.cobweb-left { top: 0; left: 0; background: radial-gradient(ellipse at 0% 0%, rgba(255,255,255,0.3) 0%, transparent 70%); }
.cobweb-right { top: 0; right: 0; background: radial-gradient(ellipse at 100% 0%, rgba(255,255,255,0.3) 0%, transparent 70%); }

/* ===== NAME SCREEN ===== */
.name-input-wrapper { position: relative; max-width: 400px; margin: 0 auto 1rem; }
#player-name {
  width: 100%; padding: 15px 20px; font-family: 'Patrick Hand', cursive; font-size: 1.4rem;
  background: rgba(255,255,255,0.05); border: 2px solid var(--purple);
  border-radius: 10px; color: var(--bone); outline: none; transition: all 0.3s; text-align: center;
}
#player-name::placeholder { color: var(--bone-dim); opacity: 0.5; }
#player-name:focus { border-color: var(--marigold); box-shadow: 0 0 20px rgba(244,162,97,0.3); }

/* ===== AVATAR SCREEN ===== */
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; max-width: 600px; margin: 0 auto 1rem; }
.avatar-card {
  background: rgba(255,255,255,0.05); border: 2px solid rgba(123,45,142,0.3);
  border-radius: 12px; padding: 15px 8px 10px; cursor: pointer; transition: all 0.3s; text-align: center;
}
.avatar-card:hover { background: rgba(255,255,255,0.1); border-color: var(--purple-light); transform: translateY(-4px); }
.avatar-card.selected { border-color: var(--marigold); background: rgba(244,162,97,0.15); box-shadow: 0 0 20px rgba(244,162,97,0.3); }
.avatar-card .avatar-icon { font-size: 3rem; display: block; margin-bottom: 5px; }
.avatar-card .avatar-name { font-size: 0.9rem; color: var(--bone-dim); }

/* ===== HUD ===== */
#game-screen { justify-content: flex-start; }
.hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px;
  background: linear-gradient(180deg, rgba(13,2,33,0.95) 0%, rgba(13,2,33,0.7) 80%, transparent 100%);
  z-index: 20; gap: 10px;
}
.hud-left { display: flex; align-items: center; gap: 10px; }
.hud-avatar { font-size: 1.8rem; }
.hud-name { font-family: 'Patrick Hand', cursive; font-size: 1.2rem; color: var(--marigold); }
.hud-center { font-family: 'Creepster', cursive; font-size: 1.3rem; color: var(--teal-light); letter-spacing: 1px; }
.hud-right { display: flex; align-items: center; gap: 15px; }
.hud-timer { font-family: 'Creepster', cursive; font-size: 1.3rem; color: var(--bone); display: flex; align-items: center; gap: 5px; }
.hud-tries { display: flex; gap: 3px; }
.try-dot { font-size: 1.2rem; transition: all 0.3s; }
.try-dot.used { opacity: 0.2; filter: grayscale(1); }

/* ===========================================================
   ROOM CONTAINER & SCENE BASE
   =========================================================== */
.room-container {
  width: 100%; max-width: 800px; height: 45vh; min-height: 250px; max-height: 400px;
  margin: 70px auto 0; position: relative; border-radius: 15px; overflow: hidden;
  border: 3px solid var(--purple);
  box-shadow: 0 0 30px rgba(123,45,142,0.3), inset 0 0 50px rgba(0,0,0,0.5);
}
.room-scene { position: relative; width: 100%; height: 100%; overflow: hidden; }

/* --- Shared room structure --- */
.r-back-wall { position: absolute; top: 0; left: 12%; right: 12%; height: 62%; z-index: 1; }
.r-left-wall { position: absolute; top: 0; left: 0; width: 12%; height: 100%; z-index: 2; }
.r-right-wall { position: absolute; top: 0; right: 0; width: 12%; height: 100%; z-index: 2; }
.r-floor { position: absolute; bottom: 0; left: 0; right: 0; height: 38%; z-index: 1; }
.room-vignette {
  position: absolute; inset: 0; z-index: 8; pointer-events: none;
  background: radial-gradient(ellipse at 50% 40%, transparent 30%, rgba(0,0,0,0.7) 100%);
}

/* Dust motes */
.dust-motes { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.mote {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(240,230,211,0.4);
  animation: moteFloat linear infinite;
}
.mote:nth-child(1) { left: 20%; top: 80%; animation-duration: 8s; animation-delay: 0s; }
.mote:nth-child(2) { left: 50%; top: 90%; animation-duration: 10s; animation-delay: 1.5s; }
.mote:nth-child(3) { left: 75%; top: 85%; animation-duration: 9s; animation-delay: 3s; }
.mote:nth-child(4) { left: 35%; top: 95%; animation-duration: 11s; animation-delay: 2s; }
.mote:nth-child(5) { left: 60%; top: 70%; animation-duration: 7s; animation-delay: 4s; }
.mote:nth-child(6) { left: 85%; top: 75%; animation-duration: 12s; animation-delay: 0.5s; }
@keyframes moteFloat {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-350px) translateX(30px); opacity: 0; }
}

/* ===========================================================
   ROOM 1: THE GRAND FOYER
   =========================================================== */
.foyer-scene .r-back-wall {
  background:
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(100,50,130,0.12) 49px, rgba(100,50,130,0.12) 50px),
    repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(100,50,130,0.08) 49px, rgba(100,50,130,0.08) 50px),
    linear-gradient(180deg, #2a1845 0%, #1f1035 100%);
}
.foyer-scene .r-left-wall {
  background: linear-gradient(90deg, #150a25, #1f1035);
  clip-path: polygon(0 0, 100% 6%, 100% 56%, 0 100%);
}
.foyer-scene .r-right-wall {
  background: linear-gradient(270deg, #150a25, #1f1035);
  clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 56%);
}
.foyer-scene .r-floor {
  background:
    repeating-conic-gradient(#141424 0% 25%, #1e1e30 0% 50%) 0 0/40px 40px;
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

/* Chandelier */
.foyer-chandelier {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center;
}
.ch-chain { width: 2px; height: 20px; background: #8b7355; }
.ch-body {
  width: 80px; height: 35px; border: 2px solid #8b7355;
  border-top: none; border-radius: 0 0 50% 50%;
  background: linear-gradient(180deg, transparent, rgba(139,115,85,0.2));
  position: relative;
}
.ch-candles { display: flex; justify-content: space-around; position: absolute; top: -15px; left: -10px; right: -10px; }
.ch-candle { display: flex; flex-direction: column; align-items: center; }
.ch-stick { width: 4px; height: 12px; background: #d4c5a9; border-radius: 1px; }
.ch-flame {
  width: 8px; height: 14px;
  background: radial-gradient(ellipse at 50% 80%, #fff 0%, #ffd700 30%, #ff8c00 60%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flameFlicker 1.5s ease-in-out infinite alternate;
  filter: blur(0.5px);
}
.ch-candle:nth-child(2) .ch-flame { animation-delay: 0.3s; }
.ch-candle:nth-child(3) .ch-flame { animation-delay: 0.7s; }
.ch-candle:nth-child(4) .ch-flame { animation-delay: 0.2s; }
.ch-candle:nth-child(5) .ch-flame { animation-delay: 0.9s; }
.chandelier-glow {
  position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
  width: 250px; height: 200px; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,200,80,0.15) 0%, transparent 70%);
}
@keyframes flameFlicker {
  0% { transform: scaleY(1) scaleX(1); opacity: 0.8; }
  25% { transform: scaleY(1.1) scaleX(0.9); opacity: 1; }
  50% { transform: scaleY(0.85) scaleX(1.05); opacity: 0.7; }
  75% { transform: scaleY(1.05) scaleX(0.95); opacity: 0.9; }
  100% { transform: scaleY(0.9) scaleX(1.02); opacity: 0.85; }
}

/* Staircase */
.foyer-staircase {
  position: absolute; bottom: 37%; left: 30%; width: 40%; height: 50%; z-index: 3;
}
.stair-body {
  width: 100%; height: 100%;
  background:
    repeating-linear-gradient(0deg,
      rgba(30,20,50,0.9) 0px, rgba(30,20,50,0.9) 18px,
      rgba(80,50,110,0.3) 18px, rgba(80,50,110,0.3) 20px
    );
  clip-path: polygon(15% 100%, 85% 100%, 95% 0%, 5% 0%);
  border: 1px solid rgba(100,60,140,0.3);
}
.stair-rail-l, .stair-rail-r {
  position: absolute; bottom: 0; width: 3px; background: rgba(139,115,85,0.6);
}
.stair-rail-l { left: 14%; height: 100%; transform: rotate(3deg); transform-origin: bottom; }
.stair-rail-r { right: 14%; height: 100%; transform: rotate(-3deg); transform-origin: bottom; }
.stair-newel-l, .stair-newel-r {
  position: absolute; bottom: -2px; width: 10px; height: 20px;
  background: #8b7355; border-radius: 3px;
}
.stair-newel-l { left: calc(14% - 4px); }
.stair-newel-r { right: calc(14% - 4px); }

/* Archways */
.foyer-arch {
  position: absolute; bottom: 38%; width: 15%; height: 35%; z-index: 4;
  background: #0a0516;
  border-radius: 50% 50% 0 0;
  border: 2px solid rgba(100,60,140,0.3); border-bottom: none;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}
.foyer-arch.arch-l { left: 16%; }
.foyer-arch.arch-r { right: 16%; }

/* Portraits */
.foyer-portrait {
  position: absolute; top: 15%; width: 50px; height: 65px; z-index: 4;
  border: 3px solid #8b7355; background: #1a1030;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
.foyer-portrait.port-l { left: 18%; }
.foyer-portrait.port-r { right: 18%; }
.portrait-face {
  position: absolute; top: 35%; left: 50%; transform: translateX(-50%);
  font-size: 1.1rem; animation: eyesGlow 4s ease-in-out infinite;
}
@keyframes eyesGlow {
  0%, 80%, 100% { filter: brightness(1); }
  90% { filter: brightness(2) drop-shadow(0 0 5px #ff0); }
}

/* Sconces */
.wall-sconce {
  position: absolute; top: 30%; z-index: 4; display: flex; flex-direction: column; align-items: center;
}
.wall-sconce.sconce-l { left: 14%; }
.wall-sconce.sconce-r { right: 14%; }
.sconce-bracket {
  width: 8px; height: 15px; background: #8b7355;
  border-radius: 0 0 3px 3px;
}
.sconce-flame {
  width: 6px; height: 10px;
  background: radial-gradient(ellipse at 50% 80%, #fff 0%, #ffa500 50%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flameFlicker 2s ease-in-out infinite alternate;
  filter: blur(0.5px);
}
.sconce-glow {
  position: absolute; top: -20px; width: 60px; height: 60px;
  background: radial-gradient(circle, rgba(255,180,50,0.15) 0%, transparent 70%);
  pointer-events: none;
}

/* Front door */
.foyer-door {
  position: absolute; bottom: 2%; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 50px; height: 55px;
  background: linear-gradient(180deg, #2a1a15, #1a100d);
  border: 2px solid #5a3a2a; border-bottom: none;
  border-radius: 25% 25% 0 0;
}
.door-knob {
  position: absolute; top: 55%; right: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #c4a35a;
  box-shadow: 0 0 4px rgba(196,163,90,0.5);
}

/* Cobweb SVG-style */
.foyer-cobweb {
  position: absolute; top: 0; width: 80px; height: 60px; z-index: 5; pointer-events: none;
  opacity: 0.18;
}
.foyer-cobweb.cw-l { left: 12%; }
.foyer-cobweb.cw-r { right: 12%; transform: scaleX(-1); }
.foyer-cobweb::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.5) 0%, transparent 50%),
    linear-gradient(120deg, rgba(255,255,255,0.3) 0%, transparent 40%),
    linear-gradient(150deg, rgba(255,255,255,0.2) 0%, transparent 30%);
  mask-image: radial-gradient(ellipse at 0% 0%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 0% 0%, black 0%, transparent 80%);
}

/* ===========================================================
   ROOM 2: THE HAUNTED KITCHEN
   =========================================================== */
.kitchen-scene .r-back-wall {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(60,40,30,0.2) 24px, rgba(60,40,30,0.2) 25px),
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(60,40,30,0.15) 49px, rgba(60,40,30,0.15) 50px),
    linear-gradient(180deg, #1a2018, #0f160e);
}
.kitchen-scene .r-left-wall {
  background: linear-gradient(90deg, #0d130b, #141e12);
  clip-path: polygon(0 0, 100% 6%, 100% 56%, 0 100%);
}
.kitchen-scene .r-right-wall {
  background: linear-gradient(270deg, #0d130b, #141e12);
  clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 56%);
}
.kitchen-scene .r-floor {
  background:
    repeating-linear-gradient(90deg, #1a1510 0px, #1a1510 39px, #201a14 39px, #201a14 40px),
    linear-gradient(180deg, #1a1510, #12100c);
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

/* Shelves */
.kitchen-shelf {
  position: absolute; z-index: 3; height: 4px;
  background: #3a2a1e; border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.kitchen-shelf.shelf-1 { top: 18%; left: 20%; width: 25%; }
.kitchen-shelf.shelf-2 { top: 35%; left: 55%; width: 20%; }
.shelf-items {
  position: absolute; top: -22px; left: 0; right: 0;
  display: flex; justify-content: space-around; font-size: 1rem;
}

/* Counter */
.kitchen-counter {
  position: absolute; bottom: 38%; left: 25%; width: 50%; height: 8px; z-index: 3;
  background: linear-gradient(180deg, #4a3a2e, #3a2a1e);
  border-radius: 2px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}
.counter-front {
  position: absolute; top: 8px; left: 0; width: 100%; height: 50px;
  background:
    repeating-linear-gradient(90deg, #2a1a10 0px, #2a1a10 24px, #231610 24px, #231610 25px),
    #2a1a10;
  border-radius: 0 0 3px 3px;
}

/* Ghost chef */
.ghost-chef {
  position: absolute; top: 10%; right: 22%; z-index: 3;
  font-size: 2.5rem; opacity: 0.2;
  animation: chefBob 3s ease-in-out infinite;
}
@keyframes chefBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

/* Green ambient glow */
.kitchen-glow {
  position: absolute; bottom: 30%; left: 20%; z-index: 6; pointer-events: none;
  width: 200px; height: 150px;
  background: radial-gradient(ellipse, rgba(57,255,20,0.08) 0%, transparent 70%);
}

/* Steam/smoke */
.kitchen-steam {
  position: absolute; z-index: 6; pointer-events: none;
  width: 20px; opacity: 0.3;
}
.steam-puff {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(200,200,200,0.3);
  animation: steamRise 3s ease-out infinite;
}
.steam-puff:nth-child(2) { animation-delay: 1s; margin-left: 5px; }
.steam-puff:nth-child(3) { animation-delay: 2s; margin-left: -3px; }
@keyframes steamRise {
  0% { transform: translateY(0) scale(0.5); opacity: 0.4; }
  100% { transform: translateY(-60px) scale(1.5); opacity: 0; }
}

/* ===========================================================
   ROOM 3: THE SÉANCE ROOM
   =========================================================== */
.seance-scene .r-back-wall {
  background:
    repeating-linear-gradient(60deg, transparent, transparent 30px, rgba(120,40,180,0.04) 30px, rgba(120,40,180,0.04) 31px),
    repeating-linear-gradient(-60deg, transparent, transparent 30px, rgba(120,40,180,0.04) 30px, rgba(120,40,180,0.04) 31px),
    linear-gradient(180deg, #2a1048, #1a0830);
}
.seance-scene .r-left-wall {
  background: linear-gradient(90deg, #120620, #1a0830);
  clip-path: polygon(0 0, 100% 6%, 100% 56%, 0 100%);
}
.seance-scene .r-right-wall {
  background: linear-gradient(270deg, #120620, #1a0830);
  clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 56%);
}
.seance-scene .r-floor {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(80,30,120,0.2) 0%, transparent 60%),
    linear-gradient(180deg, #18102a, #100820);
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

/* Séance table */
.seance-table {
  position: absolute; bottom: 30%; left: 50%; transform: translateX(-50%); z-index: 3;
}
.table-top {
  width: 120px; height: 20px;
  background: linear-gradient(180deg, #4a2060, #3a1850);
  border-radius: 50%;
  border: 1px solid rgba(120,60,160,0.4);
}
.table-cloth {
  width: 100px; height: 35px; margin: -2px auto 0;
  background: linear-gradient(180deg, #3a1850, #2a1040);
  border-radius: 0 0 30% 30%;
  border: 1px solid rgba(100,50,140,0.3); border-top: none;
}
.table-leg {
  width: 6px; height: 20px; background: #3a1850;
  margin: 0 auto; border-radius: 0 0 2px 2px;
}

/* Crystal ball */
.crystal-ball-holder {
  position: absolute; bottom: 52%; left: 50%; transform: translateX(-50%); z-index: 4;
}
.crystal-ball {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(200,180,255,0.4), rgba(100,50,180,0.3), rgba(40,20,80,0.6));
  border: 1px solid rgba(180,140,255,0.3);
  box-shadow: 0 0 20px rgba(140,80,220,0.4), inset 0 0 15px rgba(180,140,255,0.2);
  animation: crystalPulse 3s ease-in-out infinite;
}
@keyframes crystalPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(140,80,220,0.4), inset 0 0 15px rgba(180,140,255,0.2); }
  50% { box-shadow: 0 0 35px rgba(140,80,220,0.6), inset 0 0 25px rgba(180,140,255,0.4); }
}
.crystal-base { width: 24px; height: 8px; margin: -2px auto 0; background: #5a3a6a; border-radius: 0 0 50% 50%; }

/* Madame Morticia - Mimi's original ghost art! */
.madame-morticia {
  position: absolute; top: 5%; left: 50%; transform: translateX(-50%); z-index: 4;
  text-align: center;
}
.morticia-ghost-img {
  width: 80px; height: auto;
  opacity: 0.55;
  animation: morticiaFloat 4s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(180,140,255,0.5)) drop-shadow(0 0 25px rgba(140,80,220,0.3)) invert(1);
  pointer-events: none;
}
@keyframes morticiaFloat {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(-12px); opacity: 0.7; }
}

/* Floating candles */
.seance-candles { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.s-candle {
  position: absolute; display: flex; flex-direction: column; align-items: center;
  animation: sCandleFloat 5s ease-in-out infinite;
}
.s-candle-stick { width: 4px; height: 14px; background: #e8d8b8; border-radius: 1px; }
.s-candle-flame {
  width: 5px; height: 9px;
  background: radial-gradient(ellipse at 50% 80%, #fff 0%, #ffc700 40%, transparent 100%);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flameFlicker 1.8s ease-in-out infinite alternate;
}
.s-candle:nth-child(odd) { animation-duration: 4s; }
.s-candle:nth-child(3n) .s-candle-flame { animation-delay: 0.5s; }
@keyframes sCandleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Mystical symbols */
.mystic-symbols {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden;
}
.mystic-symbol {
  position: absolute; font-size: 1.2rem; opacity: 0.08;
  animation: symbolGlow 6s ease-in-out infinite;
}
@keyframes symbolGlow {
  0%, 100% { opacity: 0.08; }
  50% { opacity: 0.18; }
}

/* Purple ambient */
.seance-glow {
  position: absolute; top: 30%; left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: none;
  width: 300px; height: 200px;
  background: radial-gradient(ellipse, rgba(140,80,220,0.1) 0%, transparent 70%);
}

/* ===========================================================
   ROOM 4: THE ATTIC
   =========================================================== */
.attic-scene .r-back-wall {
  background:
    repeating-linear-gradient(90deg, #1a1525 0px, #1a1525 29px, #1e1828 29px, #1e1828 30px),
    linear-gradient(180deg, #1a1525, #151020);
}
.attic-scene .r-left-wall {
  background: linear-gradient(90deg, #0f0a18, #151020);
  clip-path: polygon(0 0, 100% 6%, 100% 56%, 0 100%);
}
.attic-scene .r-right-wall {
  background: linear-gradient(270deg, #0f0a18, #151020);
  clip-path: polygon(0 6%, 100% 0, 100% 100%, 0 56%);
}
.attic-scene .r-floor {
  background:
    repeating-linear-gradient(90deg, #18120a 0px, #18120a 39px, #1e1610 39px, #1e1610 40px),
    #18120a;
  clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

/* Roof beams */
.attic-beam {
  position: absolute; z-index: 3;
  background: linear-gradient(180deg, #3a2a1e, #2a1a12);
  border-radius: 3px;
}
.attic-beam.beam-h { top: 8%; left: 12%; right: 12%; height: 8px; }
.attic-beam.beam-v1 { top: 0; left: 30%; width: 6px; height: 12%; transform: rotate(-2deg); }
.attic-beam.beam-v2 { top: 0; right: 35%; width: 6px; height: 10%; transform: rotate(1deg); }
.attic-beam.beam-diag {
  top: 0; left: 50%; width: 5px; height: 14%;
  transform-origin: top center; transform: rotate(15deg);
}

/* Moonbeam */
.moonbeam {
  position: absolute; top: 0; right: 20%; z-index: 6; pointer-events: none;
  width: 80px; height: 100%;
  background: linear-gradient(180deg,
    rgba(180,200,255,0.12) 0%,
    rgba(180,200,255,0.05) 30%,
    rgba(180,200,255,0.02) 60%,
    transparent 100%
  );
  clip-path: polygon(30% 0%, 70% 0%, 100% 100%, 0% 100%);
  animation: moonbeamShimmer 5s ease-in-out infinite;
}
@keyframes moonbeamShimmer {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Moon */
.attic-moon {
  position: absolute; top: 4%; right: 23%; z-index: 5;
  width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #e8e0d0, #c0b8a8);
  box-shadow: 0 0 20px rgba(200,190,170,0.3);
}

/* Sheet-covered furniture */
.sheet-furniture {
  position: absolute; z-index: 3;
  background: rgba(200,190,170,0.06);
  border: 1px solid rgba(200,190,170,0.08);
  border-radius: 4px 4px 0 0;
}
.sheet-furniture.sf-1 { bottom: 38%; left: 20%; width: 40px; height: 50px; }
.sheet-furniture.sf-2 { bottom: 38%; right: 25%; width: 55px; height: 35px; border-radius: 2px; }
.sheet-drape {
  position: absolute; inset: -2px; border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(200,190,170,0.08), rgba(200,190,170,0.03));
  border: 1px solid rgba(200,190,170,0.06);
}

/* Bats in rafters */
.attic-bats { position: absolute; top: 3%; left: 20%; z-index: 5; pointer-events: none; }
.attic-bat {
  display: inline-block; font-size: 0.9rem; opacity: 0.3;
  transform: rotate(180deg);
  animation: batHang 4s ease-in-out infinite;
}
.attic-bat:nth-child(2) { margin-left: 8px; animation-delay: 1.5s; }
.attic-bat:nth-child(3) { margin-left: 5px; animation-delay: 3s; }
@keyframes batHang {
  0%, 90%, 100% { transform: rotate(180deg); }
  95% { transform: rotate(180deg) scaleX(-1); }
}

/* ===========================================================
   ROOM OBJECTS (point-and-click interactive items)
   =========================================================== */
.room-object {
  position: absolute; cursor: pointer; transition: all 0.3s ease;
  display: flex; flex-direction: column; align-items: center; z-index: 10;
}
.room-object:hover { transform: scale(1.15); filter: brightness(1.3); }
.room-object.disabled { pointer-events: none; opacity: 0.3; filter: grayscale(1); }
.room-object .object-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 10px rgba(244,162,97,0.4));
  transition: filter 0.3s;
}
.room-object:hover .object-icon {
  filter: drop-shadow(0 0 20px rgba(244,162,97,0.8));
  animation: objectWobble 0.5s ease-in-out;
}
.room-object .object-label {
  font-size: 0.85rem; color: var(--bone);
  background: rgba(0,0,0,0.8); padding: 3px 12px; border-radius: 10px;
  margin-top: 4px; white-space: nowrap; opacity: 0; transition: opacity 0.3s;
  border: 1px solid rgba(123,45,142,0.3);
}
.room-object:hover .object-label { opacity: 1; }
@keyframes objectWobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

/* ===== ROOM TEXT & CHOICES ===== */
.room-text { max-width: 800px; width: 100%; text-align: center; padding: 15px 20px; margin: 0 auto; }
.room-text h3 { font-size: 1.6rem; color: var(--marigold); margin-bottom: 8px; }
.room-text p { font-size: 1.05rem; line-height: 1.5; color: var(--bone); }
.choices-container {
  max-width: 800px; width: 100%; margin: 0 auto; padding: 0 20px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.choice-btn {
  background: rgba(45,24,84,0.6); border: 2px solid var(--purple);
  color: var(--bone); font-family: 'Patrick Hand', cursive; font-size: 1.15rem;
  padding: 14px 20px; border-radius: 10px; cursor: pointer;
  transition: all 0.3s ease; text-align: left;
  display: flex; align-items: center; gap: 12px;
}
.choice-btn:hover:not(:disabled) {
  background: rgba(123,45,142,0.4); border-color: var(--marigold);
  transform: translateX(8px); box-shadow: 0 0 15px rgba(244,162,97,0.2);
}
.choice-btn:disabled { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; }
.choice-btn .choice-letter {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--purple); color: var(--marigold);
  font-family: 'Creepster', cursive; font-size: 1.1rem; flex-shrink: 0;
}
.choice-prompt {
  text-align: center; color: var(--teal-light); font-size: 1.1rem; padding: 5px;
  animation: promptPulse 2s ease-in-out infinite;
}
@keyframes promptPulse { 0%, 100% { opacity: 0.7; } 50% { opacity: 1; } }

/* ===========================================================
   FEEDBACK OVERLAY & ANIMATION STAGE
   =========================================================== */
.feedback-overlay {
  position: absolute; inset: 0;
  background: rgba(13,2,33,0.92);
  display: flex; justify-content: center; align-items: center;
  z-index: 30; transition: opacity 0.4s;
}
.feedback-overlay.hidden { opacity: 0; pointer-events: none; }
.feedback-content { text-align: center; max-width: 550px; padding: 20px; width: 100%; }
.feedback-message {
  font-size: 1.15rem; line-height: 1.6; color: var(--bone);
  margin-bottom: 1.5rem; white-space: pre-line;
}

/* Animation stage */
.anim-stage {
  width: 100%; height: 220px; margin: 0 auto 1rem;
  position: relative; border-radius: 12px; overflow: hidden;
  background: rgba(10,5,25,0.6);
  border: 2px solid rgba(123,45,142,0.3);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.5);
}
.anim-stage.no-bg { background: none; border: none; box-shadow: none; }

/* --- Shared animation elements --- */
.a-char {
  position: absolute; font-size: 3rem; z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.a-prop { position: absolute; z-index: 5; }
.a-effect { position: absolute; z-index: 15; pointer-events: none; }
.a-text {
  position: absolute; z-index: 20;
  font-family: 'Creepster', cursive; font-weight: bold;
  opacity: 0;
}
.a-floor {
  position: absolute; bottom: 0; left: 0; right: 0; height: 25%;
  background: linear-gradient(180deg, transparent, rgba(20,15,30,0.8));
}

/* ===========================================================
   ANIMATION KEYFRAMES - SHARED PRIMITIVES
   =========================================================== */
@keyframes moveRight {
  0% { left: 5%; } 100% { left: 60%; }
}
@keyframes moveLeft {
  0% { right: 5%; } 100% { right: 60%; }
}
@keyframes fallDown {
  0% { top: 35%; opacity: 1; }
  100% { top: 110%; opacity: 0.5; }
}
@keyframes flyUp {
  0% { bottom: 15%; }
  100% { bottom: 120%; }
}
@keyframes spinCW {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(720deg); }
}
@keyframes shrinkAway {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}
@keyframes growIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes squish {
  0% { transform: scaleX(1) scaleY(1); }
  40% { transform: scaleX(2.2) scaleY(0.3); }
  70% { transform: scaleX(1.6) scaleY(0.5); }
  100% { transform: scaleX(1.4) scaleY(0.6); }
}
@keyframes bounceAround {
  0% { left: 50%; top: 40%; }
  15% { left: 85%; top: 20%; transform: rotate(90deg); }
  30% { left: 10%; top: 60%; transform: rotate(200deg); }
  45% { left: 70%; top: 10%; transform: rotate(340deg); }
  60% { left: 20%; top: 50%; transform: rotate(500deg); }
  75% { left: 75%; top: 65%; transform: rotate(600deg); }
  100% { left: 45%; top: 75%; transform: rotate(720deg); }
}
@keyframes successGlow {
  0% { filter: drop-shadow(0 0 5px rgba(255,215,0,0.3)); }
  50% { filter: drop-shadow(0 0 20px rgba(255,215,0,0.8)); }
  100% { filter: drop-shadow(0 0 10px rgba(255,215,0,0.5)); }
}
@keyframes walkRight {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  0% { top: 30%; transform: rotate(0deg); }
  100% { top: 120%; transform: rotate(540deg); }
}
@keyframes riseUp {
  0% { bottom: 20%; transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { bottom: 120%; transform: scale(0.8); }
}
@keyframes suctionPull {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(0.7) translate(var(--pull-x), var(--pull-y)); }
  100% { transform: scale(0) translate(var(--pull-x), var(--pull-y)); }
}
@keyframes avalanche {
  0% { top: -20%; opacity: 0; }
  20% { opacity: 1; }
  100% { top: 50%; opacity: 1; }
}
@keyframes confettiSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===========================================================
   SPECIFIC OUTCOME ANIMATIONS
   =========================================================== */

/* --- Foyer: Left Hall (fall through floor) --- */
.anim-foyer-leftHall .a-char {
  left: 45%; top: 30%;
  animation: fallDown 1.2s 0.4s ease-in forwards, spinCW 1.2s 0.4s linear forwards;
}
.anim-foyer-leftHall .a-crack {
  position: absolute; bottom: 25%; left: 25%; right: 25%; height: 4px;
  background: #000; border-radius: 2px;
  transform: scaleX(0);
  animation: crackOpen 0.4s ease-out forwards;
}
@keyframes crackOpen {
  0% { transform: scaleX(0); box-shadow: none; }
  100% { transform: scaleX(1); box-shadow: 0 0 20px rgba(0,0,0,0.8), 0 2px 15px rgba(80,0,120,0.4); }
}
.anim-foyer-leftHall .a-burrito {
  position: absolute; bottom: 8%; left: 42%; opacity: 0;
  font-size: 2.5rem;
  animation: popIn 0.4s 1.6s both;
}
.anim-foyer-leftHall .a-text {
  top: 8%; left: 50%; transform: translateX(-50%);
  font-size: 1.5rem; color: var(--marigold);
  animation: popIn 0.3s 1.6s both;
}

/* --- Foyer: Stairs (correct - walk up) --- */
.anim-foyer-stairs .a-char {
  bottom: 15%; left: 20%;
  animation: walkUpStairs 2s ease-in-out forwards, successGlow 2s ease-in-out forwards;
}
@keyframes walkUpStairs {
  0% { left: 20%; bottom: 15%; }
  50% { left: 45%; bottom: 45%; }
  100% { left: 55%; bottom: 75%; opacity: 0.8; }
}
.anim-foyer-stairs .a-sparkle {
  position: absolute; font-size: 1.5rem; opacity: 0;
}
.anim-foyer-stairs .a-sparkle:nth-child(2) { left: 30%; top: 50%; animation: sparkle 0.8s 0.5s both; }
.anim-foyer-stairs .a-sparkle:nth-child(3) { left: 45%; top: 35%; animation: sparkle 0.8s 1s both; }
.anim-foyer-stairs .a-sparkle:nth-child(4) { left: 55%; top: 20%; animation: sparkle 0.8s 1.5s both; }
.anim-foyer-stairs .a-door-glow {
  position: absolute; top: 0; right: 20%; width: 40px; height: 60px;
  background: radial-gradient(ellipse, rgba(255,215,0,0.4) 0%, transparent 70%);
  opacity: 0; animation: fadeInSlow 1s 1.2s both;
}
@keyframes fadeInSlow { 0% { opacity: 0; } 100% { opacity: 1; } }

/* --- Foyer: Right Hall (portraits attack) --- */
.anim-foyer-rightHall .a-char {
  left: 45%; top: 40%;
  animation: squish 0.5s 1s ease-out forwards;
}
.anim-foyer-rightHall .a-portrait-l {
  position: absolute; left: -10%; top: 25%;
  width: 45px; height: 55px; border: 3px solid #8b7355; background: #1a1030;
  font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  animation: portraitSlam 0.5s 0.5s ease-in forwards;
}
.anim-foyer-rightHall .a-portrait-r {
  position: absolute; right: -10%; top: 25%;
  width: 45px; height: 55px; border: 3px solid #8b7355; background: #1a1030;
  font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
  animation: portraitSlamR 0.5s 0.5s ease-in forwards;
}
@keyframes portraitSlam { 0% { left: -10%; } 100% { left: 32%; } }
@keyframes portraitSlamR { 0% { right: -10%; } 100% { right: 32%; } }
.anim-foyer-rightHall .a-text {
  top: 8%; left: 50%; transform: translateX(-50%);
  font-size: 1.8rem; color: var(--gold);
  animation: popIn 0.3s 1s both;
}
.anim-foyer-rightHall .a-stars {
  position: absolute; top: 15%; left: 50%; transform: translateX(-50%);
  font-size: 1.2rem; opacity: 0;
  animation: popIn 0.3s 1.2s both, floatStars 1.5s 1.2s linear infinite;
}
@keyframes floatStars {
  0% { transform: translateX(-50%) rotate(0deg); }
  100% { transform: translateX(-50%) rotate(360deg); }
}

/* --- Foyer: Front Door (brick wall bonk) --- */
.anim-foyer-frontDoor .a-wall {
  position: absolute; right: 15%; top: 10%; bottom: 15%;
  width: 50px; z-index: 5;
  background:
    repeating-linear-gradient(0deg, #6b3a2a 0px, #6b3a2a 12px, #5a2d1e 12px, #5a2d1e 14px),
    repeating-linear-gradient(90deg, transparent 0px, transparent 24px, #4a2010 24px, #4a2010 25px);
  border-radius: 3px;
}
.anim-foyer-frontDoor .a-char {
  left: 10%; top: 35%;
  animation: runAndBonk 0.8s ease-in forwards, squish 0.4s 0.8s ease-out forwards;
}
@keyframes runAndBonk {
  0% { left: 10%; } 100% { left: 53%; }
}
.anim-foyer-frontDoor .a-bonk {
  position: absolute; right: 22%; top: 5%;
  font-size: 2rem; color: var(--gold);
  font-family: 'Creepster', cursive;
  animation: popIn 0.3s 0.8s both;
}
.anim-foyer-frontDoor .a-stars {
  position: absolute; right: 18%; top: 22%;
  font-size: 1.3rem; opacity: 0;
  animation: popIn 0.3s 1.1s both, floatStars 1.5s 1.1s linear infinite;
}

/* --- Kitchen: Cauldron (turned into frog) --- */
.anim-kitchen-cauldron .a-cauldron {
  position: absolute; bottom: 10%; left: 30%;
  font-size: 3rem;
}
.anim-kitchen-cauldron .a-char {
  left: 55%; top: 25%;
  animation: moveTowardsCauldron 0.6s ease-in forwards;
}
@keyframes moveTowardsCauldron {
  0% { left: 55%; top: 25%; }
  100% { left: 38%; top: 45%; }
}
.anim-kitchen-cauldron .a-poof {
  position: absolute; left: 32%; top: 20%; font-size: 4rem; opacity: 0;
  color: var(--green-glow);
  animation: poofAppear 0.6s 0.6s both;
}
@keyframes poofAppear {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 1; transform: scale(1.5); }
  100% { opacity: 0.6; transform: scale(2); filter: blur(3px); }
}
.anim-kitchen-cauldron .a-frog {
  position: absolute; left: 40%; bottom: 20%;
  font-size: 2rem; opacity: 0;
  animation: frogAppear 0.3s 1.2s both, frogHop 0.6s 1.5s ease-in-out 3;
}
@keyframes frogAppear { 0% { opacity: 0; transform: scale(0); } 100% { opacity: 1; transform: scale(1); } }
@keyframes frogHop {
  0%, 100% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-25px) translateX(20px); }
}

/* --- Kitchen: Fridge (food avalanche) --- */
.anim-kitchen-fridge .a-fridge {
  position: absolute; right: 10%; top: 10%; font-size: 3.5rem;
  animation: fridgeOpen 0.4s 0.3s ease-out both;
}
@keyframes fridgeOpen { 0% { transform: scaleX(1); } 100% { transform: scaleX(1.2); } }
.anim-kitchen-fridge .a-char {
  right: 20%; top: 35%;
}
.anim-kitchen-fridge .a-food {
  position: absolute; font-size: 2rem; opacity: 0;
  animation: avalanche 0.5s ease-in both;
}
.anim-kitchen-fridge .a-food:nth-child(3) { right: 25%; animation-delay: 0.4s; }
.anim-kitchen-fridge .a-food:nth-child(4) { right: 15%; animation-delay: 0.6s; }
.anim-kitchen-fridge .a-food:nth-child(5) { right: 30%; animation-delay: 0.8s; }
.anim-kitchen-fridge .a-food:nth-child(6) { right: 20%; animation-delay: 1.0s; }
.anim-kitchen-fridge .a-food:nth-child(7) { right: 35%; animation-delay: 1.2s; }
.anim-kitchen-fridge .a-turkey {
  position: absolute; right: 22%; top: 40%; font-size: 2.5rem; opacity: 0;
  animation: popIn 0.3s 1.8s both;
}

/* --- Kitchen: Cookbook (correct - find key) --- */
.anim-kitchen-cookbook .a-book {
  position: absolute; left: 35%; top: 30%;
  font-size: 3rem;
  animation: bookOpen 0.5s 0.3s ease-out both;
}
@keyframes bookOpen { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(-20deg) scale(1.1); } }
.anim-kitchen-cookbook .a-key {
  position: absolute; left: 45%; top: 25%; font-size: 2.5rem; opacity: 0;
  animation: keyFloat 1.5s 0.8s both;
}
@keyframes keyFloat {
  0% { opacity: 0; transform: translateY(20px) rotate(0deg); }
  30% { opacity: 1; }
  100% { opacity: 1; transform: translateY(-30px) rotate(20deg); }
}
.anim-kitchen-cookbook .a-sparkle {
  position: absolute; font-size: 1.5rem; opacity: 0;
}
.anim-kitchen-cookbook .a-sparkle:nth-child(3) { left: 50%; top: 15%; animation: sparkle 0.7s 1s both; }
.anim-kitchen-cookbook .a-sparkle:nth-child(4) { left: 38%; top: 40%; animation: sparkle 0.7s 1.3s both; }
.anim-kitchen-cookbook .a-sparkle:nth-child(5) { left: 55%; top: 50%; animation: sparkle 0.7s 1.6s both; }
.anim-kitchen-cookbook .a-glow {
  position: absolute; left: 35%; top: 15%; width: 120px; height: 120px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,215,0,0.25) 0%, transparent 70%);
  opacity: 0; animation: fadeInSlow 0.8s 0.8s both;
}

/* --- Kitchen: Oven (launched) --- */
.anim-kitchen-oven .a-oven {
  position: absolute; bottom: 5%; right: 25%;
  font-size: 3rem;
  animation: ovenGlow 0.5s 0.2s ease-out both;
}
@keyframes ovenGlow { 0% { filter: brightness(1); } 100% { filter: brightness(1.5) drop-shadow(0 0 10px #ff6600); } }
.anim-kitchen-oven .a-char {
  right: 30%; bottom: 20%;
  animation: riseUp 1s 0.6s ease-in forwards;
}
.anim-kitchen-oven .a-smoke {
  position: absolute; bottom: 25%; right: 30%;
  font-size: 2rem; opacity: 0;
  animation: smokeTrail 1.2s 0.6s both;
}
@keyframes smokeTrail {
  0% { opacity: 0; bottom: 25%; } 30% { opacity: 0.6; } 100% { opacity: 0.2; bottom: 80%; transform: scale(2); filter: blur(3px); }
}
.anim-kitchen-oven .a-text {
  bottom: 50%; left: 50%; transform: translateX(-50%);
  font-size: 1.6rem; color: var(--orange-red);
  animation: popIn 0.3s 0.6s both;
}

/* --- Seance: Marigolds (correct) --- */
.anim-seance-marigolds .a-char {
  left: 20%; bottom: 20%;
  animation: successGlow 2s both;
}
.anim-seance-marigolds .a-flower {
  position: absolute; font-size: 2rem; opacity: 0;
  animation: flowerBloom 0.5s both;
}
@keyframes flowerBloom {
  0% { opacity: 0; transform: scale(0) rotate(-20deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.anim-seance-marigolds .a-ghost-happy-img {
  position: absolute; right: 20%; top: 5%; width: 70px; height: auto;
  filter: invert(1) drop-shadow(0 0 10px rgba(180,140,255,0.5));
  animation: ghostDelighted 1s 1.2s both;
}
@keyframes ghostDelighted {
  0% { transform: scale(1); } 30% { transform: scale(1.3); }
  60% { transform: scale(1.1); } 100% { transform: scale(1.15); }
}
.anim-seance-marigolds .a-passage {
  position: absolute; right: 0; top: 15%; bottom: 25%;
  width: 40px; background: linear-gradient(90deg, transparent, rgba(255,215,0,0.3));
  opacity: 0; animation: fadeInSlow 0.8s 1.5s both;
}

/* --- Seance: Pizza (ghost sneeze bounce) --- */
.anim-seance-pizza .a-ghost-img {
  position: absolute; right: 20%; top: 5%; width: 65px; height: auto;
  filter: invert(1) drop-shadow(0 0 10px rgba(180,140,255,0.5));
}
.anim-seance-pizza .a-pizza {
  position: absolute; left: 35%; top: 30%; font-size: 2rem; opacity: 0;
  animation: popIn 0.3s 0.2s both;
}
.anim-seance-pizza .a-achoo {
  position: absolute; right: 15%; top: 5%;
  font-size: 1.5rem; color: var(--teal-light); font-family: 'Creepster', cursive;
  animation: popIn 0.3s 0.6s both;
}
.anim-seance-pizza .a-char {
  left: 40%; top: 40%;
  animation: bounceAround 2s 0.8s ease-in-out forwards;
}

/* --- Seance: Spellbook (ghost babies) --- */
.anim-seance-spellbook .a-book {
  position: absolute; left: 20%; top: 30%; font-size: 2.5rem;
  animation: bookOpen 0.5s 0.2s both;
}
.anim-seance-spellbook .a-char {
  right: 25%; top: 40%;
}
.anim-seance-spellbook .a-ghost-baby {
  position: absolute; font-size: 1.3rem; opacity: 0;
}
.anim-seance-spellbook .a-ghost-baby:nth-child(3) { left: 25%; top: 15%; animation: ghostBabySwarml 0.8s 0.5s both; }
.anim-seance-spellbook .a-ghost-baby:nth-child(4) { left: 20%; top: 30%; animation: ghostBabySwarmr 0.8s 0.7s both; }
.anim-seance-spellbook .a-ghost-baby:nth-child(5) { left: 30%; top: 45%; animation: ghostBabySwarml 0.8s 0.9s both; }
.anim-seance-spellbook .a-ghost-baby:nth-child(6) { left: 15%; top: 20%; animation: ghostBabySwarmr 0.8s 1.1s both; }
.anim-seance-spellbook .a-ghost-baby:nth-child(7) { left: 28%; top: 50%; animation: ghostBabySwarml 0.8s 1.3s both; }
.anim-seance-spellbook .a-ghost-baby:nth-child(8) { left: 22%; top: 10%; animation: ghostBabySwarmr 0.8s 1.5s both; }
@keyframes ghostBabySwarml {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  40% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.9; transform: translate(120px, 0) scale(0.9); }
}
@keyframes ghostBabySwarmr {
  0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
  40% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.9; transform: translate(100px, 10px) scale(0.9); }
}
.anim-seance-spellbook .a-text {
  right: 10%; top: 10%;
  font-size: 1.3rem; color: var(--pink);
  animation: popIn 0.3s 1.5s both;
}

/* --- Seance: Crystal Ball (sucked in) --- */
.anim-seance-crystalBall .a-ball {
  position: absolute; left: 50%; top: 40%; transform: translateX(-50%);
  font-size: 3.5rem;
  animation: crystalPulse 1s ease-in-out infinite;
}
.anim-seance-crystalBall .a-char {
  left: 20%; top: 30%;
  --pull-x: 100px; --pull-y: 30px;
  animation: suctionPull 1.2s 0.5s ease-in forwards;
}
.anim-seance-crystalBall .a-mini-char {
  position: absolute; left: 51%; top: 43%; font-size: 0.9rem; opacity: 0;
  animation: popIn 0.3s 1.7s both, floatStars 3s 1.7s linear infinite;
}
.anim-seance-crystalBall .a-text {
  left: 50%; bottom: 8%; transform: translateX(-50%);
  font-size: 1.2rem; color: var(--purple-light); white-space: nowrap;
  animation: popIn 0.3s 1.8s both;
}

/* --- Attic: Window (fake painting bonk) --- */
.anim-attic-window .a-window {
  position: absolute; left: 15%; top: 10%;
  width: 60px; height: 50px; border: 4px solid #8b7355;
  background: linear-gradient(180deg, #4488cc, #88bbee);
  border-radius: 3px;
}
.anim-attic-window .a-window::after {
  content: '🎨'; position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 0.7rem;
}
.anim-attic-window .a-char {
  right: 20%; top: 30%;
  animation: runLeft 0.7s ease-in forwards, squish 0.4s 0.7s ease-out forwards;
}
@keyframes runLeft {
  0% { right: 20%; } 100% { right: 55%; }
}
.anim-attic-window .a-bonk {
  left: 25%; top: 5%; font-size: 1.8rem; color: var(--gold); font-family: 'Creepster', cursive;
  animation: popIn 0.3s 0.7s both;
}
.anim-attic-window .a-frame {
  position: absolute; left: 17%; top: 25%;
  width: 50px; height: 50px; border: 4px solid #8b7355; background: transparent;
  opacity: 0;
  animation: frameFall 0.5s 1.1s both;
}
@keyframes frameFall {
  0% { opacity: 0; top: 5%; transform: rotate(-10deg); }
  100% { opacity: 1; top: 35%; transform: rotate(5deg); }
}

/* --- Attic: Trap Door (giant slide) --- */
.anim-attic-trapdoor .a-hole {
  position: absolute; bottom: 20%; left: 30%; width: 80px; height: 20px;
  background: #000; border-radius: 50%;
  transform: scaleY(0);
  animation: holeOpen 0.4s 0.2s ease-out forwards;
}
@keyframes holeOpen {
  0% { transform: scaleY(0); } 100% { transform: scaleY(1); box-shadow: 0 0 20px rgba(0,0,0,0.8); }
}
.anim-attic-trapdoor .a-char {
  left: 38%; top: 20%;
  animation: slideDown 1.2s 0.6s ease-in forwards;
}
.anim-attic-trapdoor .a-whee {
  position: absolute; left: 50%; top: 15%; transform: translateX(-50%);
  font-size: 1.8rem; color: var(--marigold); font-family: 'Creepster', cursive;
  animation: popIn 0.3s 0.8s both, spinWhee 2s 0.8s linear forwards;
}
@keyframes spinWhee {
  0% { transform: translateX(-50%) rotate(0deg) scale(1); }
  100% { transform: translateX(-50%) rotate(360deg) scale(0.3); opacity: 0; }
}
.anim-attic-trapdoor .a-spiral {
  position: absolute; bottom: 15%; left: 32%;
  font-size: 2rem; opacity: 0;
  animation: popIn 0.3s 0.4s both;
}

/* --- Attic: Wardrobe (correct - escape!) --- */
.anim-attic-wardrobe .a-wardrobe {
  position: absolute; left: 50%; top: 15%; transform: translateX(-50%);
  font-size: 3.5rem;
  animation: wardrobeOpen 0.5s 0.3s both;
}
@keyframes wardrobeOpen {
  0% { transform: translateX(-50%) scaleX(1); }
  100% { transform: translateX(-50%) scaleX(1.3); }
}
.anim-attic-wardrobe .a-light {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 120px; height: 100%; opacity: 0;
  background: linear-gradient(180deg, rgba(255,240,200,0.4) 0%, rgba(255,240,200,0.1) 50%, transparent 100%);
  animation: lightBurst 1s 0.6s both;
}
@keyframes lightBurst {
  0% { opacity: 0; width: 20px; }
  100% { opacity: 1; width: 160px; }
}
.anim-attic-wardrobe .a-char {
  left: 30%; bottom: 25%;
  animation: walkIntoLight 1.5s 0.8s ease-in forwards, successGlow 1.5s 0.8s both;
}
@keyframes walkIntoLight {
  0% { left: 30%; bottom: 25%; opacity: 1; }
  100% { left: 48%; bottom: 40%; opacity: 0; }
}
.anim-attic-wardrobe .a-sparkle {
  position: absolute; font-size: 1.5rem; opacity: 0;
}
.anim-attic-wardrobe .a-sparkle:nth-child(4) { left: 45%; top: 20%; animation: sparkle 0.8s 1s both; }
.anim-attic-wardrobe .a-sparkle:nth-child(5) { left: 55%; top: 35%; animation: sparkle 0.8s 1.3s both; }
.anim-attic-wardrobe .a-sparkle:nth-child(6) { left: 48%; top: 50%; animation: sparkle 0.8s 1.6s both; }

/* --- Attic: Chimney (Santa!) --- */
.anim-attic-chimney .a-chimney {
  position: absolute; right: 15%; top: 5%;
  width: 50px; height: 70px;
  background:
    repeating-linear-gradient(0deg, #6b3a2a 0px, #6b3a2a 10px, #5a2d1e 10px, #5a2d1e 12px),
    repeating-linear-gradient(90deg, transparent 0px, transparent 24px, #4a2010 24px, #4a2010 25px);
  border-radius: 3px 3px 0 0;
}
.anim-attic-chimney .a-santa {
  position: absolute; right: 20%; top: 0; font-size: 2.5rem; opacity: 0;
  animation: santaAppear 0.4s 0.5s both;
}
@keyframes santaAppear {
  0% { opacity: 0; top: -10%; } 100% { opacity: 1; top: 2%; }
}
.anim-attic-chimney .a-text {
  right: 5%; top: 8%;
  font-size: 1.3rem; color: var(--red);
  animation: popIn 0.3s 0.8s both;
}
.anim-attic-chimney .a-char {
  right: 22%; top: 30%;
  animation: kickedDown 0.8s 1s ease-in forwards;
}
@keyframes kickedDown {
  0% { top: 30%; transform: rotate(0deg); }
  100% { top: 80%; transform: rotate(180deg); }
}
.anim-attic-chimney .a-soot {
  position: absolute; right: 15%; bottom: 10%;
  font-size: 1.5rem; opacity: 0;
  animation: popIn 0.3s 1.8s both;
}

/* ===========================================================
   DEATH SCREEN
   =========================================================== */
#death-screen {
  background: radial-gradient(ellipse at 50% 50%, #2a0a0a 0%, #0d0221 70%);
  justify-content: center;
}
.death-content { position: relative; z-index: 2; }
.death-title {
  font-size: 4rem; color: var(--red);
  text-shadow: 0 0 20px rgba(230,57,70,0.8), 0 0 40px rgba(230,57,70,0.4);
  animation: deathPulse 1.5s ease-in-out infinite; margin-bottom: 1rem;
}
@keyframes deathPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.death-message {
  font-size: 1.2rem; color: var(--marigold); margin-bottom: 1rem;
  line-height: 1.6; max-width: 500px; margin-left: auto; margin-right: auto;
}
.death-avatar { font-size: 4rem; margin: 1rem 0; animation: deathSpin 2s ease-in-out; }
.death-subtitle { font-size: 1rem; color: var(--bone-dim); margin-bottom: 1.5rem; }
.death-buttons { display: flex; flex-direction: column; align-items: center; gap: 8px; }
@keyframes deathSpin {
  0% { transform: rotate(0deg) scale(1); } 25% { transform: rotate(180deg) scale(0.5); }
  50% { transform: rotate(360deg) scale(0.3); } 75% { transform: rotate(540deg) scale(0.5); }
  100% { transform: rotate(720deg) scale(1); }
}
.rip-stones { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 1; }
.rip {
  font-family: 'Creepster', cursive; font-size: 2rem; color: var(--bone-dim); opacity: 0.15;
  background: rgba(255,255,255,0.05); padding: 30px 25px 15px;
  border-radius: 10px 10px 0 0; border: 1px solid rgba(255,255,255,0.05);
}

/* ===========================================================
   VICTORY SCREEN
   =========================================================== */
#victory-screen {
  background: radial-gradient(ellipse at 50% 30%, #2d1854 0%, #0d0221 70%);
  justify-content: center;
}
.victory-content { position: relative; z-index: 5; }
.victory-title {
  font-size: 4rem; color: var(--gold);
  text-shadow: 0 0 20px rgba(255,215,0,0.8), 0 0 40px rgba(255,215,0,0.4), 0 0 80px rgba(255,215,0,0.2);
  animation: victoryPulse 1s ease-in-out infinite alternate; margin-bottom: 1rem;
}
@keyframes victoryPulse {
  0% { transform: scale(1); } 100% { transform: scale(1.08); }
}
.victory-avatar { font-size: 5rem; margin: 0.5rem 0; animation: victoryDance 0.6s ease-in-out infinite alternate; }
@keyframes victoryDance {
  0% { transform: rotate(-10deg) translateY(0); }
  100% { transform: rotate(10deg) translateY(-10px); }
}
.victory-name { font-size: 1.5rem; color: var(--marigold); margin-bottom: 1rem; }
.victory-time { margin-bottom: 1.5rem; }
.time-label { font-size: 1.1rem; color: var(--bone-dim); }
.time-value {
  font-family: 'Creepster', cursive; font-size: 2.5rem; color: var(--teal-light);
  display: block; margin-top: 0.3rem;
}
.victory-buttons { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.confetti-container { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti-piece { position: absolute; top: -20px; width: 12px; height: 12px; opacity: 0.9; animation: confettiFall linear forwards; }
@keyframes confettiFall {
  0% { top: -5%; transform: rotate(0deg) translateX(0); opacity: 1; }
  100% { top: 105%; transform: rotate(720deg) translateX(100px); opacity: 0; }
}
.fireworks { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.firework {
  position: absolute; width: 6px; height: 6px; border-radius: 50%;
  animation: fireworkBurst 1s ease-out forwards;
}
@keyframes fireworkBurst {
  0% { transform: scale(0); opacity: 1; } 50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ===========================================================
   LEADERBOARD
   =========================================================== */
.leaderboard-content { max-width: 550px; }
.leaderboard-list { margin: 1rem 0; max-height: 55vh; overflow-y: auto; }
.leaderboard-entry {
  display: flex; align-items: center; padding: 10px 15px;
  border-bottom: 1px solid rgba(123,45,142,0.2); gap: 12px; transition: background 0.3s;
}
.leaderboard-entry:nth-child(odd) { background: rgba(255,255,255,0.02); }
.leaderboard-entry.highlight {
  background: rgba(244,162,97,0.15); border: 1px solid rgba(244,162,97,0.3);
  border-radius: 8px; animation: highlightPulse 2s ease-in-out;
}
@keyframes highlightPulse { 0%, 100% { background: rgba(244,162,97,0.15); } 50% { background: rgba(244,162,97,0.3); } }
.lb-rank { font-family: 'Creepster', cursive; font-size: 1.3rem; color: var(--bone-dim); width: 35px; text-align: center; }
.leaderboard-entry:nth-child(1) .lb-rank { color: var(--gold); }
.leaderboard-entry:nth-child(2) .lb-rank { color: #c0c0c0; }
.leaderboard-entry:nth-child(3) .lb-rank { color: #cd7f32; }
.lb-avatar { font-size: 1.5rem; }
.lb-name { flex: 1; font-size: 1.1rem; color: var(--bone); }
.lb-time { font-family: 'Creepster', cursive; font-size: 1.2rem; color: var(--teal-light); }
.leaderboard-empty { padding: 40px 20px; color: var(--bone-dim); font-style: italic; }
.leaderboard-buttons { display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ===========================================================
   TRANSITION OVERLAY
   =========================================================== */
.transition-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; justify-content: center; align-items: center; pointer-events: none;
}
.transition-overlay.hidden { opacity: 0; }
.door-left, .door-right {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background: #0a0011; transition: transform 0.8s ease-in-out;
}
.door-left { left: 0; transform: translateX(-100%); border-right: 3px solid var(--purple); }
.door-right { right: 0; transform: translateX(100%); border-left: 3px solid var(--purple); }
.transition-overlay.closing .door-left { transform: translateX(0); }
.transition-overlay.closing .door-right { transform: translateX(0); }
.transition-overlay.opening .door-left { transform: translateX(-100%); }
.transition-overlay.opening .door-right { transform: translateX(100%); }
.transition-text {
  position: relative; z-index: 101;
  font-family: 'Creepster', cursive; font-size: 2rem;
  color: var(--marigold); text-shadow: 0 0 20px rgba(244,162,97,0.6);
  opacity: 0; transition: opacity 0.4s;
}
.transition-overlay.closing .transition-text { opacity: 1; transition-delay: 0.5s; }

/* ===== SCREEN SHAKE ===== */
.shake { animation: shakeAnim 0.5s ease-in-out; }
@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  10% { transform: translateX(-10px) rotate(-1deg); }
  20% { transform: translateX(10px) rotate(1deg); }
  30% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
  50% { transform: translateX(-5px); } 60% { transform: translateX(5px); }
}

/* ===========================================================
   RESPONSIVE
   =========================================================== */
@media (max-width: 768px) {
  .title-main { font-size: 2.8rem; }
  .title-line { font-size: 1.5rem; }
  h2 { font-size: 2rem; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .avatar-card .avatar-icon { font-size: 2.2rem; }
  .avatar-card .avatar-name { font-size: 0.75rem; }
  .avatar-card { padding: 10px 5px 8px; }
  .room-container { height: 35vh; min-height: 200px; max-height: 300px; }
  .room-object .object-icon { font-size: 2.5rem; }
  .choice-btn { font-size: 1rem; padding: 12px 15px; }
  .hud { padding: 8px 12px; }
  .hud-center { font-size: 1rem; }
  .death-title, .victory-title { font-size: 3rem; }
  .anim-stage { height: 180px; }
}
@media (max-width: 480px) {
  .title-main { font-size: 2.2rem; }
  .avatar-grid { grid-template-columns: repeat(2, 1fr); }
  .room-container { height: 30vh; min-height: 180px; }
  .room-object .object-icon { font-size: 2rem; }
  .room-object .object-label { font-size: 0.7rem; }
  .hud-name { display: none; }
  .anim-stage { height: 150px; }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .room-container { height: 40vh; max-height: 380px; }
  .choice-btn { font-size: 1.2rem; padding: 16px 22px; }
  .room-object .object-icon { font-size: 3.5rem; }
  .avatar-grid { gap: 15px; }
  .avatar-card .avatar-icon { font-size: 3rem; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple-light); }
