:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #000;
  color: #fff;
  overflow: hidden;
}

#view {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10;
  overflow-y: auto;
  padding: 16px;
}

.overlay .panel {
  max-width: 520px;
  width: 100%;
  padding: 32px 40px;
  background: #111;
  border: 1px solid #333;
  border-radius: 12px;
  text-align: center;
  margin: auto 0;
}

@media (max-height: 500px) {
  .overlay .panel {
    padding: 16px 24px;
  }
  .overlay h1 {
    font-size: 20px;
    margin-bottom: 8px;
  }
  .overlay p {
    margin: 8px 0;
  }
  .overlay .note {
    margin-top: 6px;
    font-size: 11px;
  }
}

.overlay h1 {
  margin: 0 0 16px;
  font-size: 28px;
}

.overlay p { line-height: 1.6; }
.overlay .note { color: #888; font-size: 12px; margin-top: 24px; }

button {
  appearance: none;
  border: 1px solid #555;
  background: #222;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}
button:hover { background: #333; }

#start-btn {
  margin-top: 12px;
  background: #2a6df4;
  border-color: #4789ff;
  padding: 12px 36px;
  font-size: 18px;
}
#start-btn:hover { background: #3d7ff8; }

.hud {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 5;
  pointer-events: none;
}

.hud-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  pointer-events: auto;
}

.hud label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.55);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.hud select {
  background: #111;
  color: #fff;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 13px;
  max-width: 240px;
}

.hud button#toggle-debug {
  padding: 6px 10px;
  font-size: 13px;
  pointer-events: auto;
}

.debug {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  display: inline-block;
  pointer-events: auto;
}
.debug div { line-height: 1.5; }

.error {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #5a1f1f;
  border: 1px solid #a13a3a;
  padding: 12px 20px;
  border-radius: 8px;
  max-width: 80vw;
  z-index: 20;
  font-size: 14px;
}

.hud input[type="range"] {
  width: 100px;
  vertical-align: middle;
}

.hidden { display: none !important; }
