:root {
  --bg: #0b0c09;
  --olive: #9aaa4a;
  --olive-dim: #5a6430;
  --rust: #b44a22;
  --rust-deep: #3a1a10;
  --hazard: #e6c12a;
  --crt: #d8e26a;
  --smoke: #1a1e18;
  --panel: rgba(18, 14, 10, 0.88);
  --ink: #e8dcc0;
  --muted: #8a8070;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Share Tech Mono", "Courier New", ui-monospace, monospace;
  cursor: crosshair;
  user-select: none;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.14) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.45;
}

body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 41;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
}

#view {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #1a1e18;
}

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

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
}

#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: var(--hazard);
  box-shadow: 0 0 6px #e6c12a;
}

#crosshair::before {
  left: 7px;
  top: 0;
  width: 2px;
  height: 18px;
}

#crosshair::after {
  left: 0;
  top: 8px;
  width: 18px;
  height: 2px;
}

#hp {
  position: absolute;
  left: 28px;
  bottom: 26px;
  font-family: "Black Ops One", Impact, sans-serif;
  font-size: 64px;
  line-height: 0.85;
  color: var(--hazard);
  text-shadow:
    0 0 12px rgba(230, 193, 42, 0.55),
    3px 3px 0 #3a1a10;
  letter-spacing: 2px;
}

#hp.low {
  color: var(--rust);
  text-shadow:
    0 0 16px rgba(180, 74, 34, 0.8),
    3px 3px 0 #1a0804;
}

#hp::after {
  content: "HP";
  display: block;
  font-family: "Share Tech Mono", monospace;
  font-size: 14px;
  letter-spacing: 6px;
  color: var(--olive);
  text-shadow: none;
  margin-top: 4px;
}

#ammo {
  position: absolute;
  left: 150px;
  bottom: 38px;
  font-family: "Black Ops One", Impact, sans-serif;
  font-size: 28px;
  line-height: 0.9;
  color: var(--olive);
  text-shadow:
    0 0 10px rgba(154, 170, 74, 0.55),
    2px 2px 0 #1a1408;
  letter-spacing: 3px;
}

#ammo::after {
  content: "LMB";
  display: block;
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--rust);
  text-shadow: none;
  margin-top: 6px;
}

#ammo.muted {
  color: var(--muted);
  text-shadow: 2px 2px 0 #1a1408;
}

#timer {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px 7px;
  border: 1px solid var(--olive-dim);
  background: rgba(12, 14, 9, 0.72);
  color: var(--crt);
  font-size: 15px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

#ping {
  position: absolute;
  top: 18px;
  right: 22px;
  color: var(--olive);
  font-size: 13px;
  letter-spacing: 2px;
}

#feed {
  position: absolute;
  top: 54px;
  right: 22px;
  width: 320px;
  text-align: right;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  text-shadow: 0 1px 0 #000;
}

#feed .row {
  opacity: 0.95;
}

#feed .row b {
  color: var(--hazard);
  font-weight: 400;
}

#feed .row em {
  color: var(--rust);
  font-style: normal;
}

#banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Black Ops One", Impact, sans-serif;
  font-size: 42px;
  letter-spacing: 6px;
  color: var(--hazard);
  text-shadow: 0 0 18px rgba(230, 193, 42, 0.45), 4px 4px 0 #2a1408;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s linear;
  white-space: nowrap;
}

#banner.show {
  opacity: 1;
}

#banner.blood {
  color: var(--rust);
}

#scoreboard {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 460px;
  padding: 18px 22px 16px;
  background: var(--panel);
  border: 2px solid var(--hazard);
  box-shadow: 0 0 0 6px rgba(180, 74, 34, 0.25);
}

#scoreboard.open {
  display: block;
}

#scoreboard h2 {
  font-family: "Black Ops One", Impact, sans-serif;
  font-size: 18px;
  letter-spacing: 4px;
  color: var(--hazard);
  margin-bottom: 10px;
}

#scoreboard table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#scoreboard th {
  text-align: left;
  color: var(--olive);
  font-weight: 400;
  letter-spacing: 2px;
  padding: 4px 8px 8px 0;
  border-bottom: 1px solid var(--olive-dim);
}

#scoreboard th.n,
#scoreboard td.n {
  text-align: right;
}

#scoreboard td {
  padding: 6px 8px 6px 0;
  color: var(--ink);
}

#scoreboard tr.me td {
  color: var(--hazard);
}

#dmg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(140, 16, 8, 0.78) 100%);
  opacity: 0;
  transition: opacity 0.12s linear;
}

#dmg.flash {
  opacity: 1;
  transition: none;
}

#hitmark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 0;
}

#hitmark.on {
  opacity: 1;
}

#hitmark::before,
#hitmark::after {
  content: "";
  position: absolute;
  background: #fff6c2;
  box-shadow: 0 0 8px #fff;
}

#hitmark::before {
  left: 12px;
  top: 0;
  width: 4px;
  height: 28px;
}

#hitmark::after {
  left: 0;
  top: 12px;
  width: 28px;
  height: 4px;
}

#overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(12, 10, 8, 0.55), rgba(12, 10, 8, 0.28) 40%, rgba(12, 10, 8, 0.72)),
    repeating-linear-gradient(
      -18deg,
      transparent 0 18px,
      rgba(180, 74, 34, 0.05) 18px 20px
    );
}

#overlay.playing {
  background: transparent;
  justify-content: flex-end;
  pointer-events: none;
}

#overlay.playing .join-card,
#overlay.playing .hazard-bar {
  display: none;
}

#overlay.playing #lockhint {
  display: block;
  pointer-events: none;
}

#overlay.hidden,
#overlay.playing.locked #lockhint {
  display: none;
}

.hazard-bar {
  height: 18px;
  background: repeating-linear-gradient(
    -28deg,
    var(--hazard) 0 16px,
    #16140c 16px 32px
  );
  box-shadow: inset 0 0 0 2px #2a2208;
}

.hazard-bar.bottom {
  transform: scaleY(-1);
}

.join-card {
  align-self: center;
  width: min(520px, calc(100% - 40px));
  padding: 28px 32px 26px;
  background: var(--panel);
  border: 1px solid var(--rust);
  box-shadow:
    0 0 0 8px rgba(58, 26, 16, 0.55),
    0 24px 60px rgba(0, 0, 0, 0.55);
}

.kicker {
  color: var(--olive);
  letter-spacing: 3px;
  font-size: 11px;
  margin-bottom: 8px;
}

.join-card h1 {
  font-family: "Black Ops One", Impact, sans-serif;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 0.95;
  color: var(--hazard);
  text-shadow: 3px 3px 0 var(--rust-deep);
  margin-bottom: 10px;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.nick-label {
  display: block;
  color: var(--olive);
  font-size: 11px;
  letter-spacing: 3px;
  margin-bottom: 6px;
}

#nick {
  width: 100%;
  padding: 10px 12px;
  background: #100e0a;
  border: 1px solid var(--olive-dim);
  color: var(--hazard);
  font: 18px "Share Tech Mono", monospace;
  letter-spacing: 2px;
  outline: none;
  cursor: text;
}

#nick:focus {
  border-color: var(--hazard);
}

#enter {
  width: 100%;
  margin-top: 14px;
  padding: 12px 16px;
  border: 0;
  background: var(--rust);
  color: #1a0804;
  font-family: "Black Ops One", Impact, sans-serif;
  font-size: 20px;
  letter-spacing: 3px;
  cursor: pointer;
}

#enter:hover {
  background: var(--hazard);
}

.hints {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  list-style: none;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.hints kbd {
  display: inline-block;
  min-width: 52px;
  margin-right: 6px;
  padding: 1px 6px;
  border: 1px solid var(--olive-dim);
  color: var(--crt);
  font: 11px "Share Tech Mono", monospace;
}

#lockhint {
  display: none;
  align-self: center;
  margin-bottom: 48px;
  padding: 8px 16px;
  background: rgba(12, 10, 8, 0.8);
  border: 1px solid var(--olive-dim);
  color: var(--hazard);
  letter-spacing: 3px;
  font-size: 13px;
}
