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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: 'IBM Plex Sans', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: none;
}

/* HUD */
.hud {
  position: fixed;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px 18px;
  color: rgba(255, 255, 255, 0.8);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  line-height: 1.7;
  z-index: 100;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.hud.hidden {
  opacity: 0;
}

.hud.visible {
  opacity: 1;
}

.hud-title {
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(180, 210, 255, 0.6);
  margin-bottom: 6px;
}

.hud-shortcuts {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

kbd {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  margin-right: 4px;
}

/* Panel trigger zone */
#panel-trigger {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px;
  z-index: 49;
}

/* Control Panel */
.panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(8, 8, 12, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px 12px 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  cursor: default;
}

.panel.visible {
  transform: translateY(0);
}

.panel-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 28px;
  flex-wrap: wrap;
  min-height: 72px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-label {
  font-size: 11px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.3px;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.control-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 300;
  color: rgba(180, 210, 255, 0.7);
  min-width: 32px;
  text-align: right;
}

/* Slider styling */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(180, 210, 255, 0.9);
  box-shadow: 0 0 8px rgba(180, 210, 255, 0.4), 0 0 2px rgba(180, 210, 255, 0.8);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 14px rgba(180, 210, 255, 0.6), 0 0 3px rgba(180, 210, 255, 0.9);
}

.slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(180, 210, 255, 0.9);
  box-shadow: 0 0 8px rgba(180, 210, 255, 0.4);
  border: none;
  cursor: pointer;
}

/* Buttons */
.mode-btn,
.toggle-btn,
.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-btn:hover,
.toggle-btn:hover,
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(180, 210, 255, 0.3);
}

.toggle-btn.active {
  background: rgba(180, 210, 255, 0.15);
  border-color: rgba(180, 210, 255, 0.4);
  color: rgba(180, 210, 255, 0.9);
  box-shadow: 0 0 8px rgba(180, 210, 255, 0.2);
}

/* Color swatches */
.color-swatch {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  background: none;
}

.color-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-swatch::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.color-swatch::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

.color-swatch.hidden {
  display: none;
}

/* Audio meter */
.audio-meter {
  width: 40px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.audio-meter.hidden {
  display: none;
}

.audio-level {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, rgba(100, 200, 255, 0.7), rgba(255, 120, 180, 0.7));
  border-radius: 3px;
  transition: width 0.05s;
}

/* Footer */
.footer-link a {
  font-size: 10px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.25);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.footer-link a:hover {
  color: rgba(255, 255, 255, 0.5);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .panel {
    transition: none;
  }
  .hud {
    transition: none;
  }
}