:root {
  --panel-bg: rgba(8, 20, 32, 0.62);
  --panel-border: rgba(140, 200, 240, 0.18);
  --text: #eaf4fb;
  --text-dim: rgba(210, 231, 244, 0.62);
  --accent: #57d7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #05101c;
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

#overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

#overlay.hidden {
  opacity: 0;
}

.panel,
#title-card,
#hud,
#hints {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

#title-card {
  position: absolute;
  top: 22px;
  left: 22px;
  padding: 14px 20px 15px;
  min-width: 236px;
}

#title-card h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

#title-card p {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

#hud {
  position: absolute;
  bottom: 22px;
  left: 22px;
  padding: 15px 18px 12px;
  width: 288px;
}

.hud-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  padding: 3px 0;
}

.hud-label {
  color: var(--text-dim);
  white-space: nowrap;
}

.hud-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#graph {
  display: block;
  width: 100%;
  height: 55px;
  margin-top: 11px;
  border-radius: 7px;
  background: rgba(3, 12, 22, 0.55);
}

.graph-caption {
  margin: 7px 0 0;
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}

#hints {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 9px 16px;
  display: flex;
  gap: 18px;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

kbd {
  display: inline-block;
  min-width: 17px;
  padding: 1px 5px;
  margin-right: 2px;
  text-align: center;
  font-family: inherit;
  font-size: 10.5px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: #05101c;
  z-index: 20;
  transition: opacity 500ms ease;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

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

.spinner {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(87, 215, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

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

.lil-gui.root {
  --background-color: rgba(8, 20, 32, 0.66);
  --widget-color: rgba(255, 255, 255, 0.09);
  --focus-color: rgba(87, 215, 255, 0.32);
  --hover-color: rgba(255, 255, 255, 0.15);
  --font-size: 11.5px;
  --title-height: 30px;
  top: 22px;
  right: 22px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

@media (max-width: 720px) {
  #hud,
  #hints {
    display: none;
  }
}
