:root {
  color-scheme: dark;
  --ink: #14171c;
  --paper: #efe7da;
  --line: rgba(239, 231, 218, 0.28);
  --signal: #ff6a2a;
  --teal: #7fd1c7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
}

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

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

body.playing { cursor: none; }

.hidden { display: none !important; }

#menu {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 6vh 0 6vh 7vw;
  background:
    linear-gradient(90deg, rgba(14, 16, 20, 0.94) 0%, rgba(14, 16, 20, 0.84) 32%, rgba(14, 16, 20, 0.22) 64%, rgba(14, 16, 20, 0.02) 100%);
}

.panel, .card {
  width: min(440px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  max-height: calc(100vh - 8vh);
  overflow: auto;
  padding-right: 8px;
}

.custom-guns {
  display: grid;
  gap: 8px;
  padding-left: 8px;
}

#knife-note {
  margin: 0;
  font-size: 13px;
  color: var(--teal);
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--signal);
}

a.back {
  width: fit-content;
  color: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-underline-offset: 3px;
}

h1 {
  margin: 0;
  font-family: Didot, "Songti SC", "STSong", serif;
  font-size: 74px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 0.9;
}

h2 {
  margin: 0;
  font-family: Didot, "Songti SC", serif;
  font-size: 42px;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.lead, .help, #career, #result-sub {
  margin: 0;
  color: rgba(239, 231, 218, 0.72);
  line-height: 1.55;
}

.help {
  padding: 0;
  list-style: none;
  font-size: 13px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
}

input[type="text"], input:not([type]), select, #pname {
  height: 40px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--signal);
}

button {
  height: 44px;
  border: 0;
  background: var(--signal);
  color: #1a100c;
  letter-spacing: 0.12em;
  font-weight: 700;
}

button.ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}

#pause, #result {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.46);
}

.card {
  width: min(420px, calc(100vw - 36px));
  padding: 28px 26px;
  background: rgba(16, 18, 22, 0.92);
  border: 1px solid var(--line);
}

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

#top {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

#timer {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

#scoreline {
  font-size: 14px;
  letter-spacing: 0.12em;
  opacity: 0.85;
}

#feed {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  font-size: 13px;
}

#feed div {
  background: rgba(10, 12, 16, 0.48);
  padding: 4px 8px;
  animation: fadeout 4.2s linear forwards;
}

#feed .dim { opacity: 0.7; }

@keyframes fadeout {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

#nameplate {
  position: absolute;
  left: 50%;
  top: calc(50% + 28px);
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 0.12em;
}

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  --gap: 7px;
}

#crosshair span {
  position: absolute;
  background: #f4efe6;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.85);
}

#crosshair.hot span { background: #ffb09a; }

#crosshair span:nth-child(1) { width: 8px; height: 2px; left: calc(-1 * var(--gap) - 8px); top: -1px; }
#crosshair span:nth-child(2) { width: 8px; height: 2px; left: var(--gap); top: -1px; }
#crosshair span:nth-child(3) { width: 2px; height: 8px; top: calc(-1 * var(--gap) - 8px); left: -1px; }
#crosshair span:nth-child(4) { width: 2px; height: 8px; top: var(--gap); left: -1px; }

#scope {
  position: absolute;
  inset: 0;
}

#scope.dot {
  background:
    radial-gradient(circle at center, #ff3b2a 0 2.5px, transparent 3.5px),
    radial-gradient(circle at center, transparent 0 42px, rgba(12, 14, 16, 0.45) 43px 78px, rgba(12, 14, 16, 0.12) 79px);
}

#scope.glass {
  background:
    linear-gradient(#efe7da, #efe7da) center / 2px 22px no-repeat,
    linear-gradient(#efe7da, #efe7da) center / 22px 2px no-repeat,
    radial-gradient(circle at center, #efe7da 0 1.5px, transparent 2.5px),
    radial-gradient(circle at center, transparent 0 32%, rgba(6, 8, 10, 0.94) 37%);
}

#hitmark {
  position: absolute;
  width: 10px;
  height: 10px;
  left: -5px;
  top: -5px;
  opacity: 0;
  border: 2px solid #fff;
  transform: rotate(45deg) scale(0.6);
}

#hitmark.show { animation: ping 0.18s ease-out; }
#hitmark.head { border-color: #ffd36a; }

@keyframes ping {
  from { opacity: 1; transform: rotate(45deg) scale(0.5); }
  to { opacity: 0; transform: rotate(45deg) scale(1.15); }
}

#death {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  text-align: center;
}

#death p { margin: 0 0 6px; letter-spacing: 0.16em; }
#death strong { font-size: 42px; font-variant-numeric: tabular-nums; }

#board {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 320px;
  padding: 16px 18px 12px;
  background: rgba(10, 12, 16, 0.84);
  border: 1px solid var(--line);
}

#board h3 {
  margin: 0 0 10px;
  letter-spacing: 0.16em;
  font-size: 14px;
  font-weight: 600;
}

.row, #result-list .row {
  display: grid;
  grid-template-columns: 1fr 36px 36px;
  gap: 8px;
  padding: 4px 0;
  font-variant-numeric: tabular-nums;
}

.row.head, #result-list .head { opacity: 0.55; font-size: 12px; }
.row.me { color: #fff; }

#result-list { margin: 8px 0 4px; }

#slots {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(239, 231, 218, 0.45);
}

#slots .on {
  color: var(--paper);
  box-shadow: inset 0 -2px 0 var(--signal);
}

#bottom {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

#minimap {
  width: 148px;
  height: 148px;
  border: 1px solid var(--line);
  background: rgba(8, 10, 14, 0.28);
}

#hpnum, #mag {
  font-size: 42px;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

#hpbar {
  width: 150px;
  height: 6px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.14);
}

#hpfill {
  display: block;
  height: 100%;
  width: 100%;
  background: #e7d7b4;
  transform-origin: left center;
}

#hpfill.low { background: #ff5a3c; }

#guard {
  display: block;
  min-height: 16px;
  margin-top: 4px;
  letter-spacing: 0.08em;
  color: var(--teal);
}

#ammo { text-align: right; min-width: 120px; }

#wname {
  display: block;
  margin-bottom: 4px;
  letter-spacing: 0.16em;
  font-size: 12px;
}

#reserve { margin-left: 8px; opacity: 0.7; }

#reloadbar {
  display: block;
  height: 3px;
  width: 0;
  margin: 6px 0 0 auto;
  background: var(--signal);
}

#vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(120, 16, 10, 0.72) 100%);
  opacity: 0;
}

#lockhint, #boot {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 12px;
  background: rgba(10, 12, 16, 0.8);
  letter-spacing: 0.08em;
  font-size: 13px;
}

#boot { z-index: 5; }

@media (max-width: 760px) {
  h1 { font-size: 64px; }
  #menu { padding-left: 24px; }
  #minimap { width: 96px; height: 96px; }
  #slots { display: none; }
}
