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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 44%, #1e2347 0%, #12152d 62%, #0a0c1d 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #e6ecff;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#canvas-container:active {
  cursor: grabbing;
}

#canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.hud {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(12, 14, 30, 0.72);
  border: 1px solid rgba(130, 170, 255, 0.22);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: calc(100vw - 24px);
}

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

.control label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(224, 234, 255, 0.9);
  white-space: nowrap;
}

.divider {
  width: 1px;
  height: 18px;
  background: rgba(160, 185, 255, 0.2);
  flex-shrink: 0;
}

.control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 96px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
  cursor: pointer;
}

#neon::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #322444 0%, #ff2da5 65%, #00f0ff 100%);
}

#rain::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2d3349 0%, #58b8ff 100%);
}

#neon::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #322444 0%, #ff2da5 65%, #00f0ff 100%);
}

#rain::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2d3349 0%, #58b8ff 100%);
}

.control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #f5f8ff;
  border: 2px solid #161933;
  box-shadow: 0 0 8px rgba(120, 225, 255, 0.7);
  transition: transform 0.12s ease;
}

.control input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f5f8ff;
  border: 2px solid #161933;
  box-shadow: 0 0 8px rgba(120, 225, 255, 0.7);
  transition: transform 0.12s ease;
}

.control input[type="range"]:hover::-webkit-slider-thumb,
.control input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.16);
}

.control input[type="range"]:hover::-moz-range-thumb,
.control input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.16);
}

@media (max-width: 480px) {
  .hud {
    gap: 10px;
    padding: 7px 12px;
  }

  .control {
    gap: 6px;
  }

  .control label {
    font-size: 11px;
  }

  .control input[type="range"] {
    width: 78px;
  }
}
