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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  color: #cdd3e0;
  font-size: 12px;
}

#glcanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
  cursor: grab;
}
#glcanvas:active { cursor: grabbing; }

#panel {
  position: fixed;
  top: 12px; right: 12px;
  width: 290px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: rgba(10, 12, 20, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(140, 160, 255, 0.15);
  border-radius: 10px;
  padding: 14px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
#panel.hidden {
  transform: translateX(320px);
  opacity: 0;
  pointer-events: none;
}
#panel::-webkit-scrollbar { width: 6px; }
#panel::-webkit-scrollbar-thumb { background: rgba(140,160,255,0.2); border-radius: 3px; }

#panel header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
#panel h1 {
  font-size: 13px;
  letter-spacing: 4px;
  background: linear-gradient(90deg, #b48bff, #6be0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
#toggle-panel {
  background: none; border: none; color: #667;
  cursor: pointer; font-size: 13px;
}
#toggle-panel:hover { color: #fff; }

#show-panel {
  position: fixed;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  background: rgba(10, 12, 20, 0.82);
  border: 1px solid rgba(140, 160, 255, 0.15);
  border-radius: 8px;
  color: #cdd3e0;
  font-size: 15px;
  cursor: pointer;
  display: none;
}
#show-panel.visible { display: block; }

.row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.row label { flex: 0 0 auto; color: #8892aa; }

select {
  flex: 1;
  background: rgba(30, 34, 52, 0.9);
  color: #cdd3e0;
  border: 1px solid rgba(140, 160, 255, 0.2);
  border-radius: 5px;
  padding: 4px 6px;
  font-family: inherit; font-size: 12px;
  outline: none;
}

.btn-row {
  display: flex; gap: 6px;
  margin-bottom: 6px;
}
.btn-row button, footer button {
  flex: 1;
  background: rgba(30, 34, 52, 0.9);
  color: #cdd3e0;
  border: 1px solid rgba(140, 160, 255, 0.2);
  border-radius: 5px;
  padding: 6px 4px;
  font-family: inherit; font-size: 11px;
  cursor: pointer;
}
.btn-row button:hover { border-color: rgba(140, 160, 255, 0.55); color: #fff; }
.btn-row button.active { background: rgba(120, 90, 255, 0.35); border-color: #8a6bff; }

.group { margin-top: 10px; }
.group > h2 {
  font-size: 10px;
  letter-spacing: 2px;
  color: #5f6b8a;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(140, 160, 255, 0.1);
  padding-bottom: 4px;
  margin-bottom: 8px;
}

.ctl {
  display: grid;
  grid-template-columns: 92px 1fr 38px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ctl label { color: #8892aa; white-space: nowrap; overflow: hidden; }
.ctl .val { color: #b48bff; text-align: right; font-variant-numeric: tabular-nums; }
.ctl.wide { grid-template-columns: 92px 1fr; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%; height: 4px;
  background: rgba(140, 160, 255, 0.18);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b48bff, #6be0ff);
  border: none;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #9d7bff;
  border: none;
  cursor: pointer;
}

footer {
  margin-top: 12px;
  color: #4a5268;
  font-size: 10px;
  text-align: center;
}
