* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #05070a;
  color: #d8dde3;
  font-family: "Courier New", monospace;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

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

#hud {
  position: fixed;
  top: 12px;
  left: 16px;
  font-size: 28px;
  letter-spacing: 2px;
  text-shadow: 0 0 6px #000;
  pointer-events: none;
}

#hud .best { font-size: 14px; opacity: 0.7; }

#vignette, #danger {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#vignette {
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.75) 100%);
}
#danger {
  background: radial-gradient(ellipse at center, rgba(120, 0, 0, 0) 40%, rgba(160, 0, 0, 0.7) 100%);
  opacity: 0;
}

#flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(120, 0, 0, 0) 20%, rgba(150, 0, 0, 0.85) 100%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
#flash.on { opacity: 1; }

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
}

.overlay h1 {
  margin: 0 0 8px;
  font-size: clamp(32px, 9vw, 72px);
  letter-spacing: 6px;
  color: #b3201f;
  text-shadow: 0 0 18px #500;
}

.overlay p { margin: 0; font-size: 18px; }
.overlay .hint { opacity: 0.6; font-size: 14px; }
.overlay .record { color: #e0b030; letter-spacing: 3px; }

button {
  margin-top: 20px;
  padding: 14px 28px;
  font: inherit;
  font-size: 18px;
  letter-spacing: 2px;
  color: #d8dde3;
  background: #1a1d22;
  border: 2px solid #b3201f;
  cursor: pointer;
}
button:hover { background: #2a1517; }

.hidden { display: none !important; }
