* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #14171c;
  color: #f4f1ea;
  font-family: "Avenir Next Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  touch-action: none;
}

#view {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

#hurt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 42%, rgba(168, 24, 24, 0.72) 100%);
  opacity: 0;
}

#hurt.on {
  opacity: 1;
}

#crosshair {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65);
}

#crosshair::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 50%;
}

#crosshair.hot {
  border-color: #f0a202;
}

#crosshair.hot::after {
  background: #f0a202;
}

body:has(#overlay:not(.hidden)) #crosshair {
  opacity: 0;
}

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

#topbar,
#bottombar {
  position: absolute;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#topbar {
  top: 10px;
}

#bottombar {
  bottom: 12px;
}

#brand {
  letter-spacing: 0.18em;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.8;
}

#timer,
#score,
#ammo,
#hp-num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

#timer {
  font-size: 22px;
  color: #f0a202;
}

#timer.low {
  color: #ff5a4a;
}

#score {
  min-width: 1.5em;
  text-align: right;
  font-size: 18px;
}

#hp-wrap {
  position: relative;
  width: 116px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.4);
}

#hp-fill {
  height: 100%;
  width: 100%;
  background: #7dcea0;
  transform-origin: left center;
}

#hp-fill.low {
  background: #e24b4b;
}

#hp-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.04em;
}

#ammo {
  font-size: 18px;
  letter-spacing: 0.04em;
}

#ammo.reloading {
  color: #f0a202;
}

#look-hint {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 3;
  padding: 6px 10px;
  background: rgba(10, 12, 16, 0.72);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

body.playing:not(.touch) #look-hint {
  display: block;
}

body.playing.locked #look-hint {
  display: none;
}

#touch-ui {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

body.touch.playing #touch-ui {
  display: block;
}

#stick-zone {
  position: absolute;
  left: 8px;
  bottom: 36px;
  width: 132px;
  height: 132px;
  pointer-events: auto;
  display: grid;
  place-items: center;
}

#stick-base {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(8, 10, 14, 0.4);
  position: relative;
}

#stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42px;
  height: 42px;
  margin: -21px 0 0 -21px;
  border-radius: 50%;
  background: rgba(240, 162, 2, 0.9);
}

#actions {
  position: absolute;
  right: 14px;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

#fire,
#reload,
#play-btn {
  border: 0;
  color: #14171c;
  background: #f0a202;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
}

#fire {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  font-size: 14px;
}

#reload {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(244, 241, 234, 0.88);
  font-size: 16px;
}

#fire:active,
#reload:active,
#play-btn:active {
  transform: scale(0.96);
}

#overlay {
  position: fixed;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.45);
}

#overlay.hidden {
  display: none;
}

.card {
  width: min(320px, calc(100% - 32px));
  padding: 22px 20px 18px;
  text-align: center;
  background: rgba(16, 18, 24, 0.88);
  border: 1px solid rgba(240, 162, 2, 0.45);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f0a202;
}

h1 {
  margin: 6px 0 8px;
  font-size: 42px;
  letter-spacing: 0.14em;
  font-weight: 800;
}

#overlay-text {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.35;
  color: rgba(244, 241, 234, 0.86);
}

#play-btn {
  min-width: 140px;
  padding: 12px 22px;
  font-size: 16px;
}

body.playing #bottombar {
  bottom: 14px;
}

body.touch.playing #bottombar {
  bottom: auto;
  top: 36px;
  left: 12px;
  right: auto;
  width: auto;
  gap: 10px;
}

body.touch.playing #topbar {
  right: 12px;
}
