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

.config-toggle {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: max(20px, env(safe-area-inset-right));
  background: rgba(20, 20, 20, 0.95);
  border: 1px solid #333;
  color: #888;
  font-family: "Courier New", monospace;
  font-size: 10px;
  padding: 8px 12px;
  cursor: pointer;
  z-index: 11;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s;
}

.config-toggle:hover {
  color: #aaa;
}

.controls {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  background: rgba(20, 20, 20, 0.95);
  padding: 16px;
  border: 1px solid #333;
  z-index: 10;
  font-family: "Courier New", monospace;
  font-size: 11px;
  min-width: 220px;
  color: #888;
  display: none;
}

.controls.open {
  display: block;
}

.controls h3 {
  margin: 0 0 12px 0;
  font-size: 11px;
  font-weight: 400;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.control-group {
  margin-bottom: 12px;
}

.control-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.control-group input[type="color"] {
  width: 100%;
  height: 28px;
  border: 1px solid #333;
  border-radius: 0;
  cursor: pointer;
  background: #000;
}

.control-group input[type="range"] {
  width: 100%;
  height: 2px;
  background: #333;
  outline: none;
  -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: #888;
  cursor: pointer;
  border-radius: 0;
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #888;
  cursor: pointer;
  border-radius: 0;
  border: none;
}

.control-group input[type="checkbox"] {
  margin-right: 6px;
  cursor: pointer;
}

.control-group .value {
  color: #aaa;
  font-weight: 400;
}

.control-group label:has(input[type="checkbox"]) {
  text-transform: none;
  font-size: 11px;
  color: #888;
  cursor: pointer;
}

@media (max-width: 768px) {
  .controls {
    top: auto;
    bottom: max(60px, calc(env(safe-area-inset-bottom) + 52px));
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    min-width: auto;
    max-height: 60vh;
    overflow-y: auto;
  }

  .config-toggle {
    bottom: 12px;
    right: 12px;
  }
}
