/* PARKING SIMULATOR — horror UI */

:root {
  --green: #7de0a6;
  --dim: #9aa3ad;
  --blood: #a33;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: #030405;
  overflow: hidden;
  font-family: "Courier New", ui-monospace, monospace;
  color: var(--dim);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

canvas.game { position: fixed; inset: 0; display: block; }

/* ---------- post overlays ---------- */

#grain {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.06;
  z-index: 5;
}

#vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
      rgba(0,0,0,0) 42%,
      rgba(0,0,0,0.45) 78%,
      rgba(0,0,0,0.88) 100%);
  z-index: 4;
}

#scanlines {
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
      rgba(0,0,0,0.14) 0px, rgba(0,0,0,0.14) 1px,
      transparent 1px, transparent 3px);
  opacity: 0.35;
  z-index: 5;
}

/* ---------- HUD ---------- */

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 6; }

#objective {
  position: absolute; top: 22px; left: 26px;
  font-size: 14px; letter-spacing: 2px;
  color: var(--dim);
  text-shadow: 0 0 6px rgba(0,0,0,0.9);
  white-space: pre-line;
}

#clock {
  position: absolute; top: 22px; right: 26px;
  font-size: 15px; letter-spacing: 3px;
  color: #b8bfc7;
  text-shadow: 0 0 8px rgba(120,140,160,0.35);
}

#speed {
  position: absolute; bottom: 20px; right: 26px;
  font-size: 14px; letter-spacing: 2px;
  color: var(--dim);
}

#prompt {
  position: absolute; bottom: 64px; left: 0; right: 0;
  text-align: center;
  font-size: 14px; letter-spacing: 2px;
  color: #cfd6dd;
  text-shadow: 0 0 8px rgba(0,0,0,0.9);
}

#toast {
  position: absolute; top: 34%; left: 0; right: 0;
  text-align: center;
  font-size: 19px; letter-spacing: 5px;
  color: #d7dde3;
  text-shadow: 0 0 14px rgba(160,180,200,0.35);
  opacity: 0;
  transition: opacity 0.7s ease;
  white-space: pre-line;
}
#toast.show { opacity: 1; }
#toast.creepy { color: #c98; text-shadow: 0 0 14px rgba(200,60,40,0.4); }

/* ---------- full screens ---------- */

.screen {
  position: fixed; inset: 0;
  z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  background: rgba(2,3,4,0.55);
  gap: 18px;
  padding: 24px;
}

.hidden { display: none !important; }

.screen h1 {
  font-size: clamp(38px, 7vw, 84px);
  letter-spacing: 12px;
  font-weight: 700;
  color: #dfe6ec;
  text-shadow:
    0 0 18px rgba(150,190,220,0.25),
    0 0 2px rgba(255,255,255,0.5);
  line-height: 1.15;
}

#title-screen { background: rgba(2,3,4,0.42); }

#title-screen .pre {
  font-size: 13px; letter-spacing: 6px; color: #6d7681;
}

#game-title { animation: flick 4.2s infinite steps(1); }

#title-screen .tag {
  font-size: 14px; letter-spacing: 2px; color: #98a1ab; max-width: 620px;
}

#title-screen .controls {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px 22px; max-width: 700px;
  font-size: 12px; letter-spacing: 1px; color: #626b75;
  margin-top: 10px;
}

#title-screen .warn {
  font-size: 12px; letter-spacing: 2px; color: #7c5a52;
}

#title-screen .start {
  margin-top: 16px;
  font-size: 17px; letter-spacing: 6px;
  color: var(--green);
  text-shadow: 0 0 12px rgba(90,220,150,0.5);
}

#death { background: rgba(4,1,1,0.72); }
#death h1 {
  color: #d8c9c4;
  text-shadow: 0 0 22px rgba(180,40,30,0.35);
  animation: flick 3.1s infinite steps(1);
}
#death p { font-size: 15px; letter-spacing: 3px; color: #a08a84; max-width: 640px; }

#pause .small { font-size: 12px; letter-spacing: 3px; color: #565e66; }

.hint { font-size: 14px; letter-spacing: 4px; color: #8fa0ae; }

.blink { animation: blink 1.6s infinite; }

@keyframes blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0.25; }
}

@keyframes flick {
  0%   { opacity: 1; }
  87%  { opacity: 1; }
  88%  { opacity: 0.4; }
  89%  { opacity: 1; }
  92%  { opacity: 0.55; }
  93%  { opacity: 1; }
  95%  { opacity: 0.2; }
  96%  { opacity: 1; }
}

/* ---------- jumpscare ---------- */

#jumpscare {
  position: fixed; inset: 0;
  z-index: 20;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
#jumpscare canvas {
  width: 100vmin; height: 100vmin;
  animation: lunge 0.9s ease-in forwards, judder 0.09s infinite;
}
@keyframes lunge {
  from { transform: scale(0.55); opacity: 0.6; }
  to   { transform: scale(1.9);  opacity: 1; }
}
@keyframes judder {
  0%   { translate: 0 0; }
  25%  { translate: 6px -4px; }
  50%  { translate: -5px 5px; }
  75%  { translate: 4px 3px; }
  100% { translate: -3px -5px; }
}

#fade {
  position: fixed; inset: 0;
  background: #000;
  z-index: 15;
  pointer-events: none;
  opacity: 1;
  transition: opacity 2.2s ease;
}
