:root {
  color-scheme: dark;
  --ink: #0c1418;
  --panel: rgba(11, 20, 24, 0.82);
  --panel-soft: rgba(13, 23, 28, 0.66);
  --line: rgba(232, 196, 128, 0.24);
  --line-strong: rgba(232, 196, 128, 0.46);
  --gold: #e5bb73;
  --gold-bright: #ffdc94;
  --text: #f4ecdd;
  --muted: #a8b0ad;
  --cyan: #82d8df;
  --red: #ed705f;
  --green: #9ed18d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button,
kbd {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

#game-shell {
  position: fixed;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}

body[data-state="playing"] #game {
  cursor: none;
}

.scene-shade,
.vignette,
.damage-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-shade {
  background:
    linear-gradient(180deg, rgba(6, 12, 15, 0.58) 0%, transparent 20%, transparent 72%, rgba(6, 12, 15, 0.6) 100%),
    linear-gradient(90deg, rgba(6, 12, 15, 0.22), transparent 20%, transparent 80%, rgba(6, 12, 15, 0.22));
}

.vignette {
  box-shadow: inset 0 0 150px rgba(4, 9, 12, 0.52);
}

.damage-flash {
  z-index: 8;
  opacity: 0;
  background: radial-gradient(circle, transparent 35%, rgba(197, 42, 31, 0.58) 100%);
  box-shadow: inset 0 0 100px rgba(255, 67, 45, 0.38);
}

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(18, 30, 34, 0.9), rgba(9, 17, 21, 0.76));
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hud-top {
  position: absolute;
  z-index: 10;
  top: max(18px, env(safe-area-inset-top));
  left: max(22px, env(safe-area-inset-left));
  right: max(22px, env(safe-area-inset-right));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 20px;
  pointer-events: none;
  transition: opacity 180ms ease;
}

body[data-state="menu"] .hud-top,
body[data-state="gameover"] .hud-top {
  opacity: 0.62;
}

.brand-panel {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 18px 9px 11px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--gold);
  border: 1px solid rgba(229, 187, 115, 0.32);
  background: rgba(229, 187, 115, 0.07);
  transform: rotate(-2deg);
}

.brand-mark svg,
.modal-emblem svg,
.end-emblem svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark svg path + path,
.modal-emblem svg path + path,
.end-emblem svg path + path {
  stroke-width: 3;
}

.brand-name {
  color: var(--gold-bright);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.18em;
  line-height: 1;
}

.brand-subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.wave-panel {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 230px;
  min-height: 58px;
  padding: 9px 20px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%, 0 10px);
}

.status-light {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px rgba(237, 112, 95, 0.75);
  animation: pulse 1.8s ease-in-out infinite;
}

.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.2em;
  line-height: 1;
}

.wave-panel strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1;
}

.wave-panel strong span {
  color: #77817f;
  font-size: 11px;
}

.wave-divider,
.score-divider {
  width: 1px;
  height: 30px;
  background: var(--line);
}

.enemy-count {
  min-width: 60px;
}

.enemy-count strong {
  color: var(--red);
}

.enemy-count span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.score-panel {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  padding: 9px 10px 9px 17px;
}

.score-block,
.best-block {
  min-width: 68px;
}

.score-block strong,
.best-block strong {
  display: block;
  margin-top: 6px;
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  line-height: 1;
}

.best-block strong {
  color: var(--gold);
  font-size: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #b9c0bc;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  pointer-events: auto;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--gold-bright);
  border-color: var(--line-strong);
  background: rgba(229, 187, 115, 0.09);
  outline: none;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-off {
  display: none;
}

body.sound-muted .sound-on {
  display: none;
}

body.sound-muted .sound-off {
  display: block;
}

.hud-bottom {
  position: absolute;
  z-index: 10;
  left: max(22px, env(safe-area-inset-left));
  right: max(22px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 20px;
  pointer-events: none;
}

.health-panel,
.coil-panel {
  width: 236px;
  padding: 13px 15px 11px;
}

.coil-panel {
  justify-self: end;
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c8ceca;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.panel-heading strong {
  margin-left: auto;
  color: var(--text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.heart-icon,
.coil-icon {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  color: var(--red);
}

.coil-icon {
  color: var(--cyan);
}

.heart-icon svg,
.coil-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.heart-icon svg {
  fill: rgba(237, 112, 95, 0.18);
}

.meter {
  position: relative;
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.38);
}

.meter::after {
  position: absolute;
  inset: 0;
  content: "";
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(10% - 1px), rgba(8, 15, 18, 0.7) calc(10% - 1px), rgba(8, 15, 18, 0.7) 10%);
}

.meter span {
  display: block;
  width: 100%;
  height: 100%;
  transition: width 100ms linear, background 180ms ease;
}

.health-meter span {
  background: linear-gradient(90deg, #b95043, #ed8770);
  box-shadow: 0 0 12px rgba(237, 112, 95, 0.35);
}

.coil-meter span {
  background: linear-gradient(90deg, #4f9fa9, #9ce8e9);
  box-shadow: 0 0 12px rgba(130, 216, 223, 0.3);
}

body.overheated .coil-meter span {
  background: linear-gradient(90deg, #b95043, #ed8770);
}

body.overheated #coil-value {
  color: var(--red);
}

.health-caption,
.coil-caption {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: #7f8b88;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.controls-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 8px 16px;
  color: #aab4b0;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.controls-panel > span {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.controls-panel i {
  width: 1px;
  height: 18px;
  background: var(--line);
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 20px;
  padding: 0 5px;
  color: #e8e4d9;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-color: rgba(255, 255, 255, 0.28);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px rgba(0, 0, 0, 0.22);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.wide-key {
  min-width: 44px;
}

.controls-panel svg {
  width: 15px;
  height: 18px;
  fill: none;
  stroke: #e8e4d9;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.announcement {
  position: absolute;
  z-index: 12;
  top: 20%;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(90vw, 620px);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.8);
  transform: translate(-50%, -8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.announcement.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.announcement span {
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.34em;
}

.announcement strong {
  margin-top: 7px;
  color: #fff8e9;
  font-size: clamp(28px, 4.2vw, 54px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
}

.announcement span:last-child {
  margin-top: 10px;
  color: #d1d8d3;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.14em;
}

.crosshair {
  position: fixed;
  z-index: 15;
  top: 50%;
  left: 50%;
  display: none;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 231, 181, 0.85);
  border-radius: 50%;
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(255, 203, 117, 0.45));
  transform: translate(-50%, -50%);
  transition: width 80ms ease, height 80ms ease, border-color 80ms ease;
}

.crosshair::before,
.crosshair::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: rgba(255, 236, 200, 0.9);
  transform: translate(-50%, -50%);
}

.crosshair::before {
  width: 6px;
  height: 1px;
}

.crosshair::after {
  width: 1px;
  height: 6px;
}

.crosshair span,
.crosshair i {
  position: absolute;
  background: rgba(255, 231, 181, 0.75);
}

.crosshair span {
  top: 50%;
  left: -5px;
  width: 4px;
  height: 1px;
  box-shadow: 35px 0 rgba(255, 231, 181, 0.75);
}

.crosshair i {
  top: -5px;
  left: 50%;
  width: 1px;
  height: 4px;
  box-shadow: 0 35px rgba(255, 231, 181, 0.75);
}

.crosshair.hit {
  width: 22px;
  height: 22px;
  border-color: var(--red);
}

body[data-state="playing"] .crosshair.visible {
  display: block;
}

.toast {
  position: absolute;
  z-index: 14;
  left: 50%;
  bottom: 112px;
  max-width: 90vw;
  padding: 9px 15px;
  opacity: 0;
  color: var(--gold-bright);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(9, 17, 21, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal-layer {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  opacity: 0;
  visibility: hidden;
  background: rgba(5, 10, 13, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: none;
  transition: opacity 200ms ease, visibility 200ms ease;
}

.modal-layer.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  position: relative;
  width: min(100%, 500px);
  max-height: calc(100dvh - 36px);
  padding: 30px 34px 26px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background:
    radial-gradient(circle at 50% 0%, rgba(229, 187, 115, 0.09), transparent 45%),
    linear-gradient(145deg, rgba(18, 29, 33, 0.97), rgba(8, 16, 20, 0.97));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.05);
  text-align: center;
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
}

.modal::before,
.modal::after {
  position: absolute;
  width: 50px;
  height: 2px;
  content: "";
  background: var(--gold);
  opacity: 0.55;
}

.modal::before {
  top: 0;
  left: 30px;
}

.modal::after {
  right: 30px;
  bottom: 0;
}

.modal-emblem {
  width: 54px;
  height: 54px;
  margin: 0 auto 15px;
  color: var(--gold);
  filter: drop-shadow(0 0 14px rgba(229, 187, 115, 0.2));
}

.modal-kicker {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.modal h1,
.modal h2 {
  margin: 8px 0 0;
  color: #fff5df;
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 1;
}

.modal h1 {
  font-size: clamp(40px, 7vw, 58px);
  text-shadow: 0 4px 24px rgba(229, 187, 115, 0.14);
}

.modal h2 {
  font-size: clamp(32px, 6vw, 46px);
}

.modal-lead {
  max-width: 390px;
  margin: 17px auto 0;
  color: #b8c1bd;
  font-size: 12px;
  line-height: 1.7;
}

.modal-lead strong {
  color: var(--gold-bright);
  font-weight: 750;
}

.mission-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.mission-tags span {
  padding: 6px 9px;
  color: #9eaaa5;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px 0;
  text-align: left;
}

.control-grid > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.025);
}

.control-grid kbd {
  min-width: 58px;
  height: 24px;
  color: var(--gold-bright);
  border-color: rgba(229, 187, 115, 0.24);
  background: rgba(229, 187, 115, 0.06);
  font-size: 8px;
}

.control-grid span {
  color: #aeb8b3;
  font-size: 10px;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.18em;
  transition: transform 150ms ease, filter 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover,
.button:focus-visible {
  outline: none;
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.button:active {
  transform: translateY(0);
}

.primary-button {
  color: #1b1b17;
  border: 1px solid #f0ca87;
  background: linear-gradient(135deg, #f2ce8d, #c9954f);
  box-shadow: 0 10px 26px rgba(201, 149, 79, 0.18), inset 0 1px rgba(255, 255, 255, 0.45);
}

.primary-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secondary-button {
  margin-top: 9px;
  color: #b6c0bb;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.035);
}

.modal-footnote {
  margin: 14px 0 0;
  color: #75817d;
  font-size: 9px;
  line-height: 1.5;
}

.compact-modal {
  width: min(100%, 430px);
  padding-top: 38px;
  padding-bottom: 32px;
}

.compact-modal .modal-lead {
  margin-bottom: 24px;
}

.end-emblem {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  color: var(--green);
}

.end-modal.failed .end-emblem {
  color: var(--red);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.results-grid > div {
  padding: 13px 8px;
  background: rgba(8, 16, 20, 0.92);
}

.results-grid span {
  display: block;
  color: #7f8c87;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.results-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--gold-bright);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.mobile-controls {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.08); }
}

@media (max-width: 1100px) {
  .controls-panel {
    display: none;
  }
}

@media (max-width: 900px) {
  .hud-top {
    left: 14px;
    right: 14px;
    gap: 10px;
  }

  .brand-panel {
    padding-right: 12px;
  }

  .brand-subtitle,
  .best-block,
  .score-divider {
    display: none;
  }

  .wave-panel {
    min-width: 190px;
    gap: 10px;
    padding-inline: 14px;
  }

  .controls-panel {
    display: none;
  }

  .hud-bottom {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .hud-top {
    top: max(10px, env(safe-area-inset-top));
    grid-template-columns: auto 1fr auto;
  }

  .brand-panel {
    min-height: 46px;
    padding: 6px 9px;
  }

  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .brand-name {
    font-size: 12px;
    letter-spacing: 0.13em;
  }

  .wave-panel {
    min-width: 0;
    min-height: 46px;
    justify-self: stretch;
    justify-content: center;
    padding: 6px 10px;
  }

  .status-light,
  .wave-divider,
  .enemy-count {
    display: none;
  }

  .wave-panel strong {
    font-size: 14px;
  }

  .score-panel {
    min-height: 46px;
    gap: 5px;
    padding: 6px;
  }

  .score-block {
    min-width: 52px;
  }

  .score-block strong {
    font-size: 11px;
  }

  .icon-button {
    width: 30px;
    height: 30px;
  }

  #pause-button {
    display: none;
  }

  .hud-bottom {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    gap: 8px;
  }

  .health-panel,
  .coil-panel {
    width: 100%;
    padding: 10px;
  }

  .panel-heading {
    gap: 5px;
    font-size: 7px;
    letter-spacing: 0.1em;
  }

  .panel-heading strong {
    font-size: 10px;
  }

  .health-caption,
  .coil-caption {
    font-size: 6px;
  }

  .announcement {
    top: 18%;
  }

  .announcement strong {
    font-size: 28px;
  }

  .modal-layer {
    padding: 14px;
  }

  .modal {
    padding: 24px 22px 22px;
  }

  .modal-emblem {
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
  }

  .modal-lead {
    font-size: 11px;
  }

  .mission-tags {
    flex-wrap: wrap;
  }

  .control-grid {
    margin: 16px 0;
  }

  .control-grid > div {
    padding: 6px 8px;
  }

  .control-grid kbd {
    min-width: 50px;
  }

  .toast {
    bottom: 94px;
  }
}

@media (pointer: coarse) {
  body[data-state="playing"] #game {
    cursor: default;
  }

  .crosshair {
    display: none !important;
  }

  .mobile-controls {
    position: absolute;
    z-index: 18;
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease, visibility 150ms ease;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(88px, env(safe-area-inset-bottom));
    left: max(18px, env(safe-area-inset-left));
    display: flex;
    align-items: end;
    justify-content: space-between;
    pointer-events: none;
  }

  body[data-state="playing"] .mobile-controls {
    opacity: 1;
    visibility: visible;
  }

  .joystick {
    position: relative;
    width: 112px;
    height: 112px;
    border: 1px solid rgba(229, 187, 115, 0.24);
    border-radius: 50%;
    background: rgba(9, 17, 21, 0.35);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.22);
    pointer-events: auto;
    touch-action: none;
  }

  .joystick::before,
  .joystick::after {
    position: absolute;
    top: 50%;
    left: 50%;
    content: "";
    background: rgba(229, 187, 115, 0.12);
    transform: translate(-50%, -50%);
  }

  .joystick::before {
    width: 74px;
    height: 1px;
  }

  .joystick::after {
    width: 1px;
    height: 74px;
  }

  #joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(229, 187, 115, 0.5);
    border-radius: 50%;
    background: rgba(229, 187, 115, 0.16);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%);
  }

  .mobile-actions {
    display: flex;
    align-items: end;
    gap: 12px;
    pointer-events: auto;
  }

  .mobile-action {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    padding: 0;
    color: var(--text);
    border: 1px solid rgba(229, 187, 115, 0.4);
    border-radius: 50%;
    background: rgba(13, 23, 28, 0.62);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.12em;
    touch-action: none;
  }

  .fire-action {
    width: 78px;
    height: 78px;
    color: #172126;
    border-color: #9edce0;
    background: rgba(130, 216, 223, 0.78);
  }

  .mobile-action:active {
    filter: brightness(1.25);
    transform: scale(0.96);
  }
}

@media (max-height: 660px) and (min-width: 621px) {
  .modal {
    padding-top: 20px;
    padding-bottom: 18px;
  }

  .modal-emblem {
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
  }

  .modal h1 {
    font-size: 42px;
  }

  .modal-lead {
    margin-top: 12px;
  }

  .mission-tags {
    margin-top: 12px;
  }

  .control-grid {
    margin: 14px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
