/* 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;
}

/* Scene Frame Scaling (Aspect Ratio 16:9 on Landscape, Full Screen on Portrait Mobile) */
#stall-scene {
  position: relative;
  width: min(100vw, calc(100vh * (16 / 9)));
  height: min(100vh, calc(100vw * (9 / 16)));
  background-color: #1c1917;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  border-radius: 12px;
  transition: width 0.3s ease, height 0.3s ease;
}

/* Portrait Mobile Viewport (Takes full screen gracefully with no black bars) */
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  #stall-scene {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

.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;
}

/* Hotspot Base */
.hotspot {
  position: absolute;
  cursor: pointer;
  z-index: 10;
  transform: translate(-50%, -50%);
}

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

.bulb-point {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fffbeb;
  box-shadow: 0 0 15px 4px #fbbf24;
  transition: all 0.5s ease;
}

.bulb-halo {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(253, 230, 138, 0.6) 0%, rgba(245, 158, 11, 0.3) 40%, rgba(217, 119, 6, 0.1) 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 {
  background: #78716c !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 */
.kettle-click-target {
  position: absolute;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  cursor: pointer;
  z-index: 12;
}

.steam-container {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, -20%);
  width: 60px;
  height: 120px;
  pointer-events: none;
  filter: blur(1.8px);
}

.steam-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: steamRise 3.5s infinite linear;
}

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

@keyframes steamRise {
  0% {
    stroke-dashoffset: 220;
    opacity: 0;
    transform: translateY(0) scaleX(0.7);
  }
  35% {
    opacity: 0.65;
  }
  75% {
    opacity: 0.35;
  }
  100% {
    stroke-dashoffset: 0;
    opacity: 0;
    transform: translateY(-40px) scaleX(1.4);
  }
}

.steam-burst .steam-svg {
  animation-duration: 1.8s !important;
  stroke-width: 6px !important;
  stroke: rgba(255, 255, 255, 0.9) !important;
}

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

.cup-steam {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 60px;
  pointer-events: none;
  filter: blur(1.2px);
}

.cup-steam-svg {
  width: 100%;
  height: 100%;
  stroke-dasharray: 120;
  stroke-dashoffset: 120;
  animation: cupSteamRise 2.8s infinite linear;
}

@keyframes cupSteamRise {
  0% { stroke-dashoffset: 120; opacity: 0; transform: translateY(0); }
  50% { opacity: 0.55; }
  100% { stroke-dashoffset: 0; opacity: 0; transform: translateY(-20px) scaleX(1.2); }
}

/* 4. Retro TV / Radio */
.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;
}

.equalizer .bar {
  width: 3px;
  background: #34d399;
  border-radius: 1px;
  animation: equalize 0.8s infinite ease-in-out alternate;
}
.b1 { height: 14px; animation-delay: 0.1s; }
.b2 { height: 22px; animation-delay: 0.3s; }
.b3 { height: 18px; animation-delay: 0.2s; }
.b4 { height: 10px; animation-delay: 0.4s; }

@keyframes equalize {
  0% { height: 4px; }
  100% { height: 22px; }
}

/* 5. Speech Bubble for Dialogues */
.speech-bubble {
  position: absolute;
  top: 48%;
  left: 28%;
  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: 30;
  max-width: 220px;
  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: 12;
}

/* 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: translateY(0); }
  50% { transform: translateY(-3px); }
}
