/* ========================================
   Black Hole Vortex — Global Styles
   ======================================== */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
  color: #ffffff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Three.js canvas fills entire viewport */
canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

/* Loading indicator */
#loading {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

#loading.hidden {
  opacity: 0;
}

/* ── Camera UI Panel ── */
#ui-wrapper {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 240px;
  background: rgba(10, 10, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12px;
  z-index: 100;
  overflow: hidden;
  transition: width 0.3s ease;
}

#ui-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.7);
  user-select: none;
}

#ui-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

#ui-toggle:hover {
  color: #fff;
}

#camera-panel {
  padding: 8px 14px 14px;
}

#camera-panel.collapsed {
  display: none;
}

/* Slider rows */
.ctrl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ctrl-row label {
  flex: 0 0 80px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.ctrl-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.ctrl-val {
  flex: 0 0 36px;
  text-align: right;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
}

/* Checkbox row */
.ctrl-chk {
  margin-top: 4px;
  gap: 6px;
}

.ctrl-chk input[type="checkbox"] {
  accent-color: #fff;
  cursor: pointer;
}

.ctrl-chk label {
  flex: unset;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}

/* Section divider */
.ctrl-divider {
  margin: 12px 0 8px;
  padding: 6px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  user-select: none;
}

/* Number input */
.ctrl-row input[type="number"] {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

.ctrl-row input[type="number"]:focus {
  border-color: rgba(255, 255, 255, 0.35);
}

.ctrl-row input[type="number"]::-webkit-inner-spin-button,
.ctrl-row input[type="number"]::-webkit-outer-spin-button {
  opacity: 0.4;
}

/* Reset / Regenerate button */
#btn-reset {
  width: 100%;
  padding: 6px 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btn-reset:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Pause / Resume button */
#btn-pause {
  width: 100%;
  padding: 6px 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btn-pause:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* Sound Toggle Button */
#sound-btn {
  position: fixed;
  bottom: 16px;
  right: 16px;
  padding: 8px 12px;
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  cursor: pointer;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  user-select: none;
  transition: all 0.2s;
}

#sound-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}