:root {
  --ct: #5b8cff;
  --t: #e09a3e;
  --ink: #0b0d10;
  --paper: #e8edf3;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: Tahoma, "Segoe UI", sans-serif;
  user-select: none;
  cursor: crosshair;
}

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

#radar {
  position: fixed;
  left: 14px;
  top: 14px;
  z-index: 6;
  width: 176px;
  height: 176px;
  opacity: 0.82;
  pointer-events: none;
  background: rgba(6, 10, 16, 0.72);
  border: 1px solid rgba(180, 200, 220, 0.28);
}

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

#scorebar {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 #000, 0 0 12px #000;
}

#clock {
  min-width: 92px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.team-ct {
  color: var(--ct);
}
.team-t {
  color: var(--t);
}

#roundNum {
  position: absolute;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.22em;
  opacity: 0.7;
}

#fps {
  position: absolute;
  left: 18px;
  top: 198px;
  font-size: 11px;
  letter-spacing: 0.14em;
  opacity: 0.45;
}

#killfeed {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 280px;
  text-align: right;
  font-size: 13px;
  line-height: 1.55;
  text-shadow: 0 1px 2px #000;
}

#killfeed div {
  opacity: 0.95;
}

#hpbox {
  position: absolute;
  left: 18px;
  bottom: 18px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 #000;
}

#hpbox .lab {
  font-size: 11px;
  opacity: 0.55;
  margin-left: 8px;
}

#money {
  position: absolute;
  left: 18px;
  bottom: 56px;
  color: #d6e24a;
  font-size: 20px;
  font-weight: 700;
  text-shadow: 0 1px 0 #000;
}

#ammoBox {
  position: absolute;
  right: 18px;
  bottom: 18px;
  text-align: right;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 0 #000;
}

#weaponName {
  display: block;
  font-size: 12px;
  letter-spacing: 0.18em;
  opacity: 0.65;
  margin-bottom: 2px;
}

#hint {
  position: absolute;
  left: 50%;
  bottom: 54px;
  transform: translateX(-50%);
  width: min(520px, 54vw);
  font-size: 10px;
  letter-spacing: 0.05em;
  opacity: 0.38;
  text-align: center;
  line-height: 1.45;
  white-space: normal;
}

#useBar {
  position: absolute;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  width: 240px;
}

.use-label {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.2em;
  margin-bottom: 6px;
}

.use-track {
  height: 8px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.use-track i {
  display: block;
  height: 100%;
  width: 0;
  background: #d6e24a;
}

#crosshair {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 6;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  opacity: 0.8;
}

.ch {
  position: absolute;
  background: #d6e24a;
  box-shadow: 0 0 4px #000;
}
.ch.h {
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
}
.ch.v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
}
.ch.dot {
  width: 3px;
  height: 3px;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

#hitmark {
  pointer-events: none;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 7;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid #d6e24a;
  transform: rotate(45deg);
  opacity: 0;
}

#hurt {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 4;
  background: radial-gradient(circle, transparent 36%, rgba(140, 0, 0, 0.55));
  opacity: 0;
}

#flash {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 4;
  background: radial-gradient(circle at 50% 58%, rgba(255, 230, 180, 0.4), transparent 42%);
  opacity: 0;
}

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

#scope.on {
  display: block;
}

#scope .scope-mask {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle min(36vh, 32vw) at 50% 50%,
    transparent 0 96.4%,
    rgba(0, 0, 0, 0.78) 98.2%,
    #000 100%
  );
}

#scope .scope-rim {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72vh, 64vw);
  height: min(72vh, 64vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px #050505, inset 0 0 34px 12px rgba(0, 0, 0, 0.55);
}

#scope .scope-reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(72vh, 64vw);
  height: min(72vh, 64vw);
  transform: translate(-50%, -50%);
}

#scope .scope-hair {
  position: absolute;
  background: #050505;
}

#scope .scope-hair.h {
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: linear-gradient(
    to right,
    #050505 0 calc(50% - 5px),
    transparent calc(50% - 4px) calc(50% + 4px),
    #050505 calc(50% + 5px) 100%
  );
}

#scope .scope-hair.v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(
    to bottom,
    #050505 0 calc(50% - 5px),
    transparent calc(50% - 4px) calc(50% + 4px),
    #050505 calc(50% + 5px) 100%
  );
}

#scope .scope-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  margin: -1px 0 0 -1px;
  background: #050505;
  border-radius: 50%;
}

#scope .scope-mils {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: transparent;
}

#scope .scope-mils.h {
  box-shadow:
    -8vh 0 0 0 #050505,
    -16vh 0 0 0 #050505,
    -24vh 0 0 0 #050505,
    8vh 0 0 0 #050505,
    16vh 0 0 0 #050505,
    24vh 0 0 0 #050505;
}

#scope .scope-mils.v {
  box-shadow:
    0 -8vh 0 0 #050505,
    0 -16vh 0 0 #050505,
    0 -24vh 0 0 #050505,
    0 8vh 0 0 #050505,
    0 16vh 0 0 #050505,
    0 24vh 0 0 #050505;
}

#banner {
  pointer-events: none;
  position: fixed;
  top: 22%;
  left: 50%;
  z-index: 8;
  transform: translateX(-50%);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-shadow: 0 2px 0 #000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#banner.on {
  opacity: 1;
}

#scoreboard {
  display: none;
  position: fixed;
  left: 50%;
  top: 22%;
  z-index: 12;
  transform: translateX(-50%);
  background: rgba(8, 10, 14, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 12px 16px;
  min-width: 420px;
}

#scoreboard.on {
  display: block;
}

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

#scoreboard th {
  text-align: left;
  opacity: 0.5;
  font-weight: 400;
  letter-spacing: 0.12em;
  font-size: 11px;
  padding-bottom: 8px;
}

#scoreboard td {
  padding: 3px 10px 3px 0;
}

#flashbang {
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background: #f4f2e4;
  opacity: 0;
}

#buy {
  position: fixed;
  left: 210px;
  top: 42%;
  z-index: 11;
  transform: translateY(-50%);
  background: rgba(8, 12, 18, 0.94);
  border: 1px solid rgba(214, 226, 74, 0.4);
  padding: 14px 18px 16px;
  min-width: 340px;
  width: 360px;
  pointer-events: auto;
}

#buyCatLabel {
  font-size: 15px;
  letter-spacing: 0.14em;
  color: #d6e24a;
  margin: 0 0 8px;
}

.buy-kicker,
.buy-note {
  font-size: 11px;
  letter-spacing: 0.16em;
  opacity: 0.6;
  margin-bottom: 10px;
}

.buy-note {
  margin: 10px 0 0;
}

.buy-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  cursor: pointer;
}

.buy-item:hover,
.buy-item.ok {
  color: #d6e24a;
}

.buy-item.no {
  opacity: 0.4;
}

#menu,
#pause,
#end {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(20, 28, 40, 0.18), rgba(6, 8, 12, 0.42));
  cursor: default;
}

#menu.visible,
#pause.visible,
#end.visible {
  display: grid;
}

.panel {
  width: min(640px, 92vw);
  padding: 28px 32px;
  background: rgba(10, 12, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.kicker {
  letter-spacing: 0.28em;
  font-size: 11px;
  opacity: 0.55;
}

h1 {
  font-size: 42px;
  letter-spacing: 0.08em;
  margin: 6px 0 12px;
}

.blurb {
  opacity: 0.78;
  line-height: 1.45;
  margin-bottom: 16px;
}

.controls {
  list-style: none;
  font-size: 13px;
  line-height: 1.7;
  opacity: 0.8;
  margin-bottom: 18px;
}

kbd {
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 0 6px;
  margin-right: 3px;
  font-family: inherit;
  font-size: 11px;
}

.pick-lab {
  font-size: 11px;
  letter-spacing: 0.2em;
  opacity: 0.55;
  margin-bottom: 8px;
}

.team-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

button {
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: inherit;
  padding: 10px 16px;
  letter-spacing: 0.16em;
  font-family: inherit;
  font-size: 13px;
}

button:hover,
button.on {
  background: rgba(255, 255, 255, 0.08);
}

button.team-ct.on {
  border-color: var(--ct);
  color: var(--ct);
}

button.team-t.on {
  border-color: var(--t);
  color: var(--t);
}

#startBtn {
  border-color: #d6e24a;
  color: #d6e24a;
}

body.locked {
  cursor: none;
}

body.locked #crosshair {
  opacity: 1;
}

#hud.dead #hpbox,
#hud.dead #ammoBox,
#hud.dead #money,
#hud.dead #hint {
  opacity: 0.35;
}
