* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #0b1020 0, #020308 60%, #000 100%);
  color: #f5f5f5;
  overflow: hidden;
}

/* Three.js canvas */
canvas {
  display: block;
}

/* Controls panel */
#controls {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 10;
  background: rgba(10, 10, 20, 0.9);
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f5f5f5;
  max-width: 320px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

#controls h3 {
  margin-bottom: 8px;
  font-size: 16px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffd27f;
}

#controls h4 {
  margin: 12px 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9fd5ff;
}

#controls label {
  display: inline-block;
  margin-top: 6px;
  margin-bottom: 2px;
  font-size: 12px;
  color: #d0d7e2;
}

#controls input[type="range"] {
  width: 100%;
  margin: 2px 0 4px;
  -webkit-appearance: none;
  background: transparent;
}

#controls input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  border-radius: 999px;
}

#controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #facc15;
  border: 2px solid #0f172a;
  margin-top: -5px;
  cursor: pointer;
}

#controls input[type="range"]::-moz-range-track {
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  border-radius: 999px;
}

#controls input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #facc15;
  border: 2px solid #0f172a;
  cursor: pointer;
}

#controls span {
  font-size: 12px;
  color: #9ca3af;
}

/* Text / number / color inputs */
#controls input[type="text"],
#controls input[type="number"],
#controls input[type="color"],
#controls select {
  width: 100%;
  margin: 2px 0 6px;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 13px;
}

#controls input[type="color"] {
  padding: 0;
  height: 28px;
}

/* Buttons */
#controls button {
  margin-top: 6px;
  margin-right: 4px;
  padding: 6px 10px;
  border-radius: 4px;
  border: none;
  font-size: 13px;
  cursor: pointer;
  background: linear-gradient(135deg, #3b82f6, #22c55e);
  color: #0b1020;
  font-weight: 600;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

#controls button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.7);
  filter: brightness(1.05);
}

#controls button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Info box */
#info-box {
  position: absolute;
  min-width: 180px;
  max-width: 260px;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 8px 10px;
  font-size: 13px;
  z-index: 20;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

#info-box h4 {
  margin-bottom: 4px;
  font-size: 14px;
  color: #facc15;
}

.hidden {
  display: none !important;
}

/* Väiksemad ekraanid */
@media (max-width: 768px) {
  #controls {
    max-width: 90vw;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
  }
}
#controls input[type="range"] + span {
  display: inline-block;
  margin-left: 8px;
  width: 32px;
  text-align: right;
}
.section {
  margin-bottom: 12px;
}

.section-toggle {
  cursor: pointer;
  padding: 6px 0;
  margin: 0;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-toggle::after {
  content: "▼";
  font-size: 12px;
  transition: transform 0.2s ease;
}

.section.collapsed .section-toggle::after {
  transform: rotate(-90deg);
}

.section-content {
  margin-top: 6px;
  display: block;
}

.section.collapsed .section-content {
  display: none;
}
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
}

.modal-content {
  background: #222;
  color: white;
  padding: 20px;
  width: 350px;
  margin: 10% auto;
  border-radius: 10px;
  box-shadow: 0 0 20px black;
}

.close {
  float: right;
  font-size: 28px;
  cursor: pointer;
}
