/* The Night Drop — Store / 3D Experience UI */

/* ============================================
   Canvas
   ============================================ */
#store-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  cursor: crosshair;
}

/* ============================================
   Loading Screen
   ============================================ */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--night-black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-text {
  font-family: var(--font-retro);
  font-size: 32px;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 4px;
  animation: blink 1s step-end infinite;
}

.loading-subtext {
  font-family: var(--font-retro);
  font-size: 18px;
  color: var(--text-dim);
  margin-top: 16px;
  letter-spacing: 2px;
}

.loading-bar-container {
  width: 300px;
  height: 4px;
  background: var(--store-mid);
  margin-top: 32px;
  border: 1px solid var(--neon-cyan);
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  transition: width 0.3s;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================
   HUD Overlay
   ============================================ */
#hud {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

#hud > * {
  pointer-events: auto;
}

/* Logo - top left */
.hud-logo {
  position: absolute;
  top: 20px;
  left: 20px;
  font-family: var(--font-retro);
  font-size: 24px;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
  pointer-events: none;
}

/* 2D Mode button - top right */
.hud-2d-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-family: var(--font-retro);
  font-size: 16px;
  padding: 8px 16px;
  border: 1px solid var(--text-dim);
  background: rgba(10, 10, 15, 0.7);
  color: var(--text-dim);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all 0.2s;
  text-decoration: none;
}

.hud-2d-btn:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  text-shadow: none;
}

/* Controls hint - bottom right */
.hud-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  font-family: var(--font-retro);
  font-size: 14px;
  color: var(--text-dim);
  text-align: right;
  letter-spacing: 1px;
  pointer-events: none;
  transition: opacity 0.5s;
}

/* Restock countdown - top center */
.hud-restock {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-retro);
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  pointer-events: none;
  background: rgba(10, 10, 15, 0.6);
  padding: 4px 14px;
  border: 1px solid rgba(136, 136, 170, 0.2);
  white-space: nowrap;
}

.hud-restock span {
  color: var(--neon-cyan);
}

/* Now playing - bottom left */
.hud-now-playing {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-retro);
  font-size: 16px;
  color: var(--text-dim);
  cursor: pointer;
}

.hud-now-playing .mute-icon {
  font-size: 20px;
  color: var(--neon-cyan);
  transition: color 0.2s;
}

.hud-now-playing:hover .mute-icon {
  color: var(--neon-pink);
}

/* Crosshair */
.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-retro);
  font-size: 24px;
  color: var(--neon-cyan);
  pointer-events: none;
  text-shadow: 0 0 6px rgba(0, 245, 255, 0.5);
  transition: color 0.15s;
  z-index: 101;
}

.crosshair.active {
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 45, 120, 0.6);
}

/* Interaction prompt */
.interact-prompt {
  position: absolute;
  top: calc(50% + 24px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-retro);
  font-size: 16px;
  color: var(--neon-pink);
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.interact-prompt.visible {
  opacity: 1;
}

/* Click to unmute */
.unmute-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-retro);
  font-size: 20px;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 16px 32px;
  border: 1px solid var(--neon-cyan);
  background: rgba(10, 10, 15, 0.9);
  cursor: pointer;
  z-index: 200;
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 245, 255, 0.2); }
  50% { box-shadow: 0 0 25px rgba(0, 245, 255, 0.5); }
}

/* ============================================
   Tutorial Overlay
   ============================================ */
#tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(10, 10, 15, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

#tutorial-overlay .tutorial-text {
  font-family: var(--font-retro);
  font-size: 28px;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
}

#tutorial-overlay .tutorial-dismiss {
  font-family: var(--font-retro);
  font-size: 16px;
  color: var(--text-dim);
  animation: blink 1.5s step-end infinite;
}

/* ============================================
   Movie Info Panel
   ============================================ */
#movie-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  z-index: 200;
  background: rgba(10, 10, 15, 0.95);
  border-left: 2px solid var(--neon-cyan);
  box-shadow:
    -5px 0 30px rgba(0, 245, 255, 0.1),
    inset 0 0 20px rgba(0, 0, 0, 0.5);
  padding: 30px 24px;
  overflow-y: auto;
  transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

#movie-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    var(--scanline) 2px, var(--scanline) 4px
  );
  pointer-events: none;
}

#movie-panel.open {
  right: 0;
}

.panel-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-retro);
  font-size: 24px;
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
  z-index: 1;
}

.panel-close:hover {
  color: var(--neon-pink);
}

.panel-poster {
  width: 100%;
  max-width: 240px;
  margin: 0 auto 20px;
  display: block;
  border: 2px solid var(--store-mid);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  image-rendering: auto;
}

.panel-title {
  font-family: var(--font-retro);
  font-size: 28px;
  color: var(--neon-cyan);
  margin-bottom: 8px;
  line-height: 1.2;
}

.panel-meta {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.panel-stars {
  color: var(--tape-gold);
  font-size: 16px;
  letter-spacing: 2px;
}

.panel-genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.genre-tag {
  font-family: var(--font-retro);
  font-size: 14px;
  padding: 3px 10px;
  border: 1px solid var(--neon-purple);
  color: var(--neon-purple);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.panel-overview {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: 20px;
}

.panel-providers-title {
  font-family: var(--font-retro);
  font-size: 18px;
  color: var(--neon-cyan);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.panel-providers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.provider-tag {
  font-family: var(--font-body);
  font-size: 11px;
  padding: 4px 10px;
  background: var(--store-mid);
  color: var(--text-main);
  border-radius: 2px;
}

.panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.panel-actions .btn {
  font-size: 14px;
  padding: 8px 16px;
  flex: 1;
}

/* ============================================
   Box Office Modal
   ============================================ */
#box-office-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.9);
}

#box-office-modal.open {
  display: flex;
}

.box-office-content {
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(10, 10, 15, 0.95);
  border: 2px solid var(--neon-cyan);
  padding: 30px;
  position: relative;
}

.box-office-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    var(--scanline) 2px, var(--scanline) 4px
  );
  pointer-events: none;
}

.box-office-title {
  font-family: var(--font-retro);
  font-size: 24px;
  color: var(--neon-pink);
  text-align: center;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.box-office-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--store-mid);
}

.box-office-rank {
  font-family: var(--font-retro);
  font-size: 24px;
  color: var(--neon-cyan);
  min-width: 32px;
}

.box-office-info h3 {
  font-family: var(--font-retro);
  font-size: 18px;
  color: var(--text-main);
  letter-spacing: 1px;
}

.box-office-info p {
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-dim);
}

/* ============================================
   Trailer Modal
   ============================================ */
#trailer-modal {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 15, 0.92);
}

#trailer-modal.open {
  display: flex;
}

.trailer-content {
  width: 90%;
  max-width: 800px;
  background: rgba(10, 10, 15, 0.95);
  border: 2px solid var(--neon-pink);
  padding: 24px;
  position: relative;
}

.trailer-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    var(--scanline) 2px, var(--scanline) 4px
  );
  pointer-events: none;
}

#trailer-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
  z-index: 1;
}

#trailer-player iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================
   Pause Menu
   ============================================ */
#pause-menu {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(10, 10, 15, 0.9);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

#pause-menu.open {
  display: flex;
}

#pause-menu h2 {
  font-family: var(--font-retro);
  font-size: 36px;
  color: var(--neon-cyan);
  letter-spacing: 4px;
  margin-bottom: 20px;
}

#pause-menu .btn {
  width: 240px;
  text-align: center;
}

.pause-music {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
}

.pause-track-name {
  font-family: var(--font-retro);
  font-size: 16px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

#pause-mute {
  width: 240px;
  font-size: 14px;
}

/* ============================================
   Mobile Controls
   ============================================ */
#mobile-joystick {
  position: fixed;
  bottom: 80px;
  left: 40px;
  width: 120px;
  height: 120px;
  z-index: 150;
  display: none;
}

@media (pointer: coarse) {
  #mobile-joystick {
    display: block;
  }

  .hud-controls {
    display: none;
  }
}

.joystick-base {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  background: rgba(10, 10, 15, 0.5);
  position: relative;
}

.joystick-knob {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 245, 255, 0.3);
  border: 2px solid var(--neon-cyan);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  touch-action: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
  #movie-panel {
    width: 100%;
    right: -100%;
  }

  .hud-logo {
    font-size: 14px;
    top: 12px;
    left: 12px;
  }

  .hud-2d-btn {
    font-size: 12px;
    padding: 5px 10px;
    top: 12px;
    right: 12px;
  }

  .hud-restock {
    top: auto;
    bottom: 60px;
    right: 12px;
    left: auto;
    transform: none;
    font-size: 11px;
    padding: 3px 10px;
  }

  .hud-now-playing {
    bottom: 12px;
    left: 12px;
    font-size: 13px;
  }

  .crosshair {
    font-size: 20px;
  }

  .loading-text {
    font-size: 22px;
  }

  #mobile-joystick {
    bottom: 100px;
    left: 24px;
  }
}
