* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #07090b; overflow: hidden; touch-action: none; }
body { font: 14px/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: #dfe7ea; user-select: none; -webkit-user-select: none; }
#wrap { position: fixed; inset: 0; }
#view { width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
#flash { position: absolute; inset: 0; pointer-events: none; background: #c8102e; opacity: 0; }
#mini { position: absolute; top: 12px; right: 12px; width: 168px; height: 168px; display: none; opacity: .85; border-radius: 8px; background: rgba(7, 9, 11, .7); }

#say { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); max-width: min(720px, 92vw);
  padding: 8px 14px; border-radius: 8px; background: rgba(7, 9, 11, .78); color: #f4e9ff; text-align: center;
  opacity: 0; transition: opacity .25s; pointer-events: none; font-style: italic; }
#say.on { opacity: 1; }

#hud { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10, 14, 17, .86); border-top: 2px solid #1f6b5c; pointer-events: none; }
.box { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 6px; background: #121a1f; }
.box.grow { flex: 1; justify-content: space-between; min-width: 0; }
.box.right { justify-content: flex-end; }
.lbl { font-size: 11px; letter-spacing: .12em; color: #6fb7a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.box b { font-size: 22px; color: #f2f5f6; min-width: 2.2ch; text-align: right; }
#hp.low { color: #ff5b6e; }
#kills { font-size: 12px; color: #8a9aa1; white-space: nowrap; }
#ppe { display: flex; gap: 3px; }
#ppe img { width: 22px; height: 22px; image-rendering: pixelated; opacity: .18; filter: grayscale(1); transition: opacity .3s; }
#ppe img.on { opacity: 1; filter: none; }

#touch { position: absolute; inset: 0 0 56px 0; display: none; }
.touchy #touch { display: block; }
#stick { position: absolute; left: 28px; bottom: 28px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .07); border: 2px solid rgba(255, 255, 255, .14); }
#knob { position: absolute; left: 38px; top: 38px; width: 44px; height: 44px; border-radius: 50%; background: rgba(111, 183, 166, .55); }
#fire, #swap { position: absolute; display: grid; place-items: center; border-radius: 50%; font-weight: bold; color: #fff; }
#fire { right: 28px; bottom: 32px; width: 92px; height: 92px; background: rgba(200, 16, 46, .5); border: 2px solid rgba(255, 120, 140, .5); }
#swap { right: 136px; bottom: 40px; width: 56px; height: 56px; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .2); font-size: 22px; }

#screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px; background: rgba(7, 9, 11, .9); text-align: center; animation: fade .35s ease; }
#screen.hide { display: none; }
#screen h1 { font-size: clamp(36px, 9vw, 88px); letter-spacing: .14em; color: #b6ff3b; line-height: 1; }
#screen h2 { font-size: clamp(20px, 4vw, 32px); color: #b6ff3b; letter-spacing: .08em; }
#screen .sub { color: #c86bff; letter-spacing: .2em; font-size: 13px; text-transform: uppercase; }
#screen .journal { max-width: 640px; color: #e8dcf2; font-style: italic; font-size: 16px; }
#screen .stats { color: #8a9aa1; }
#screen .keys { color: #8a9aa1; font-size: 12px; max-width: 640px; }
#screen .keys b { color: #dfe7ea; }
#screen button { font: inherit; font-size: 16px; letter-spacing: .12em; padding: 12px 28px; border-radius: 8px; border: 0;
  background: #1f6b5c; color: #fff; cursor: pointer; transition: transform .15s, background .15s; }
#screen button:hover { background: #26876f; transform: scale(1.04); }
@keyframes fade { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  .box { padding: 3px 6px; gap: 5px; }
  .box b { font-size: 17px; }
  .box.grow { display: none; }
  #ppe img { width: 16px; height: 16px; }
  #say { bottom: 64px; font-size: 12px; }
}
