:root {
  color-scheme: dark;
  --red: #ff2b1f;
  --amber: #ffb000;
  --green: #80ff8b;
  --ink: #090606;
  --panel: rgba(12, 8, 8, 0.78);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #050304; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; color: #f7e7d0; }
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 45, 25, 0.18), transparent 34%),
    linear-gradient(180deg, #130504 0%, #050304 55%, #000 100%);
  pointer-events: none;
}
#gameShell { position: relative; width: 100vw; height: 100dvh; display: grid; place-items: center; }
#view {
  width: min(100vw, calc(100dvh * 16 / 9));
  height: min(100dvh, calc(100vw * 9 / 16));
  image-rendering: pixelated;
  background: #000;
  box-shadow: 0 0 0 2px #2a0907, 0 0 80px rgba(255, 20, 0, 0.32);
}
#hud {
  position: fixed; inset: 18px 18px auto 18px; z-index: 4;
  display: grid; gap: 10px; pointer-events: none;
  text-shadow: 0 2px 0 #000, 0 0 12px rgba(255, 0, 0, .55);
}
.brand { display: flex; align-items: baseline; gap: 8px; letter-spacing: -0.08em; font-weight: 950; font-size: clamp(28px, 6vw, 74px); line-height: .8; color: var(--red); }
.brand small { letter-spacing: .04em; color: #f6d7a0; font-size: clamp(11px, 1.6vw, 18px); }
.meters { display: flex; flex-wrap: wrap; gap: 10px; }
.meters div, #message {
  background: linear-gradient(180deg, rgba(39, 18, 10, .78), rgba(7, 4, 4, .82));
  border: 1px solid rgba(255, 83, 45, .35);
  padding: 8px 10px;
  color: #f8d7a9;
  box-shadow: inset 0 0 20px rgba(0,0,0,.55);
}
.meters b { color: var(--amber); }
#message { width: fit-content; max-width: min(720px, calc(100vw - 36px)); color: #ffe7bd; }
.overlay {
  position: fixed; inset: 0; z-index: 9; display: grid; align-items: start; justify-items: start;
  background: radial-gradient(circle at 50% 40%, rgba(75, 12, 8, .52), rgba(0,0,0,.88) 62%);
  padding: clamp(92px, 12vh, 150px) 20px 20px;
}
.overlay.hidden { display: none; }
.panel {
  width: min(600px, calc(100vw - 40px)); max-height: calc(100dvh - 40px); margin-left: clamp(0px, 4vw, 70px); padding: clamp(20px, 4.2vw, 44px);
  background: linear-gradient(160deg, rgba(21, 8, 7, .94), rgba(5, 3, 3, .92));
  border: 1px solid rgba(255, 59, 34, .45);
  box-shadow: 0 0 80px rgba(255, 0, 0, .25), inset 0 0 40px rgba(255, 65, 0, .08);
  text-align: center;
  overflow: auto;
}
.eyebrow { color: var(--amber); letter-spacing: .28em; font-size: 12px; margin: 0 0 14px; }
h1 { margin: 0 auto; max-width: 100%; font-size: clamp(38px, 7.4vw, 72px); line-height: .82; letter-spacing: -.07em; text-transform: uppercase; color: var(--red); }
h1 span { display: block; }
.lead { color: #f4d3a6; font-size: clamp(15px, 2.4vw, 20px); line-height: 1.55; margin: 22px auto; max-width: 620px; }
button {
  appearance: none; border: 0; cursor: pointer; color: #210000; background: linear-gradient(180deg, #ffda75, #ff381f 58%, #9c120b);
  font: 950 18px/1 ui-monospace, monospace; letter-spacing: .05em; padding: 16px 24px;
  box-shadow: 0 10px 0 #3b0704, 0 0 34px rgba(255, 55, 20, .4); text-transform: uppercase;
}
button:hover { filter: brightness(1.13); transform: translateY(-1px); }
.controls { margin-top: 24px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; color: #c99470; font-size: 12px; }
.controls span { border: 1px solid rgba(255,255,255,.12); padding: 7px 9px; background: rgba(0,0,0,.2); }
#mobileControls { position: fixed; z-index: 5; bottom: 18px; left: 18px; right: 18px; display: none; justify-content: space-between; align-items: end; pointer-events: auto; }
#mobileControls button { width: 56px; height: 48px; padding: 0; opacity: .72; }
#mobileControls .fire { width: 92px; height: 92px; border-radius: 50%; }
@media (hover: none), (max-width: 760px) { #mobileControls { display: flex; } #hud { inset: 10px 10px auto 10px; } .meters div, #message { padding: 6px 7px; font-size: 11px; } }
#cssWeapon { position: fixed; left: 50%; bottom: -10px; transform: translateX(-50%); width: 360px; height: 220px; z-index: 7; display: none; pointer-events: none; filter: drop-shadow(0 12px 0 rgba(0,0,0,.65)) drop-shadow(0 0 22px rgba(255, 76, 20, .22)); }
body.playing #cssWeapon { display: block; }
#cssWeapon i { position: absolute; display: block; image-rendering: pixelated; }
#cssWeapon .barrel { top: 0; width: 76px; height: 132px; background: linear-gradient(90deg, #5a554b 0 16%, #d5c4a3 17% 31%, #292927 32% 55%, #9b917e 56% 80%, #34312c 81%); border: 4px solid #0a0908; box-shadow: inset 0 -18px 0 rgba(0,0,0,.28), inset 0 8px 0 rgba(255,255,255,.18); }
#cssWeapon .barrel.left { left: 91px; }
#cssWeapon .barrel.right { right: 91px; }
#cssWeapon .receiver { left: 70px; top: 88px; width: 220px; height: 72px; background: linear-gradient(#3b332b, #111); border: 5px solid #050505; box-shadow: inset 0 10px 0 #6f6254; }
#cssWeapon .stock { left: 42px; top: 145px; width: 276px; height: 86px; background: linear-gradient(#a75a2e, #552613 62%, #2a120b); border: 5px solid #120806; }
#cssWeapon .hand { top: 148px; width: 70px; height: 70px; background: linear-gradient(#d59a6a, #8d4b31); border: 4px solid #35160f; }
#cssWeapon .hand.left { left: 0; transform: skewY(10deg); }
#cssWeapon .hand.right { right: 0; transform: skewY(-10deg); }
@media (max-width: 760px) { #cssWeapon { width: 260px; height: 160px; transform: translateX(-50%) scale(.72); transform-origin: bottom center; } }
