#custom-gui {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #f0f0f0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  padding: 0 20px 15px 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 200ms cubic-bezier(0.4, 0, 0.2, 1);
  width: fit-content;
}

#custom-gui.hidden {
  transform: translateX(-50%) translateY(calc(100% - 32px));
}

#custom-gui.hidden .gui-handle .handle-icon {
  transform: rotate(180deg);
}

.gui-handle {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px;
  cursor: pointer;
  user-select: none;
  border-radius: 8px 8px 0 0;
  transition: background 0.2s ease;
  margin: 0 -20px;
}

.gui-handle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.handle-text {
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.gui-handle:hover .handle-text {
  color: rgba(255, 255, 255, 0.8);
}

.handle-icon {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.gui-handle:hover .handle-icon {
  color: rgba(255, 255, 255, 0.8);
}

.gui-hint {
  position: fixed;
  top: 20px;
  right: 20px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  z-index: 10000;
  pointer-events: none;
  transition: opacity 500ms ease-out;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 12px;
  border-radius: 4px;
}

.gui-hint.fade-out {
  opacity: 0;
}

.presets-section {
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 15px;
}

.presets-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  justify-content: center;
}

.preset-group h3 {
  margin: 0 0 10px 0;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #b3b3b3;
  text-transform: uppercase;
  text-align: center;
}

.preset-divider {
  width: 1px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 10px;
}

.preset-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.preset-btn:focus-visible {
  outline: 2px solid #4a9eff;
  outline-offset: 2px;
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.preset-btn.active {
  background: rgba(74, 158, 255, 0.3);
  border-color: #4a9eff;
  color: #4a9eff;
}

.gui-sections-row {
  display: grid;
  grid-template-columns: 280px 380px 280px;
  gap: 20px;
  justify-content: center;
  align-items: start;
}

.gui-section {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 15px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-rows: auto 1fr;
  align-content: start;
}

/* Responsive: stack vertically on smaller screens */
@media (max-width: 1100px) {
  .gui-sections-row {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin: 0 auto;
  }
}

.gui-section h3 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.8px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 6px;
  text-align: center;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  margin-bottom: 8px;
}

.control-group label {
  min-width: 60px;
  font-size: 12px;
  color: #ccc;
  text-align: right;
}

.control-group input[type="range"] {
  flex: 1;
  max-width: 160px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.control-group.lfo-controlled input[type="range"] {
  background: rgba(255, 100, 100, 0.3);
  pointer-events: none;
  opacity: 0.6;
}

.control-group.lfo-controlled label {
  color: rgba(255, 150, 150, 0.8);
}

.control-group.lfo-controlled input[type="range"]::-webkit-slider-thumb {
  background: #888;
  cursor: not-allowed;
}

.control-group.lfo-controlled input[type="range"]::-webkit-slider-thumb:hover {
  background: #888;
  transform: none;
}

.control-group.lfo-controlled input[type="range"]::-moz-range-thumb {
  background: #888;
  cursor: not-allowed;
}

.control-group.lfo-controlled input[type="range"]::-moz-range-thumb:hover {
  background: #888;
  transform: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #4a9eff;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
  background: #6bb3ff;
  transform: scale(1.1);
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #4a9eff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.control-group input[type="range"]::-moz-range-thumb:hover {
  background: #6bb3ff;
  transform: scale(1.1);
}

.value-display {
  min-width: 50px;
  text-align: right;
  font-size: 12px;
  font-family: "Courier New", monospace;
  color: #4a9eff;
}

.warp-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 15px;
  align-items: start;
}

.warp-sliders {
  flex: 1;
}

.eye-joystick-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  height: calc(3 * 28px + 2 * 8px);
}

.eye-label {
  color: #fff;
  font-size: 10px;
  letter-spacing: 1px;
}

#eyeJoystick {
  cursor: crosshair;
  border-radius: 4px;
}

#eyeJoystick:focus-visible {
  outline: 2px solid #4a9eff;
  outline-offset: 2px;
}

.eye-joystick-container.lfo-controlled #eyeJoystick {
  cursor: not-allowed;
  pointer-events: none;
  opacity: 0.6;
  border: 1px solid rgba(255, 100, 100, 0.5);
}

.eye-joystick-container.lfo-controlled .eye-label {
  color: rgba(255, 150, 150, 0.8);
}


.dance-controls-horizontal {
  display: flex;
  gap: 30px;
  justify-content: center;
}

.level-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.level-control label {
  font-size: 12px;
  color: #ccc;
  text-align: center;
}

.level-arrows {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.arrow-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  width: 16px;
  height: 16px;
  cursor: pointer;
  font-size: 8px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.arrow-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.arrow-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

.arrow-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.arrow-btn:focus-visible {
  outline: 2px solid #4a9eff;
  outline-offset: 2px;
}

.level-display {
  min-width: 28px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #4a9eff;
  font-family: "Courier New", monospace;
  padding: 0;
}
