/* ==========================================================================
   Vrindavan Treasure Hunt — Core Game Stylesheet
   Theme: "Vrindavan Festival" (Evolve Pune Brand Palette & Vedic Gold Accents)
   ========================================================================== */

:root {
  --terra: #C1502E;
  --terra-deep: #9A3D20;
  --terra-tint: #F6E3DA;
  --paper: #FDFBF7;
  --sand: #F5EFE6;
  --ink: #221C18;
  --ink-soft: #71655C;
  --line: #EAE2D6;
  --gold: #D97706;
  --gold-light: #FEF3C7;
  --gold-glow: #F59E0B;
  --peacock-blue: #0284C7;
  --peacock-green: #059669;
  --world-w: 2752px;
  --world-h: 1536px;
}

/* Prevent unwanted browser bounce during dragging */
html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
  touch-action: none;
  background-color: #120D1C;
  font-family: "Sora", -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* Viewport Container */
#game-viewport {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
  background: #120D1C;
}

/* Pannable 2D World Canvas */
#game-world {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--world-w);
  height: var(--world-h);
  will-change: transform;
  transform-origin: 0 0;
  cursor: grab;
  background-color: #2D1B36;
}

#game-viewport.is-dragging #game-world {
  cursor: grabbing;
}

/* Base Illustrated Map Background */
#world-background-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Target Interactive Hotspots */
.target-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  cursor: pointer;
  z-index: 20;
  outline: none;
}

/* Visual item inside hotspot */
.target-visual {
  width: 38px;
  height: 38px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

.target-hotspot:hover .target-visual,
.target-hotspot:focus-visible .target-visual {
  transform: scale(1.18);
  filter: drop-shadow(0 0 14px rgba(245, 158, 11, 0.95));
}

/* Discovered State */
.target-hotspot.is-found .target-visual {
  animation: found-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.95));
}

.target-hotspot.is-found::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: #10B981;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 800;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  animation: badge-appear 0.4s 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Found Pop Keyframes */
@keyframes found-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.5) rotate(-10deg); }
  75% { transform: scale(1.2) rotate(6deg); }
  100% { transform: scale(1.15) rotate(0deg); }
}

@keyframes badge-appear {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Discovery Golden Sparkle Ring */
.sparkle-burst {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  pointer-events: none;
  z-index: 25;
  animation: ring-explode 0.9s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes ring-explode {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 1;
    border: 4px solid #FDE047;
    border-radius: 9999px;
    box-shadow: 0 0 25px #F59E0B;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
    border: 1px solid #FEF08A;
    border-radius: 9999px;
  }
}

/* Hint Beacon Ripple Effect */
.hint-beacon {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 140px;
  height: 140px;
  pointer-events: none;
  z-index: 22;
}

.hint-beacon::before,
.hint-beacon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 3px solid #F59E0B;
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.85);
  animation: beacon-wave 2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.hint-beacon::after {
  animation-delay: 0.8s;
}

@keyframes beacon-wave {
  0% {
    transform: scale(0.2);
    opacity: 1;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Idle Sparkle Shimmer */
.idle-shimmer {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  pointer-events: none;
  z-index: 21;
  animation: idle-twinkle 2.5s ease-in-out infinite;
}

@keyframes idle-twinkle {
  0%, 100% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.95; filter: drop-shadow(0 0 14px #FBBF24); }
}

/* Glass HUD Styling */
.hud-glass {
  background: rgba(253, 251, 247, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(234, 226, 214, 0.9);
  box-shadow: 0 10px 30px rgba(34, 28, 24, 0.14);
}

/* Bottom Target Tray Glass Container (Low Opacity & Translucent) */
.bottom-tray-glass {
  background: rgba(253, 251, 247, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(234, 226, 214, 0.65);
  box-shadow: 0 8px 24px rgba(34, 28, 24, 0.16);
  transition: opacity 0.3s ease, transform 0.2s ease;
}

/* Target Tray Item */
.tray-item {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

@media (min-width: 640px) {
  .tray-item {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }
}

/* Locked state */
.tray-item.is-locked {
  background: #F5EFE6;
  border: 1.5px dashed #D6C7B2;
  opacity: 0.65;
  filter: grayscale(1);
}

.tray-item.is-locked .tray-icon {
  opacity: 0.45;
}

/* Unlocked state */
.tray-item.is-unlocked {
  background: #FEF3C7;
  border: 1.5px solid #F59E0B;
  opacity: 1;
  filter: grayscale(0);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
  transform: scale(1.05);
}

.tray-item.is-unlocked::after {
  content: '✓';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: #10B981;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Discovery Banner Pop Animation */
@keyframes discovery-slide {
  0% {
    transform: translate(-50%, -20px) scale(0.9);
    opacity: 0;
  }
  20% {
    transform: translate(-50%, 0) scale(1.04);
    opacity: 1;
  }
  30% {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
  85% {
    transform: translate(-50%, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -15px) scale(0.95);
    opacity: 0;
  }
}

.animate-discovery {
  animation: discovery-slide 3.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Floating Navigation Indicator */
@keyframes gentle-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
}

.animate-gentle-pulse {
  animation: gentle-pulse 2s ease-in-out infinite;
}



/* Reduced Motion Overrides */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  #game-world {
    transition: none !important;
  }
}
