* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #0b1220;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #e8edf7;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#hud {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 1.1rem;
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 2;
}

#overlay,
#gameOver {
  position: fixed;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  background: rgba(10, 14, 26, 0.72);
  z-index: 3;
  padding: 24px;
}

/* An ID selector here would otherwise beat the UA [hidden] rule's display:none. */
#overlay:not([hidden]),
#gameOver:not([hidden]) {
  display: flex;
}

#overlay h1,
#gameOver h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.02em;
}

#overlay p {
  max-width: 380px;
  color: #aab4c9;
  margin: 0 0 8px;
}

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 999px;
  border: 1px solid #38bdf8;
  background: #38bdf8;
  color: #05131f;
  cursor: pointer;
}

button:hover {
  background: #67cffb;
}
