/* Universal Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0c0a09;
  color: #f5f5f4;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.font-siliguri {
  font-family: 'Hind Siliguri', sans-serif;
}

/* 2D Stationary Scene Viewport (Completely Stable, Zero Tilt/Parallax) */
#scene-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #0c0a09;
}

#stall-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #0c0a09;
  overflow: hidden;
  transform: none !important; /* Fixed stationary position */
}

#hotspots-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Control Buttons */
.control-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  color: #e7e5e4;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

@media (min-width: 640px) {
  .control-btn {
    padding: 6px 14px;
    font-size: 13px;
    gap: 6px;
  }
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

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

.control-btn.active {
  background: #d97706;
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.control-btn.special {
  background: linear-gradient(135deg, #b45309, #d97706);
  color: #ffffff;
  border-color: #f59e0b;
  font-weight: 600;
}

/* Hotspots (Stationary 2D Anchoring) */
.hotspot {
  position: absolute;
  cursor: pointer;
  z-index: 15;
  transform: translate(-50%, -50%);
}

#bulb-spot {
  z-index: 16;
}

#kettle-spot {
  z-index: 18;
}

#cup-spot {
  z-index: 17;
}

#tv-spot {
  z-index: 19;
}

#person-spot {
  z-index: 14;
}

#weather-canvas {
  z-index: 20;
}

/* 1. Bulb Glow & Lighting */
.bulb-click-target {
  position: absolute;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  cursor: pointer;
  z-index: 18;
}

.bulb-point {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fffbeb 30%, #f59e0b 80%);
  box-shadow: 0 0 14px 5px rgba(251, 191, 36, 0.7);
  transition: all 0.5s ease;
  pointer-events: none;
}

.bulb-halo {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(253, 230, 138, 0.55) 0%, rgba(245, 158, 11, 0.28) 38%, rgba(217, 119, 6, 0.08) 65%, transparent 80%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: bulbFlicker 6s infinite ease-in-out;
  transition: opacity 0.5s ease;
}

.bulb-off .bulb-halo {
  opacity: 0 !important;
}

.bulb-off .bulb-point {
  opacity: 0.15 !important;
  box-shadow: none !important;
}

@keyframes bulbFlicker {
  0%, 100% { opacity: 0.95; transform: translate(-50%, -50%) scale(1); }
  45% { opacity: 0.9; }
  50% { opacity: 0.82; transform: translate(-50%, -50%) scale(0.98); }
  52% { opacity: 0.94; }
  85% { opacity: 0.88; }
}

/* 2. Kettle Steam Animation (Continuous, Highly Visible, Natural Floating Smoke) */
.kettle-click-target {
  position: absolute;
  width: 70px;
  height: 70px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  cursor: pointer;
  z-index: 20;
}

.steam-container {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 130px;
  pointer-events: none;
  overflow: visible;
}

.steam-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.75));
  animation: steamRise 3.2s infinite ease-out;
}

.s-1 { animation-delay: 0s; }
.s-2 { animation-delay: 1.1s; transform: scaleX(-1); }
.s-3 { animation-delay: 2.2s; }

@keyframes steamRise {
  0% {
    transform: translateY(12px) scaleX(0.7) scaleY(0.7);
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  60% {
    opacity: 0.65;
    transform: translateY(-38px) scaleX(1.15) scaleY(1.05);
  }
  100% {
    transform: translateY(-88px) scaleX(1.65) scaleY(1.4);
    opacity: 0;
  }
}

.steam-burst .steam-svg {
  animation-duration: 1.6s !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)) !important;
}
.steam-burst .steam-svg path {
  stroke-width: 5.5px !important;
  stroke: rgba(255, 255, 255, 0.95) !important;
}

/* 3. Tea Cup Interaction & Steam */
.cup-click-target {
  position: absolute;
  width: 52px;
  height: 52px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  cursor: pointer;
  z-index: 19;
}

.cup-steam {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 70px;
  pointer-events: none;
  overflow: visible;
}

.cup-steam-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7));
  animation: cupSteamRise 2.8s infinite ease-out;
}

@keyframes cupSteamRise {
  0% {
    transform: translateY(6px) scale(0.6);
    opacity: 0;
  }
  25% {
    opacity: 0.85;
  }
  65% {
    opacity: 0.5;
    transform: translateY(-24px) scale(1.15);
  }
  100% {
    transform: translateY(-55px) scale(1.55);
    opacity: 0;
  }
}

/* 4. Retro TV / Radio Overlay */
.scanlines {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.35) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 5;
}

.crt-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 6;
}

@keyframes spinVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.playing #tv-vinyl {
  animation: spinVinyl 3.5s linear infinite;
}

.equalizer .bar {
  width: 2.5px;
  background: #34d399;
  border-radius: 1px;
  animation: equalize 0.7s infinite ease-in-out alternate;
}

.paused .equalizer .bar,
.equalizer.paused .bar {
  animation: none !important;
  height: 2px !important;
  opacity: 0.35;
}

.b1 { height: 6px; animation-delay: 0.1s; }
.b2 { height: 12px; animation-delay: 0.25s; }
.b3 { height: 9px; animation-delay: 0.15s; }
.b4 { height: 13px; animation-delay: 0.35s; }
.b5 { height: 5px; animation-delay: 0.2s; }

@keyframes equalize {
  0% { height: 2px; }
  100% { height: 12px; }
}

/* 5. Speech Bubble for Dialogues */
.speech-bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #ffffff;
  color: #1f2937;
  padding: 10px 16px;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  z-index: 35;
  max-width: 240px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.speech-bubble.hidden {
  opacity: 0;
  transform: translate(-50%, -85%) scale(0.85);
  pointer-events: none;
}

.bubble-arrow {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #ffffff;
}

.person-click-target {
  position: absolute;
  inset: 0;
  cursor: pointer;
  z-index: 18;
}

/* Interactive Feedback ripple */
.click-ripple {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(245, 158, 11, 0.8);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 35;
}

@keyframes rippleAnim {
  0% { width: 0; height: 0; opacity: 1; transform: translate(-50%, -50%); }
  100% { width: 80px; height: 80px; opacity: 0; transform: translate(-50%, -50%); }
}

/* 6. Playlist Drawer & Items */
#playlist-drawer.open {
  transform: translateX(0);
}

.custom-scroll::-webkit-scrollbar {
  width: 5px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.3);
  border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.6);
}

.playlist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s ease;
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(-2px);
}

.playlist-item.active {
  background: rgba(217, 119, 6, 0.25);
  border-color: rgba(245, 158, 11, 0.5);
}

.playlist-item.active .song-name {
  color: #fef08a;
  font-weight: 600;
}

/* 7. Chatbox & Messages Styling */
.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble-user {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  border-top-left-radius: 2px;
  padding: 6px 10px;
  color: #f5f5f4;
}

.chat-bubble-own {
  background: rgba(217, 119, 6, 0.25);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fffbeb;
}

.chat-system-msg {
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 5px 8px;
  text-align: center;
  color: #fde68a;
  font-size: 11px;
}

/* 8. Buy Tea Modal & Amounts */
.amount-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.amount-btn:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.amount-btn.active {
  background: rgba(217, 119, 6, 0.25);
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

#buy-tea-prompt {
  animation: promptFloat 4s infinite ease-in-out;
}

@keyframes promptFloat {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -4px); }
}
