* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05060a; color: #e8ecf2;
  font-family: "Helvetica Neue", Arial, sans-serif; user-select: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: none; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 2px 4px #000c; }
#topleft { position: absolute; left: 20px; top: 16px; }
#wave { font-size: 28px; font-weight: 900; letter-spacing: 3px; color: #ff4d3d; }
#left { font-size: 14px; opacity: .8; letter-spacing: 1px; }
#topright { position: absolute; right: 20px; top: 16px; text-align: right; }
#score { font-size: 32px; font-weight: 900; font-variant-numeric: tabular-nums; }
#combo { font-size: 16px; color: #ffd23d; font-weight: 700; min-height: 20px; }
#location { position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  background: #0b5d36; border: 2px solid #e8ecf2; border-radius: 4px; padding: 3px 12px;
  font-weight: 700; font-size: 14px; letter-spacing: 1px; text-shadow: none; white-space: nowrap; }
#feed { position: absolute; right: 20px; top: 96px; text-align: right; font-size: 14px; font-weight: 700; }
#feed div { animation: fade 2.4s forwards; color: #ffd23d; }
@keyframes fade { 0%,70% { opacity: 1; } 100% { opacity: 0; } }
#banner { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-size: 56px;
  font-weight: 900; letter-spacing: 8px; color: #ff4d3d; opacity: 0; transition: opacity .4s; }
#banner small { display: block; font-size: 18px; letter-spacing: 3px; color: #e8ecf2; }
#minimap { position: absolute; left: 20px; top: 84px; width: 180px; height: 180px; border-radius: 50%;
  border: 2px solid #ffffff55; background: #000a; }
#bottomleft { position: absolute; left: 20px; bottom: 20px; }
#hpbar { position: relative; width: 260px; height: 22px; background: #000a; border: 2px solid #ffffff55; border-radius: 4px; overflow: hidden; }
#hpfill { position: absolute; inset: 0; width: 100%; background: linear-gradient(90deg, #c8102e, #ff4d3d); transition: width .15s; }
#hptext { position: absolute; inset: 0; text-align: center; font-weight: 900; line-height: 18px; font-size: 14px; }
#hint { margin-top: 8px; font-size: 14px; color: #8dff6a; font-weight: 700; min-height: 18px; }
#bottomright { position: absolute; right: 20px; bottom: 20px; text-align: right; }
#weapon { font-size: 16px; letter-spacing: 3px; opacity: .85; font-weight: 700; }
#ammo { font-size: 44px; font-weight: 900; font-variant-numeric: tabular-nums; }
#ammo small { font-size: 20px; opacity: .7; }
#slots span { display: inline-block; margin-left: 6px; padding: 2px 8px; border: 1px solid #ffffff44; border-radius: 3px; font-size: 12px; opacity: .5; }
#slots span.on { opacity: 1; border-color: #ffd23d; color: #ffd23d; }
#crosshair { position: fixed; width: 28px; height: 28px; margin: -14px 0 0 -14px; border: 2px solid #ffffffcc;
  border-radius: 50%; left: 50%; top: 50%; box-shadow: 0 0 6px #000; }
#crosshair::after { content: ""; position: absolute; left: 11px; top: 11px; width: 2px; height: 2px; background: #fff; }
#damage { position: absolute; inset: 0; box-shadow: inset 0 0 160px #c8102e; opacity: 0; transition: opacity .3s; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #10131ccc 0%, #05060af2 70%); text-align: center; padding: 16px; }
.screen h1 { margin: 0; font-size: clamp(56px, 12vw, 128px); font-weight: 900; letter-spacing: 6px; color: #ff4d3d;
  text-shadow: 0 0 24px #ff4d3d88, 0 6px 0 #5a0d08; }
.screen h2 { margin: 0 0 18px; font-size: clamp(22px, 4vw, 40px); letter-spacing: 14px; color: #ffd23d; text-shadow: 0 0 16px #ffd23d66; }
.screen .tag { max-width: 520px; opacity: .8; font-size: 16px; line-height: 1.5; }
.screen button { margin: 24px 0; font-family: inherit; font-weight: 900; font-size: 22px; line-height: 1; letter-spacing: 6px; padding: 16px 44px;
  color: #05060a; background: #8dff6a; border: 0; border-radius: 4px; cursor: pointer; box-shadow: 0 0 24px #8dff6a66; }
.screen button:hover { background: #b6ff9c; }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; max-width: 560px; font-size: 14px; opacity: .8; }
.controls b { color: #ffd23d; }
.credit { position: absolute; bottom: 10px; font-size: 11px; opacity: .45; }
#stats { font-size: 18px; line-height: 1.8; }

body.fp #crosshair { left: 50% !important; top: 50% !important; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 0; border-radius: 0; box-shadow: none;
  background: linear-gradient(#fff, #fff) center / 2px 8px no-repeat, linear-gradient(#fff, #fff) center / 8px 2px no-repeat; }
body.fp #crosshair::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #fff 6px, transparent 6px, transparent 16px, #fff 16px) center / 22px 2px no-repeat, linear-gradient(#fff 6px, transparent 6px, transparent 16px, #fff 16px) center / 2px 22px no-repeat; filter: drop-shadow(0 0 1px #000); }
body.fp #crosshair::after { display: none; }

/* ---- touch controls ---- */
#touch { position: fixed; inset: 0; pointer-events: none; }
#touch button { pointer-events: auto; position: absolute; border: 2px solid #ffffff66; background: #0008; color: #fff; font: 800 14px/1 Arial, sans-serif;
  border-radius: 50%; width: 58px; height: 58px; touch-action: none; -webkit-user-select: none; user-select: none; }
#touch button.on { background: #ffffff44; }
#t-fire { right: calc(24px + env(safe-area-inset-right, 0px)); bottom: calc(40px + env(safe-area-inset-bottom, 0px)); width: 92px !important; height: 92px !important; background: #c8102ecc !important; font-size: 16px !important; }
#t-reload { right: calc(130px + env(safe-area-inset-right, 0px)); bottom: calc(30px + env(safe-area-inset-bottom, 0px)); }
#t-jump { right: calc(30px + env(safe-area-inset-right, 0px)); bottom: calc(146px + env(safe-area-inset-bottom, 0px)); font-size: 11px !important; }
#t-swap { right: calc(130px + env(safe-area-inset-right, 0px)); bottom: calc(100px + env(safe-area-inset-bottom, 0px)); font-size: 22px !important; }
#t-ride { right: calc(100px + env(safe-area-inset-right, 0px)); bottom: calc(170px + env(safe-area-inset-bottom, 0px)); width: 72px !important; border-radius: 30px !important; background: #2a8a1acc !important; }
#t-view { right: calc(16px + env(safe-area-inset-right, 0px)); top: calc(90px + env(safe-area-inset-top, 0px)); width: 64px !important; height: 34px !important; border-radius: 6px !important; font-size: 12px !important; }
#t-pause { right: calc(88px + env(safe-area-inset-right, 0px)); top: calc(90px + env(safe-area-inset-top, 0px)); width: 40px !important; height: 34px !important; border-radius: 6px !important; }
#stick { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 2px solid #ffffff44; background: #0004; opacity: 0; transition: opacity .15s; }
#stick.on { opacity: 1; }
#knob { position: absolute; left: 30px; top: 30px; width: 50px; height: 50px; border-radius: 50%; background: #ffffffaa; }
body.touch #view { touch-action: none; }
body.touch #bottomright { bottom: auto; top: calc(130px + env(safe-area-inset-top, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); }
body.touch #ammo { font-size: 28px; }
body.touch #minimap { width: 120px; height: 120px; top: 70px; }
body.touch #bottomleft { left: 50%; transform: translateX(-50%); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
body.touch #hpbar { width: 160px; height: 16px; }
body.touch #hptext { line-height: 12px; font-size: 11px; }
body.touch .controls { display: none; }
body.touch #crosshair { left: 50% !important; top: 50% !important; }
body.touch #banner { font-size: 34px; }
.touch-hint { display: none; }
body.touch .touch-hint { display: block; max-width: 420px; opacity: .85; font-size: 15px; line-height: 1.5; }

.links { font-size: 14px; opacity: .8; } .links a { color: #ffd23d; text-decoration: none; } .links a:hover { text-decoration: underline; }

#radar { position: fixed; left: 50%; top: 50%; color: #ff4d3d; text-align: center; opacity: 0; transition: opacity .3s; pointer-events: none; text-shadow: 0 0 8px #000; }
#radar b { display: block; font-size: 30px; line-height: 1; }
#radar span { display: block; font-size: 12px; font-weight: 800; color: #fff; }
#hint.low { color: #ff4d3d; }
@media (max-width: 600px) {
  #wave { font-size: 20px; }
  #left { font-size: 11px; }
  #location { top: calc(58px + env(safe-area-inset-top, 0px)); font-size: 11px; padding: 2px 8px; }
  body.touch #minimap { top: 86px; width: 96px; height: 96px; }
  body.touch #bottomleft { left: max(16px, env(safe-area-inset-left, 0px)); transform: none; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  body.touch #hpbar { width: 120px; }
  #score { font-size: 24px; }
  #feed { top: 220px; font-size: 12px; }
  #banner { font-size: 26px; letter-spacing: 3px; }
}
