:root {
  --bg: #010204;
  --panel: rgba(12, 16, 26, 0.85);
  --text: #eef5ff;
  --gold: #ffd077;
  --dim-gold: #aa8533;
  --red: #ff2a4b;
  --orange: #ff6600;
  --blue: #4466ff;
  --cyan: #00f0ff;
  --purple: #bf7fff;
  --green: #22ff88;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Helvetica Neue", "Inter", sans-serif;
}

body, html {
  margin: 0; padding: 0;
  width: 100vw; height: 100vh;
  background-color: var(--bg); color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
}

#webgl-canvas {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; z-index: 1;
}

/* CONTROL PANEL */
#dashboard {
  position: absolute; top: 0; left: 0;
  width: 420px; height: 100%;
  background: var(--panel);
  backdrop-filter: blur(15px);
  border-right: 1px solid rgba(255,208,119,0.2);
  z-index: 10;
  display: flex; flex-direction: column;
}

.header {
  padding: 32px; border-bottom: 1px solid rgba(255,208,119,0.2);
}
.header h1 {
  margin: 0; font-size: 20px; font-weight: 400; letter-spacing: 0.15em; color: var(--gold);
}
.header p {
  margin: 8px 0 0 0; font-size: 11px; font-family: var(--mono); color: var(--cyan); text-transform: uppercase;
}

.nav-list {
  flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px;
}

.nav-btn {
  background: rgba(0,0,0,0.5); border: 1px solid rgba(238,245,255,0.1);
  padding: 20px; cursor: pointer; text-align: left; transition: all 0.3s ease;
  position: relative; overflow: hidden;
}
.nav-btn::before {
  content: ''; position: absolute; left: 0; top: 0; width: 4px; height: 100%;
  background: transparent; transition: background 0.3s ease;
}
.nav-btn.active { background: rgba(255,208,119,0.1); border-color: var(--gold); }
.nav-btn.active::before { background: var(--gold); }
.nav-btn:hover { border-color: rgba(238,245,255,0.4); }

.nav-btn h2 { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: 0.05em; color: #fff; }
.nav-btn p { margin: 6px 0 0 0; font-size: 12px; color: rgba(238,245,255,0.6); line-height: 1.4; }

#scene-controls {
  padding: 24px; border-top: 1px solid rgba(238,245,255,0.1); background: rgba(0,0,0,0.6);
  height: max-content;
}

.ctrl-group { margin-bottom: 24px; }
.ctrl-label { font-family: var(--mono); font-size: 11px; color: var(--cyan); letter-spacing: 0.1em; margin-bottom: 12px; display: block; }
input[type=range] {
  -webkit-appearance: none; width: 100%; background: transparent; height: 20px;
}
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 2px; background: rgba(255,255,255,0.2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 14px; width: 14px; background: var(--cyan); margin-top: -6px; border-radius: 50%; cursor: ew-resize; box-shadow: 0 0 10px var(--cyan); }

.readout {
  font-family: var(--mono); font-size: 12px; color: var(--gold); margin-top: 8px;
}

#canvas-overlay {
  position: absolute; top: 40px; right: 40px; z-index: 10; text-align: right;
  pointer-events: none;
}
#canvas-title { font-size: 28px; font-weight: 300; letter-spacing: 0.2em; color: var(--cyan); margin: 0; text-shadow: 0 0 20px rgba(0,0,0,0.8); }
#canvas-desc { font-size: 14px; color: rgba(238,245,255,0.8); max-width: 400px; margin-top: 8px; line-height: 1.6; text-shadow: 0 0 10px rgba(0,0,0,0.8); }
.status-badge {
  display: inline-block; padding: 4px 8px; margin-top: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  background: rgba(0,240,255,0.1); border: 1px solid var(--cyan); color: var(--cyan);
}

.scanlines {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 99; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%);
  background-size: 100% 4px; opacity: 0.15;
}

#mobile-toggle {
  display: none;
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: 12px 24px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.15em;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 208, 119, 0.2);
}

/* RESPONSIVE MEDIA QUERIES */

/* Tablets / Compact Desktops (769px to 1024px) */
@media (max-width: 1024px) {
  #canvas-overlay {
    top: 40px; right: 20px; left: 450px; text-align: right;
  }
}

/* Mobile Devices (< 768px) */
@media (max-width: 768px) {
  #canvas-overlay {
    top: 40px; bottom: auto; right: 20px; left: 20px; text-align: center;
  }
  #canvas-desc { margin: 8px auto 0 auto; }
  
  #mobile-close-btn { display: block !important; }

  #dashboard {
    width: 100%; height: auto; max-height: 90vh; overflow-y: auto; top: auto; bottom: 0;
    border-right: none; border-top: 1px solid rgba(255,208,119,0.2);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
  }

  #dashboard.open { transform: translateY(0); }

  .nav-list {
    flex: none; /* Strip vertical void stretching */
    flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 16px; scroll-snap-type: x mandatory;
    /* Purge raw scrollbars for premium native feel */
    scrollbar-width: none; 
    -ms-overflow-style: none;
  }
  .nav-list::-webkit-scrollbar { display: none; }
  
  .nav-btn { min-width: 260px; scroll-snap-align: stretch; margin-right: 16px; margin-bottom: 0px; }
  
  #scene-controls { margin-top: auto; } /* Drives the sliders flush to the bottom */

  #mobile-toggle { display: block; }
}

/* Slim Viewports / Small Handhelds (< 480px) */
@media (max-width: 480px) {
  #canvas-title { font-size: 20px; }
  #canvas-desc { font-size: 13px; }
  
  .nav-btn { min-width: 230px; padding: 16px; }
  .nav-btn h2 { font-size: 13px; }
  .nav-btn p { font-size: 11px; }
}
