* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b1220;
  color: #e8f0f8;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  touch-action: none;
}
#game {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: #0b1220;
  overflow: hidden;
}
#view {
  display: block;
  width: 100%;
  height: 100%;
  background: #0b1220;
}
.hidden { display: none !important; }
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hud-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px 0;
}
.hp-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hp-label, .stat {
  font-size: 12px;
  color: #9db0c4;
  letter-spacing: 0.04em;
}
.hp-bar {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: #1a2838;
  overflow: hidden;
  border: 1px solid #2c4258;
}
#hpFill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #c23b3b, #ff8a3d);
}
#hpNum { font-size: 13px; font-weight: 700; min-width: 28px; }
.stat b { color: #ff8a3d; font-size: 16px; }
#cross {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2px solid rgba(232, 240, 248, 0.85);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}
#cross::before, #cross::after {
  content: "";
  position: absolute;
  background: #ff8a3d;
}
#cross::before { left: 9px; top: -6px; width: 2px; height: 6px; }
#cross::after { left: 9px; bottom: -6px; width: 2px; height: 6px; }
#gun {
  position: absolute;
  right: 18%;
  bottom: 0;
  width: 86px;
  height: 150px;
  pointer-events: none;
}
#gun .barrel {
  position: absolute;
  left: 28px;
  top: 0;
  width: 18px;
  height: 92px;
  background: linear-gradient(90deg, #3a4654, #8b98a8 40%, #2a333d);
  border-radius: 4px 4px 0 0;
}
#gun .body {
  position: absolute;
  left: 8px;
  bottom: 0;
  width: 70px;
  height: 78px;
  background: linear-gradient(180deg, #5c4a3a, #2a221c);
  border-radius: 8px 8px 0 0;
  border: 2px solid #1a1410;
}
#flash {
  position: absolute;
  right: calc(18% + 22px);
  bottom: 118px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6c8 0%, #ff8a3d 45%, transparent 70%);
  opacity: 0;
}
#flash.on { opacity: 1; }
.touch-pad {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 16px 8px;
  pointer-events: none;
}
.stick {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(14, 22, 34, 0.45);
  border: 2px solid rgba(157, 176, 196, 0.45);
  position: relative;
  pointer-events: auto;
}
.knob {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 138, 61, 0.85);
  position: absolute;
  left: 32px;
  top: 32px;
}
#fireBtn {
  pointer-events: auto;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 0;
  background: #ff8a3d;
  color: #1a120c;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 6px 0 #b85a1e;
}
#overlay, #over {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.15) 0%, rgba(8, 14, 24, 0.72) 70%);
  padding: 24px 16px 36px;
}
.panel {
  width: 100%;
  background: rgba(12, 20, 32, 0.88);
  border: 1px solid #2c4258;
  border-radius: 16px;
  padding: 18px 16px 16px;
}
.kicker {
  margin: 0;
  color: #8aa0b8;
  font-size: 12px;
  letter-spacing: 0.12em;
}
h1, h2 { margin: 6px 0 8px; font-size: 28px; color: #f4f7fb; }
.lead { margin: 0 0 14px; color: #c5d2e0; font-size: 14px; line-height: 1.5; }
.lead b { color: #ff8a3d; }
#startBtn, #retryBtn {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #ff8a3d;
  color: #1a120c;
  font-size: 17px;
  font-weight: 800;
}

#game{max-width:none;isolation:isolate;user-select:none;-webkit-user-select:none}#view{touch-action:none}#overlay,#over{align-items:flex-start;text-align:center;background:linear-gradient(#101a24cf,transparent 43%);padding:max(24px,env(safe-area-inset-top)) 16px 0}#overlay .panel,#over .panel{border:0;background:transparent;padding:0;width:min(92%,440px)}.kicker{color:#e4cbaa;letter-spacing:0;font-weight:700}h1,h2{font-size:38px;color:#fbf7ed;text-shadow:0 2px 6px #10181a}h1 span{color:#ff8a3d;margin-left:5px}#hint{display:none}#startBtn,#retryBtn{width:min(200px,80%);border-radius:6px;margin-top:6px;box-shadow:0 3px 0 #9b4c23}#over{align-items:center;background:#0d1724bc}.hud-top{background:linear-gradient(#111d27dc,transparent);padding:max(15px,env(safe-area-inset-top)) 16px 28px;max-width:600px;margin:auto}.hp-label,.stat{color:#fff;letter-spacing:0}.touch-pad{bottom:max(12px,env(safe-area-inset-bottom))}.stick{background:#14232cb8}#fireBtn:active{box-shadow:none;background:#ffd198}.knob{pointer-events:none}button{cursor:pointer;touch-action:manipulation}@media(min-width:800px){.touch-pad{padding-inline:5vw}h1{font-size:46px}}

#overlay,#over{pointer-events:none}
#overlay .panel,#over .panel{pointer-events:auto}
#startBtn,#retryBtn{position:relative;z-index:4;min-height:52px;font-size:18px}
#fireBtn{z-index:3;touch-action:none}
.stick{z-index:3;touch-action:none}
#hud{z-index:2}
