@font-face {
  font-family: "Press Start 2P";
  src: url("./PressStart2P-Regular.034c77f1f0.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --blood: #c22a1e;
  --blood-dark: #6e130d;
  --rust: #8a3b24;
  --gold: #e8b04a;
  --gold-bright: #ffd77a;
  --bone: #e8dcc0;
  --green: #8fbf4a;
  --blue: #5d9fd0;
  --metal: #26211e;
  --metal-light: #3b332d;
  --panel: rgba(12, 7, 6, 0.86);
  --pixel: "Press Start 2P", "Courier New", monospace;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070403;
  color: var(--bone);
  font-family: var(--mono);
  user-select: none;
  -webkit-user-select: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  cursor: none;
}

.hidden { display: none !important; }

/* ── CRTs & grain ─────────────────────────────────────────────── */

#scanlines {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.16) 0px,
    rgba(0, 0, 0, 0.16) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.55;
  mix-blend-mode: multiply;
}

#vignette {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.55) 100%);
}

#damage {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(150, 10, 5, 0.55) 100%),
    linear-gradient(180deg, rgba(120, 0, 0, 0.15), transparent 40%);
  transition: opacity 0.22s ease-out;
}
#damage.hurt { opacity: 1; transition: opacity 0.04s linear; }
#damage.low { opacity: 0.5; animation: lowpulse 1.4s ease-in-out infinite; }
@keyframes lowpulse {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.62; }
}

#flash {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 210, 160, 0.55), transparent 65%);
  mix-blend-mode: screen;
}
#flash.on { animation: flash 0.25s ease-out; }
@keyframes flash {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* ── Crosshair ────────────────────────────────────────────────── */

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 9;
  width: 80px;
  height: 80px;
  margin: -40px 0 0 -40px;
  pointer-events: none;
}
#reticle {
  width: 80px;
  height: 80px;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.9));
}

#hitmarker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  opacity: 0;
}
#hitmarker::before,
#hitmarker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 2px;
  margin: -1px 0 0 -12px;
  background: #fff8e7;
  box-shadow: 0 0 6px rgba(255, 240, 200, 0.8);
}
#hitmarker::before { transform: rotate(45deg); }
#hitmarker::after { transform: rotate(-45deg); }
#hitmarker.hit { animation: hitmark 0.1s ease-out; }
#hitmarker.kill::before, #hitmarker.kill::after { background: #ff3b2b; box-shadow: 0 0 8px rgba(255, 60, 30, 0.9); }
#hitmarker.kill { animation: hitmark 0.22s ease-out; }
@keyframes hitmark {
  0% { opacity: 1; transform: scale(0.8); }
  70% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1); }
}

/* ── Viewmodel & muzzle ───────────────────────────────────────── */

#viewmodel {
  position: absolute;
  left: 50%;
  bottom: 108px;
  z-index: 8;
  width: min(620px, 58vw);
  transform: translateX(-50%);
  pointer-events: none;
}
#weapon-canvas {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.6));
  will-change: transform;
}

#muzzle {
  position: absolute;
  left: 50%;
  bottom: 250px;
  z-index: 9;
  width: 250px;
  height: 250px;
  margin-left: -125px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 245, 190, 0.95) 0%, rgba(255, 160, 40, 0.75) 26%, rgba(255, 60, 10, 0.25) 52%, transparent 70%);
  mix-blend-mode: screen;
  filter: blur(1px);
}
#muzzle.fire { animation: muzzle 0.09s steps(2, end); }
@keyframes muzzle {
  0% { opacity: 1; transform: scale(0.55) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.1) rotate(4deg); }
  100% { opacity: 0; transform: scale(1.25) rotate(-3deg); }
}

/* ── Top bar ──────────────────────────────────────────────────── */

#game-hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

#topbar {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: stretch;
  gap: 6px;
  font-family: var(--pixel);
}

.top-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px 7px;
  background: linear-gradient(180deg, rgba(34, 24, 20, 0.92), rgba(10, 6, 5, 0.9));
  border: 1px solid rgba(138, 59, 36, 0.65);
  border-top-color: rgba(232, 176, 74, 0.35);
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  min-width: 92px;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.08), 0 2px 8px rgba(0, 0, 0, 0.45);
}
.top-label {
  font-size: 7px;
  letter-spacing: 0.1em;
  color: #b06a4a;
}
.top-value {
  font-size: 12px;
  color: var(--gold);
  text-shadow: 0 0 8px rgba(232, 176, 74, 0.25);
}
.phase-cell { min-width: 190px; }
.phase-value { font-size: 9px; line-height: 1.4; color: #f0d9a0; }
.top-spacer { flex: 1; }

/* ── Bottom HUD ───────────────────────────────────────────────── */

#bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 132px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 8px 10px 10px;
  background:
    linear-gradient(180deg, rgba(90, 54, 38, 0.95) 0%, rgba(30, 20, 16, 0.98) 12%, rgba(12, 8, 7, 0.99) 100%);
  border-top: 2px solid #6b3a28;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 200, 130, 0.1);
}

.hud-seg {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px 6px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 72, 48, 0.22), transparent 65%),
    linear-gradient(180deg, #1b1411 0%, #0e0a09 100%);
  border: 1px solid #38271f;
  border-top-color: #5a3f2f;
  box-shadow: inset 0 1px 0 rgba(255, 210, 150, 0.07), inset 0 -12px 24px rgba(0, 0, 0, 0.35);
  min-width: 0;
}
.hud-seg::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 3px;
  height: 2px;
  background: repeating-linear-gradient(90deg, #4a2f22 0 8px, transparent 8px 12px);
  opacity: 0.5;
}

.hud-label {
  font-family: var(--pixel);
  font-size: 7px;
  letter-spacing: 0.08em;
  color: #a55c3e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-hint { color: #5e4a3c; font-size: 6px; }
.hud-big {
  font-family: var(--pixel);
  font-size: 30px;
  line-height: 1.1;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(232, 176, 74, 0.25), 0 2px 0 #000;
  letter-spacing: 0.04em;
}
.hud-small {
  font-family: var(--pixel);
  font-size: 7px;
  color: #c9a06c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-tiny { font-family: var(--pixel); font-size: 6px; color: #ff5a44; height: 8px; }

.seg-ammo { flex: 1.05; }
.seg-health { flex: 0.8; }
.seg-health .hud-big { color: var(--green); }
.seg-health.warn .hud-big { color: #ffb038; }
.seg-health.crit .hud-big { color: #ff4130; animation: critblink 0.8s steps(2, end) infinite; }
@keyframes critblink { 50% { opacity: 0.55; } }
.seg-face {
  flex: 0 0 98px;
  padding: 6px;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #3a2118 0%, #140c09 75%);
}
#face {
  width: 68px;
  height: 68px;
  image-rendering: pixelated;
  border: 1px solid #5d3a28;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.6);
  background: #1a0e0a;
}
.seg-armor { flex: 0.78; }
.seg-armor .hud-big { color: var(--blue); }
.seg-weapons { flex: 1.45; }
.seg-build { flex: 1.85; }

#weapon-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.weapon-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 38px;
  border: 1px solid #3a2a22;
  background: linear-gradient(180deg, #221914, #120d0b);
  font-family: var(--pixel);
  font-size: 6px;
  color: #7e6757;
}
.weapon-slot .wnum { font-size: 7px; color: #a57a4d; }
.weapon-slot .wname { font-size: 6px; color: #b08a68; letter-spacing: 0.02em; }
.weapon-slot.active {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: linear-gradient(180deg, #43291a, #1e1109);
  box-shadow: 0 0 10px rgba(232, 176, 74, 0.2), inset 0 0 8px rgba(232, 176, 74, 0.12);
}
.weapon-slot.empty { opacity: 0.35; }
.weapon-slot.active .wnum { color: #fff0c0; }
.weapon-slot.active .wname { color: #ffe0a0; }

#block-slots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.block-slot {
  position: relative;
  height: 44px;
  border: 1px solid #3a2a22;
  background: linear-gradient(180deg, #221914, #120d0b);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.block-slot canvas {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  opacity: 0.9;
}
.block-slot .bcount {
  position: absolute;
  right: 2px;
  bottom: 1px;
  font-family: var(--pixel);
  font-size: 7px;
  color: #e8dcc0;
  text-shadow: 1px 1px 0 #000;
}
.block-slot.active {
  border-color: var(--green);
  box-shadow: 0 0 9px rgba(143, 191, 74, 0.25), inset 0 0 8px rgba(143, 191, 74, 0.12);
}
.block-slot.active canvas { opacity: 1; }
.block-slot.zero { opacity: 0.35; }
#block-name {
  color: #a8c96f;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0;
  margin-left: 4px;
}

/* ── Messages / banner / toast ────────────────────────────────── */

#messages {
  position: absolute;
  left: 22px;
  bottom: 152px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 520px;
  z-index: 11;
}
.msg {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.3;
  color: #e8dcc0;
  background: linear-gradient(90deg, rgba(10, 6, 5, 0.92), rgba(10, 6, 5, 0.35));
  border-left: 3px solid #8a3b24;
  padding: 4px 10px 4px 8px;
  text-shadow: 1px 1px 0 #000;
  animation: msgin 0.18s ease-out;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.msg.gold { border-left-color: var(--gold); color: #ffe2a0; }
.msg.green { border-left-color: var(--green); color: #d6f0a8; }
.msg.red { border-left-color: var(--blood); color: #ffb0a0; }
.msg.blue { border-left-color: var(--blue); color: #b8ddf5; }
.msg.fade { opacity: 0; transform: translateX(-10px); }
@keyframes msgin { from { opacity: 0; transform: translateX(-14px); } }

#banner {
  position: absolute;
  left: 0;
  right: 0;
  top: 24%;
  text-align: center;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 12;
}
#banner.show { opacity: 1; transform: scale(1); }
#banner-title {
  font-family: var(--pixel);
  font-size: clamp(20px, 3.4vw, 38px);
  letter-spacing: 0.08em;
  color: #ffd27a;
  padding: 0 4vw;
  line-height: 1.35;
  text-shadow:
    0 3px 0 #4b0d07,
    0 0 18px rgba(255, 70, 30, 0.5),
    0 0 60px rgba(194, 42, 30, 0.4);
}
#banner-sub {
  font-family: var(--pixel);
  font-size: clamp(8px, 1vw, 11px);
  color: #d09a62;
  margin-top: 14px;
  letter-spacing: 0.14em;
}

#toast {
  position: absolute;
  left: 50%;
  bottom: 196px;
  transform: translateX(-50%);
  font-family: var(--pixel);
  font-size: 12px;
  color: #c8f08a;
  text-shadow: 0 2px 0 #000, 0 0 14px rgba(143, 191, 74, 0.45);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 12;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
#toast.gold { color: #ffd27a; text-shadow: 0 2px 0 #000, 0 0 14px rgba(232, 176, 74, 0.45); }
#toast.red { color: #ff8a72; text-shadow: 0 2px 0 #000, 0 0 14px rgba(194, 42, 30, 0.5); }

/* ── Overlay screens ──────────────────────────────────────────── */

#overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

#screen-loading {
  background: radial-gradient(circle at 50% 45%, #2a0c07 0%, #0a0504 65%);
}
.load-wrap { text-align: center; }
.load-title {
  font-family: var(--pixel);
  font-size: clamp(26px, 4vw, 48px);
  color: var(--gold);
  text-shadow: 0 0 30px rgba(194, 42, 30, 0.5);
  margin-bottom: 28px;
}
.load-bar {
  width: min(360px, 70vw);
  height: 8px;
  margin: 0 auto;
  border: 1px solid #603a28;
  background: #160d09;
  overflow: hidden;
}
.load-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--blood), var(--gold));
  animation: load 1.1s ease-in-out infinite;
}
@keyframes load { 0% { transform: translateX(-110%); } 100% { transform: translateX(360%); } }
.load-text {
  margin-top: 18px;
  font-family: var(--pixel);
  font-size: 8px;
  color: #a56a4a;
  letter-spacing: 0.16em;
}

#screen-title {
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(8, 4, 4, 0.55) 0%, rgba(8, 4, 4, 0.28) 38%, rgba(8, 4, 4, 0.88) 100%),
    radial-gradient(ellipse at 50% 20%, transparent 0%, rgba(60, 10, 6, 0.25) 60%, rgba(5, 3, 3, 0.8) 100%);
  align-items: flex-start;
  padding-top: max(4vh, 24px);
}
.title-wrap {
  padding-bottom: 42px;
  width: min(920px, 92vw);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.episode {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #a86a4c;
  margin-bottom: 18px;
  text-shadow: 0 2px 0 #000;
}
.logo {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(42px, 8.4vw, 104px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff1c0 0%, #e8b04a 32%, #c22a1e 68%, #68130c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 0 #2a0704) drop-shadow(0 0 40px rgba(194, 42, 30, 0.45));
}
.logo span { display: inline-block; }
.tagline {
  font-family: var(--pixel);
  font-size: clamp(8px, 1.15vw, 12px);
  letter-spacing: 0.22em;
  color: #d8b078;
  margin: 24px 0 30px;
  text-shadow: 0 2px 0 #000;
}
.title-actions { display: flex; flex-direction: column; gap: 10px; width: min(420px, 84vw); }

.btn {
  pointer-events: auto;
  font-family: var(--pixel);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: #f2dfb8;
  padding: 15px 20px;
  border: 1px solid #7a4a30;
  background: linear-gradient(180deg, #3a2419 0%, #1b100c 55%, #100a08 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 210, 150, 0.18),
    inset 0 -2px 0 rgba(0, 0, 0, 0.5),
    0 3px 0 #0a0605,
    0 8px 20px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.06s ease, border-color 0.12s ease;
  text-shadow: 0 2px 0 #000;
}
.btn:hover { filter: brightness(1.25); border-color: #c98a52; }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 210, 150, 0.12), 0 1px 0 #0a0605; }
.btn-primary {
  color: #fff3cf;
  border-color: #b5552c;
  background:
    linear-gradient(180deg, rgba(255, 190, 90, 0.18), transparent 45%),
    linear-gradient(180deg, #6e2214 0%, #3a100a 60%, #240a06 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 160, 0.25),
    inset 0 -3px 0 rgba(0, 0, 0, 0.45),
    0 3px 0 #140402,
    0 0 26px rgba(194, 42, 30, 0.25);
}
.btn-primary:hover { border-color: #ff9b5a; filter: brightness(1.32); }
.btn-ghost { color: #c9a887; font-size: 8px; padding: 12px 18px; }
.btn-danger { color: #e8a090; border-color: #7a2a20; font-size: 8px; padding: 12px 18px; }

.panel {
  width: min(720px, 92vw);
  margin-top: 22px;
  padding: 22px 24px;
  text-align: left;
  background: linear-gradient(180deg, rgba(26, 15, 11, 0.94), rgba(9, 5, 4, 0.95));
  border: 1px solid #6a3c28;
  box-shadow: inset 0 1px 0 rgba(255, 210, 150, 0.08), 0 18px 60px rgba(0, 0, 0, 0.55);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.panel-title {
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}
.panel-title.big { font-size: 24px; }
.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 18px;
}
.controls-grid > div { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #cbb79b; }
kbd {
  font-family: var(--pixel);
  font-size: 6px;
  color: #f0d9a0;
  background: #21150f;
  border: 1px solid #5a3828;
  border-bottom-width: 2px;
  padding: 5px 6px;
  white-space: nowrap;
  min-width: 48px;
  text-align: center;
}
.panel-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid #3a241a;
  font-size: 12px;
  line-height: 1.55;
  color: #a98f74;
}
.title-foot {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  align-items: center;
  font-family: var(--pixel);
  font-size: 6px;
  color: #6e5342;
  letter-spacing: 0.1em;
}
.foot-dot { color: #7a1e14; font-size: 8px; }

/* ── Pause ────────────────────────────────────────────────────── */

#screen-pause {
  background: radial-gradient(circle at center, rgba(30, 8, 5, 0.55), rgba(4, 2, 2, 0.94));
  backdrop-filter: blur(3px);
}
.pause-wrap { text-align: center; width: min(600px, 90vw); padding: 34px 36px; margin: 0; }
.pause-sub { font-family: var(--pixel); font-size: 8px; letter-spacing: 0.2em; color: #9a6a50; margin: 10px 0 26px; }
.pause-actions { display: flex; flex-direction: column; gap: 10px; width: min(360px, 100%); margin: 0 auto; }
.pause-controls {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #3a241a;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  font-size: 11px;
  color: #a98f74;
}
.pause-controls span { display: flex; align-items: center; gap: 6px; }

/* ── Death / victory ──────────────────────────────────────────── */

#screen-dead {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(140, 15, 5, 0.35), transparent 55%),
    linear-gradient(180deg, rgba(10, 3, 2, 0.9), rgba(24, 2, 1, 0.96));
}
#screen-victory {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(220, 150, 40, 0.22), transparent 55%),
    linear-gradient(180deg, rgba(8, 6, 2, 0.9), rgba(14, 10, 2, 0.96));
}
.end-wrap { text-align: center; width: min(640px, 90vw); }
.end-kicker {
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: #b3523c;
  margin-bottom: 18px;
}
.end-title {
  font-family: var(--pixel);
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.15;
  margin: 0;
  color: #f0dcb4;
  text-shadow: 0 4px 0 #2a0704, 0 0 30px rgba(194, 42, 30, 0.35);
}
.end-title span { color: var(--blood); }
.end-sub { font-size: 13px; line-height: 1.6; color: #a98f74; margin: 18px 0 26px; }
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 22px;
  width: min(420px, 100%);
  margin: 0 auto 28px;
  padding: 18px 22px;
  background: rgba(8, 5, 4, 0.55);
  border: 1px solid #4a2c20;
  text-align: left;
}
.stat { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: #a98f74; }
.stat b { font-family: var(--pixel); font-size: 9px; color: var(--gold); font-weight: 400; }
.victory .end-kicker { color: var(--gold); }

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 1100px) {
  #bottom { height: 118px; padding: 6px 8px 8px; }
  .hud-big { font-size: 24px; }
  .hud-label { font-size: 6px; }
  .seg-face { flex-basis: 82px; }
  #face { width: 58px; height: 58px; }
  .weapon-slot { height: 34px; font-size: 5px; }
  #block-slots .block-slot { height: 38px; }
  .block-slot canvas { width: 26px; height: 26px; }
  #viewmodel { bottom: 96px; }
  #messages { bottom: 132px; }
}

@media (max-width: 820px) {
  #bottom { height: 104px; }
  .seg-weapons .hud-small, .seg-ammo .hud-small { display: none; }
  .seg-ammo { flex: 0.9; }
  .seg-face { flex-basis: 68px; }
  #face { width: 48px; height: 48px; }
  .hud-big { font-size: 19px; }
  .hud-label { font-size: 5px; }
  .weapon-slot { height: 28px; }
  .weapon-slot .wname { font-size: 5px; }
  .block-slot { height: 32px; }
  .block-slot canvas { width: 22px; height: 22px; }
  .controls-grid { grid-template-columns: 1fr 1fr; }
  #viewmodel { width: 74vw; bottom: 82px; }
  #muzzle { bottom: 190px; width: 170px; height: 170px; margin-left: -85px; }
  #topbar { top: 8px; left: 8px; right: 8px; gap: 3px; }
  .top-cell { padding: 6px 8px; min-width: 60px; }
  .top-value { font-size: 9px; }
  .top-label { font-size: 5px; }
  .phase-cell { min-width: 120px; }
  .phase-value { font-size: 6px; }
  #messages { left: 10px; bottom: 116px; max-width: 80vw; }
  .msg { font-size: 10px; }
}
