#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#alarm-flash { position: fixed; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(255,64,64,0.35) 100%);
  transition: opacity 0.25s; }
#alarm-flash.on { opacity: 1; animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

#hud { position: fixed; top: 10px; left: 12px; right: 12px; display: flex; gap: 14px;
  align-items: center; pointer-events: none; flex-wrap: wrap; }
.hud-item { background: rgba(10,16,24,0.72); border: 1px solid rgba(111,242,207,0.25);
  padding: 6px 12px; border-radius: 10px; font-size: 0.8rem; letter-spacing: 0.1em;
  color: #8fb4d8; }
.hud-item b { color: #eaf6ff; font-size: 1rem; margin-left: 4px; }
#hud-time b.low, .hud-item #hud-time.low {  }
#hud-time.low { color: #ff7a6b !important; }
#hud-crouch { display: none; }
#hud-crouch.on { display: block; border-color: #77ffc4; color: #77ffc4; }

#det-meter { position: fixed; top: 52px; left: 12px; width: 190px; height: 16px;
  background: rgba(10,16,24,0.75); border: 1px solid rgba(255,179,71,0.4);
  border-radius: 8px; overflow: hidden; }
#det-meter span { position: absolute; inset: 0; text-align: center; line-height: 16px;
  font-size: 0.6rem; letter-spacing: 0.18em; color: #ffd9a0; }
#det-fill { width: 0%; height: 100%;
  background: linear-gradient(90deg, #6ff2cf, #ffd24a 55%, #ff5533);
  transition: width 0.15s; }
#det-meter.seen { border-color: #ffd24a; box-shadow: 0 0 12px rgba(255,210,74,0.5); }
#det-meter.alarm { border-color: #ff5533; box-shadow: 0 0 16px rgba(255,85,51,0.7); }

#message { position: fixed; top: 84px; left: 50%; transform: translateX(-50%);
  font-size: 1rem; font-weight: 600; color: #ffe6b0; text-shadow: 0 2px 8px #000;
  pointer-events: none; white-space: nowrap; }

.overlay { position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; background: rgba(6,10,16,0.78); backdrop-filter: blur(4px); }
.overlay.hidden { display: none; }
.panel { max-width: 640px; width: min(92vw, 640px); padding: 34px 38px;
  background: linear-gradient(160deg, rgba(23,35,49,0.96), rgba(11,17,26,0.96));
  border: 1px solid rgba(111,242,207,0.3); border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6); text-align: center; }
.panel h1 { font-size: 2.2rem; letter-spacing: 0.12em; color: #eaf6ff; }
.panel h1 span { color: #77ffc4; }
.panel h2 { font-size: 1.7rem; letter-spacing: 0.1em; }
#end-title.win { color: #77ffc4; } #end-title.lose { color: #ff7a6b; }
.tag { color: #8fb4d8; font-style: italic; margin: 8px 0 14px; }
.howto { list-style: none; text-align: left; margin: 0 0 16px; }
.howto li { margin: 7px 0; font-size: 0.92rem; line-height: 1.45; }
.howto em { color: #ffb347; font-style: normal; }
.howto b { color: #77ffc4; }
.keys { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.keys span { background: rgba(111,242,207,0.08); border: 1px solid rgba(111,242,207,0.25);
  padding: 5px 10px; border-radius: 8px; font-size: 0.78rem; color: #b9d2ea; }
.keys b { color: #eaf6ff; }

/* touch controls */
#touch-move { position: fixed; left: 18px; bottom: 18px; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(111,242,207,0.1); touch-action: none;
  border: 2px solid rgba(111,242,207,0.35); display: flex;
  align-items: center; justify-content: center; }
#stick-knob { width: 52px; height: 52px; border-radius: 50%;
  background: rgba(233,250,246,0.5); border: 2px solid rgba(255,255,255,0.7); }
#touch-crouch, #touch-sprint { position: fixed; right: 18px; width: 86px; height: 56px;
  border-radius: 14px; border: 2px solid rgba(255,179,71,0.5);
  background: rgba(255,179,71,0.14); color: #ffd9a0; font: inherit; font-size: 0.75rem;
  font-weight: 700; letter-spacing: 0.1em; touch-action: none; }
#touch-crouch { bottom: 92px; } #touch-sprint { bottom: 24px; border-color: rgba(86,217,255,0.5);
  background: rgba(86,217,255,0.14); color: #bfeaff; }
@media (pointer: fine) { #touch-move, #touch-crouch, #touch-sprint { display: none; } }
@media (max-width: 720px) {
  #hud { gap: 8px; } .hud-item { font-size: 0.68rem; padding: 4px 8px; }
  .panel { padding: 22px 18px; } .panel h1 { font-size: 1.6rem; }
  .howto li { font-size: 0.82rem; }
}
