:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #120914;
  color: #f5e9d1;
}

* {
  box-sizing: border-box;
}

html,
body,
#game {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #120914;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end stretch;
  padding: 0 14px 14px;
  background-color: #140b0c;
  background-image: url("assets/hovertank-splash-01.jpg?v=hovertank-splash-1");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

#splash-screen[hidden] {
  display: none;
}

.splash-controls {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(620px, 1fr) minmax(175px, 210px) minmax(82px, 100px);
  align-items: stretch;
  width: min(100%, 1340px);
  justify-self: center;
  gap: 10px;
}

.splash-instructions {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  gap: 9px 14px;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid rgba(143, 243, 255, 0.42);
  border-radius: 6px;
  background: rgba(7, 13, 19, 0.78);
  box-shadow: 0 0 20px rgba(41, 179, 216, 0.16);
  color: #d8f8ff;
  font: 650 13px "Segoe UI", system-ui, sans-serif;
  backdrop-filter: blur(6px);
}

.splash-instructions > div {
  display: grid;
  gap: 2px;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.splash-instructions kbd {
  color: #8ff3ff;
  font: 800 13px "Segoe UI", system-ui, sans-serif;
  white-space: nowrap;
}

.splash-instructions span {
  color: #f5e9d1;
  line-height: 1.2;
}

#splash-left-stack {
  display: grid;
  grid-template-rows: minmax(0, 0.92fr) minmax(0, 1.08fr);
  grid-column: 1;
  grid-row: 1;
  gap: 6px;
  min-width: 0;
}

#pilot-profile-panel,
#music-ammo-balance-panel {
  display: grid;
  width: 100%;
  max-width: none;
  border: 1px solid rgba(143, 243, 255, 0.58);
  border-radius: 6px;
  background: rgba(7, 13, 19, 0.86);
  box-shadow: 0 0 22px rgba(41, 179, 216, 0.24);
  color: #d8f8ff;
  backdrop-filter: blur(7px);
}

#pilot-profile-panel {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px 7px;
  align-items: center;
  padding: 8px 10px;
  font: 700 12px "Segoe UI", system-ui, sans-serif;
}

#pilot-profile-panel > label:first-child {
  grid-column: 1 / -1;
  color: #fff;
  text-align: center;
  font-size: 15px;
}

#pilot-profile-select,
#pilot-call-sign {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(143, 243, 255, 0.58);
  border-radius: 4px;
  background: #0c0f13;
  color: #e2feff;
  padding: 5px 6px;
  font: 700 11px "Segoe UI", system-ui, sans-serif;
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 1 / -1;
  gap: 5px;
}

.profile-actions button {
  min-width: 0;
  border: 1px solid rgba(143, 243, 255, 0.48);
  border-radius: 4px;
  background: #14242b;
  color: #dffcff;
  padding: 4px 2px;
  font: 800 10px "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

.profile-actions button:hover,
.profile-actions button:focus-visible {
  background: #215066;
  outline: 1px solid #8ff3ff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#profile-config-dialog {
  width: min(430px, calc(100vw - 28px));
  border: 1px solid rgba(143, 243, 255, 0.72);
  border-radius: 6px;
  background: rgba(7, 13, 19, 0.97);
  color: #e5fbff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.78), 0 0 28px rgba(55, 205, 255, 0.22);
  padding: 0;
}

#profile-config-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
}

#profile-config-form {
  display: grid;
  gap: 10px;
  padding: 18px;
  font: 700 13px "Segoe UI", system-ui, sans-serif;
}

#profile-config-form h2 {
  margin: 0;
  color: #8ff3ff;
  font-size: 20px;
  text-align: center;
}

#profile-config-call-sign {
  width: 100%;
  border: 1px solid rgba(143, 243, 255, 0.58);
  border-radius: 4px;
  background: #0c0f13;
  color: #fff;
  padding: 8px;
  font: 800 14px "Segoe UI", system-ui, sans-serif;
}

#profile-config-form fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  border: 1px solid rgba(143, 243, 255, 0.3);
  border-radius: 5px;
  padding: 10px 12px 12px;
}

#profile-config-form legend { color: #8ff3ff; }
#profile-config-form fieldset label { display: flex; gap: 9px; align-items: center; }
#profile-config-form fieldset input { accent-color: #55e7ff; }
.profile-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile-dialog-actions button { min-height: 38px; border: 1px solid rgba(143, 243, 255, 0.5); border-radius: 4px; background: #14242b; color: #e5fbff; font-weight: 800; cursor: pointer; }
.profile-dialog-actions button:last-child { background: #17617a; }

#music-ammo-balance-panel {
  grid-template-columns: auto minmax(150px, 1fr) auto;
  gap: 7px 12px;
  align-items: center;
  padding: 9px 12px;
  font: 700 15px "Segoe UI", system-ui, sans-serif;
}

.balance-title,
#music-ammo-balance-value {
  grid-column: 1 / -1;
  text-align: center;
}

.balance-title {
  color: #ffffff;
  font-size: 15px;
}

.balance-endpoint:last-of-type {
  color: #ffb36e;
}

#music-ammo-balance {
  width: 100%;
  margin: 0;
  accent-color: #8ff3ff;
  cursor: pointer;
}

#music-ammo-balance-value {
  color: #8ff3ff;
  font-variant-numeric: tabular-nums;
}

#splash-settings-stack {
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  grid-column: 3;
  grid-row: 1;
  gap: 6px;
  min-width: 0;
}

#game-mode-panel,
#soundtrack-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(169, 230, 255, 0.5);
  border-radius: 6px;
  background: rgba(11, 17, 22, 0.86);
  color: #d8f8ff;
  font: 700 15px "Segoe UI", system-ui, sans-serif;
  backdrop-filter: blur(7px);
}

#game-mode-panel > span,
#soundtrack-panel > span {
  color: #ffffff;
  text-align: center;
}

#game-mode,
#soundtrack-select {
  width: 100%;
  background-color: #0c0f13;
  color: #e2feff;
  border: 1px solid rgba(143, 243, 255, 0.58);
  border-radius: 5px;
  padding: 5px 7px;
  font: 700 12px "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

#splash-rotor-volume-panel {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 42px;
  gap: 3px 8px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(105, 226, 255, 0.5);
  border-radius: 6px;
  background: rgba(7, 13, 19, 0.86);
  color: #d8f8ff;
  font: 700 15px "Segoe UI", system-ui, sans-serif;
  backdrop-filter: blur(7px);
}

#missile-range-panel {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) 34px;
  gap: 3px 8px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(90, 255, 142, 0.5);
  border-radius: 6px;
  background: rgba(7, 18, 14, 0.86);
  color: #d8ffe4;
  font: 700 15px "Segoe UI", system-ui, sans-serif;
  backdrop-filter: blur(7px);
}

#comms-volume-panel {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) 42px;
  gap: 3px 8px;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid rgba(255, 198, 105, 0.5);
  border-radius: 6px;
  background: rgba(22, 15, 7, 0.86);
  color: #fff1d8;
  font: 700 15px "Segoe UI", system-ui, sans-serif;
  backdrop-filter: blur(7px);
}

#comms-volume-panel > span {
  grid-column: 1 / -1;
  color: #ffffff;
  text-align: center;
}

#comms-volume {
  width: 100%;
  margin: 0;
  accent-color: #ffc669;
  cursor: pointer;
}

#comms-volume-value {
  color: #ffd99b;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#missile-range-panel > span {
  grid-column: 1 / -1;
  color: #ffffff;
  text-align: center;
}

#missile-range {
  width: 100%;
  margin: 0;
  accent-color: #55ff91;
  cursor: pointer;
}

#missile-range-value {
  color: #7dffa8;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#splash-rotor-volume-panel > span {
  grid-column: 1 / -1;
  color: #ffffff;
  text-align: center;
}

#splash-rotor-volume {
  width: 100%;
  margin: 0;
  accent-color: #69e2ff;
  cursor: pointer;
}

#splash-rotor-volume-value {
  color: #8ff0ff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#play-launch {
  position: relative;
  display: flex;
  grid-column: 4;
  grid-row: 1;
  min-width: 0;
}

#play-coin {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  z-index: 2;
  width: 76px;
  height: 76px;
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.58)) drop-shadow(0 0 9px rgba(255, 190, 83, 0.42));
  transform: translateX(-50%);
  transform-origin: 50% 50%;
  pointer-events: none;
}

#coin-slot {
  position: absolute;
  left: 50%;
  top: 9px;
  z-index: 3;
  width: 48px;
  height: 5px;
  border: 1px solid rgba(193, 239, 255, 0.8);
  border-radius: 2px;
  background: #030608;
  box-shadow: 0 0 9px rgba(101, 226, 255, 0.72), inset 0 1px 2px #000;
  transform: translateX(-50%);
  pointer-events: none;
}

#play-launch.depositing #play-coin {
  animation: coin-deposit 680ms cubic-bezier(0.45, 0, 0.9, 0.42) forwards;
}

#play-launch.depositing #coin-slot {
  animation: slot-flash 680ms ease-out;
}

@keyframes coin-deposit {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) rotateY(0deg) scale(1); }
  62% { opacity: 1; transform: translateX(-50%) translateY(72px) rotateY(540deg) scale(0.72); }
  84% { opacity: 1; transform: translateX(-50%) translateY(91px) rotateY(720deg) scale(0.42); }
  100% { opacity: 0; transform: translateX(-50%) translateY(96px) rotateY(810deg) scale(0.18); }
}

@keyframes slot-flash {
  0%, 62% { box-shadow: 0 0 9px rgba(101, 226, 255, 0.72), inset 0 1px 2px #000; }
  78% { border-color: #fff4b0; box-shadow: 0 0 22px #ffcf58, inset 0 0 7px #ff982f; }
  100% { box-shadow: 0 0 9px rgba(101, 226, 255, 0.72), inset 0 1px 2px #000; }
}

#play-button {
  width: 100%;
  min-height: 76px;
  border: 2px solid #8ff3ff;
  border-radius: 6px;
  background: rgba(10, 17, 23, 0.88);
  box-shadow: 0 0 24px rgba(70, 220, 255, 0.5), inset 0 0 18px rgba(44, 171, 214, 0.22);
  color: #ffffff;
  font: 900 27px "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  cursor: pointer;
  backdrop-filter: blur(7px);
}

#play-button:hover,
#play-button:focus-visible {
  border-color: #ffffff;
  background: rgba(111, 26, 22, 0.92);
  box-shadow: 0 0 32px rgba(255, 85, 47, 0.72);
  outline: 3px solid rgba(143, 243, 255, 0.72);
  outline-offset: 4px;
}

#play-button:disabled {
  cursor: wait;
}

#crosshair,
#hit-marker {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#crosshair::before,
#crosshair::after,
#crosshair i::before,
#crosshair i::after {
  position: absolute;
  content: "";
  background: rgba(190, 246, 255, 0.82);
  box-shadow: 0 0 5px rgba(85, 225, 255, 0.72);
  transition: background 80ms ease, box-shadow 80ms ease;
}

#crosshair::before,
#crosshair::after { left: 16px; width: 2px; height: 8px; }
#crosshair::before { top: 0; }
#crosshair::after { bottom: 0; }
#crosshair i::before,
#crosshair i::after { top: 16px; width: 8px; height: 2px; }
#crosshair i::before { left: 0; }
#crosshair i::after { right: 0; }

#crosshair.flash::before,
#crosshair.flash::after,
#crosshair.flash i::before,
#crosshair.flash i::after {
  background: #fff2a6;
  box-shadow: 0 0 12px #ff5b32;
}

#hit-marker::before,
#hit-marker::after {
  position: absolute;
  left: 16px;
  top: 7px;
  width: 2px;
  height: 20px;
  content: "";
  background: #fff;
  opacity: 0;
  transform: rotate(45deg) scale(1.5);
  transition: opacity 130ms ease, transform 130ms ease;
  box-shadow: 0 0 8px #ff4d2e;
}

#hit-marker::after { transform: rotate(-45deg) scale(1.5); }
#hit-marker.active::before { opacity: 1; transform: rotate(45deg) scale(1); }
#hit-marker.active::after { opacity: 1; transform: rotate(-45deg) scale(1); }

#damage-numbers {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.damage-number {
  position: absolute;
  color: #fff3a6;
  font: 800 16px "Segoe UI", system-ui, sans-serif;
  text-shadow: 0 0 6px #ff3b20, 0 2px 2px #000;
  animation: damage-rise 760ms ease-out forwards;
}

@keyframes damage-rise {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.82); }
  to { opacity: 0; transform: translate(-50%, -110px) scale(1.12); }
}

#damage-flash {
  position: fixed;
  inset: 0;
  border: 0 solid rgba(255, 30, 22, 0);
  box-shadow: inset 0 0 0 rgba(255, 20, 12, 0);
  pointer-events: none;
  transition: box-shadow 420ms ease, border-width 420ms ease;
}

#damage-flash.active {
  border-width: 12px;
  box-shadow: inset 0 0 85px rgba(255, 20, 12, 0.72);
  transition: none;
}

#run-summary {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 5, 10, 0.76);
  backdrop-filter: blur(8px);
}

#run-summary[hidden] { display: none; }

.summary-panel {
  width: min(680px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgba(255, 91, 50, 0.56);
  border-radius: 8px;
  background: rgba(20, 12, 18, 0.94);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.58);
}

.summary-kicker { color: #ff7d5e; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.summary-panel h1 { margin: 4px 0 20px; color: #fff1d2; font-size: 30px; }
.composite-score { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 18px; margin: -8px 0 18px; padding: 12px 0 14px; border-top: 1px solid rgba(255,125,94,0.45); border-bottom: 1px solid rgba(255,125,94,0.45); }
.composite-score span { color: #c8bdba; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.composite-score strong { grid-row: 1 / 3; grid-column: 2; color: #fff1d2; font-size: 38px; line-height: 1; font-variant-numeric: tabular-nums; }
.composite-score b { color: #ff8c68; font-size: 17px; text-transform: uppercase; }
.score-entry { display: grid; grid-template-columns: auto minmax(130px, 1fr) auto; align-items: center; gap: 9px; margin: 0 0 12px; }
.score-entry label { color: #ffb28f; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.score-entry input { min-width: 0; height: 38px; border: 1px solid rgba(133,245,255,0.48); border-radius: 4px; background: #080d12; color: #eaffff; padding: 0 10px; font: 800 14px "Segoe UI", sans-serif; text-transform: uppercase; }
.score-entry button { height: 38px; border: 1px solid #ff7753; border-radius: 4px; background: #792a28; color: #fff; padding: 0 13px; font-weight: 800; cursor: pointer; }
.score-entry button:disabled { opacity: 0.5; cursor: default; }
.high-score-chart { margin: 0 0 18px; padding: 12px 14px; border: 1px solid rgba(133,245,255,0.22); background: rgba(3,10,15,0.62); }
.high-score-chart h2 { margin: 0 0 8px; color: #85f5ff; font-size: 13px; text-transform: uppercase; }
.high-score-chart ol { display: grid; gap: 4px; margin: 0; padding-left: 28px; }
.high-score-chart li { padding-left: 4px; color: #dcecff; font-size: 12px; }
.high-score-chart li span { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; }
.high-score-chart strong { color: #fff1d2; }
.high-score-chart em { color: #ff9d7f; font-style: normal; }
.summary-panel dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 0 0 24px; }
.summary-panel dl div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.summary-panel dt { color: #c8bdba; }
.summary-panel dd { margin: 0; color: #85f5ff; font-weight: 800; font-variant-numeric: tabular-nums; }
#restart-button { width: 100%; min-height: 46px; border: 1px solid #ff7753; border-radius: 6px; background: #8f2b27; color: #fff; font: 800 15px "Segoe UI", system-ui, sans-serif; cursor: pointer; }
#restart-button:hover, #restart-button:focus-visible { background: #b53b31; outline: 2px solid #8ff0ff; outline-offset: 2px; }

@media (max-width: 620px) {
  .summary-panel dl { grid-template-columns: 1fr; }
}

#hud {
  position: fixed;
  bottom: 18px;
  left: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 9px 12px;
  border: 1px solid rgba(255, 198, 92, 0.28);
  border-radius: 8px;
  background: rgba(18, 9, 20, 0.62);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(9px);
  line-height: 1.45;
  font-size: 14px;
  pointer-events: none;
}

.hud-title {
  margin-bottom: 8px;
  color: #ffd47a;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

#hud span {
  color: #d8f8ff;
}

#status {
  margin: 0;
  color: #ffcf9c;
  font-style: italic;
}

#supply-altitude-advisor {
  position: fixed;
  left: 50%;
  bottom: 72px;
  z-index: 18;
  min-width: 290px;
  padding: 10px 18px;
  transform: translateX(-50%);
  border: 2px solid rgba(86, 239, 255, 0.76);
  border-radius: 6px;
  background: rgba(3, 18, 24, 0.88);
  color: #8ffcff;
  font: 800 17px "Arial Black", Impact, "Segoe UI Black", sans-serif;
  text-align: center;
  text-shadow: 0 0 9px rgba(62, 232, 255, 0.9);
  box-shadow: 0 0 22px rgba(62, 232, 255, 0.3), inset 0 0 14px rgba(62, 232, 255, 0.12);
  pointer-events: none;
}

#supply-altitude-advisor[hidden] {
  display: none;
}

#supply-altitude-advisor.flash {
  animation: supply-altitude-flash 0.42s ease-out 3;
}

@keyframes supply-altitude-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

#top-right-hud {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  display: grid;
  gap: 8px;
  min-width: 250px;
  pointer-events: none;
}

#hit-points-panel {
  min-width: 250px;
  padding: 10px 16px 12px;
  border: 2px solid rgba(107, 238, 255, 0.7);
  border-radius: 6px;
  background: rgba(5, 12, 19, 0.78);
  box-shadow: 0 0 20px rgba(61, 210, 255, 0.28), inset 0 0 14px rgba(61, 210, 255, 0.12);
  color: #d8f8ff;
  font-family: "Arial Black", Impact, "Segoe UI Black", sans-serif;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(7px);
}

#live-score-panel {
  padding: 9px 16px 11px;
  border: 2px solid rgba(255, 202, 98, 0.72);
  border-radius: 6px;
  background: rgba(5, 12, 19, 0.82);
  box-shadow: 0 0 20px rgba(255, 176, 72, 0.2), inset 0 0 14px rgba(255, 176, 72, 0.09);
  color: #fff0bd;
  font-family: "Arial Black", Impact, "Segoe UI Black", sans-serif;
  text-align: center;
  backdrop-filter: blur(7px);
}

#altitude-panel {
  padding: 8px 16px 10px;
  border: 2px solid rgba(82, 255, 114, 0.7);
  border-radius: 6px;
  background: rgba(5, 12, 19, 0.82);
  box-shadow: 0 0 18px rgba(82, 255, 114, 0.2), inset 0 0 12px rgba(82, 255, 114, 0.1);
  color: #d8ffe2;
  font-family: "Arial Black", Impact, "Segoe UI Black", sans-serif;
  text-align: center;
  backdrop-filter: blur(7px);
}

#altitude-panel span {
  display: block;
  color: #52ff72;
  font-size: 11px;
  line-height: 1;
}

#altitude-readout {
  display: block;
  margin-top: 3px;
  font-size: 28px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(82, 255, 114, 0.72);
}

#live-score-panel span {
  display: block;
  color: #ffca62;
  font-size: 11px;
  line-height: 1;
}

#live-score {
  display: block;
  margin-top: 3px;
  font-size: 38px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 9px rgba(255, 207, 112, 0.72), 3px 3px 0 #2b2114;
}

.hit-points-label {
  display: block;
  color: #ffca62;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
}

#hit-points {
  display: block;
  font-size: 42px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px currentColor, 3px 3px 0 #132630;
}

#bombing-scope {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 11;
  width: min(330px, calc(100vw - 36px));
  border: 1px solid rgba(91, 255, 184, 0.72);
  border-radius: 6px;
  background: rgba(0, 14, 12, 0.88);
  box-shadow: 0 0 24px rgba(39, 255, 169, 0.18), inset 0 0 20px rgba(31, 255, 169, 0.08);
  color: #8effc6;
  font: 700 10px "Segoe UI", system-ui, sans-serif;
  pointer-events: none;
  backdrop-filter: blur(5px);
}

.bombing-scope-header,
.bombing-scope-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
  padding: 0 9px;
}

.bombing-scope-header {
  border-bottom: 1px solid rgba(91, 255, 184, 0.28);
}

.bombing-scope-footer {
  border-top: 1px solid rgba(91, 255, 184, 0.28);
  color: rgba(142, 255, 198, 0.72);
  font-size: 9px;
}

.bombing-scope-header b,
.bombing-scope-footer b {
  color: #e2fff0;
  font-weight: 800;
}

#bombing-scope-canvas {
  display: block;
  width: 100%;
  aspect-ratio: 15 / 11;
}

#sonar-activation {
  position: fixed;
  left: 50%;
  top: 48%;
  z-index: 18;
  width: clamp(210px, 25vw, 360px);
  aspect-ratio: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.94);
}

#sonar-activation.active {
  visibility: visible;
  animation: sonar-activation-flicker 1.3s ease-out both;
}

#launch-countdown {
  position: fixed;
  left: 50%;
  top: 23%;
  z-index: 19;
  min-width: min(420px, calc(100vw - 40px));
  color: #b9ffe0;
  font: 900 clamp(34px, 6vh, 72px) "Segoe UI", system-ui, sans-serif;
  text-align: center;
  text-shadow: 0 0 10px #24ff91, 0 0 28px rgba(32, 255, 135, 0.72);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 140ms ease, transform 180ms ease;
}

#launch-countdown.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#launch-countdown.configure {
  font-size: clamp(22px, 3.5vh, 42px);
}

.sonar-activation-ring {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 2px solid rgba(83, 255, 159, 0.92);
  border-radius: 50%;
  box-shadow:
    0 0 16px rgba(44, 255, 139, 0.8),
    0 0 44px rgba(30, 255, 128, 0.34),
    inset 0 0 18px rgba(47, 255, 137, 0.48),
    inset 0 0 0 30px rgba(20, 255, 117, 0.035),
    inset 0 0 0 62px rgba(20, 255, 117, 0.025);
  background: rgba(0, 28, 14, 0.2);
}

.sonar-activation-ring::before,
.sonar-activation-ring::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  height: 2px;
  background: rgba(123, 255, 184, 0.95);
  box-shadow: 0 0 9px #39ff8d, 0 0 18px rgba(44, 255, 139, 0.72);
  transform-origin: 0 50%;
}

.sonar-activation-ring::before {
  width: 100%;
  left: 0;
  background: rgba(78, 255, 157, 0.24);
  box-shadow: none;
}

#sonar-activation.active .sonar-activation-ring::after {
  animation: sonar-activation-sweep 0.72s 0.18s cubic-bezier(0.3, 0.7, 0.35, 1) both;
}

.sonar-activation-ring > i,
.sonar-activation-ring > b {
  position: absolute;
  border: 1px solid rgba(85, 255, 164, 0.42);
  border-radius: 50%;
}

.sonar-activation-ring > i {
  inset: 24%;
}

.sonar-activation-ring > b {
  inset: 42%;
  box-shadow: 0 0 12px rgba(41, 255, 136, 0.62);
}

.sonar-activation-ring > span {
  position: absolute;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  color: #a8ffd0;
  font: 800 12px "Segoe UI", system-ui, sans-serif;
  text-shadow: 0 0 8px #20ff7c;
  white-space: nowrap;
}

@keyframes sonar-activation-flicker {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.94); }
  5% { opacity: 0.92; }
  9% { opacity: 0.18; }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  22% { opacity: 0.58; }
  28% { opacity: 1; }
  72% { opacity: 0.94; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
}

@keyframes sonar-activation-sweep {
  from { transform: rotate(-90deg); }
  to { transform: rotate(270deg); }
}

#cockpit-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  pointer-events: none;
}

.canopy-rail {
  position: absolute;
  top: -5vh;
  bottom: 17vh;
  width: clamp(24px, 4.5vw, 72px);
  border: 2px solid rgba(145, 180, 187, 0.42);
  background: linear-gradient(90deg, rgba(7, 12, 14, 0.92), rgba(45, 55, 58, 0.58), rgba(5, 9, 10, 0.94));
  box-shadow: inset 0 0 16px rgba(120, 235, 255, 0.08), 0 0 18px rgba(0, 0, 0, 0.72);
}

.canopy-rail-left { left: -22px; transform: skewX(5deg); }
.canopy-rail-right { right: -22px; transform: skewX(-5deg); }

.canopy-header {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 260px;
  padding: 7px 18px 8px;
  transform: translateX(-50%);
  border: 1px solid rgba(128, 228, 255, 0.35);
  border-top: 0;
  background: rgba(5, 12, 15, 0.84);
  color: #aeeeff;
  font: 800 10px "Segoe UI", system-ui, sans-serif;
  text-align: center;
}

.canopy-header i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #53e9ff;
  box-shadow: 0 0 9px #53e9ff;
  animation: cockpit-blink 1.7s steps(2, end) infinite;
}

.cockpit-console {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(210px, 360px) minmax(180px, 1fr);
  align-items: end;
  gap: clamp(10px, 2vw, 30px);
  min-height: 19vh;
  padding: 14px max(5vw, 72px) 12px;
  border-top: 2px solid rgba(116, 218, 235, 0.38);
  background: linear-gradient(180deg, rgba(9, 15, 17, 0.78), rgba(2, 6, 7, 0.98) 34%);
  box-shadow: 0 -18px 34px rgba(0, 0, 0, 0.48), inset 0 8px 18px rgba(82, 202, 224, 0.05);
}

.cockpit-bank {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid rgba(118, 223, 238, 0.25);
  background: rgba(7, 18, 20, 0.82);
}

.cockpit-bank dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.cockpit-bank dl div { min-width: 0; text-align: center; }
.cockpit-bank dt { color: #70a9ad; font: 700 8px "Segoe UI", sans-serif; }
.cockpit-bank dd { margin: 2px 0 0; color: #b8fff0; font: 800 17px Consolas, monospace; text-shadow: 0 0 8px rgba(71, 255, 186, 0.55); }

.cockpit-lamps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.cockpit-lamps i {
  width: 10px;
  height: 6px;
  background: #35ff9b;
  box-shadow: 0 0 8px #35ff9b;
  animation: cockpit-blink 1.35s steps(2, end) infinite;
}

.cockpit-lamps i:nth-child(2) { background: #ffcf4a; box-shadow: 0 0 8px #ffcf4a; animation-delay: -0.45s; }
.cockpit-lamps i:nth-child(3) { animation-delay: -0.8s; }
.cockpit-lamps i:nth-child(4) { background: #60cfff; box-shadow: 0 0 8px #60cfff; animation-delay: -1.1s; }
.cockpit-lamps i:nth-child(5) { animation-delay: -0.2s; }

#cockpit-sonar-panel {
  padding: 6px 8px 8px;
  border: 1px solid rgba(78, 255, 166, 0.5);
  background: #00100c;
  color: #82ffc0;
  font: 800 8px "Segoe UI", sans-serif;
  text-align: center;
  box-shadow: inset 0 0 18px rgba(44, 255, 164, 0.08), 0 0 14px rgba(44, 255, 164, 0.1);
}

#cockpit-sonar-canvas { display: block; width: 100%; height: min(11vh, 90px); margin-top: 4px; }

.cockpit-warning {
  margin-bottom: 8px;
  padding: 4px 6px;
  border: 1px solid rgba(73, 255, 160, 0.24);
  color: #67ffac;
  font: 800 9px "Segoe UI", sans-serif;
  text-align: center;
}

#cockpit-overlay.red-alert .cockpit-warning {
  border-color: #ff4b43;
  background: rgba(126, 0, 0, 0.48);
  color: #fff0e7;
  box-shadow: 0 0 18px rgba(255, 40, 30, 0.62);
  animation: cockpit-alert 0.28s steps(2, end) infinite;
}

@keyframes cockpit-blink { 0%, 58% { opacity: 1; } 59%, 100% { opacity: 0.28; } }
@keyframes cockpit-alert { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.5; } }

.cockpit-mode #hit-points-panel { opacity: 0.22; }
.cockpit-mode #bottom-right-controls { opacity: 0.32; }

@media (max-width: 760px) {
  .cockpit-console {
    grid-template-columns: 1fr minmax(145px, 1.2fr) 1fr;
    gap: 5px;
    min-height: 18vh;
    padding: 7px 8px 6px;
  }

  .cockpit-bank { padding: 6px 4px; }
  .cockpit-bank dl { grid-template-columns: 1fr; gap: 2px; }
  .cockpit-bank dt { font-size: 6px; }
  .cockpit-bank dd { font-size: 11px; }
  .cockpit-lamps { margin-bottom: 4px; }
  .cockpit-lamps i { width: 6px; height: 4px; }
  .cockpit-warning { margin-bottom: 4px; padding: 2px; font-size: 6px; }
  #cockpit-sonar-canvas { height: 70px; }
  .cockpit-mode #bottom-right-controls { display: none; }
}

.countdown-label {
  display: block;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(107, 238, 255, 0.28);
  color: #ffca62;
  font-size: 10px;
  line-height: 1;
}

#mission-countdown {
  display: block;
  margin-top: 3px;
  color: #d8f8ff;
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 7px rgba(107, 238, 255, 0.65);
}

.coordinates-label {
  display: block;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(107, 238, 255, 0.22);
  color: #ffca62;
  font-size: 9px;
  line-height: 1;
}

#coordinates,
#base-range {
  display: block;
  margin-top: 3px;
  color: #bff7ff;
  font-size: 13px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#wingman-1-status,
#wingman-2-status {
  display: block;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(107, 238, 255, 0.16);
  color: #9deeff;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

#wingman-2-status {
  color: #9dffc1;
}

#bottom-right-controls {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 12;
  display: flex;
  align-items: stretch;
  gap: 8px;
  height: 40px;
  max-width: calc(100vw - 36px);
}

#pause-button,
#instructions-button,
#music-button {
  height: 40px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(255, 211, 132, 0.44);
  border-radius: 8px;
  background: rgba(73, 30, 42, 0.74);
  color: #fff4da;
  font: 700 14px "Segoe UI", system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
  backdrop-filter: blur(9px);
}

#pause-button:hover,
#pause-button:focus-visible,
#instructions-button:hover,
#instructions-button:focus-visible,
#music-button:hover,
#music-button:focus-visible {
  background: rgba(118, 50, 49, 0.86);
  outline: 2px solid rgba(120, 221, 255, 0.56);
  outline-offset: 2px;
}

#rotor-volume-panel {
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr) 42px;
  width: 240px;
  height: 40px;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(105, 226, 255, 0.34);
  border-radius: 8px;
  background: rgba(11, 19, 27, 0.72);
  color: #d8f8ff;
  font: 700 13px "Segoe UI", system-ui, sans-serif;
  backdrop-filter: blur(9px);
}

#rotor-volume-panel > span {
  white-space: nowrap;
}

#rotor-volume {
  width: 100%;
  height: 18px;
  margin: 0;
  accent-color: #69e2ff;
  cursor: pointer;
}

#rotor-volume-value {
  color: #8ff0ff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#fuel-panel {
  display: flex;
  height: 40px;
  min-width: 138px;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(80, 244, 255, 0.36);
  border-radius: 8px;
  background: rgba(8, 18, 25, 0.72);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  color: #d8f8ff;
  font: 700 15px "Segoe UI", system-ui, sans-serif;
  text-align: right;
  backdrop-filter: blur(9px);
  pointer-events: none;
}

#fuel-panel span {
  display: inline-block;
  min-width: 34px;
  color: #7fffe9;
  font-variant-numeric: tabular-nums;
}

#instructions {
  position: fixed;
  left: 50%;
  bottom: 70px;
  z-index: 30;
  display: flex;
  width: min(960px, calc(100vw - 36px));
  max-width: calc(100vw - 36px);
  transform: translateX(-50%);
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid rgba(154, 220, 233, 0.25);
  border-radius: 8px;
  background: rgba(10, 12, 21, 0.58);
  color: #f4ead8;
  font-size: 13px;
  backdrop-filter: blur(9px);
  pointer-events: none;
}

#instructions strong {
  flex: 0 0 auto;
  color: #8ff0ff;
}

#instructions span {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

#instructions[hidden] {
  display: none;
}

@media (min-width: 621px) and (max-width: 1000px) {
  .splash-controls {
    grid-template-columns: 180px minmax(0, 1fr) 150px 75px;
  }

  .splash-instructions {
    gap: 6px 4px;
  }

  .splash-instructions kbd {
    font-size: 11px;
  }

  .splash-instructions span {
    display: none;
  }

  #game-mode-panel,
  #soundtrack-panel {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 7px 8px;
    font-size: 11px;
  }

  #game-mode-panel > span,
  #soundtrack-panel > span {
    font-size: 10px;
  }

  #game-mode,
  #soundtrack-select {
    padding: 4px 6px;
    font-size: 11px;
  }
}

@media (max-width: 620px) {
  #splash-screen {
    padding: 0 8px 8px;
  }

  .splash-controls {
    grid-template-columns: 100px minmax(0, 1fr) 64px 48px;
    gap: 6px;
  }

  #pilot-profile-panel {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 4px;
  }

  #pilot-profile-panel > label:first-child {
    font-size: 8px;
  }

  #pilot-profile-select,
  #pilot-call-sign {
    padding: 2px 3px;
    font-size: 8px;
  }

  .profile-actions {
    gap: 2px;
  }

  .profile-actions button {
    padding: 2px 0;
    font-size: 6px;
  }

  #play-coin {
    bottom: calc(100% + 8px);
    width: 52px;
    height: 52px;
  }

  .splash-instructions {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 5px 2px;
    padding: 7px 4px;
  }

  .splash-instructions > div {
    gap: 0;
  }

  .splash-instructions kbd {
    font-size: 7px;
  }

  .splash-instructions span {
    display: none;
  }

  #music-ammo-balance-panel {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 7px 8px;
  }

  #music-ammo-balance-panel .balance-endpoint {
    display: none;
  }

  .balance-title {
    font-size: 10px;
  }

  #music-ammo-balance-value {
    font-size: 10px;
  }

  #game-mode-panel,
  #soundtrack-panel {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 5px 6px;
    font-size: 8px;
  }

  #game-mode,
  #soundtrack-select {
    padding: 4px;
    font-size: 9px;
  }

  #splash-rotor-volume-panel {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 7px 5px;
    font-size: 8px;
  }

  #missile-range-panel {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 7px 5px;
    font-size: 8px;
  }

  #missile-range-panel > span,
  #missile-range-value {
    font-size: 8px;
    text-align: center;
  }

  #comms-volume-panel {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 7px 5px;
    font-size: 8px;
  }

  #comms-volume-panel > span,
  #comms-volume-value {
    font-size: 8px;
    text-align: center;
  }

  #splash-rotor-volume-panel > span {
    font-size: 8px;
  }

  #splash-rotor-volume-value {
    font-size: 8px;
    text-align: center;
  }

  #play-button {
    min-height: 58px;
    font-size: 17px;
  }

  #hud {
    bottom: 8px;
    left: 8px;
    max-width: min(210px, calc(100vw - 16px));
    padding: 11px 12px;
    font-size: 12px;
  }

  .hud-title {
    font-size: 15px;
  }

  #top-right-hud {
    top: 12px;
    right: 12px;
    min-width: 170px;
  }

  #hit-points-panel {
    padding: 8px 11px 10px;
  }

  #bombing-scope {
    top: 180px;
    left: 8px;
    width: min(230px, calc(100vw - 16px));
  }

  .bombing-scope-header,
  .bombing-scope-footer {
    height: 19px;
    padding: 0 6px;
    font-size: 8px;
  }

  #hit-points {
    font-size: 30px;
  }

  #live-score-panel {
    padding: 7px 11px 9px;
  }

  #altitude-panel {
    padding: 6px 11px 8px;
  }

  #altitude-readout {
    font-size: 22px;
  }

  #live-score {
    font-size: 28px;
  }

  #bottom-right-controls {
    right: 8px;
    bottom: 8px;
    gap: 5px;
    height: 38px;
    max-width: calc(100vw - 16px);
  }

  #pause-button,
  #instructions-button,
  #music-button {
    height: 38px;
    min-height: 38px;
    padding: 0 4px;
    font-size: 8px;
  }

  #rotor-volume-panel {
    width: 70px;
    height: 38px;
    grid-template-columns: minmax(34px, 1fr) 24px;
    gap: 4px;
    padding: 5px 6px;
    font-size: 10px;
  }

  #rotor-volume-panel > span {
    display: none;
  }

  #fuel-panel {
    height: 38px;
    min-width: 75px;
    gap: 3px;
    padding: 5px 4px;
    font-size: 8px;
  }

  #fuel-panel span {
    min-width: 20px;
  }

  #instructions {
    left: 12px;
    top: 12px;
    bottom: auto;
    width: auto;
    transform: none;
    padding: 9px 12px;
  }

  #instructions span {
    display: none;
  }
}
