:root {
  --bg: #081018;
  --panel: rgba(8, 16, 24, 0.78);
  --line: rgba(255, 255, 255, 0.15);
  --text: #e8eff7;
  --subtle: #9db1c7;
  --accent: #65f0c9;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 15%, rgba(16, 60, 100, 0.28), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(70, 20, 20, 0.16), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

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

#scene {
  z-index: 1;
}

#sceneGpu {
  z-index: 2;
  pointer-events: none;
}

.startup-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #000;
  transition: opacity 0.45s ease;
}

.startup-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.startup-screen.is-loading #startup-copenhagen::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-right: 2px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  animation: startup-spin 0.9s linear infinite;
}

.startup-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.startup-actions {
  display: flex;
  align-items: center;
  justify-content: center;
}

#startup-copenhagen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 999px;
  background: transparent;
  color: #ccc;
  padding: 0.72rem 1.35rem;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

#startup-copenhagen:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

#startup-copenhagen:disabled {
  opacity: 0.55;
  cursor: default;
}

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

.hud {
  position: fixed;
  left: 14px;
  top: 14px;
  width: min(520px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.hud h1 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.hud p {
  margin: 6px 0 10px;
  font-size: 12px;
  color: var(--subtle);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.controls button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.controls label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--subtle);
}

.controls input[type="range"] {
  width: 160px;
}

.paramGroups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.paramGroup {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px 8px;
  background: rgba(255, 255, 255, 0.03);
}

.paramGroup h2 {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

.paramRow {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--subtle);
}

.paramRow:last-child {
  margin-bottom: 0;
}

.paramRow span {
  color: var(--text);
}

.paramRow input[type="range"] {
  width: 100%;
  margin: 0;
}

.paramRow select {
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 11px;
}

.paramRow output {
  text-align: right;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

@media (max-width: 820px) {
  .paramGroups {
    grid-template-columns: 1fr;
  }
}

#status,
#stats {
  font-size: 12px;
  line-height: 1.45;
}

#status {
  color: var(--accent);
  margin-bottom: 4px;
}

#stats {
  color: var(--subtle);
}

#streetLabel {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 4;
  pointer-events: none;
  font-family: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.8rem;
  color: #333;
  letter-spacing: 0.01em;
  opacity: 0;
  transition: opacity 0.35s ease;
}

body.started #streetLabel {
  opacity: 1;
}
