html,
body {
  height: 100%;
  margin: 0;
  background: #ffffff;
  overflow: hidden;
}

#hud {
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  position: fixed;
  left: 2.5vw;
  bottom: 2.5vw;
  font:
    12px/1.3 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
  color: #ddd;
  background: rgba(0, 0, 0, 0.45);
  padding: 10px 12px;
  border-radius: 10px;
  user-select: none;
  width: min(90vw, 300px);
}

#hud label {
  display: block;
  margin-top: 8px;
}

#hud input[type="range"] {
  width: 100%;
  margin-top: auto;
  overflow: auto;
}

#hud button {
  display: none;
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: #ddd;
  cursor: pointer;
}

#hud button:hover {
  background: rgba(0, 0, 0, 0.5);
}

#status {
  display: none;
  margin-top: 6px;
  opacity: 0.85;
  white-space: pre-wrap;
}

.val {
  font-variant-numeric: tabular-nums;
}

.muted {
  display: none;
  opacity: 0.8;
  margin-top: 6px;
}

.mono {
  display: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
}

/* Loading overlay */

.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(5px);
  z-index: 9999;
  opacity: 1;
  transition: opacity 220ms ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.65);
  color: #ddd;
  border: 1px solid rgba(116, 116, 116, 0.12);

  font:
    13px/1.2 system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.9);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
