* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #1a0a2e;
  position: fixed;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: 'Comic Sans MS', 'Chalkboard SE', cursive;
}
#game-container {
  position: absolute;
  width: 600px;
  height: 900px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  overflow: hidden;
  cursor: pointer;
}
#bg { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; top: 0; left: 0; }

/* --- Scene transition overlay --- */
#scene-overlay {
  position: absolute;
  inset: 0;
  background: black;
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 0.4s ease;
}
#scene-overlay.fading {
  opacity: 1;
  pointer-events: all;
}

/* --- Deur markers --- */
.deur-marker {
  position: absolute;
  width: 60px;
  height: 70px;
  background: rgba(255, 210, 80, 0.85);
  /* Pijlvorm omhoog: stel --rotation in per deur om de richting te wijzigen */
  clip-path: polygon(50% 0%, 100% 42%, 72% 42%, 72% 100%, 28% 100%, 28% 42%, 0% 42%);
  --rotation: 0deg;
  transform: rotate(var(--rotation));
  cursor: pointer;
  z-index: 12;
  animation: deurGlow 2s ease-in-out infinite;
}
@keyframes deurGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 210, 80, 0.6)); }
  50%       { filter: drop-shadow(0 0 20px rgba(255, 210, 80, 1)); }
}
#deur-naar-2 { left: 330px; top: 330px; --rotation: 340deg;   } /* omhoog  */
#deur-naar-1 { left: 30px;  top: 750px; --rotation: 210deg; } /* omlaag  */

/* --- World objects --- */
#puppy {
  position: absolute;
  width: 90px;
  /* top = (470 / 900) * 100%, left = (275 / 600) * 100% — matches the interactive zone in config.js */
  left: 45.83%;
  top: 450px;
  pointer-events: none;
  z-index: 15;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,0.4));
  cursor: pointer;
}

#boom {
  position: absolute;
  left: 100px;
  top: 30px;
  width: 180px;
  /* height: 180px; */
  object-fit: contain;
  pointer-events: none;
  z-index: 10;
}


/* --- Pet companion --- */
#pet-puppy {
  position: absolute;
  width: 55px;
  display: none; /* shown by JS when activated */
  pointer-events: none;
  z-index: 19; /* just behind the panda (z-index 20) */
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}

/* --- Click ripple --- */
.click-ripple {
  position: absolute; width: 40px; height: 20px; border-radius: 50%;
  background: rgba(255,255,150,0.6); border: 2px solid rgba(255,220,0,0.8);
  pointer-events: none; transform: translate(-50%, -50%) scale(0);
  animation: ripple 0.6s ease-out forwards; z-index: 10;
}
@keyframes ripple {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}

/* --- Debug overlay for interactive zones --- */
.interactive-zone-debug {
  position: absolute;
  background: rgba(255, 0, 0, 0.28);
  border: 2px solid rgba(255, 0, 0, 0.9);
  pointer-events: none;
  z-index: 12;
}

/* --- Footsteps --- */
.footstep {
  position: absolute; width: 6px; height: 4px; background: rgba(139,90,43,0.4);
  border-radius: 50%; pointer-events: none; animation: footfade 1.5s ease-out forwards; z-index: 5;
}
@keyframes footfade { 0% { opacity: 0.7; } 100% { opacity: 0; } }

/* --- Panda character --- */
#panda {
  position: absolute; width: 80px; height: 100px; pointer-events: none;
  z-index: 20; transform: translate(-50%, -100%); transition: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
#panda.walking { animation: pandaWalk 0.35s steps(1) infinite; }
@keyframes pandaWalk {
  0%   { transform: translate(-50%, -100%) translateY(0px); }
  25%  { transform: translate(-50%, -100%) translateY(-3px) rotate(-1deg); }
  50%  { transform: translate(-50%, -100%) translateY(0px); }
  75%  { transform: translate(-50%, -100%) translateY(-3px) rotate(1deg); }
  100% { transform: translate(-50%, -100%) translateY(0px); }
}
#panda.idle { animation: pandaIdle 2s ease-in-out infinite; }
@keyframes pandaIdle {
  0%, 100% { transform: translate(-50%, -100%) translateY(0px); }
  50%       { transform: translate(-50%, -100%) translateY(-4px); }
}

/* --- Nametag & speech bubble --- */
#nametag {
  position: absolute; background: rgba(255,255,255,0.92); border: 2px solid #ff8fab;
  border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: bold;
  color: #d63384; pointer-events: none; z-index: 21; white-space: nowrap;
  transform: translateX(-50%); box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
#speech {
  position: absolute; background: white; border: 2px solid #aad4f5; border-radius: 14px;
  padding: 6px 12px; font-size: 13px; color: #333; pointer-events: none; z-index: 22;
  white-space: nowrap; transform: translateX(-50%); box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  opacity: 0; transition: opacity 0.3s;
}
#speech::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: white; border-bottom: none;
}
#speech.show { opacity: 1; }

/* --- Inventory bar --- */
#inventory {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 30;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 16px;
  border-radius: 50px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.08);
}
.inv-slot {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  cursor: pointer;
}
.inv-slot:hover {
  border-color: rgba(255, 140, 200, 0.7);
  background: rgba(255, 140, 200, 0.12);
  transform: scale(1.08);
}
.inv-slot.has-item {
  border-color: rgba(255, 215, 0, 0.6);
  background: rgba(255, 215, 0, 0.1);
}

/* --- HUD: coin counter & title badge --- */
#coins {
  position: absolute; top: 12px; right: 14px; background: rgba(0,0,0,0.5);
  border-radius: 20px; padding: 5px 12px; color: #ffd700; font-size: 14px;
  font-weight: bold; z-index: 30; backdrop-filter: blur(4px); border: 1px solid rgba(255,215,0,0.3);
}
#title-badge {
  position: absolute; top: 12px; left: 14px; background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 20px; padding: 5px 14px; color: white; font-size: 15px; font-weight: bold;
  z-index: 30; letter-spacing: 1px; box-shadow: 0 2px 10px rgba(102,126,234,0.5);
}

/* --- Coin pop animation --- */
.coin-pop {
  position: absolute; font-size: 18px; pointer-events: none; z-index: 25;
  animation: coinPop 1s ease-out forwards; transform: translateX(-50%);
}
@keyframes coinPop {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(1.5); }
}

/* --- Intro / start screen overlay --- */
#intro {
  position: absolute; inset: 0; background: rgba(0,0,0,0.75);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 100; border-radius: 16px; gap: 16px; backdrop-filter: blur(4px);
}
#intro h1 { color: white; font-size: 36px; text-shadow: 0 0 20px rgba(255,140,200,0.8); }
#intro p  { color: rgba(255,255,255,0.85); font-size: 14px; text-align: center; max-width: 280px; line-height: 1.6; }
#intro button {
  background: linear-gradient(135deg, #ff8fab, #c084fc); border: none; border-radius: 30px;
  color: white; font-size: 18px; padding: 12px 36px; cursor: pointer; font-family: inherit;
  font-weight: bold; box-shadow: 0 4px 20px rgba(255,100,180,0.5); transition: transform 0.15s;
}
#intro button:hover { transform: scale(1.05); }
