/* Torch mode — activated with Enter+S */
.torch-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8000;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.92);
  transition: opacity 0.5s ease;
}

.torch-overlay.active {
  display: block;
}

.torch-overlay.active ~ * {
  position: relative;
}

.torch-hint {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8002;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: rgba(136, 204, 255, 0.4);
  pointer-events: none;
  animation: torchHintPulse 2s ease infinite;
}

.torch-hint.active {
  display: block;
}

@keyframes torchHintPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* The blue light that follows cursor */
.torch-light {
  display: none;
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 8001;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(100, 180, 255, 0.25) 0%,
    rgba(60, 140, 255, 0.15) 30%,
    rgba(30, 80, 200, 0.05) 60%,
    transparent 70%
  );
  mix-blend-mode: screen;
}

.torch-light.active {
  display: block;
}

/* Punch a hole in the dark overlay where cursor is */
.torch-overlay.active {
  mask-image: radial-gradient(circle 150px at var(--torch-x, -100px) var(--torch-y, -100px), transparent 0%, black 100%);
  -webkit-mask-image: radial-gradient(circle 150px at var(--torch-x, -100px) var(--torch-y, -100px), transparent 0%, black 100%);
}

/* Torch emoji indicator */
.torch-icon {
  display: none;
  position: fixed;
  z-index: 8003;
  font-size: 1.5rem;
  pointer-events: none;
  transform: translate(-50%, -120%);
  filter: hue-rotate(180deg) brightness(1.5);
  animation: torchIconFlicker 0.5s ease infinite;
}

.torch-icon.active {
  display: block;
}

@keyframes torchIconFlicker {
  0%, 100% { transform: translate(-50%, -120%) scale(1); }
  50% { transform: translate(-50%, -120%) scale(1.1); }
}

/* Mobile torch toggle button */
.torch-mobile-btn {
  display: none;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 9000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.6);
  font-size: 1.3rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

@media (pointer: coarse) {
  .torch-mobile-btn {
    display: block;
  }
}
@media (max-width: 600px) {
  .torch-mobile-btn {
    display: block;
  }
}
