/* ==========================================================================
   HALLOWEEN CANDY BREW - 100% ACCURATE 3D CABIN & NEON STYLESHEET
   ========================================================================== */

:root {
  /* Environment Colors */
  --bg-deep-void: #050209;
  --stone-mortar: #120919;
  --stone-face: #22142f;
  --wood-dark: #1b0c06;
  --wood-warm: #3d1e10;
  --wood-grain: #5e3019;

  /* Magical Neon Palettes */
  --neon-orange: #ff7518;
  --neon-orange-glow: rgba(255, 117, 24, 0.95);
  --neon-yellow: #ffb703;
  --neon-yellow-glow: rgba(255, 183, 3, 0.95);
  --neon-green: #22c55e;
  --neon-green-glow: rgba(34, 197, 94, 0.95);
  --neon-purple: #c084fc;
  --neon-purple-glow: rgba(192, 132, 252, 0.95);
  --neon-cyan: #38bdf8;
  --neon-cyan-glow: rgba(56, 189, 248, 0.95);

  /* Typography */
  --font-title: 'Creepster', cursive, system-ui;
  --font-ui: 'Montserrat', system-ui, -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-deep-void);
  color: #fff;
  font-family: var(--font-ui);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==========================================================================
   1. 3D CABIN ENVIRONMENT: RAFTERS, STONE WALLS & WOOD FLOOR
   ========================================================================== */
.cabin-environment {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

/* Procedural Stone Masonry Wall with Realistic Irregular Blocks */
.stone-wall-texture {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 72%;
  background:
    /* Stone texture shading & block borders */
    linear-gradient(rgba(10, 5, 15, 0.65), rgba(4, 2, 8, 0.85)),
    radial-gradient(ellipse at 50% 40%, rgba(36, 20, 48, 0.8) 0%, rgba(14, 7, 20, 0.95) 75%),
    repeating-linear-gradient(0deg, #0d0614 0px, #0d0614 4px, transparent 4px, transparent 52px),
    repeating-linear-gradient(90deg, #0d0614 0px, #0d0614 4px, #261536 4px, #261536 104px);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.98);
}

/* Ceiling Timber Rafter Beams */
.ceiling-rafters {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background: linear-gradient(180deg, #080302 0%, #1f0d06 70%, #0c0402 100%);
  border-bottom: 6px solid #140703;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: space-around;
  z-index: 3;
}

.rafter-beam {
  width: 22px;
  height: 100%;
  background: linear-gradient(90deg, #100603 0%, #3d1b0d 50%, #100603 100%);
  border-left: 2px solid #080201;
  border-right: 2px solid #080201;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.7);
}

/* Warm Atmospheric Lighting Bounces from Cauldron Fire & Neon Signs */
.ambient-room-light {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    /* Center green cauldron aura */
    radial-gradient(circle at 50% 62%, rgba(34, 197, 94, 0.25) 0%, transparent 50%),
    /* Base orange fire glow */
    radial-gradient(ellipse at 50% 84%, rgba(255, 117, 24, 0.3) 0%, transparent 45%),
    /* Left amber/purple neon spill */
    radial-gradient(circle at 12% 28%, rgba(255, 183, 3, 0.15) 0%, transparent 35%),
    /* Right blue ghost neon spill */
    radial-gradient(circle at 86% 36%, rgba(56, 189, 248, 0.18) 0%, transparent 40%);
}

/* Perspective Rustic Wooden Floor with Timber Planks */
.wood-floor-planks {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 32%;
  background:
    /* Perspective wooden floorboards */
    repeating-linear-gradient(90deg, #090302 0px, #1a0b06 3px, #3d1c0e 6px, #261108 120px, #090302 124px),
    linear-gradient(180deg, rgba(4, 2, 6, 0.98) 0%, rgba(54, 25, 14, 0.9) 55%, #140703 100%);
  border-top: 5px solid #140703;
  box-shadow: inset 0 25px 50px rgba(0, 0, 0, 0.98);
  transform: perspective(700px) rotateX(16deg);
  transform-origin: bottom center;
}

/* ==========================================================================
   2. PARTICLE & FLUID VFX CANVAS (ON TOP AT Z-INDEX: 25)
   ========================================================================== */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 25;
  pointer-events: none;
}

#app-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1440px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 24px;
}

/* ==========================================================================
   3. TOP HEADER: 3D TITLE, GOTHIC MOON WINDOW & CANDY PAIL
   ========================================================================== */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 100px;
  padding-top: 4px;
}

/* Title: 3D Carved Fantasy Typography */
.brand-section {
  display: flex;
  flex-direction: column;
  line-height: 0.86;
}

.brand-title-orange {
  font-family: var(--font-title);
  font-size: 44px;
  color: #ff9d2e;
  text-shadow:
    0 2px 0 #9d0208,
    0 4px 0 #6a040f,
    0 0 22px var(--neon-orange-glow);
  letter-spacing: 2px;
}

.brand-title-green {
  font-family: var(--font-title);
  font-size: 58px;
  color: #4ade80;
  text-shadow:
    0 2px 0 #166534,
    0 4px 0 #14532d,
    0 0 28px var(--neon-green-glow);
  letter-spacing: 3px;
}

/* Center: Gothic Attic Moon Window */
.attic-window-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.gothic-window-frame {
  width: 116px;
  height: 84px;
  background: #0f0814;
  border: 5px solid #3d2215;
  border-top-left-radius: 58px;
  border-top-right-radius: 58px;
  box-shadow:
    0 0 30px rgba(56, 189, 248, 0.45),
    inset 0 0 18px rgba(0, 0, 0, 0.95);
  padding: 3px;
}

.window-glass {
  position: relative;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 60%, #1e3a8a 0%, #030712 100%);
  border-top-left-radius: 52px;
  border-top-right-radius: 52px;
  overflow: hidden;
}

.moon-body {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 46px;
  height: 46px;
  background: #fffbeb;
  border-radius: 50%;
  box-shadow:
    0 0 22px #fff,
    0 0 40px #93c5fd;
}

.moon-crater {
  position: absolute;
  background: rgba(203, 213, 225, 0.55);
  border-radius: 50%;
}
.moon-crater.c1 { width: 9px; height: 9px; top: 12px; left: 10px; }
.moon-crater.c2 { width: 7px; height: 7px; top: 25px; left: 24px; }
.moon-crater.c3 { width: 5px; height: 5px; top: 11px; left: 28px; }

.window-mullion-v {
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 3.5px; height: 100%;
  background: #3d2215;
}
.window-mullion-h {
  position: absolute;
  top: 50%; left: 0;
  width: 100%; height: 3.5px;
  background: #3d2215;
}

/* Right: Trick-Or-Treat Candy Pail Tracker */
.candy-pail-card {
  background: rgba(20, 10, 6, 0.9);
  border: 2.5px solid #63371f;
  border-radius: 18px;
  padding: 10px 18px;
  width: 340px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.9),
    inset 0 0 18px rgba(255, 117, 24, 0.2);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.candy-pail-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #fff;
  text-align: center;
}

.candy-pail-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pail-pumpkin-icon {
  filter: drop-shadow(0 0 10px var(--neon-orange-glow));
}

.candy-bar-track {
  flex: 1;
  height: 28px;
  background: #0c050d;
  border: 2px solid #522b19;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.95);
}

.candy-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ea580c 0%, #f59e0b 50%, #fbbf24 100%);
  border-radius: 12px;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.9);
  transition: width 0.4s ease;
  position: relative;
}

.candy-sprite-row {
  position: absolute;
  top: 0; left: 8px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.candy-bar-percent {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 4px #000;
}

.candy-fraction-label {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
  text-align: center;
}

/* ==========================================================================
   4. MAIN STAGE LAYOUT
   ========================================================================== */
.main-stage {
  flex: 1;
  display: grid;
  grid-template-columns: 200px 180px 1fr 340px;
  gap: 16px;
  align-items: center;
  position: relative;
  z-index: 10;
}

/* ==========================================================================
   A. LEFT PANEL: SVG GLASS NEON SIGNS & BLUETOOTH WAND STATUS
   ========================================================================== */
.left-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.neon-signs-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.neon-sign-box {
  animation: realistic-neon-flicker 4s infinite alternate ease-in-out;
}

.neon-svg {
  filter: drop-shadow(0 0 12px rgba(255, 183, 3, 0.7));
}

/* Bluetooth Wand Status Card */
.wand-status-widget {
  background: rgba(18, 10, 26, 0.9);
  border: 2px solid #442262;
  border-radius: 18px;
  padding: 14px 12px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.9),
    inset 0 0 22px rgba(192, 132, 252, 0.18);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wand-status-widget:hover {
  border-color: var(--neon-purple);
  box-shadow: 0 0 30px var(--neon-purple-glow);
  transform: translateY(-2px);
}

.wand-status-header {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #e2e8f0;
  line-height: 1.2;
  margin-bottom: 10px;
}

.wand-illustration-box {
  position: relative;
  display: inline-block;
  margin-bottom: 8px;
}

.wand-pulse-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 65px; height: 65px;
  border-radius: 50%;
  border: 2px solid var(--neon-yellow);
  opacity: 0;
}
.wand-status-widget.disconnected .wand-pulse-ring {
  animation: pulse-ring 2s infinite;
}

.wand-info-block {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 8px;
}

.wand-model-label { color: #cbd5e1; }
.wand-conn-status {
  color: #4ade80;
  font-weight: 900;
  text-shadow: 0 0 10px var(--neon-green-glow);
}
.wand-status-widget.disconnected .wand-conn-status {
  color: #94a3b8;
  text-shadow: none;
}

.wand-battery-gauge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.battery-pill-track {
  width: 48px;
  height: 15px;
  background: #0a0410;
  border: 1.5px solid #4ade80;
  border-radius: 8px;
  padding: 1.5px;
}

.battery-pill-fill {
  height: 100%;
  background: #4ade80;
  border-radius: 6px;
  box-shadow: 0 0 10px var(--neon-green-glow);
}

.battery-text {
  font-size: 11px;
  font-weight: 900;
  color: #4ade80;
}

.wand-level-tag {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  display: inline-block;
  transition: all 0.3s ease;
}

.wand-level-tag.lvl-1 {
  background: rgba(192, 132, 252, 0.2);
  border: 1px solid #c084fc;
  color: #e879f9;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.4);
}

.wand-level-tag.lvl-2 {
  background: rgba(255, 117, 24, 0.25);
  border: 1px solid #ff7518;
  color: #facc15;
  box-shadow: 0 0 14px rgba(255, 117, 24, 0.6);
}

.wand-level-tag.lvl-3 {
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.3), rgba(56, 189, 248, 0.3));
  border: 1.5px solid #facc15;
  color: #fff;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.8);
  animation: pulse-ring 2.5s infinite;
}

/* ==========================================================================
   B. CENTER-LEFT: INGREDIENTS TO ADD (HARVEST FRUITS & VEGGIES)
   ========================================================================== */
.ingredients-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title-neon {
  font-size: 15px;
  font-weight: 900;
  color: #4ade80;
  text-shadow: 0 0 12px var(--neon-green-glow);
  text-align: center;
  letter-spacing: 1px;
}

.ingredients-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 10px;
  justify-items: center;
}

.ingredient-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ingredient-card.span-full {
  grid-column: span 2;
}

.ingredient-card:hover {
  transform: scale(1.18) translateY(-4px);
}

.ing-badge {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(14, 6, 22, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
}

.ing-badge.badge-purple {
  border: 2.8px solid #c084fc;
  box-shadow: 0 0 20px var(--neon-purple-glow);
}
.ing-badge.badge-blue {
  border: 2.8px solid #38bdf8;
  box-shadow: 0 0 20px var(--neon-cyan-glow);
}
.ing-badge.badge-orange {
  border: 2.8px solid #f59e0b;
  box-shadow: 0 0 20px var(--neon-yellow-glow);
}
.ing-badge.badge-green {
  border: 2.8px solid #22c55e;
  box-shadow: 0 0 20px var(--neon-green-glow);
}
.ing-badge.badge-pumpkin {
  border: 2.8px solid #ff7518;
  box-shadow: 0 0 22px var(--neon-orange-glow);
}

.ing-emoji {
  font-size: 34px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.9));
}

.ing-count {
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 4px #000;
}

/* ==========================================================================
   C. CENTER: NEON BAT, BUBBLING CAULDRON & "STIR & BREW" BUTTON
   ========================================================================== */
.center-cauldron-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  padding-bottom: 6px;
}

.neon-bat-banner {
  position: absolute;
  top: -160px;
  animation: float-gentle 4.5s infinite ease-in-out;
  opacity: 0.65;
  pointer-events: none;
}

.cauldron-container {
  position: relative;
  width: 450px;
  height: 360px;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cauldron-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 25px 35px rgba(0, 0, 0, 0.98));
}

/* ==========================================================================
   TOP INSTRUCTION & ANNOUNCEMENT HUD (ELEVATED ABOVE CAULDRON)
   ========================================================================== */
.top-instruction-hud {
  position: absolute;
  top: -110px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 40;
  pointer-events: none;
}

.active-recipe-tag {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #facc15;
  background: rgba(10, 4, 18, 0.92);
  border: 1.5px solid rgba(250, 204, 21, 0.7);
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.4);
  padding: 4px 18px;
  border-radius: 20px;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.9);
  backdrop-filter: blur(10px);
}

.recipe-action-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(8, 3, 14, 0.96);
  border: 2.5px solid #22c55e;
  box-shadow: 0 0 25px rgba(34, 197, 94, 0.8), 0 8px 24px rgba(0, 0, 0, 0.9);
  padding: 7px 22px;
  border-radius: 28px;
  backdrop-filter: blur(12px);
  animation: action-pulse 2s infinite ease-in-out;
}

@keyframes action-pulse {
  0%, 100% {
    box-shadow: 0 0 16px var(--neon-green-glow);
    border-color: #22c55e;
  }
  50% {
    box-shadow: 0 0 28px rgba(74, 222, 128, 0.95), 0 0 40px rgba(34, 197, 94, 0.6);
    border-color: #4ade80;
  }
}

.action-tag {
  font-size: 11px;
  font-weight: 900;
  color: #022c22;
  background: #4ade80;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
  text-shadow: none;
}

.action-instruction-text {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 6px #000, 0 0 8px rgba(34, 197, 94, 0.6);
  letter-spacing: 0.5px;
}

.spell-feedback-toast {
  position: absolute;
  top: 56px;
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.98), rgba(202, 138, 4, 0.98));
  border: 2px solid #facc15;
  box-shadow: 0 0 32px rgba(250, 204, 21, 0.95), 0 10px 30px rgba(0, 0, 0, 0.9);
  padding: 9px 28px;
  border-radius: 30px;
  text-shadow: 0 2px 4px #000;
  opacity: 0;
  transform: translateY(-15px) scale(0.85);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 50;
  white-space: nowrap;
  pointer-events: none;
}

.spell-feedback-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1.05);
}

/* Glowing Neon "STIR & BREW" Button */
.cauldron-action-bar {
  margin-top: 6px;
  z-index: 15;
}

.neon-action-btn {
  background: rgba(12, 28, 16, 0.92);
  border: 3.5px solid #22c55e;
  border-radius: 20px;
  padding: 12px 42px;
  cursor: pointer;
  box-shadow:
    0 0 28px var(--neon-green-glow),
    inset 0 0 20px rgba(34, 197, 94, 0.45);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.neon-action-btn:hover {
  background: rgba(22, 101, 52, 0.98);
  border-color: #86efac;
  box-shadow: 0 0 40px var(--neon-green-glow);
  transform: scale(1.08) translateY(-2px);
}

.neon-action-btn:active {
  transform: scale(0.96);
}

.neon-btn-text {
  font-family: var(--font-title);
  font-size: 28px;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px #4ade80, 0 0 22px #22c55e;
}

/* ==========================================================================
   D. RIGHT PANEL: APOTHECARY WOODEN SHELF & BREW STATUS
   ========================================================================== */
.right-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shelf-and-ghost-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Realistic 2-Tier Wooden Apothecary Shelf */
.apothecary-shelf-unit {
  flex: 1;
  position: relative;
  background: rgba(22, 11, 7, 0.85);
  border: 3px solid #5a3220;
  border-radius: 16px;
  padding: 12px 12px 6px 12px;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.9),
    inset 0 0 35px rgba(0, 0, 0, 0.95);
}

.shelf-tier {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.jars-row {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 50px;
  padding-bottom: 2px;
}

.wood-shelf-plank {
  width: 100%;
  height: 9px;
  background: linear-gradient(180deg, #6b3a22 0%, #3d1c0e 100%);
  border-radius: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.9);
}

.apothecary-jar {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.apothecary-jar:hover {
  transform: scale(1.2);
}

.jar-cork {
  width: 12px;
  height: 5px;
  background: #a16207;
  border-radius: 2px;
}

.jar-glass {
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
}

.jar-label {
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  color: #fef08a;
  background: #422006;
  border: 0.5px solid #a16207;
  padding: 1px 2px;
  border-radius: 2px;
  margin-bottom: 1px;
}

.jar-glow-content {
  font-size: 14px;
}
.jar-glow-content.eggs-green { filter: drop-shadow(0 0 8px var(--neon-green-glow)); }
.jar-glow-content.balls-green { filter: drop-shadow(0 0 8px var(--neon-green-glow)); }

.potion-flask-red {
  background: rgba(239, 68, 68, 0.45);
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
  width: 24px; height: 28px;
}

.round-flask-purple {
  background: rgba(168, 85, 247, 0.45);
  border-color: #c084fc;
  box-shadow: 0 0 14px var(--neon-purple-glow);
  width: 26px; height: 28px;
  border-radius: 50%;
}

.jar-skull-lantern {
  position: relative;
}
.skull-face {
  font-size: 28px;
  filter: drop-shadow(0 0 12px #facc15);
}
.skull-flame-glow {
  position: absolute;
  top: 8px; left: 8px;
  width: 12px; height: 12px;
  background: #ffbe0b;
  border-radius: 50%;
  filter: blur(4px);
}

/* Hanging Garlic Braid */
.hanging-garlic-braid {
  position: absolute;
  top: 8px;
  right: -24px;
  display: flex;
  flex-direction: column;
  font-size: 16px;
  gap: -6px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.9));
}

/* Glowing Blue Neon Ghost on Wall (Fully In-Bounds) */
.neon-ghost-wall-sign {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: realistic-neon-flicker 5s infinite alternate ease-in-out;
}

/* Brew Status Card */
.brew-status-container {
  background: rgba(16, 9, 24, 0.9);
  border: 2px solid #442262;
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.9),
    inset 0 0 18px rgba(192, 132, 252, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.target-ingredients-row {
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
}

.target-ing-icon {
  font-size: 22px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.7));
}

.added-ingredients-slots {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.slot {
  flex: 1;
  height: 44px;
  background: #08030c;
  border: 2px solid #2e1642;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.95);
  transition: all 0.3s ease;
}

.slot.has-item {
  border-color: var(--neon-green);
  box-shadow: 0 0 14px var(--neon-green-glow);
}

.slot-item {
  font-size: 24px;
}

.bouncing-green-arrow {
  position: absolute;
  bottom: -20px;
  font-size: 16px;
  animation: bounce-arrow 1.2s infinite ease-in-out;
}

.brew-status-text-block {
  font-size: 12px;
  font-weight: 700;
  color: #cbd5e1;
}

.brew-status-header-text {
  font-size: 13px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
}

.acting-potently-glow {
  color: #4ade80;
  text-shadow: 0 0 12px var(--neon-green-glow);
}

.status-effects-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: #94a3b8;
}

/* ==========================================================================
   5. VIRTUAL WAND TESTING BAR (FOOTER)
   ========================================================================= */
.virtual-wand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(8, 4, 12, 0.98);
  border-top: 1.5px solid #2c143d;
  z-index: 30;
}

.virtual-wand-title {
  font-size: 11px;
  font-weight: 800;
  color: #facc15;
  letter-spacing: 1px;
}

.quick-gesture-btn {
  background: #180d24;
  border: 1px solid #4a276b;
  color: #e2e8f0;
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-gesture-btn:hover {
  background: #3b1d56;
  border-color: var(--neon-purple);
  box-shadow: 0 0 12px var(--neon-purple-glow);
  transform: translateY(-2px);
}

.key-hint {
  font-size: 9px;
  color: #94a3b8;
  background: #09030e;
  border: 1px solid #3c1e56;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 3px;
}

/* ==========================================================================
   6. KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes bounce-arrow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

@keyframes pulse-ring {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

@keyframes realistic-neon-flicker {
  0%, 100% { opacity: 1; }
  45% { opacity: 1; }
  46% { opacity: 0.7; }
  48% { opacity: 1; }
  85% { opacity: 1; }
  86% { opacity: 0.5; }
  88% { opacity: 1; }
}

/* ==========================================================================
   7. WAND TRAINER MODAL & IMU GAUGE STYLES (PLUSH-PAL DTW FRAMEWORK)
   ========================================================================== */
.wand-train-btn {
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(59, 130, 246, 0.4));
  border: 1.5px solid #c084fc;
  color: #fff;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.3);
}

.wand-train-btn:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.7), rgba(59, 130, 246, 0.7));
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.7);
  transform: translateY(-1px);
}

.wand-trainer-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 2, 14, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.wand-trainer-modal-content {
  position: relative;
  background: linear-gradient(145deg, #1c0f2a, #0d0614);
  border: 2px solid #a855f7;
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.5), 0 20px 50px rgba(0,0,0,0.9);
  border-radius: 24px;
  width: 90%;
  max-width: 580px;
  padding: 24px;
  color: #fff;
  font-family: var(--font-body);
}

.trainer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(168, 85, 247, 0.3);
  padding-bottom: 14px;
}

.trainer-title {
  font-family: var(--font-title);
  font-size: 22px;
  color: #fbbf24;
  text-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
}

.trainer-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.trainer-close-btn:hover {
  color: #f43f5e;
}

.trainer-live-monitor {
  background: rgba(10, 4, 18, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 14px;
  padding: 14px;
  margin: 16px 0;
}

.monitor-label {
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.imu-meters-row {
  display: flex;
  gap: 12px;
}

.imu-meter {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.axis-label {
  font-weight: 800;
  font-size: 12px;
  color: #94a3b8;
  width: 14px;
}

.meter-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 50%;
  transition: width 0.05s linear;
}

.meter-fill.x { background: #f43f5e; box-shadow: 0 0 8px #f43f5e; }
.meter-fill.y { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.meter-fill.z { background: #38bdf8; box-shadow: 0 0 8px #38bdf8; }

.meter-val {
  font-size: 11px;
  font-family: monospace;
  color: #cbd5e1;
  width: 42px;
  text-align: right;
}

.live-gesture-detected-box {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detected-label {
  font-size: 11px;
  color: #a855f7;
  font-weight: 800;
}

.detected-badge {
  font-size: 12px;
  font-weight: 800;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid #4ade80;
  padding: 3px 10px;
  border-radius: 12px;
}

.trainer-gestures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.trainer-gesture-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(26, 14, 38, 0.7);
  border: 1.5px solid rgba(168, 85, 247, 0.25);
  border-radius: 14px;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.trainer-gesture-card:hover {
  border-color: #c084fc;
  background: rgba(45, 20, 68, 0.7);
}

.tg-icon {
  font-size: 24px;
}

.tg-info {
  flex: 1;
}

.tg-name {
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
}

.tg-desc {
  font-size: 10px;
  color: #94a3b8;
}

.tg-samples {
  font-size: 9px;
  color: #38bdf8;
  margin-top: 2px;
}

.record-gesture-btn {
  background: linear-gradient(135deg, #e11d48, #be123c);
  border: 1px solid #fb7185;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.record-gesture-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 10px #f43f5e;
}

.recording-countdown-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 6, 20, 0.94);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  animation: fadeInModal 0.2s;
}

.countdown-big-number {
  font-family: var(--font-title);
  font-size: 72px;
  color: #fbbf24;
  text-shadow: 0 0 30px #f59e0b;
  animation: pulseCountdown 0.8s infinite;
}

@keyframes pulseCountdown {
  0% { transform: scale(0.85); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.85); opacity: 0.8; }
}

.countdown-instruction {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 10px;
}

.trainer-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(168, 85, 247, 0.3);
}

.btn-trainer-reset {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #94a3b8;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.btn-trainer-reset:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-trainer-done {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid #34d399;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 20px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.5);
}

.btn-trainer-done:hover {
  transform: scale(1.04);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.8);
}

/* ==========================================================================
   8. COMPREHENSIVE RESPONSIVE MOBILE & TABLET MEDIA QUERIES
   ========================================================================== */

/* A. Tablets & Small Laptops (769px - 1024px) */
@media (max-width: 1024px) {
  #app-container {
    padding: 8px 14px;
    height: auto;
    min-height: 100dvh;
  }

  .brand-title-orange { font-size: 32px; }
  .brand-title-green { font-size: 42px; }

  .attic-window-container {
    transform: scale(0.85);
  }

  .candy-pail-card {
    width: 240px;
    padding: 8px 12px;
  }

  .main-stage {
    grid-template-columns: 150px 120px 1fr 240px;
    gap: 8px;
  }

  .cauldron-container {
    width: 340px;
    height: 280px;
  }

  .ing-badge {
    width: 50px;
    height: 50px;
  }
  .ing-emoji { font-size: 26px; }

  .shelf-and-ghost-wrapper {
    flex-direction: column;
  }
}

/* B. Mobile Phones (Portrait <= 768px) - 100dvh Zero-Scroll Fit */
@media (max-width: 768px) {
  html, body {
    overflow: hidden;
    height: 100%;
    position: fixed;
    width: 100%;
  }

  #app-container {
    height: 100dvh;
    max-height: 100dvh;
    padding: 4px 8px 44px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    z-index: 30;
  }

  /* 1. Top Navigation Bar (Header) */
  .top-nav {
    height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0 0 2px 0;
    margin-bottom: 2px;
    z-index: 30;
  }

  .brand-section {
    order: 1;
    line-height: 0.85;
  }

  .brand-title-orange {
    font-size: 16px;
    letter-spacing: 0.5px;
  }

  .brand-title-green {
    font-size: 20px;
    letter-spacing: 0.8px;
  }

  .attic-window-container {
    display: none; /* Hide decorative window to maximize play field */
  }

  .candy-pail-card {
    order: 2;
    width: 135px;
    padding: 4px 6px;
    border-radius: 10px;
    gap: 2px;
    border-width: 1.5px;
  }

  .candy-pail-title {
    font-size: 8px;
    letter-spacing: 0.3px;
  }

  .candy-bar-track {
    height: 14px;
    border-radius: 7px;
  }

  .candy-sprite-row {
    display: none;
  }

  .candy-bar-percent {
    font-size: 9px;
  }

  .candy-fraction-label {
    font-size: 8px;
  }

  .pail-pumpkin-icon svg {
    width: 18px;
    height: 18px;
  }

  /* 2. Main Stage Vertical Stack */
  .main-stage {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
    margin-top: 0;
    z-index: 30;
    min-height: 0;
  }

  /* Wand Status Bar (Top Slim Pill Widget) */
  .left-panel {
    order: 1;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    z-index: 30;
  }

  .neon-signs-stack {
    display: none;
  }

  .wand-status-widget {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border-radius: 12px;
    width: 100%;
    gap: 6px;
    border-width: 1.5px;
  }

  .wand-status-header {
    display: none;
  }

  .wand-illustration-box {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .wand-icon-svg {
    width: 26px;
    height: 26px;
  }

  .wand-info-block {
    margin-bottom: 0;
    text-align: left;
  }

  .wand-model-label {
    font-size: 8px;
  }

  .wand-conn-status {
    font-size: 10px;
  }

  .wand-battery-gauge {
    gap: 3px;
  }

  .battery-pill-track {
    width: 28px;
    height: 11px;
  }

  .battery-text {
    font-size: 8px;
  }

  .wand-level-tag {
    margin-top: 0;
    font-size: 8px;
    padding: 2px 5px;
  }

  .wand-train-btn {
    margin-top: 0;
    font-size: 8px;
    padding: 3px 6px;
    border-radius: 6px;
    white-space: nowrap;
  }

  /* 3. Cauldron Center Hero */
  .center-cauldron-section {
    order: 2;
    width: 100%;
    padding-bottom: 0;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 30;
    position: relative;
  }

  .neon-bat-banner {
    display: none;
  }

  .top-instruction-hud {
    position: relative;
    top: 0;
    max-width: 100%;
    margin-bottom: 3px;
    z-index: 35;
    pointer-events: none;
  }

  .active-recipe-tag {
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 12px;
  }

  .recipe-action-banner {
    padding: 4px 14px;
    border-radius: 16px;
    gap: 6px;
    border-width: 2px;
    background: rgba(8, 3, 14, 0.98);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.9), 0 4px 12px rgba(0, 0, 0, 0.95);
  }

  .action-instruction-text {
    font-size: 13px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 4px #000;
  }

  .action-tag {
    font-size: 9px;
    padding: 2px 6px;
    color: #022c22;
    background: #4ade80;
    font-weight: 900;
    border-radius: 4px;
  }

  .spell-feedback-toast {
    font-size: 13px;
    padding: 4px 14px;
    top: 32px;
  }

  .cauldron-container {
    width: 190px;
    height: 145px;
    max-width: 65vw;
    position: relative;
  }

  .cauldron-action-bar {
    margin-top: 2px;
    z-index: 35;
  }

  .neon-action-btn {
    padding: 4px 18px;
    border-radius: 10px;
    border-width: 2px;
  }

  .neon-btn-text {
    font-size: 14px;
    letter-spacing: 0.8px;
  }

  /* 4. Ingredients Shelf (Horizontal Carousel) */
  .ingredients-section {
    order: 3;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 0;
    z-index: 30;
    position: relative;
  }

  .section-title-neon {
    font-size: 10px;
    letter-spacing: 0.5px;
  }

  .ingredients-matrix {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    padding: 2px 0;
    -webkit-overflow-scrolling: touch;
  }

  .ingredient-card {
    gap: 1px;
    flex-shrink: 0;
  }

  .ingredient-card.span-full {
    grid-column: auto;
  }

  .ing-badge {
    width: 38px;
    height: 38px;
    border-width: 2px;
  }

  .ing-emoji {
    font-size: 20px;
  }

  .ing-count {
    font-size: 11px;
  }

  /* 5. Brew Status Card (Compact HUD) */
  .right-panel {
    order: 4;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 0;
    z-index: 30;
    position: relative;
  }

  .shelf-and-ghost-wrapper {
    display: none;
  }

  .brew-status-container {
    width: 100%;
    max-width: 330px;
    padding: 4px 8px;
    border-radius: 10px;
    gap: 3px;
  }

  .target-ingredients-row {
    gap: 4px;
  }

  .target-ing-icon {
    font-size: 14px;
  }

  .added-ingredients-slots {
    gap: 4px;
  }

  .added-ingredients-slots .slot {
    width: 24px;
    height: 24px;
    border-radius: 6px;
  }

  .slot-item {
    font-size: 13px;
  }

  .bouncing-green-arrow {
    font-size: 12px;
    top: -14px;
  }

  .brew-status-header-text {
    font-size: 8px;
  }

  .status-effects-list {
    display: none;
  }

  /* 6. Virtual Wand Bar (Fixed Bottom Touch Carousel) */
  .virtual-wand-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 38px;
    z-index: 100;
    background: rgba(10, 3, 16, 0.98);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 4px 8px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
    border-top: 1.5px solid #442262;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.9);
  }

  .virtual-wand-title {
    font-size: 9px;
    white-space: nowrap;
    align-self: center;
    color: #facc15;
  }

  .quick-gesture-btn {
    padding: 4px 8px;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 6px;
  }

  .key-hint {
    display: none;
  }

  /* Wand Trainer Modal Mobile Scaling */
  .wand-trainer-modal-content {
    width: 95%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 12px;
    border-radius: 16px;
  }

  .trainer-title {
    font-size: 15px;
  }

  .imu-meters-row {
    flex-direction: column;
    gap: 4px;
  }

  .trainer-gestures-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 160px;
  }

  .countdown-big-number {
    font-size: 44px;
  }
}

