* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; overflow: hidden; background: #0a0e1d; }
body { font-family: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Menlo, monospace; color: #dbe6ff; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }

#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between;
  align-items: flex-start; padding: 10px 14px; pointer-events: none; z-index: 5;
  background: linear-gradient(rgba(7,10,24,.75), rgba(7,10,24,0)); }
#hud-level { color: #7fd0ff; letter-spacing: .12em; font-size: 13px; text-transform: uppercase; }
#hud-stats { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.stat { font-size: 12px; color: #8fa0c8; }
.stat b { color: #eaf6ff; font-size: 14px; }
.life { color: #2a3f66; font-size: 14px; }
.life.on { color: #ff5f7a; text-shadow: 0 0 8px #ff5f7a; }

#detection { position: fixed; top: 54px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; align-items: center; opacity: 0; transition: opacity .3s; z-index: 5; }
#det-label { font-size: 11px; letter-spacing: .2em; color: #ffb347; }
#det-bar { width: 180px; height: 10px; border: 1px solid #3a4a7a; border-radius: 5px; overflow: hidden; background: rgba(10,14,29,.7); }
#det-fill { width: 100%; height: 0%; background: #53f2c9; transition: height .12s linear, background .3s; }

#banner { position: fixed; top: 96px; left: 50%; transform: translateX(-50%);
  padding: 10px 18px; background: rgba(10, 16, 34, .85); border: 1px solid #2c5a7a;
  border-radius: 8px; color: #9fe8ff; font-size: 14px; max-width: 90vw; text-align: center;
  opacity: 0; transition: opacity .35s; pointer-events: none; z-index: 6; }
#banner.show { opacity: 1; }

#start-overlay, #end-overlay { position: fixed; inset: 0; display: flex; align-items: center;
  justify-content: center; background: radial-gradient(ellipse at 50% 40%, rgba(20,32,66,.92), rgba(4,6,14,.97));
  z-index: 20; }
#start-overlay.hide, #end-overlay.hide { display: none !important; }
.panel { max-width: 560px; margin: 16px; padding: 28px 30px; border-radius: 14px;
  background: rgba(12,18,38,.9); border: 1px solid #2c5a7a; box-shadow: 0 0 60px rgba(30,80,160,.25); }
.panel h1 { font-size: 34px; letter-spacing: .18em; color: #eaf6ff; }
.panel h1 span { display: block; font-size: 14px; letter-spacing: .4em; color: #53f2c9; margin-top: 6px; }
.panel h2 { font-size: 26px; letter-spacing: .14em; margin-bottom: 12px; }
.panel p { color: #a9bce0; font-size: 14px; line-height: 1.6; margin: 14px 0; }
.howto { list-style: none; margin: 12px 0 18px; }
.howto li { font-size: 13px; color: #8fa0c8; margin: 7px 0; line-height: 1.5; }
.howto b { color: #7fd0ff; }
.big-btn { display: inline-block; padding: 13px 26px; font: inherit; font-size: 15px; letter-spacing: .1em;
  color: #04121e; background: linear-gradient(135deg, #53f2c9, #7fd0ff); border: none; border-radius: 9px;
  cursor: pointer; box-shadow: 0 0 24px rgba(83,242,201,.35); }
.big-btn:hover { filter: brightness(1.15); }

#touch-controls { position: fixed; inset: auto 0 0 0; display: flex; justify-content: space-between;
  align-items: flex-end; padding: 14px; z-index: 10; pointer-events: none; }
#stick-zone { pointer-events: auto; width: 118px; height: 118px; border-radius: 50%;
  border: 1px solid rgba(127,208,255,.35); background: rgba(10,16,34,.45); touch-action: none;
  display: flex; align-items: center; justify-content: center; }
#stick-knob { width: 52px; height: 52px; border-radius: 50%; background: rgba(83,242,201,.45);
  border: 1px solid rgba(83,242,201,.7); }
#touch-btns { pointer-events: auto; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
#touch-btns button { width: 68px; height: 48px; font: inherit; font-size: 12px; letter-spacing: .08em;
  color: #9fe8ff; background: rgba(10,16,34,.55); border: 1px solid rgba(127,208,255,.4);
  border-radius: 10px; touch-action: none; cursor: pointer; }
#touch-btns button.on { background: rgba(83,242,201,.35); color: #eafff8; }

@media (max-width: 480px) {
  .panel h1 { font-size: 25px; }
  .panel { padding: 20px; }
  #det-bar { width: 120px; }
  #hud-stats { gap: 8px; }
  #touch-controls { padding: 8px; }
  #stick-zone { width: 100px; height: 100px; }
}
