/* ================================================
   Reset & Base
   ================================================ */

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

body {
  background: #0B0F14;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  color: #E0E0E0;
  -webkit-font-smoothing: antialiased;
}

/* ================================================
   Canvas
   ================================================ */

canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
}

/* ================================================
   Control Panel
   ================================================ */

#panel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 272px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: rgba(12, 16, 24, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 22px 20px;
  z-index: 10;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  user-select: none;
}

/* Header */

.panel-header h1 {
  font-size: 17px;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}

.subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}

/* Control Group */

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

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.control-value {
  color: #FFFFFF;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Range Slider */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}

/* Buttons */

.button-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.btn {
  flex: 1;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
  letter-spacing: 0.1px;
}

.btn-primary {
  background: rgba(255, 255, 255, 0.10);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.17);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
}

/* Progress */

.progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FF6B6B, #FECA57, #64DC3C);
  border-radius: 2px;
}

/* Toggles */

.toggles {
  margin-bottom: 14px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.12s ease;
}

.toggle-label:hover {
  color: rgba(255, 255, 255, 0.65);
}

input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

input[type="checkbox"]:checked {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 3.5px;
  top: 0.5px;
  width: 4.5px;
  height: 8px;
  border: solid #FFFFFF;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

/* Footer */

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.badge.active {
  background: rgba(100, 220, 60, 0.14);
  color: rgba(100, 220, 60, 0.85);
}

.hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.2);
}

/* ================================================
   Scrollbar (panel)
   ================================================ */

#panel::-webkit-scrollbar {
  width: 4px;
}

#panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}
