#hud {
  z-index: 5;
  pointer-events: none;
  opacity: var(--hud-opacity);
  font-family: Rajdhani, sans-serif;
  color: #f4f3e9;
  text-shadow: 0 1px 4px #000a;
  --gap: 8px;
}

.hud-team {
  position: absolute;
  left: 2%;
  top: 3%;
  display: flex;
  align-items: center;
  transform-origin: top left;
  transform: scale(var(--hud-scale));
  gap: 9px;
}

.hud-emblem {
  width: 58px;
  height: 66px;
  stroke-width: 1.2;
  filter: drop-shadow(0 1px 4px #000);
  color: #dbe6df;
}

.score-stack {
  width: 110px;
  position: relative;
}

.score-stack > div {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 26px;
}

.score-stack b {
  font-family: Barlow, sans-serif;
  font-size: 27px;
  width: 33px;
}

.score-stack span {
  display: block;
  width: 62px;
  height: 5px;
  background: #243138bb;
}

.score-stack i {
  display: block;
  width: 0;
  height: 100%;
  background: currentColor;
}

.team-blue {
  color: #8bd0dd;
}

.team-red {
  color: #ec8980;
}

.score-stack small {
  font-size: 14px;
  position: absolute;
  right: -20px;
  top: 10px;
  color: #dfdfce;
}

.match-clock {
  position: absolute;
  left: 65px;
  top: 59px;
  min-width: 140px;
}

.match-clock > span {
  display: block;
  font-family: Barlow, sans-serif;
  font-size: 16px;
  color: #e4db91;
}

.match-clock small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  margin-top: 3px;
  color: #c5d2c9;
}

#kill-feed {
  position: absolute;
  left: 2.5%;
  top: 22%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 330px;
}

.feed-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  background: linear-gradient(90deg, #0a12187d, transparent);
  padding: 5px 15px 5px 7px;
  border-left: 2px solid #92c7d1;
  animation: feed-in 0.25s ease-out;
}

.feed-entry svg {
  width: 33px;
  height: 13px;
}

.feed-entry b {
  font-weight: 500;
  color: #94d4e0;
}

.feed-entry > span:last-child {
  color: #df9590;
}

.feed-entry.hostile {
  border-color: #d3776e;
}

.feed-entry.hostile b {
  color: #df9590;
}

.feed-entry.hostile > span:last-child {
  color: #94d4e0;
}

.hud-compass {
  position: absolute;
  top: 3%;
  left: 50%;
  transform: translateX(-50%);
  width: 310px;
  text-align: center;
  overflow: hidden;
  height: 67px;
}

.hud-compass > div {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #d8dcd0;
  white-space: nowrap;
  border-bottom: 1px solid #ffffff40;
  padding-bottom: 7px;
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 15%,
    #000 85%,
    transparent
  );
}

.hud-compass > span {
  color: var(--accent);
  font-size: 16px;
  position: relative;
  top: -6px;
}

.hud-compass small {
  display: block;
  font-size: 8px;
  letter-spacing: 0.2em;
  margin-top: -7px;
}

.hud-map {
  position: absolute;
  right: 2%;
  top: 3%;
  width: 195px;
  background: #111a22d9;
  box-shadow: 0 2px 12px #0005;
  transform: scale(var(--hud-scale));
  transform-origin: top right;
  border: 1px solid #b5c7c333;
}

.hud-map canvas {
  display: block;
  width: 100%;
  height: 155px;
  opacity: 0.9;
}

.map-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8px;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  color: #9fbbb1;
  background: #10191bcc;
  height: 23px;
}

.map-top button {
  pointer-events: auto;
}

.map-top svg {
  width: 15px;
  height: 15px;
}

.map-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: #101919c9;
}

.map-bottom > span {
  font-family: Barlow, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
}

.map-bottom > small {
  font-size: 8px;
  color: #bbd89c;
}

#crosshair {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  filter: drop-shadow(0 0 2px #0008);
  opacity: 0.8;
}

#crosshair i {
  position: absolute;
  display: block;
  background: #e8ede2;
  width: 2px;
  height: 8px;
}

#crosshair i:nth-child(1) {
  left: -1px;
  bottom: var(--gap);
}

#crosshair i:nth-child(2) {
  left: -1px;
  top: var(--gap);
}

#crosshair i:nth-child(3) {
  height: 2px;
  width: 8px;
  right: var(--gap);
  top: -1px;
}

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

#crosshair b {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #f4f4e9;
  left: -1px;
  top: -1px;
}

#hit-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  opacity: 0;
  z-index: 4;
}

#hit-marker i {
  position: absolute;
  width: 2px;
  height: 9px;
  background: var(--white);
}

#hit-marker i:nth-child(1) {
  transform: translate(-8px, -11px) rotate(-45deg);
}

#hit-marker i:nth-child(2) {
  transform: translate(6px, -11px) rotate(45deg);
}

#hit-marker i:nth-child(3) {
  transform: translate(-8px, 2px) rotate(45deg);
}

#hit-marker i:nth-child(4) {
  transform: translate(6px, 2px) rotate(-45deg);
}

#hit-marker.head i {
  background: #efbf6a;
}

#damage-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 35%,
    #8c272a90 100%
  );
  box-shadow: inset 0 0 90px #a0302933;
  pointer-events: none;
}

#damage-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, -50%);
  opacity: 0;
  border-radius: 50%;
  border-top: 4px solid #d84d3c;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  pointer-events: none;
}

#kill-confirmation {
  position: absolute;
  left: calc(50% + 52px);
  top: 46%;
  font-family: Barlow, sans-serif;
  color: #e4e69a;
  font-size: 20px;
  letter-spacing: 0.035em;
  opacity: 0;
}

#kill-confirmation small {
  display: block;
  color: #e4e7dc;
  font-family: Rajdhani, sans-serif;
  font-size: 10px;
  margin-top: 4px;
  letter-spacing: 0.08em;
}

#medal {
  position: absolute;
  left: 50%;
  top: 21%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
}

#medal svg {
  color: #d7c98a;
  width: 47px;
  height: 47px;
  filter: drop-shadow(0 2px 12px #0008);
}

#medal strong {
  font-family: Barlow, sans-serif;
  font-size: 16px;
  letter-spacing: 0.14em;
}

#reload-label {
  position: absolute;
  left: 50%;
  top: 66%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #e1dba3;
}

#interaction-prompt {
  position: absolute;
  left: 50%;
  top: 59%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.09em;
}

#interaction-prompt kbd {
  margin-right: 6px;
}

#grenade-warning {
  position: absolute;
  left: 50%;
  top: 32%;
  transform: translateX(-50%);
  color: #ff9983;
  font-family: Barlow, sans-serif;
  letter-spacing: 0.08em;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#grenade-warning svg {
  width: 23px;
  height: 23px;
  animation: pulse 0.5s infinite;
}

.hud-bottom-left {
  position: absolute;
  left: 2.5%;
  bottom: 3%;
  transform: scale(var(--hud-scale));
  transform-origin: bottom left;
}

.hud-brand {
  font-family: Barlow, sans-serif;
  font-size: 18px;
  line-height: 0.95;
  opacity: 0.7;
}

.hud-brand > span {
  display: block;
  font-size: 8px;
  letter-spacing: 0.5em;
  margin-top: 4px;
}

#stance-label {
  font-size: 8px;
  letter-spacing: 0.15em;
  color: #b8c1b2;
  margin-top: 20px;
}

.input-hints {
  display: flex;
  gap: 14px;
  margin-top: 9px;
  font-size: 8px;
  color: #b8c1b2;
}

.input-hints kbd {
  font-size: 7px;
  min-height: 15px;
  min-width: 16px;
  margin-right: 3px;
}

.hud-loadout {
  position: absolute;
  bottom: 3%;
  left: 50%;
  transform: translateX(-50%) scale(var(--hud-scale));
  transform-origin: bottom center;
  width: 365px;
}

.ability-slots {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-bottom: 7px;
}

.ability-slots > button {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  background: #172024a8;
  clip-path: polygon(7% 0, 100% 0, 93% 100%, 0 100%);
  height: 35px;
  border-bottom: 1px solid #c4d2aa55;
}

.ability-slots svg {
  width: 20px;
  height: 20px;
  color: #c9d2b4;
}

.ability-slots span {
  font-size: 8px;
  letter-spacing: 0.08em;
}

.ability-slots kbd {
  font-size: 7px;
  min-width: 14px;
  min-height: 14px;
  padding: 0 3px;
  color: #d5dfbe;
  border-color: #c1d39050;
}

.weapon-slots {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.weapon-slot {
  pointer-events: auto;
  position: relative;
  min-width: 98px;
  flex: 1;
  background: #162126ab;
  border: 1px solid #ffffff30;
  display: flex;
  align-items: center;
  padding: 8px 8px;
  gap: 5px;
}

.weapon-slot.active {
  border-color: #d8df8e;
  box-shadow: inset 0 0 16px #d8eb5515;
}

.weapon-slot > small {
  position: absolute;
  left: 4px;
  top: 2px;
  font-size: 7px;
  color: #b6c6b7;
}

.weapon-slot svg {
  width: 65px;
  height: 25px;
  stroke-width: 1;
}

.weapon-slot b {
  font-size: 7px;
  letter-spacing: 0.1em;
  position: absolute;
  bottom: 3px;
  left: 9px;
  color: #c6d2bf;
}

.ammo-counter {
  background: #152024b8;
  min-width: 112px;
  padding: 3px 9px;
  position: relative;
  border-bottom: 1px solid #ffffff27;
}

.ammo-counter > b {
  font-family: Barlow, sans-serif;
  font-size: 29px;
}

.ammo-counter > span {
  color: #bec8b7;
  font-size: 14px;
  margin-left: 5px;
}

.ammo-counter > small {
  position: absolute;
  right: 9px;
  bottom: 4px;
  font-size: 6px;
  letter-spacing: 0.1em;
  color: #9db39f;
}

.health-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 10px;
}

.health-row > span {
  font-family: Barlow, sans-serif;
  letter-spacing: 0.1em;
}

.health-row > b {
  font-size: 11px;
  color: #e3e7ce;
}

.health-row > div {
  height: 4px;
  background: #1c2625bb;
  flex: 1;
  transform: skewX(-15deg);
  border: 1px solid #ffffff22;
}

.health-row i {
  display: block;
  background: #e4e9d4;
  height: 100%;
  width: 100%;
  transition: width 0.15s;
}

.health-row > small {
  font-size: 6px;
  color: #c0cdb2;
  letter-spacing: 0.05em;
}

.hud-bottom-right {
  position: absolute;
  right: 2.5%;
  bottom: 3%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-size: 8px;
  letter-spacing: 0.08em;
  color: #bfcbbc;
}

.hud-bottom-right kbd {
  font-size: 7px;
  min-height: 14px;
  min-width: 18px;
}

.hud-bottom-right i {
  display: inline-block;
  width: 4px;
  height: 4px;
  background: #c9e180;
  border-radius: 50%;
  margin-right: 5px;
}

#touch-controls {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  touch-action: none;
}

.touch-mode #touch-controls {
  display: block;
}

.touch-mode .input-hints,
.touch-mode .hud-bottom-right,
.touch-mode #stance-label {
  display: none;
}

#touch-look {
  position: absolute;
  inset: 10% 0 12% 40%;
  pointer-events: auto;
  touch-action: none;
}

#touch-stick {
  position: absolute;
  left: 6%;
  bottom: 15%;
  width: 128px;
  height: 128px;
  background: #10191c20;
  border: 1px solid #ffffff38;
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  display: grid;
  place-items: center;
}

#stick-knob {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e9eee760;
  border: 1px solid #ffffff55;
  box-shadow: 0 0 20px #ffffff0a;
}

#touch-controls button {
  position: absolute;
  border-radius: 50%;
  background: #10171ac9;
  border: 1px solid #ffffff4a;
  pointer-events: auto;
  touch-action: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  opacity: var(--touch-opacity);
  transform: scale(var(--touch-scale));
}

#touch-controls button svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.5;
}

#touch-fire {
  right: 10%;
  bottom: 29%;
  width: 80px !important;
  height: 80px !important;
}

#touch-fire svg {
  width: 42px !important;
  height: 42px !important;
  transform: rotate(-30deg);
}

#touch-aim {
  right: 19%;
  bottom: 40%;
}

#touch-reload {
  right: 20%;
  bottom: 19%;
}

#touch-jump {
  right: 3%;
  bottom: 15%;
}

#touch-crouch {
  right: 9%;
  bottom: 6%;
}

#touch-grenade {
  right: 28%;
  bottom: 14%;
}

#touch-switch {
  right: 31%;
  bottom: 27%;
}

#touch-sprint {
  left: 9%;
  bottom: 45%;
}

#touch-melee {
  right: 3%;
  bottom: 42%;
}

.layout-editor #touch-controls {
  display: block;
}

.layout-editor #touch-controls button,
.layout-editor #touch-stick {
  pointer-events: auto;
  outline: 2px dashed var(--accent);
  z-index: 100;
}

.layout-editor #touch-look {
  display: none;
}

.layout-editor #page-overlay {
  pointer-events: none;
  background: #0b182088;
}

.layout-editor #page-content {
  pointer-events: none;
}

.layout-editor .page-header,
.layout-editor .finish-layout {
  pointer-events: auto;
}

.finish-layout {
  position: absolute;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  z-index: 101;
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1000px) {
  .hud-loadout {
    width: 330px;
  }

  .hud-map {
    width: 160px;
  }

  .hud-map canvas {
    height: 130px;
  }

  .hud-compass {
    width: 240px;
  }

  .input-hints {
    gap: 7px;
    font-size: 7px;
  }

  .hud-bottom-right {
    font-size: 7px;
  }

  .hud-brand {
    font-size: 15px;
  }

  .hud-emblem {
    width: 43px;
    height: 50px;
  }

  .score-stack {
    width: 95px;
  }

  .score-stack b {
    font-size: 23px;
    width: 25px;
  }

  .score-stack > div {
    height: 22px;
  }

  .match-clock {
    left: 52px;
    top: 49px;
  }

  .match-clock > span {
    font-size: 14px;
  }

  .match-clock small {
    font-size: 7px;
  }

  .score-stack small {
    right: -14px;
    font-size: 11px;
  }

  #kill-feed {
    top: 25%;
  }

  .feed-entry {
    font-size: 10px;
  }
}

@media (max-width: 800px) {
  .hud-loadout {
    width: 290px;
    bottom: 3%;
  }

  .ability-slots > button {
    height: 28px;
    padding: 5px 9px;
  }

  .ability-slots svg {
    width: 16px;
    height: 16px;
  }

  .ability-slots span {
    font-size: 6px;
  }

  .weapon-slot {
    min-width: 80px;
    padding: 5px;
  }

  .weapon-slot svg {
    width: 52px;
    height: 21px;
  }

  .ammo-counter {
    min-width: 95px;
    padding: 2px 7px;
  }

  .ammo-counter > b {
    font-size: 24px;
  }

  .ammo-counter > span {
    font-size: 11px;
  }

  .health-row {
    margin-top: 6px;
  }

  .hud-map {
    width: 140px;
  }

  .hud-map canvas {
    height: 106px;
  }

  .map-top {
    height: 18px;
    font-size: 6px;
  }

  .map-bottom {
    padding: 4px 6px;
  }

  .map-bottom > span {
    font-size: 9px;
  }

  .map-bottom > small {
    font-size: 6px;
  }

  .hud-compass {
    width: 210px;
  }

  .hud-compass > div {
    font-size: 8px;
  }

  .hud-compass small {
    font-size: 6px;
  }

  .hud-bottom-left .hud-brand {
    font-size: 13px;
  }

  .hud-brand > span {
    font-size: 6px;
  }

  .hud-bottom-right {
    display: none;
  }

  .touch-mode .hud-loadout {
    width: 270px;
  }

  .touch-mode .ability-slots {
    display: none;
  }

  .touch-mode .hud-team {
    transform: scale(0.8);
    top: 3%;
  }

  .touch-mode .hud-map {
    transform: scale(0.85);
    right: 2%;
  }

  .touch-mode #kill-feed {
    top: 25%;
    max-width: 200px;
  }

  .touch-mode .feed-entry {
    font-size: 8px;
    padding: 3px 5px;
  }

  .touch-mode #touch-stick {
    width: 102px;
    height: 102px;
    left: 5%;
    bottom: 13%;
  }

  .touch-mode #stick-knob {
    width: 40px;
    height: 40px;
  }

  .touch-mode #touch-controls button {
    width: 43px;
    height: 43px;
  }

  .touch-mode #touch-controls button svg {
    width: 23px;
    height: 23px;
  }

  .touch-mode #touch-fire {
    width: 64px !important;
    height: 64px !important;
    right: 9%;
    bottom: 28%;
  }

  .touch-mode #touch-fire svg {
    width: 34px !important;
    height: 34px !important;
  }

  #kill-confirmation {
    font-size: 17px;
    left: calc(50% + 32px);
  }

  #kill-confirmation small {
    font-size: 8px;
  }

  #reload-label {
    font-size: 9px;
  }

  #interaction-prompt {
    font-size: 8px;
  }

  #medal svg {
    width: 34px;
    height: 34px;
  }

  #medal strong {
    font-size: 12px;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  .hud-compass {
    top: 17%;
    width: 180px;
  }

  .hud-loadout {
    bottom: 3%;
    width: 280px;
  }

  .touch-mode #touch-stick {
    bottom: 15%;
  }

  .touch-mode #touch-fire {
    bottom: 25%;
    right: 7%;
  }

  .touch-mode #touch-aim {
    right: 25%;
    bottom: 33%;
  }

  .touch-mode #touch-reload {
    right: 25%;
    bottom: 19%;
  }

  .touch-mode #touch-jump {
    right: 2%;
    bottom: 14%;
  }

  .touch-mode #touch-crouch {
    right: 15%;
    bottom: 10%;
  }

  .touch-mode #touch-grenade {
    right: 38%;
    bottom: 14%;
  }

  .touch-mode #touch-melee {
    right: 3%;
    bottom: 36%;
  }

  .touch-mode #touch-switch {
    right: 39%;
    bottom: 25%;
  }

  .touch-mode #touch-sprint {
    left: 10%;
    bottom: 33%;
  }
}
