:root {
  --bg: #05060a;
  --ink: #e9edff;
  --muted: #8b93b8;
  --accent: #8a7bff;
  --panel: rgba(13, 14, 26, 0.84);
  --line: rgba(130, 130, 220, 0.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#stage { position: fixed; inset: 0; display: block; cursor: grab; }
#stage:active { cursor: grabbing; }

.hud { position: fixed; top: 22px; left: 26px; pointer-events: none; text-shadow: 0 2px 18px #000; }
.hud h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.hud .tag { color: var(--muted); font-size: 14px; margin-top: 2px; }

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 280px;
  padding: 24px 22px 20px; background: var(--panel);
  backdrop-filter: blur(14px); border-left: 1px solid var(--line);
  overflow-y: auto; transition: transform 0.32s cubic-bezier(.4,.1,.2,1);
}
.panel.hidden { transform: translateX(100%); }
.collapse {
  position: absolute; left: -34px; top: 18px; width: 34px; height: 44px;
  border: 1px solid var(--line); border-right: none; border-radius: 10px 0 0 10px;
  background: var(--panel); color: var(--ink); font-size: 18px; cursor: pointer;
}
.panel.hidden .collapse { transform: rotate(180deg); border-radius: 0 10px 10px 0; }
.panel section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.panel section:last-of-type { border-bottom: none; }
h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--accent); margin-bottom: 12px; }
label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
label span { color: var(--ink); font-variant-numeric: tabular-nums; }
section > label:first-child { margin-top: 0; }

select {
  width: 100%; padding: 9px 10px; border-radius: 9px; cursor: pointer;
  background: #111324; color: var(--ink); border: 1px solid var(--line);
  font: inherit; font-size: 14px; margin-top: 4px;
}
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), #2a2a4e); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; cursor: pointer; box-shadow: 0 0 10px var(--accent);
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: #fff; cursor: pointer; }
.chk { display: flex; align-items: center; gap: 9px; color: var(--ink); cursor: pointer; margin-top: 14px; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 16px; }
@media (max-width: 640px) { .panel { width: 84vw; } .hud h1 { font-size: 22px; } }
