* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #2a2145;
  font-family: ui-sans-serif, system-ui, "Segoe UI", sans-serif; color: #ffe9c9; }
#game { position: fixed; inset: 0; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; user-select: none; }
#hud { position: absolute; inset: 0; }
#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 18px; font-weight: 700; letter-spacing: 0.08em;
  background: #2a214588; border: 1px solid #f08a4b55; border-radius: 10px;
  padding: 6px 14px; backdrop-filter: blur(3px); font-size: 14px; }
#topbar #kills { color: #7fd4c8; }
#reticle { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px;
  transform: translate(-50%, -50%); }
#reticle .ring { position: absolute; inset: 0; border: 2px solid #ffffff88;
  border-radius: 50%; }
#reticle .dot { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px;
  transform: translate(-50%, -50%); border-radius: 50%; background: #ffd9a0; }
#hpbox { position: absolute; left: 14px; bottom: 14px; }
#ammobox { position: absolute; right: 14px; bottom: 14px; text-align: right; }
.lbl { display: block; font-size: 11px; letter-spacing: 0.15em; opacity: 0.8; margin-bottom: 4px; }
#hpbar i, #ammo i { display: inline-block; width: 18px; height: 12px; margin-right: 3px;
  border-radius: 3px; }
#ammo em { font-style: normal; color: #ffcf6e; font-size: 11px; margin-left: 4px; }
#msg { position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  font-size: 26px; font-weight: 800; letter-spacing: 0.12em; color: #ffd9a0;
  text-shadow: 0 2px 12px #0008; opacity: 0; transition: opacity 0.6s; }
#damage { position: absolute; inset: 0; background: radial-gradient(circle, transparent 40%, #d43a2a);
  opacity: 0; transition: opacity 0.25s; }
.hidden { display: none !important; }

/* touch controls */
#touch { position: absolute; inset: 0; pointer-events: none; }
#touch button { pointer-events: auto; }
.pad { position: absolute; left: 16px; bottom: 96px; display: grid;
  grid-template-columns: 56px 56px 56px; grid-template-rows: 56px 56px; gap: 6px; }
.pad .kb { grid-column: 2; border: 1px solid #f08a4b77; border-radius: 12px;
  background: #2a214577; color: #ffe9c9; font-size: 22px; touch-action: none; }
.pad [data-touch="turn-left"] { grid-row: 2; grid-column: 1; }
.pad [data-touch="drive-back"] { grid-row: 2; grid-column: 2; }
.pad [data-touch="turn-right"] { grid-row: 2; grid-column: 3; }
#firebtn { position: absolute; right: 20px; bottom: 100px; width: 84px; height: 84px;
  border-radius: 50%; border: 2px solid #f08a4b; background: #d97b3f55;
  color: #ffe9c9; font-weight: 800; font-size: 16px; letter-spacing: 0.1em;
  touch-action: none; }
#touch .kb:active, #firebtn:active { background: #f08a4b88; }
@media (min-width: 900px) and (pointer: fine) { #touch .pad, #firebtn { opacity: 0.25; } }

/* overlays */
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; pointer-events: auto;
  background: #1c1430cc; backdrop-filter: blur(4px); text-align: center; padding: 16px; }
.overlay h1 { font-size: clamp(38px, 8vw, 72px); letter-spacing: 0.18em;
  color: #ffd9a0; text-shadow: 0 0 30px #f08a4b88; }
.overlay .tag { color: #7fd4c8; letter-spacing: 0.3em; text-transform: uppercase; font-size: 13px; }
.card { background: #2a214588; border: 1px solid #f08a4b44; border-radius: 14px;
  padding: 18px 22px; max-width: 560px; line-height: 1.6; font-size: 15px; }
.card p { margin: 6px 0; }
.card button, .overlay button { margin-top: 12px; padding: 12px 30px; font-size: 17px;
  font-weight: 800; letter-spacing: 0.12em; color: #241632; background: #f08a4b;
  border: none; border-radius: 10px; cursor: pointer; }
.card button:hover { background: #ffa562; }
