:root {
  --ink: #140e0c;
  --paper: #f3e6c4;
  --gold: #e0b14a;
  --blood: #b01018;
  --dim: rgba(12, 8, 6, 0.78);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #050308;
  color: var(--paper);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", "Trebuchet MS", sans-serif;
  user-select: none;
}

canvas { display: block; width: 100%; height: 100%; }

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 2px;
  transform: translate(-50%, -50%);
}
.crosshair .tick {
  position: absolute;
  background: rgba(245, 245, 245, 0.92);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}
.crosshair .u { width: 2px; height: 9px; left: 0; top: -16px; }
.crosshair .d { width: 2px; height: 9px; left: 0; top: 9px; }
.crosshair .l { width: 9px; height: 2px; left: -16px; top: 0; }
.crosshair .r { width: 9px; height: 2px; left: 9px; top: 0; }
.crosshair.hit .tick { background: #ff3a3a; }

/* CoD-style four-tick X that flashes on a confirmed hit; red on a kill */
.hitmarker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.hitmarker.show { opacity: 1; animation: hm-pop 120ms ease-out; }
.hitmarker .x {
  position: absolute;
  width: 2px;
  height: 10px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
  transform-origin: 50% 50%;
}
.hitmarker .a { left: -1px; top: -5px; transform: translate(-9px, -9px) rotate(45deg); }
.hitmarker .b { left: -1px; top: -5px; transform: translate(9px, -9px) rotate(-45deg); }
.hitmarker .c { left: -1px; top: -5px; transform: translate(-9px, 9px) rotate(-45deg); }
.hitmarker .d { left: -1px; top: -5px; transform: translate(9px, 9px) rotate(45deg); }
.hitmarker.kill .x { background: #ff2a2a; height: 12px; }
@keyframes hm-pop {
  from { transform: scale(1.35); }
  to { transform: scale(1); }
}

.round {
  position: absolute;
  left: 28px;
  bottom: 18px;
  font-size: 108px;
  font-weight: 400;
  letter-spacing: -0.04em;
  color: var(--blood);
  text-shadow: 0 3px 0 #1a0506, 0 0 18px rgba(176, 16, 24, 0.85);
  line-height: 0.85;
}

.points {
  position: absolute;
  left: 30px;
  bottom: 128px;
  font-size: 30px;
  letter-spacing: 0.04em;
  color: #7ad07a;
  text-shadow: 0 2px 0 #041004, 0 0 10px rgba(40, 120, 40, 0.45);
}

.ammo {
  position: absolute;
  right: 28px;
  bottom: 22px;
  text-align: right;
}
.ammo .clip { font-size: 56px; line-height: 0.9; letter-spacing: -0.03em; }
.ammo .pool { font-size: 20px; opacity: 0.7; }
.ammo .gun {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: "Trebuchet MS", sans-serif;
}

.prompt {
  position: absolute;
  left: 50%;
  bottom: 22%;
  transform: translateX(-50%);
  background: var(--dim);
  border: 1px solid var(--gold);
  padding: 10px 18px;
  font-size: 16px;
  opacity: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}
.prompt.show { opacity: 1; }

.who {
  position: absolute;
  top: 20px;
  left: 26px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}
.who span { display: block; font-size: 12px; opacity: 0.75; letter-spacing: 0.18em; }

.drops {
  position: absolute;
  top: 20px;
  right: 26px;
  text-align: right;
  font-size: 16px;
  color: var(--gold);
}

.zone {
  position: absolute;
  top: 44px;
  right: 26px;
  font-size: 11px;
  letter-spacing: 0.26em;
  color: rgba(243, 230, 196, 0.55);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.hurt {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, transparent 42%, rgba(90, 0, 8, 0.72) 100%),
    linear-gradient(180deg, rgba(80, 0, 0, 0.2), transparent 18%, transparent 82%, rgba(40, 0, 0, 0.28));
  opacity: 0;
}

.round-flash {
  position: absolute;
  left: 50%;
  top: 28%;
  transform: translateX(-50%);
  font-size: 64px;
  font-weight: 800;
  color: var(--blood);
  text-shadow: 0 4px 0 #2a0a0c;
  opacity: 0;
  pointer-events: none;
}
.round-flash.show {
  animation: roundPop 1.35s ease-out;
}
@keyframes roundPop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.55); }
  18% { opacity: 1; transform: translateX(-50%) scale(1.12); }
  100% { opacity: 0; transform: translateX(-50%) scale(1); }
}

#start, #over {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(5, 3, 8, 0.35), rgba(5, 3, 8, 0.72)),
    radial-gradient(circle at 50% 28%, rgba(224, 177, 74, 0.1), transparent 44%);
  text-align: center;
  padding: 24px;
  overflow: auto;
}

#over { display: none; }

h1 {
  font-size: clamp(36px, 7vw, 78px);
  letter-spacing: 0.08em;
}

.sub {
  margin-top: 6px;
  color: var(--gold);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: 12px;
}

.blurb {
  max-width: 620px;
  margin: 18px 0 22px;
  line-height: 1.5;
  color: #d7c7a8;
}

.crew {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 920px;
  margin-bottom: 22px;
  pointer-events: auto;
}

.crew button.card {
  width: 162px;
  padding: 8px 8px 12px;
  background: #1a1210;
  border: 2px solid #5a4630;
  color: var(--paper);
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 14px;
  cursor: pointer;
}
.crew button.card.picked { border-color: var(--gold); }
.crew button.card img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  object-position: center top;
  image-rendering: auto;
  background: #0e0a08;
}
.crew button.card strong { display: block; margin-top: 6px; color: var(--gold); }
.crew button.card em { display: block; font-style: normal; font-size: 11px; opacity: 0.75; line-height: 1.35; padding: 0 4px; }

button.go {
  pointer-events: auto;
  background: var(--blood);
  color: var(--paper);
  border: 0;
  padding: 14px 36px;
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
button.go:hover { filter: brightness(1.12); }

.hint {
  margin-top: 20px;
  font-size: 13px;
  color: #a89880;
  line-height: 1.6;
}
.hint a { color: var(--gold); }

#hud.hidden, #start.hidden, #over.hidden { display: none; }

.scare {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  background: #100000;
  pointer-events: none;
}
.scare.go { display: flex; }
.scare img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  filter: contrast(1.25) saturate(0.7);
}
