:root {
  color-scheme: dark;
  --bg-top: #112235;
  --bg-bottom: #05080f;
  --text-main: #eef7ff;
  --text-muted: #9eb4c7;
  --accent: #76d4ff;
  --display-font: "Optimus Princeps", "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--display-font);
  background: radial-gradient(circle at top, var(--bg-top), var(--bg-bottom) 65%);
  color: var(--text-main);
  letter-spacing: 0.03em;
}

canvas {
  display: block;
}

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

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 4, 7, 0.98);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.intro-screen--visible {
  opacity: 1;
  pointer-events: auto;
}

.intro-screen--briefing {
  background: rgba(7, 5, 9, 0.66);
}

.intro-screen__splash {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.intro-screen--splash-loaded .intro-screen__splash {
  animation: intro-splash-loaded 850ms ease both;
}

.intro-screen--briefing .intro-screen__splash {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.intro-screen__built-with {
  position: absolute;
  top: 26px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  color: rgba(255, 241, 223, 0.9);
  font-size: 0.96rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.intro-screen__splash-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter:
    drop-shadow(0 28px 58px rgba(0, 0, 0, 0.42))
    drop-shadow(0 0 32px rgba(116, 17, 22, 0.18));
}

@keyframes intro-splash-loaded {
  0% {
    opacity: 0.16;
    transform: scale(1.01);
  }

  28% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.03);
  }
}

.intro-screen__panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  padding: 28px 30px 26px;
  border: 1px solid rgba(203, 180, 132, 0.24);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(25, 15, 16, 0.96), rgba(12, 8, 10, 0.96));
  box-shadow: 0 30px 110px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.intro-screen__x-link {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 224, 187, 0.22);
  border-radius: 999px;
  background: rgba(10, 8, 10, 0.5);
  color: #fff2df;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease;
}

.intro-screen__x-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 224, 187, 0.42);
  background: rgba(24, 18, 20, 0.74);
}

.intro-screen__x-link:focus-visible {
  outline: 2px solid rgba(255, 235, 206, 0.95);
  outline-offset: 4px;
}

.intro-screen--briefing .intro-screen__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.intro-screen__eyebrow {
  color: #e6b77d;
  font-size: 0.84rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.intro-screen__title {
  margin-top: 10px;
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 0.94;
  color: #fff2df;
  text-transform: uppercase;
}

.intro-screen__copy {
  margin-top: 14px;
  max-width: 56ch;
  color: #dbc8b0;
  font-size: 0.98rem;
  line-height: 1.7;
}

.intro-screen__copy--tight {
  margin-top: 10px;
}

.intro-screen__section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 224, 187, 0.1);
}

.intro-screen__section-title {
  color: #fff5ea;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro-screen__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 10px 18px;
  margin-top: 14px;
}

.intro-screen__grid-label {
  color: #bcae97;
}

.intro-screen__grid-value {
  color: #fff6ee;
  text-align: right;
}

.intro-screen__button {
  margin-top: 28px;
  min-width: 220px;
  padding: 14px 22px;
  border: 1px solid rgba(255, 224, 187, 0.22);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(154, 26, 26, 0.98), rgba(86, 8, 12, 0.98));
  color: #fff4ee;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition:
    transform 120ms ease,
    filter 120ms ease;
}

.intro-screen__button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.intro-screen__button:disabled {
  cursor: default;
  opacity: 0.74;
  filter: saturate(0.9);
}

.intro-screen__button:active {
  transform: translateY(0);
}

.intro-screen__button:focus-visible {
  outline: 2px solid rgba(255, 235, 206, 0.95);
  outline-offset: 4px;
}

.hud-handle {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(223, 198, 151, 0.2);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(16, 12, 9, 0.9), rgba(9, 7, 6, 0.9));
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.28);
  color: rgba(255, 245, 233, 0.92);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.hud-handle:hover {
  border-color: rgba(223, 198, 151, 0.34);
  color: #fff9f0;
}

.hud-handle:focus-visible {
  outline: 2px solid rgba(255, 235, 206, 0.95);
  outline-offset: 4px;
}

.pause-screen {
  z-index: 21;
}

.status-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 10;
  width: min(620px, calc(100vw - 180px));
  padding: 11px 18px;
  border: 1px solid rgba(201, 217, 228, 0.14);
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.72);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.28);
  color: #d7ecff;
  font-size: 0.82rem;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.status-banner[aria-hidden="true"] {
  opacity: 0;
}

.wave-announcement {
  position: fixed;
  top: 68px;
  left: 50%;
  z-index: 11;
  padding: 12px 26px;
  border: 1px solid rgba(186, 51, 51, 0.26);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(30, 8, 10, 0.94), rgba(13, 4, 6, 0.94));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
  color: #fff2e8;
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}

.wave-announcement--visible {
  animation: wave-announcement-fade 2.35s ease both;
}

@keyframes wave-announcement-fade {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.96);
  }

  14%,
  68% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(1.01);
  }
}

.credits-hud {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  min-width: 196px;
  padding: 12px 16px;
  border: 1px solid rgba(223, 198, 151, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(20, 14, 8, 0.88), rgba(10, 8, 6, 0.88));
  box-shadow: 0 20px 64px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.credits-hud__label {
  color: #dcb884;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.credits-hud__value {
  margin-top: 7px;
  color: #fff4e0;
  font-size: 1.4rem;
  line-height: 1;
}

.credits-hud__wave {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
}

.credits-hud__wave-label {
  color: #dcb884;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.credits-hud__wave-number {
  color: #c82020;
  font-size: 1.22rem;
  line-height: 1;
  text-shadow: 0 0 22px rgba(158, 14, 14, 0.22);
}

.credits-hud__wave-progress {
  margin-top: 8px;
  color: #dfd0bc;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}

.sonar-hud {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 10;
  width: 184px;
  height: 184px;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.sonar-hud[aria-hidden="true"] {
  opacity: 0;
}

.sonar-hud__scope {
  position: relative;
  width: 184px;
  height: 184px;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at center, rgba(20, 61, 37, 0.88), rgba(5, 17, 12, 0.96) 74%);
  box-shadow:
    inset 0 0 0 2px rgba(118, 208, 143, 0.12),
    inset 0 0 42px rgba(18, 76, 42, 0.38);
}

.sonar-hud__canvas,
.sonar-hud__static {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sonar-hud__canvas {
  display: block;
}

.sonar-hud__static {
  opacity: 0.26;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 50% 50%, rgba(154, 255, 182, 0.06), transparent 58%),
    repeating-linear-gradient(
      180deg,
      rgba(195, 255, 208, 0.08) 0 1px,
      rgba(0, 0, 0, 0) 1px 4px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(160, 255, 190, 0.04) 0 2px,
      rgba(0, 0, 0, 0) 2px 7px
    );
  animation: sonar-static-shift 240ms steps(2) infinite;
}

@keyframes sonar-static-shift {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0.18;
  }

  50% {
    transform: translate3d(-1px, 1px, 0);
    opacity: 0.28;
  }

  100% {
    transform: translate3d(1px, -1px, 0);
    opacity: 0.22;
  }
}

.bottom-hud {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 10;
  pointer-events: none;
}

.health-cluster {
  display: flex;
  align-items: flex-end;
  gap: 18px;
}

.health-orb {
  --health-fill: 1;
  position: relative;
  width: 168px;
  height: 168px;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.4));
}

.health-orb__frame {
  position: absolute;
  inset: 0;
  padding: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.14), transparent 18%),
    linear-gradient(180deg, rgba(108, 112, 118, 0.96), rgba(56, 60, 66, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -6px 16px rgba(0, 0, 0, 0.42),
    0 16px 40px rgba(0, 0, 0, 0.4);
}

.health-orb[data-state="warning"] .health-orb__frame {
  box-shadow:
    inset 0 0 0 2px rgba(255, 214, 122, 0.08),
    inset 0 -8px 24px rgba(0, 0, 0, 0.5),
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 28px rgba(255, 170, 42, 0.18);
}

.health-orb[data-state="danger"] .health-orb__frame {
  box-shadow:
    inset 0 0 0 2px rgba(255, 120, 120, 0.08),
    inset 0 -8px 24px rgba(0, 0, 0, 0.5),
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 36px rgba(182, 26, 26, 0.26);
}

.health-orb__glass {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 248, 236, 0.3), transparent 20%),
    radial-gradient(circle at 68% 82%, rgba(0, 0, 0, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(10, 8, 11, 0.42));
  border: 2px solid rgba(232, 240, 255, 0.12);
  box-shadow:
    inset 0 0 26px rgba(0, 0, 0, 0.52),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.health-orb__dust,
.health-orb__shine,
.health-orb__liquid {
  position: absolute;
  inset: 0;
}

.health-orb__dust {
  background:
    radial-gradient(circle at 34% 26%, rgba(250, 240, 204, 0.26), transparent 16%),
    radial-gradient(circle at 47% 54%, rgba(56, 36, 27, 0.28), transparent 18%),
    radial-gradient(circle at 58% 36%, rgba(95, 75, 56, 0.16), transparent 20%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

.health-orb__liquid {
  top: calc((1 - var(--health-fill)) * 72%);
  left: -10%;
  right: -10%;
  bottom: -6%;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 73, 73, 0.98), rgba(146, 12, 19, 0.98) 78%, rgba(78, 5, 10, 1));
  box-shadow:
    inset 0 10px 28px rgba(255, 129, 129, 0.22),
    inset 0 -8px 18px rgba(70, 0, 0, 0.36);
  transition: top 220ms ease;
}

.health-orb__liquid::before,
.health-orb__liquid::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  top: -14%;
  height: 34%;
  border-radius: 44% 56% 52% 48% / 58% 42% 58% 42%;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 170, 170, 0.8), rgba(255, 55, 55, 0.16) 70%);
}

.health-orb__liquid::after {
  top: -10%;
  height: 28%;
  opacity: 0.68;
}

.health-orb__shine {
  background:
    radial-gradient(circle at 34% 18%, rgba(255, 255, 255, 0.3), transparent 15%),
    linear-gradient(130deg, rgba(255, 255, 255, 0.22), transparent 26%);
  mix-blend-mode: screen;
  opacity: 0.58;
}

.health-orb__label {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  color: rgba(255, 235, 221, 0.84);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.health-orb__value {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  color: #fff5f3;
  font-size: 0.96rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.ammo-hud {
  min-width: 160px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(221, 210, 188, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(16, 15, 17, 0.86), rgba(8, 8, 9, 0.86));
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
}

.ammo-hud__label {
  color: #d4d6de;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ammo-hud__value {
  margin-top: 10px;
  color: #faf6ef;
  font-size: 1.9rem;
  line-height: 1;
}

.reticle {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 12;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%) scale(0.9);
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease;
}

.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(118, 212, 255, 0.95);
  box-shadow: 0 0 12px rgba(118, 212, 255, 0.45);
}

.reticle::before {
  width: 2px;
  height: 20px;
}

.reticle::after {
  width: 20px;
  height: 2px;
}

.reticle--visible {
  opacity: 0.68;
}

.reticle--aiming {
  transform: translate(-50%, -50%) scale(0.72);
  opacity: 1;
}

.damage-vignette {
  position: fixed;
  inset: -10vmax;
  z-index: 14;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(
      circle at center,
      rgba(120, 0, 0, 0) 40%,
      rgba(140, 0, 0, 0.08) 58%,
      rgba(165, 0, 0, 0.24) 74%,
      rgba(185, 0, 0, 0.58) 100%
    );
}

.editor-toolbar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 16;
  min-width: min(720px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  padding: 14px 16px 16px;
  border: 1px solid rgba(255, 227, 168, 0.22);
  border-radius: 20px;
  background: rgba(14, 10, 4, 0.84);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.editor-toolbar--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.editor-toolbar__title {
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffeec8;
}

.editor-toolbar__items {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.editor-toolbar__item {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 240, 210, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #f6f0e6;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease,
    box-shadow 120ms ease;
}

.editor-toolbar__item--selected {
  transform: translateY(-2px);
  border-color: rgba(255, 235, 182, 0.56);
  background: rgba(255, 227, 168, 0.12);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
}

.editor-toolbar__item-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff7ec;
  font-size: 0.9rem;
  font-weight: 700;
}

.editor-toolbar__item-name {
  margin-top: 10px;
  font-size: 0.96rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-toolbar__item-meta {
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.35;
  color: #cfba92;
}

.hud {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hud__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud__status {
  margin-top: 8px;
  font-size: 0.96rem;
  color: var(--accent);
}

.hud__health {
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #baf4cd;
}

.hud__health[data-state="warning"] {
  color: #ffe08f;
}

.hud__health[data-state="danger"] {
  color: #ff8f8f;
}

.hud__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hud__stat {
  padding: 6px 10px;
  border: 1px solid rgba(170, 224, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.86rem;
  font-weight: 600;
  color: #dbeeff;
}

.hud__controls {
  margin-top: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.vendor-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 18;
  width: min(360px, calc(100vw - 36px));
  opacity: 0;
  pointer-events: none;
  transform: translateX(22px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.vendor-prompt {
  position: fixed;
  left: 50%;
  bottom: 112px;
  z-index: 17;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.82);
  color: #ffffff;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.vendor-prompt--visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.vendor-prompt__label {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.vendor-prompt__key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
}

.vendor-panel--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.vendor-panel__card {
  padding: 18px 18px 16px;
  border: 1px solid rgba(255, 221, 173, 0.2);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(37, 18, 10, 0.96), rgba(16, 7, 4, 0.96));
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.vendor-panel__eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffcf8e;
}

.vendor-panel__title {
  margin-top: 8px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff5eb;
}

.vendor-panel__subtitle {
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #dfc4a6;
}

.vendor-panel__stats {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 230, 197, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #f6e7d7;
  white-space: pre-line;
}

.vendor-panel__actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.vendor-panel__button,
.vendor-panel__close {
  width: 100%;
  border-radius: 16px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 120ms ease,
    filter 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease;
}

.vendor-panel__button {
  padding: 12px 14px;
  border: 1px solid rgba(255, 220, 179, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #fff7ef;
  text-align: left;
}

.vendor-panel__button:hover:not(:disabled),
.vendor-panel__close:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.vendor-panel__button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.vendor-panel__close {
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 226, 200, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #f5dac2;
}

.vendor-panel__button:active,
.vendor-panel__close:active {
  transform: translateY(0);
}

.vendor-panel__button:focus-visible,
.vendor-panel__close:focus-visible {
  outline: 2px solid rgba(255, 234, 212, 0.92);
  outline-offset: 3px;
}

.death-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(110, 0, 0, 0.18), rgba(5, 0, 0, 0.84) 72%);
  backdrop-filter: blur(8px);
  transition: opacity 160ms ease;
}

.death-screen--visible {
  opacity: 1;
  pointer-events: auto;
}

.death-screen__panel {
  min-width: min(320px, 100%);
  padding: 28px 26px;
  border: 1px solid rgba(255, 193, 193, 0.22);
  border-radius: 18px;
  background: rgba(16, 4, 6, 0.88);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.death-screen__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff4f4;
}

.death-screen__button {
  margin-top: 18px;
  min-width: 160px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 214, 214, 0.34);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(178, 28, 42, 0.96), rgba(112, 10, 20, 0.96));
  color: #fff8f8;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    transform 120ms ease,
    filter 120ms ease;
}

.death-screen__button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.death-screen__button:active {
  transform: translateY(0);
}

.death-screen__button:focus-visible {
  outline: 2px solid rgba(255, 233, 233, 0.95);
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .hud-title {
    top: 12px;
    left: 12px;
    font-size: 0.74rem;
  }

  .status-banner {
    top: 44px;
    width: calc(100vw - 24px);
    font-size: 0.72rem;
  }

  .credits-hud {
    top: 12px;
    right: 12px;
    min-width: 132px;
  }

  .bottom-hud {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .health-cluster {
    gap: 12px;
  }

  .health-orb {
    width: 138px;
    height: 138px;
  }

  .ammo-hud {
    min-width: 132px;
    padding: 14px 14px 12px;
  }

  .ammo-hud__value {
    font-size: 1.5rem;
  }

  .intro-screen__panel {
    padding: 22px 20px;
  }

  .intro-screen__built-with {
    top: 18px;
    font-size: 0.78rem;
  }

  .intro-screen__grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .intro-screen__grid-value {
    text-align: left;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 224, 187, 0.08);
  }

  .editor-toolbar {
    left: 12px;
    right: 12px;
    bottom: 12px;
    min-width: 0;
    max-width: none;
    transform: translateY(18px);
  }

  .editor-toolbar--visible {
    transform: translateY(0);
  }

  .editor-toolbar__items {
    grid-template-columns: 1fr;
  }

  .vendor-panel {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: 92px;
    width: auto;
  }

  .vendor-prompt {
    bottom: 78px;
  }
}
