:root {
  --paper: #e8eef2;
  --mute: rgba(232, 238, 242, 0.55);
  --cold: #7ec8ff;
  --warn: #ff4d3a;
  --display: "Bebas Neue", Impact, sans-serif;
  --body: "Manrope", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #030508; color: var(--paper); font-family: var(--body); }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: none; }
#view.menu { cursor: default; }

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 28%, rgba(0,0,0,.78) 100%);
}
.grain {
  position: absolute; inset: 0; opacity: .14;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
}
#hitflash {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, transparent 30%, rgba(120,0,0,.6));
  opacity: 0;
}
#hitflash.on { opacity: 1; }
#muzzle {
  position: absolute; right: 18%; bottom: 18%; width: 130px; height: 130px; opacity: 0;
  background: radial-gradient(circle, #fff6d8 0 14%, #ffb24a 28%, transparent 68%);
  mix-blend-mode: screen;
}
#muzzle.on { opacity: 1; }

#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.hud-top {
  display: flex; gap: .5rem; padding: .85rem 1rem;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
}
.chip {
  border: 1px solid rgba(126,200,255,.25);
  background: rgba(0,0,0,.4);
  padding: .35rem .65rem;
  min-width: 7rem;
}
.chip small { display: block; font-size: .68rem; letter-spacing: .14em; color: var(--cold); }
.chip strong { font-family: var(--display); font-size: 1.35rem; letter-spacing: .06em; }

#toast {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%);
  font-family: var(--display); font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: .12em; color: var(--cold);
  text-shadow: 0 0 22px rgba(126,200,255,.45);
}

.reticle {
  position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; transform: translate(-50%,-50%);
}
.reticle i {
  position: absolute; background: #d6e8f4; box-shadow: 0 0 6px #7ec8ff;
}
.reticle i:nth-child(1) { left: 12px; top: 0; width: 2px; height: 6px; }
.reticle i:nth-child(2) { left: 12px; bottom: 0; width: 2px; height: 6px; }
.reticle i:nth-child(3) { top: 12px; left: 0; width: 6px; height: 2px; }
.reticle i:nth-child(4) { top: 12px; right: 0; width: 6px; height: 2px; }

#weapon {
  position: absolute; right: 2%; bottom: -6%; width: min(52vw, 560px);
  pointer-events: none; filter: drop-shadow(0 12px 18px rgba(0,0,0,.8));
  transform-origin: 70% 90%;
}
#weapon.kick { animation: kick .12s ease-out; }
@keyframes kick {
  0% { transform: translate(8px, 10px) rotate(4deg); }
  100% { transform: none; }
}

.hint {
  position: absolute; left: 50%; bottom: .7rem; transform: translateX(-50%);
  font-size: .72rem; letter-spacing: .08em; color: rgba(232,238,242,.4); white-space: nowrap;
}

.panel {
  position: fixed; inset: 0; z-index: 8;
  display: grid; place-items: end start;
}
.panel-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.veil { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,5,8,.92) 0 42%, rgba(3,5,8,.35) 100%); }
.panel-inner {
  position: relative; z-index: 1;
  padding: clamp(1.4rem, 5vw, 3rem);
  max-width: 38rem;
}
.eyebrow { font-family: var(--display); letter-spacing: .28em; color: var(--cold); font-size: .8rem; }
h1 { font-family: var(--display); font-size: clamp(4.2rem, 14vw, 7.4rem); line-height: .82; }
h2 { font-family: var(--display); font-size: 3rem; }
.lead { color: var(--mute); margin: .8rem 0 1rem; line-height: 1.45; max-width: 36ch; }
.howto { list-style: none; color: var(--mute); margin: 0 0 1.2rem; }
.howto li { margin: .35rem 0; }
.cta {
  appearance: none; border: 0; cursor: pointer;
  background: var(--cold); color: #041018;
  font-family: var(--display); letter-spacing: .1em; font-size: 1.2rem;
  padding: .75rem 1.2rem;
}
.cta.ghost { background: transparent; color: var(--paper); border: 1px solid rgba(232,238,242,.3); }
.back { display: inline-block; margin-top: .9rem; color: var(--mute); text-decoration: none; }
.back:hover { color: var(--cold); }

#touch {
  position: fixed; inset: auto 0 0 0; z-index: 7;
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: .7rem .8rem calc(.7rem + env(safe-area-inset-bottom));
  pointer-events: none;
}
#touch .stick {
  width: 7.2rem; height: 7.2rem; border-radius: 50%;
  border: 1px solid rgba(126,200,255,.35);
  background: rgba(0,0,0,.35);
  pointer-events: auto; touch-action: none;
}
#btn-fire {
  pointer-events: auto; width: 5.2rem; height: 5.2rem; border-radius: 50%;
  border: 0; background: var(--warn); color: #fff;
  font-family: var(--display); letter-spacing: .08em;
}

[hidden] { display: none !important; }
@media (max-width: 720px) { .hint { display: none; } }
