* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #1d3238;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif; color: #e8dcc8; }
#scene { position: fixed; inset: 0; display: block; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud-top { position: absolute; top: 10px; left: 12px; right: 12px;
  display: flex; gap: 8px; flex-wrap: wrap; }
.hud-card { background: rgba(20, 24, 28, 0.62); border: 1px solid rgba(242,165,77,.45);
  border-radius: 8px; padding: 6px 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.hud-card b { color: #f2a54d; font-variant-numeric: tabular-nums; }
.lbl { font-size: 11px; letter-spacing: .12em; opacity: .8; }
.bar { width: 120px; height: 10px; background: rgba(0,0,0,.5); border-radius: 5px; overflow: hidden; }
#hp-fill { height: 100%; width: 100%; background: #5cc9a8; transition: width .2s; }

#reload-wrap { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: 160px; height: 6px; background: rgba(0,0,0,.5); border-radius: 3px; }
#reload-fill { height: 100%; width: 100%; background: #f2a54d; border-radius: 3px; }

#crosshair { position: absolute; left: 0; top: 0; width: 44px; height: 44px; }
#crosshair i { position: absolute; background: #ffd9a0; }
#crosshair i:nth-child(1) { left: 50%; top: 0; width: 2px; height: 12px; transform: translateX(-50%); }
#crosshair i:nth-child(2) { left: 50%; bottom: 0; width: 2px; height: 12px; transform: translateX(-50%); }
#crosshair i:nth-child(3) { top: 50%; left: 0; height: 2px; width: 12px; transform: translateY(-50%); }
#crosshair i:nth-child(4) { top: 50%; right: 0; height: 2px; width: 12px; transform: translateY(-50%); }
#crosshair.locked i { background: #7cf2a0; }

#dmg-flash { position: absolute; inset: 0; background: radial-gradient(transparent 40%, rgba(224,89,69,.65));
  opacity: 0; }
#banner { position: absolute; top: 18%; left: 50%; transform: translateX(-50%);
  font-size: clamp(20px, 4vw, 34px); letter-spacing: .14em; color: #f2a54d;
  text-shadow: 0 2px 12px rgba(0,0,0,.8); opacity: 0; white-space: nowrap; }

/* Touch controls: visible on touch-style devices */
#stick-zone, #aim-zone, #btn-fire { display: none; touch-action: none; user-select: none; }
@media (hover: none) and (pointer: coarse) {
  #stick-zone { display: block; position: fixed; left: 14px; bottom: 14px; z-index: 20;
    width: 130px; height: 130px; border-radius: 50%;
    background: rgba(20,24,28,.4); border: 2px solid rgba(242,165,77,.5); }
  #stick-zone .knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px;
    border-radius: 50%; background: rgba(242,165,77,.6);
    transform: translate(calc(-50% + var(--kx, 0) * 34px), calc(-50% + var(--ky, 0) * 34px)); }
  #stick-zone span, #aim-zone span { position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
    font-size: 10px; letter-spacing: .2em; opacity: .7; }
  #aim-zone { display: block; position: fixed; right: 0; top: 90px; bottom: 120px; width: 46%;
    z-index: 19; background: transparent; }
  #btn-fire { display: block; position: fixed; right: 18px; bottom: 22px; z-index: 20;
    width: 92px; height: 92px; border-radius: 50%; border: 2px solid rgba(242,165,77,.7);
    background: rgba(138,59,48,.55); color: #ffd9a0; font-size: 16px; letter-spacing: .1em; }
}

.overlay { position: fixed; inset: 0; z-index: 30; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 42%, rgba(43,22,48,.35), rgba(10,8,12,.82)); }
.panel { max-width: min(560px, 92vw); padding: 28px 32px; text-align: center;
  background: rgba(18, 22, 26, .88); border: 1px solid rgba(242,165,77,.4);
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.panel h1 { font-size: clamp(28px, 6vw, 44px); letter-spacing: .18em; color: #f2a54d; }
.panel .tag { margin: 8px 0 14px; opacity: .85; font-style: italic; }
.howto { list-style: none; text-align: left; font-size: 14px; line-height: 1.8; margin-bottom: 18px; }
.howto b { color: #ffd9a0; }
.big-btn { pointer-events: auto; cursor: pointer; font: inherit; font-weight: 700;
  letter-spacing: .12em; font-size: 17px; color: #1d3238;
  background: linear-gradient(180deg, #ffc873, #f2a54d); border: none;
  padding: 14px 34px; border-radius: 10px; box-shadow: 0 6px 22px rgba(242,165,77,.35); }
.big-btn:hover { filter: brightness(1.12); }
