#hud { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
#crosshair {
  position: absolute; top: 50%; left: 50%; width: 5px; height: 5px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 15;
  transition: transform 0.12s ease-out, background-color 0.12s ease-out;
}
#crosshair.active {
  transform: translate(-50%, -50%) scale(2.2);
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf24;
}
.panel { background: rgba(6,10,16,0.72); border: 1px solid rgba(148,163,184,0.18); border-radius: 8px; padding: 10px 14px; backdrop-filter: blur(6px); }
.panel.small { padding: 8px 12px; min-width: 170px; }
.panel-title { font-size: 11px; letter-spacing: 2px; color: #4ade80; font-weight: 800; margin-bottom: 6px; }
.stat-row { display: flex; justify-content: space-between; font-size: 12px; gap: 14px; line-height: 1.6; }
.stat-key { font-size: 10px; letter-spacing: 2px; color: #94a3b8; }

#hud-top-left { position: absolute; top: 14px; left: 14px; max-width: 360px; }
#objective-list { list-style: none; }
#objective-list li { font-size: 13px; padding: 3px 0 3px 22px; position: relative; color: #cbd5e1; }
#objective-list li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 10px; height: 10px; border: 2px solid #64748b; border-radius: 2px; }
#objective-list li.active { color: #fff; font-weight: 600; }
#objective-list li.active::before { border-color: #fbbf24; box-shadow: 0 0 8px #fbbf24; animation: blink 1s infinite alternate; }
#objective-list li.done { color: #64748b; text-decoration: line-through; }
#objective-list li.done::before { border-color: #4ade80; background: #4ade80; }
@keyframes blink { from { opacity: 0.5; } to { opacity: 1; } }

#hud-top-right { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
#detect-bar { height: 8px; background: rgba(255,255,255,0.1); border-radius: 4px; margin: 6px 0 4px; overflow: hidden; }
#detect-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #fbbf24, #ef4444); transition: width 0.1s; }
#detect-label { font-size: 11px; letter-spacing: 2px; font-weight: 800; color: #4ade80; }
#detect-label.warn { color: #fbbf24; }
#detect-label.hunt { color: #ef4444; animation: blink 0.4s infinite alternate; }

#hud-bottom-left { position: absolute; left: 14px; bottom: 14px; width: 240px; }
#hearts { font-size: 26px; letter-spacing: 4px; margin-bottom: 6px; text-shadow: 0 0 12px rgba(239,68,68,0.6); }
.heart { color: #ef4444; transition: color 0.3s; }
.heart.lost { color: rgba(255,255,255,0.15); text-shadow: none; }
.meter { margin-bottom: 6px; }
.meter-label { font-size: 9px; letter-spacing: 2px; color: #94a3b8; margin-bottom: 2px; }
.meter-bar { height: 7px; background: rgba(255,255,255,0.1); border-radius: 4px; overflow: hidden; }
.meter-fill { height: 100%; transition: width 0.1s; }
.meter-fill.stamina { background: #38bdf8; width: 100%; }
.meter-fill.noise { background: linear-gradient(90deg, #4ade80, #fbbf24, #ef4444); width: 0%; }
#stance { font-size: 10px; letter-spacing: 2px; color: #94a3b8; margin-top: 6px; }

#hud-bottom-right { position: absolute; right: 14px; bottom: 52px; text-align: right; }
#inventory { display: inline-block; background: rgba(6,10,16,0.72); border: 1px solid rgba(148,163,184,0.18); border-radius: 8px; padding: 8px 14px; margin-bottom: 8px; min-width: 150px; text-align: center; }
.inv-label { font-size: 9px; letter-spacing: 2px; color: #94a3b8; }
#inv-item { font-size: 14px; font-weight: 700; color: #fbbf24; margin-top: 2px; }
#controls-hint { font-size: 10px; color: #64748b; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
#controls-hint b { color: #94a3b8; }

/* Interaction prompt */
#interaction-prompt {
  position: absolute; bottom: 22%; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  background: rgba(6,10,16,0.9); border: 1px solid rgba(251,191,36,0.5); backdrop-filter: blur(8px);
  padding: 10px 16px; border-radius: 6px; opacity: 0; transition: opacity 0.15s; min-width: 220px;
}
#interaction-prompt.visible { opacity: 1; }
#prompt-target { font-size: 10px; letter-spacing: 2px; color: #fbbf24; font-weight: 700; }
#prompt-action { font-size: 14px; color: #fff; }
.key-hint { display: inline-block; background: #fbbf24; color: #111; font-weight: 800; padding: 2px 8px; border-radius: 4px; font-size: 14px; }
#hold-bar { flex-basis: 100%; height: 5px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; display: none; }
#hold-bar.on { display: block; }
#hold-fill { height: 100%; width: 0%; background: #fbbf24; }

#toast {
  position: absolute; top: 90px; left: 50%; transform: translateX(-50%);
  background: rgba(6,10,16,0.85); border-left: 4px solid #4ade80; color: #fff; padding: 10px 18px; border-radius: 4px;
  font-size: 14px; opacity: 0; transition: opacity 0.3s; max-width: 640px; text-align: center;
}
#toast.show { opacity: 1; }
#toast.warn { border-left-color: #fbbf24; }
#toast.bad { border-left-color: #ef4444; }

#radio {
  position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%);
  width: min(760px, 90vw); background: rgba(6,10,16,0.8); border: 1px solid rgba(56,189,248,0.35); border-radius: 6px;
  padding: 10px 16px; opacity: 0; transition: opacity 0.3s; font-family: Consolas, "Courier New", monospace;
}
#radio.show { opacity: 1; }
#radio-who { font-size: 10px; letter-spacing: 3px; color: #38bdf8; margin-bottom: 4px; }
#radio-text { font-size: 15px; color: #e0f2fe; line-height: 1.4; min-height: 20px; }

#evac-timer { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); font-size: 22px; font-weight: 900; letter-spacing: 4px; color: #fbbf24; text-shadow: 0 0 16px rgba(251,191,36,0.6); animation: blink 0.8s infinite alternate; }

/* Locker Peeking Overlay */
#locker-peek {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
}
#locker-peek .locker-edge {
  position: absolute;
  background: #090e14;
}
#locker-peek .locker-edge.left {
  top: 0; bottom: 0; left: 0; width: 14%;
  background: linear-gradient(90deg, #030508 0%, #090e15 70%, #151d27 95%, rgba(21,29,39,0.2) 100%);
  border-right: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: 12px 0 28px rgba(0, 0, 0, 0.85);
}
#locker-peek .locker-edge.right {
  top: 0; bottom: 0; right: 0; width: 14%;
  background: linear-gradient(270deg, #030508 0%, #090e15 70%, #151d27 95%, rgba(21,29,39,0.2) 100%);
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  box-shadow: -12px 0 28px rgba(0, 0, 0, 0.85);
}
#locker-peek .locker-edge.top {
  top: 0; left: 0; right: 0; height: 10%;
  background: linear-gradient(180deg, #030508 0%, #0a0f16 75%, transparent 100%);
}
#locker-peek .locker-edge.bottom {
  bottom: 0; left: 0; right: 0; height: 12%;
  background: linear-gradient(0deg, #030508 0%, #0a0f16 75%, transparent 100%);
}

#locker-peek .locker-slats-wrap {
  position: absolute;
  top: 10%;
  bottom: 12%;
  left: 14%;
  right: 14%;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  pointer-events: none;
}

#locker-peek .locker-slat {
  height: 18px;
  width: 100%;
  background: linear-gradient(180deg, #37474f 0%, #1c2630 35%, #0c1218 80%, #040608 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 2px solid #020304;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.95);
  border-radius: 1px;
}

#locker-peek .locker-peek-hint {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 14, 22, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8);
  animation: peekPulse 2s infinite alternate;
}
#locker-peek .locker-peek-hint b {
  color: #fbbf24;
}
@keyframes peekPulse {
  from { opacity: 0.85; }
  to { opacity: 1; border-color: rgba(56, 189, 248, 0.7); box-shadow: 0 0 14px rgba(56, 189, 248, 0.3); }
}


/* ======================================================================
   LEVEL 3 - THE ROAD
   The walking meters (stamina, noise, stance, detection, the interact prompt)
   mean nothing in a jeep, so body.driving swaps them for speed, distance and a
   rear-view mirror. The mirror frame below is a plain border drawn over the
   viewport strip that chase.js renders the rear camera into - the sizes have to
   stay in step (0.30 of the canvas width, 3.4:1, 14 px from the top).
   ====================================================================== */
#chase-hud, #chase-top, #controls-hint-drive { display: none; }
body.driving #controls-hint-drive { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; font-size: 10px; color: #64748b; }
body.driving #controls-hint-drive b { color: #94a3b8; }
body.driving #chase-hud { display: block; position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); text-align: center; }
body.driving #chase-top { display: block; position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: 30vw; min-width: 260px; }
body.driving #hud-bottom-left .meter,
body.driving #hud-bottom-left #stance,
body.driving #detect-wrap,
body.driving #interaction-prompt,
body.driving #controls-hint,
body.driving #inventory { display: none !important; }
/* The radio subtitle sits low so it never covers the mirror or the dials. */
body.driving #radio { bottom: 15%; }

#chase-mirror { width: 100%; aspect-ratio: 3.4 / 1; border: 2px solid rgba(148,163,184,0.5); border-radius: 4px; box-shadow: 0 6px 22px rgba(0,0,0,0.7), inset 0 0 18px rgba(0,0,0,0.6); }
#chase-mirror::after { content: "REAR"; position: absolute; top: 4px; left: 8px; font-size: 8px; letter-spacing: 2px; color: rgba(203,213,225,0.65); }

.chase-gap { margin-top: 7px; background: rgba(6,10,16,0.72); border: 1px solid rgba(148,163,184,0.18); border-radius: 8px; padding: 7px 14px 8px; backdrop-filter: blur(6px); text-align: center; }
.chase-key { font-size: 9px; letter-spacing: 3px; color: #94a3b8; margin-bottom: 5px; }
#chase-gap-bar { height: 9px; background: rgba(255,255,255,0.08); border-radius: 5px; overflow: hidden; }
#chase-gap-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ef4444, #fbbf24 45%, #4ade80); transition: width 0.12s linear; }
#chase-gap-fill.warn { background: linear-gradient(90deg, #ef4444, #fbbf24); }
#chase-gap-fill.danger { background: #ef4444; animation: blink 0.32s infinite alternate; }
#chase-gap-label { font-size: 11px; letter-spacing: 2px; font-weight: 800; color: #cbd5e1; margin-top: 5px; }

.chase-readout { display: flex; gap: 10px; justify-content: center; }
.chase-dial { background: rgba(6,10,16,0.72); border: 1px solid rgba(148,163,184,0.18); border-radius: 8px; padding: 6px 18px; min-width: 132px; backdrop-filter: blur(6px); }
.chase-dial span { display: block; font-size: 26px; font-weight: 900; color: #fff; line-height: 1.05; font-variant-numeric: tabular-nums; }
.chase-dial small { display: block; font-size: 8.5px; letter-spacing: 2.5px; color: #94a3b8; margin-top: 2px; }
