:root {
  --accent: #7fd4ff;
  --text: #d6e8f7;
  --text-dim: #7d93a8;
  --panel: rgba(7, 13, 22, 0.55);
  --panel-border: rgba(127, 212, 255, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #03050a;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text);
}

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

#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hud-box {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

#hud-title { top: 20px; left: 20px; }

#hud-title h1 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #eef8ff;
  text-transform: uppercase;
}

#hud-title p {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

#hud-help {
  left: 20px;
  bottom: 20px;
  font-size: 12.5px;
  color: var(--text-dim);
}

#hud-help b { color: var(--text); font-weight: 600; }

#hud-legend {
  top: 20px;
  right: 20px;
  font-size: 12.5px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#hud-legend .row { display: flex; align-items: center; gap: 8px; }

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px currentColor;
}

.dot.cyan { background: #57e8ff; color: #57e8ff; }
.dot.amber { background: #ff9a4d; color: #ff9a4d; }
.dot.white { background: #ffffff; color: #ffffff; }

#hud-actions {
  right: 20px;
  bottom: 20px;
  display: flex;
  gap: 10px;
  padding: 10px;
}

button {
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text);
  background: rgba(20, 32, 48, 0.65);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  border-color: rgba(127, 212, 255, 0.55);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(127, 212, 255, 0.25);
}

button.on {
  background: rgba(24, 74, 104, 0.75);
  border-color: rgba(127, 212, 255, 0.65);
  color: #eaf8ff;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, #0a1220 0%, #03050a 70%);
  transition: opacity 0.7s ease;
}

#loading.done { opacity: 0; pointer-events: none; }

#loading p {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
}

#loading.error p {
  color: #ff9a9a;
  text-transform: none;
  letter-spacing: 0.02em;
  max-width: 640px;
  text-align: center;
}

.loader-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(127, 212, 255, 0.15);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  box-shadow: 0 0 18px rgba(127, 212, 255, 0.25);
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  #hud-legend { display: none; }
  #hud-title h1 { font-size: 16px; }
  #hud-help { font-size: 11px; }
}
