/* ============================================
   403 Super Vega Custom Font
   ============================================ */
@font-face {
  font-family: '403 Super Vega';
  src: url('../fonts/403-super-vega-regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
  /* Colors */
  --color-bg: #000000;
  --color-text: #FFFFFF;
  --color-acrylic-yellow: #FDFF00;
  --color-acrylic-red: #FF0505;
  --color-acrylic-green: #11FF00;
  --color-acrylic-blue: #2600FF;
  
  /* Typography - Desktop */
  --font-title: '403 Super Vega', sans-serif;
  --font-body: 'Nanum Myeongjo', serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-arrow: 'Alegreya', serif;
  
  --title-size: 136px;
  --title-line-height: 130px;
  --title-letter-spacing: -4px;
  
  --body-size: 20px;
  --body-line-height: 26px;
  
  --label-size: 14px;
  --label-line-height: 14px;
  
  --arrow-size: 18px;
  --arrow-line-height: 21.6px;
  
  /* Spacing */
  --page-padding: 30px;
  --corner-size: 25px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: crosshair;
}

/* ============================================
   Corner Accents
   ============================================ */
.corner-accent {
  position: fixed;
  width: var(--corner-size);
  height: var(--corner-size);
  background-color: var(--color-text);
  z-index: 100;
  pointer-events: none;
}

.corner-accent.top-left {
  top: 0;
  left: 0;
}

.corner-accent.top-right {
  top: 0;
  right: 0;
}

.corner-accent.bottom-left {
  bottom: 0;
  left: 0;
}

.corner-accent.bottom-right {
  bottom: 0;
  right: 0;
}

/* ============================================
   3D Scene Container (Full Screen)
   ============================================ */
#three-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
}

#three-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ============================================
   Gradient Masks (above room, behind text)
   ============================================ */
.gradient-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.8) 20%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.2) 75%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: 5;
  pointer-events: none;
}

.gradient-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.8) 20%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.2) 75%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: 5;
  pointer-events: none;
}

/* ============================================
   Installation Overlay (UI Layer)
   ============================================ */
.installation-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--page-padding);
}

/* Header Section */
.installation-header {
  pointer-events: auto;
}

.title {
  font-family: var(--font-title);
  font-size: var(--title-size);
  font-weight: normal;
  line-height: var(--title-line-height);
  letter-spacing: var(--title-letter-spacing);
  white-space: nowrap;
}


/* Footer Section - Centered Instructions (Desktop) */
.installation-footer {
  pointer-events: auto;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 30px;
}

.instruction-text {
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: 700;
  line-height: var(--body-line-height);
  margin-bottom: 0;
  opacity: 0.8;
}

/* Show/hide based on device */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block;
}

/* Navigation Buttons (kept for back button styling) */
.nav-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  overflow: visible;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 30px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  pointer-events: auto;
  width: fit-content;
  flex-shrink: 0;
  overflow: visible;
}

.btn:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

.btn-text {
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: 500;
  line-height: var(--label-line-height);
  text-transform: uppercase;
}

.btn-arrow {
  font-family: var(--font-arrow);
  font-size: var(--arrow-size);
  font-style: italic;
  line-height: 1;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--color-text);
  color: var(--color-bg);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-text);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-secondary.active {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Back Button
   ============================================ */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--color-text);
  border-radius: 30px;
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: var(--label-size);
  font-weight: 500;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.2s ease;
  width: fit-content;
  flex-shrink: 0;
  white-space: nowrap;
  margin-bottom: 20px;
}

.back-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.back-arrow {
  font-family: var(--font-arrow);
  font-size: 16px;
  font-style: italic;
  flex-shrink: 0;
}

/* ============================================
   Controls Toggle Button
   ============================================ */
.controls-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.controls-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Music Toggle Button
   ============================================ */
.music-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.music-toggle:hover,
.music-toggle:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* Music icon states */
.music-toggle .music-icon {
  position: absolute;
  transition: opacity 0.2s ease;
}

.music-toggle .music-on {
  opacity: 0;
}

.music-toggle .music-off {
  opacity: 1;
}

.music-toggle.playing {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}

.music-toggle.playing .music-on {
  opacity: 1;
}

.music-toggle.playing .music-off {
  opacity: 0;
}

/* Hide music toggle during cinematic intro */
body.cinematic-intro .music-toggle {
  opacity: 0 !important;
  pointer-events: none;
  transition: none !important;
}

body.cinematic-revealed .music-toggle {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.35s ease-out;
  transition-delay: 0.25s;
}

/* Hide music toggle in pointer lock mode */
body.pointer-locked .music-toggle {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.pointer-locked:hover .music-toggle {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================
   Room Controls Panel
   ============================================ */
.room-controls {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 300px;
  max-height: calc(100vh - 140px);
  background: rgba(10, 10, 12, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  display: flex;
  flex-direction: column;
}

.room-controls.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.controls-header span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.5);
}

.controls-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.controls-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.controls-content {
  padding: 16px 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.controls-content::-webkit-scrollbar {
  width: 6px;
}

.controls-content::-webkit-scrollbar-track {
  background: transparent;
}

.controls-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.controls-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Section Headers */
.control-section {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 20px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.control-section:first-child {
  margin-top: 0;
}

/* Control Row */
.control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 0 2px;
}

.control-row label {
  flex: 0 0 80px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* Color picker */
.control-row input[type="color"] {
  width: 40px;
  height: 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: none;
  padding: 0;
}

.control-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 3px;
}

.control-row input[type="color"]::-webkit-color-swatch {
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Checkbox */
.control-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #64d2ff;
  border-radius: 4px;
}

.control-row input[type="range"] {
  flex: 1;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
}

.control-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease;
}

.control-row input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.control-row input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(0.95);
}

.control-row .value {
  flex: 0 0 42px;
  font-size: 11px;
  color: #64d2ff;
  text-align: right;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  font-weight: 500;
}

/* Control Buttons */
.control-buttons {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.control-buttons button {
  width: 100%;
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.control-buttons button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.control-buttons button:active {
  transform: scale(0.98);
}

/* ============================================
   Controls Hint Modal
   ============================================ */
.controls-hint {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

.controls-hint.hidden {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hint-content {
  text-align: center;
  max-width: 400px;
  padding: 40px;
  background: rgba(20, 20, 25, 0.95);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.hint-icon {
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.6);
}

.hint-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-text);
  margin-bottom: 24px;
}

.hint-keys {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.key-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.key.wide {
  min-width: 80px;
}

.key-label {
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 8px;
}

.hint-dismiss {
  padding: 12px 32px;
  background: var(--color-text);
  border: none;
  border-radius: 30px;
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hint-dismiss:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

/* ============================================
   Pointer Lock Active State
   ============================================ */
body.pointer-locked {
  cursor: none;
}

body.pointer-locked .installation-overlay,
body.pointer-locked .back-button,
body.pointer-locked .controls-toggle,
body.pointer-locked .room-controls {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Gradients ALWAYS hidden in movement mode - use !important to override cinematic-revealed */
body.pointer-locked .gradient-top,
body.pointer-locked .gradient-bottom {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s ease;
}

body.pointer-locked:hover .installation-overlay,
body.pointer-locked:hover .back-button,
body.pointer-locked:hover .controls-toggle {
  opacity: 1;
  pointer-events: auto;
}

/* Gradients stay hidden in movement mode (no hover restore) */

/* ============================================
   Cinematic Intro Animation
   ============================================ */

/* Hide all UI during cinematic intro - NO transition initially */
body.cinematic-intro .installation-overlay,
body.cinematic-intro .gradient-top,
body.cinematic-intro .gradient-bottom,
body.cinematic-intro .back-button,
body.cinematic-intro .controls-toggle,
body.cinematic-intro .room-controls,
body.cinematic-intro .navigation-hint,
body.cinematic-intro .anchor-indicator,
body.cinematic-intro .anchor-info-panel {
  opacity: 0 !important;
  pointer-events: none;
  transition: none !important; /* Prevent flash on load */
}

/* Only enable transitions when revealed class is added */
body.cinematic-revealed .installation-overlay,
body.cinematic-revealed .gradient-top,
body.cinematic-revealed .gradient-bottom {
  opacity: 1;
  /* Keep pointer-events: none so clicks pass through to canvas */
  transition: opacity 0.35s ease-out;
}

body.cinematic-revealed .back-button,
body.cinematic-revealed .controls-toggle {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.35s ease-out;
}

body.cinematic-revealed .anchor-indicator {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.35s ease-out;
  transition-delay: 0.25s;
}

/* Staggered reveal using transition-delay */
body.cinematic-revealed .gradient-top,
body.cinematic-revealed .gradient-bottom {
  transition-delay: 0s;
}

body.cinematic-revealed .installation-header {
  transition-delay: 0.05s;
}

body.cinematic-revealed .installation-footer {
  transition-delay: 0.1s;
}

body.cinematic-revealed .back-button {
  transition-delay: 0.15s;
}

body.cinematic-revealed .controls-toggle {
  transition-delay: 0.2s;
}

/* Skip animation indicator */
.skip-hint {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  z-index: 1000;
  pointer-events: none;
  opacity: 0.5;
}

body:not(.cinematic-intro) .skip-hint {
  display: none;
}

/* ============================================
   Responsive - Tablet (1024px and below)
   ============================================ */
@media screen and (max-width: 1024px) {
  :root {
    --title-size: 90px;
    --title-line-height: 86px;
    --title-letter-spacing: -3px;
  }
}

/* ============================================
   Mobile Responsive Styles (matching Figma mweb)
   ============================================ */
@media screen and (max-width: 768px) {
  :root {
    --title-size: 42px;
    --title-line-height: 40px;
    --title-letter-spacing: -1px;
    
    --body-size: 15px;
    --body-line-height: 24px;
    
    --label-size: 12px;
    --arrow-size: 14px;
    
    --page-padding: 20px;
    --corner-size: 15px;
  }
  
  /* Show/hide based on device */
  .mobile-only {
    display: block !important;
  }
  
  .desktop-only {
    display: none !important;
  }
  
  
  /* Show mobile arrow controls */
  .mobile-controls {
    display: flex !important;
  }
  
  /* Hide keyboard controls hint on mobile */
  .controls-hint {
    display: none !important;
  }
  
  /* Always show pointer on mobile for anchor points */
  body:not(.pointer-locked) .anchor-indicator {
    opacity: 1;
    pointer-events: auto;
  }
  
  .installation-overlay {
    padding: var(--page-padding);
    padding-top: 25px;
    padding-bottom: 24px;
  }
  
  .title {
    display: none !important;
  }
  
  .gradient-top {
    display: none !important;
  }
  
  .installation-footer {
    display: flex !important;
    position: fixed !important;
    bottom: 130px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 0 !important;
    z-index: 90;
  }
  
  .instruction-text {
    font-family: var(--font-body);
    font-size: var(--body-size);
    font-weight: 700;
    line-height: var(--body-line-height);
    text-align: center;
    opacity: 0.6;
  }
  
  .back-button {
    padding: 6px 12px;
    font-size: 12px;
    margin-bottom: 10px;
  }
  
  .back-arrow {
    font-size: 14px;
  }
  
  .controls-toggle {
    bottom: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
  }
  
  .music-toggle {
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
  }
  
  .room-controls {
    right: 10px;
    bottom: 70px;
    width: calc(100vw - 20px);
    max-width: 320px;
    max-height: calc(100vh - 100px);
  }
  
  .hint-content {
    margin: 20px;
    padding: 30px 24px;
  }
  
  .hint-title {
    font-size: 12px;
  }
  
  .key {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .key-label {
    font-size: 12px;
  }
}

/* Extra small screens (iPhone SE, etc.) */
@media screen and (max-width: 480px) {
  :root {
    --title-size: 48px;
    --title-line-height: 44px;
    --title-letter-spacing: -1.5px;
    
    --body-size: 15px;
    --body-line-height: 24px;
  }
  
  .nav-links {
    gap: 6px;
  }
  
  .btn {
    padding: 5px 10px;
    width: fit-content;
    flex-shrink: 0;
    overflow: visible;
  }
  
  .btn-text {
    font-size: 11px;
    flex-shrink: 0;
  }
  
  .btn-arrow {
    font-size: 13px;
    flex-shrink: 0;
  }
}

/* ============================================
   Anchor Points & Info Panels
   ============================================ */

/* Info panel container */
.anchor-info-panel {
  position: fixed;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 20px 24px;
  max-width: 320px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.anchor-info-panel.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.anchor-info-panel .panel-title {
  font-family: var(--font-title);
  font-size: 24px;
  line-height: 1.1;
  margin-bottom: 12px;
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.anchor-info-panel .panel-description {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0;
}

.anchor-info-panel .panel-description p {
  margin: 0 0 10px 0;
}

.anchor-info-panel .panel-description p:last-child {
  margin-bottom: 0;
}

/* Close button for info panel */
.anchor-info-panel .panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.anchor-info-panel .panel-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Anchor point indicator (2D overlay) */
.anchor-indicator {
  position: fixed;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
  z-index: 50;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
  pointer-events: auto;
  opacity: 1;
  display: block;
  /* Dark shadow for visibility on light backgrounds */
  box-shadow: 
    0 0 0 2px rgba(0, 0, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.anchor-indicator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  /* Dark outline on center dot */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.anchor-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: anchor-pulse 2s ease-out infinite;
  /* Dark outer glow for pulse ring visibility */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

@keyframes anchor-pulse {
  0% {
    width: 32px;
    height: 32px;
    opacity: 1;
  }
  100% {
    width: 60px;
    height: 60px;
    opacity: 0;
  }
}

.anchor-indicator:hover {
  background: rgba(0, 0, 0, 0.4);
  border-color: #fff;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 
    0 0 0 2px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.anchor-indicator.active {
  background: rgba(0, 0, 0, 0.5);
  border-color: #fff;
  box-shadow: 
    0 0 0 2px rgba(0, 0, 0, 0.5),
    0 4px 12px rgba(0, 0, 0, 0.6),
    inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.anchor-indicator.active::after {
  animation: none;
}

/* Edge-clamped state - when element is off-screen */
.anchor-indicator.at-edge {
  transform: translate(-50%, -50%) scale(0.85);
  background: rgba(0, 0, 0, 0.25);
  border-style: dashed;
  box-shadow: 
    0 0 0 2px rgba(0, 0, 0, 0.3),
    0 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.anchor-indicator.at-edge::after {
  animation: none;
  opacity: 0;
}

.anchor-indicator.at-edge:hover {
  transform: translate(-50%, -50%) scale(0.95);
}

/* Hide anchor indicators when pointer locked (moving around) */
body.pointer-locked .anchor-indicator {
  opacity: 0.15;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Ensure anchors are visible when not pointer locked */
body:not(.pointer-locked):not(.cinematic-intro) .anchor-indicator {
  opacity: 1;
  pointer-events: auto;
}

/* Anchor label on hover */
.anchor-indicator .anchor-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.anchor-indicator:hover .anchor-label {
  opacity: 1;
}

/* Focus mode - dim everything except the info panel */
body.anchor-focused .installation-overlay,
body.anchor-focused .back-button,
body.anchor-focused .controls-toggle,
body.anchor-focused .gradient-top,
body.anchor-focused .gradient-bottom {
  opacity: 0.3 !important;
  pointer-events: none;
}

body.anchor-focused .anchor-indicator:not(.active) {
  opacity: 0.4;
  pointer-events: auto;
}

/* Mobile adjustments for anchor points */
@media screen and (max-width: 768px) {
  .anchor-indicator {
    width: 36px;
    height: 36px;
  }
  
  .anchor-indicator::before {
    width: 6px;
    height: 6px;
  }
  
  .anchor-indicator::after {
    width: 36px;
    height: 36px;
  }
  
  .anchor-indicator.at-edge {
    transform: translate(-50%, -50%) scale(0.9);
  }
  
  @keyframes anchor-pulse {
    0% {
      width: 36px;
      height: 36px;
      opacity: 1;
    }
    100% {
      width: 60px;
      height: 60px;
      opacity: 0;
    }
  }
  
  /* Mobile info panel - bottom sheet style */
  .anchor-info-panel {
    left: 12px !important;
    right: 12px !important;
    bottom: 80px !important;
    top: auto !important;
    max-width: none;
    width: calc(100% - 24px);
    padding: 16px 20px;
    border-radius: 16px;
  }
  
  .anchor-info-panel .panel-title {
    font-size: 18px;
    margin-bottom: 10px;
    padding-right: 30px;
  }
  
  .anchor-info-panel .panel-description {
    font-size: 13px;
    line-height: 1.5;
  }
  
  .anchor-info-panel .panel-description p {
    margin: 0 0 8px 0;
  }
  
  .anchor-info-panel .panel-close {
    width: 32px;
    height: 32px;
    top: 10px;
    right: 10px;
  }
  
  /* Anchor labels - hide on mobile, tap to see info */
  .anchor-indicator .anchor-label {
    display: none;
  }
  
  /* Focus mode adjustments for mobile */
  body.anchor-focused .installation-overlay {
    opacity: 0.2 !important;
  }
  
  body.anchor-focused .gradient-top,
  body.anchor-focused .gradient-bottom {
    opacity: 0.15 !important;
  }
}

/* Extra small screens */
@media screen and (max-width: 390px) {
  .anchor-indicator {
    width: 32px;
    height: 32px;
  }
  
  .anchor-indicator::after {
    width: 32px;
    height: 32px;
  }
  
  .anchor-info-panel {
    left: 8px !important;
    right: 8px !important;
    bottom: 70px !important;
    width: calc(100% - 16px);
    padding: 14px 16px;
  }
  
  .anchor-info-panel .panel-title {
    font-size: 16px;
  }
  
  .anchor-info-panel .panel-description {
    font-size: 12px;
  }
}

/* ============================================
   Mobile Arrow Controls
   ============================================ */
.mobile-controls {
  display: none; /* Hidden on desktop */
  position: fixed;
  bottom: 24px; /* Aligned with music button */
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none; /* Allow clicks to pass through container */
}

/* Joystick */
.joystick-container {
  pointer-events: auto;
  touch-action: none;
}

.joystick-base {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(255, 255, 255, 0.03);
}

.joystick-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.05s ease-out, background 0.15s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.joystick-thumb.active {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.8);
}


/* Hide mobile controls during cinematic intro */
body.cinematic-intro .mobile-controls {
  opacity: 0 !important;
  pointer-events: none;
}

body.cinematic-revealed .mobile-controls {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.35s ease-out;
  transition-delay: 0.3s;
}

/* Hide mobile controls when anchor panel is focused */
body.anchor-focused .mobile-controls {
  opacity: 0.3;
  pointer-events: none;
}

/* ============================================
   Projection Controls
   ============================================ */
.projection-toggle {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.projection-toggle:hover,
.projection-toggle:active {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.projection-toggle.active {
  background: rgba(100, 210, 255, 0.2);
  border-color: rgba(100, 210, 255, 0.5);
  color: #64d2ff;
}

/* Right wall projection toggle - positioned on left side */
.projection-toggle.right {
  right: auto;
  left: 20px;
}

.projection-toggle .toggle-label {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(100, 210, 255, 0.8);
  color: #000;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Left wall button - add "L" label */
.projection-toggle:not(.right)::after {
  content: 'L';
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(100, 210, 255, 0.8);
  color: #000;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide projection toggle during cinematic intro */
body.cinematic-intro .projection-toggle {
  opacity: 0 !important;
  pointer-events: none;
  transition: none !important;
}

body.cinematic-revealed .projection-toggle {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.35s ease-out;
  transition-delay: 0.25s;
}

/* Hide projection toggle in pointer lock mode */
body.pointer-locked .projection-toggle {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.pointer-locked:hover .projection-toggle {
  opacity: 1;
  pointer-events: auto;
}

/* Projection Controls Panel */
.projection-controls {
  position: fixed;
  bottom: 140px;
  right: 20px;
  width: 320px;
  max-height: calc(100vh - 200px);
  background: rgba(10, 10, 12, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.projection-controls.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.projection-controls .controls-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.projection-controls .controls-header h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

.projection-controls .controls-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.projection-controls .controls-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Control groups */
.projection-controls .control-group {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.projection-controls .control-group:last-child {
  border-bottom: none;
}

.projection-controls .control-group label {
  flex: 0 0 90px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.projection-controls .control-group input[type="range"] {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  cursor: pointer;
}

.projection-controls .control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease;
}

.projection-controls .control-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.projection-controls .control-group span {
  flex: 0 0 50px;
  font-size: 11px;
  color: #64d2ff;
  text-align: right;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
  font-weight: 500;
}

/* Color picker */
.projection-controls .control-group input[type="color"] {
  width: 36px;
  height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  padding: 0;
}

.projection-controls .control-group input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.projection-controls .control-group input[type="color"]::-webkit-color-swatch {
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Select dropdown */
.projection-controls .control-group select {
  flex: 1;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  padding: 0 8px;
  cursor: pointer;
}

.projection-controls .control-group select:focus {
  outline: none;
  border-color: rgba(100, 210, 255, 0.5);
}

/* Checkbox styling */
.projection-controls .control-group.checkbox {
  flex-direction: row;
}

.projection-controls .control-group.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #64d2ff;
  flex-shrink: 0;
}

.projection-controls .control-group.checkbox label {
  flex: 1;
  cursor: pointer;
}

/* Right wall projection panel - positioned on left side */
.projection-controls.right {
  right: auto;
  left: 20px;
}

/* Hide projection controls in pointer lock mode */
body.pointer-locked .projection-controls {
  opacity: 0;
  pointer-events: none;
}

/* Hide right wall toggle during cinematic intro */
body.cinematic-intro .projection-toggle.right {
  opacity: 0 !important;
  pointer-events: none;
  transition: none !important;
}

body.cinematic-revealed .projection-toggle.right {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.35s ease-out;
  transition-delay: 0.25s;
}

/* Hide right wall toggle in pointer lock mode */
body.pointer-locked .projection-toggle.right {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.pointer-locked:hover .projection-toggle.right {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
  .projection-toggle {
    bottom: 84px;
    right: 24px;
    width: 44px;
    height: 44px;
  }
  
  .projection-toggle.right {
    right: auto;
    left: 24px;
  }
  
  .projection-controls {
    right: 12px;
    bottom: 140px;
    width: calc(100vw - 24px);
    max-width: 340px;
    max-height: calc(100vh - 180px);
  }
  
  .projection-controls.right {
    right: auto;
    left: 12px;
  }
  
  .projection-controls .control-group label {
    flex: 0 0 80px;
    font-size: 11px;
  }
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
  display: none !important;
}
