:root {
  --bg: #05080b;
  --panel: rgba(8, 18, 22, 0.72);
  --edge: rgba(120, 220, 210, 0.18);
  --text: #d8ecea;
  --muted: #7fa3a0;
  --accent: #ff9a2e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #0d1c22 0%, var(--bg) 70%);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.panel {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.title {
  top: 16px;
  left: 16px;
  padding: 12px 16px;
}

.title h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(255, 140, 30, 0.45);
}

.title p { margin: 2px 0 0; color: var(--muted); }

.controls {
  top: 16px;
  right: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.label {
  width: 70px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

button {
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

button:hover { background: rgba(120, 220, 210, 0.12); }

button.active,
button[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255, 154, 46, 0.1);
}

.hint {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

#dims { position: fixed; inset: 0; pointer-events: none; }

.dim {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  z-index: 10;
  transition: opacity 0.6s;
}

#loader.done { opacity: 0; pointer-events: none; }
.loader-title { font-size: 18px; color: var(--accent); }
.bar { width: 260px; height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }
#bar-fill { width: 0; height: 100%; background: var(--accent); transition: width 0.2s; }
#loader-pct { color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .title { left: 8px; top: 8px; padding: 8px 12px; }
  .title h1 { font-size: 16px; }
  .controls { top: auto; bottom: 56px; right: 8px; left: 8px; }
  .label { width: auto; }
  .hint { font-size: 11px; bottom: 8px; }
}
