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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a1420;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #edf3f8;
  user-select: none;
}

#gl-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: grab;
}

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

#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 300px;
  background: rgba(12, 20, 32, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  z-index: 10;
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-header h1 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.subtitle {
  font-size: 11px;
  color: #9cb3c9;
  margin-top: 2px;
}

#toggle-panel {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #edf3f8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

#toggle-panel:hover {
  background: rgba(255, 255, 255, 0.16);
}

#hud-body {
  padding: 12px 14px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}

#hud.collapsed #hud-body {
  display: none;
}

.control-group {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.control-group:last-of-type {
  border-bottom: none;
  margin-bottom: 6px;
  padding-bottom: 4px;
}

.control-group h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: #8fb4d8;
  margin-bottom: 8px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #ffd180;
}

input[type="range"] {
  width: 100%;
  accent-color: #38bdf8;
  cursor: pointer;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.preset-btn {
  padding: 5px 2px;
  font-size: 10.5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.07);
  color: #dce9f5;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.preset-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
}

.inline-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.speed-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 105px;
}

.small-label {
  font-size: 11px;
  color: #9cb3c9;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  margin-bottom: 6px;
  cursor: pointer;
}

.checkbox-label input {
  accent-color: #38bdf8;
  cursor: pointer;
}

.slider-block {
  margin-top: 8px;
}

.hint {
  font-size: 10.5px;
  color: #8ea6bc;
  margin-top: 2px;
}

select {
  width: 100%;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #edf3f8;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

select option {
  background: #132030;
  color: #edf3f8;
}

.footer-help {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: #8ba3b9;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#shadow-label {
  position: fixed;
  right: 16px;
  bottom: 244px;
  background: rgba(12, 20, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  color: #d6e6f5;
  pointer-events: none;
  z-index: 10;
}

#error-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 560px;
  background: rgba(120, 20, 20, 0.94);
  border: 1px solid #ff7b7b;
  border-radius: 10px;
  padding: 18px 22px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  z-index: 100;
}

.hidden {
  display: none !important;
}
