:root {
  color-scheme: dark;
  --ink: #f4f7f8;
  --muted: #a7b4b8;
  --panel: rgba(13, 18, 22, 0.78);
  --panel-line: rgba(244, 247, 248, 0.18);
  --accent: #f2cb57;
  --danger: #ed5b47;
  --steel: #78a5b9;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #10161a;
  color: var(--ink);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

#game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-width: 320px;
  min-height: 420px;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: #172025;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

#main-menu,
#help-panel {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 9, 12, 0.66);
  backdrop-filter: blur(5px);
}

#main-menu.hidden,
#help-panel.hidden {
  display: none;
}

.menu-card,
.help-card {
  width: min(780px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: rgba(13, 18, 22, 0.96);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
}

.menu-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 20px;
  align-items: center;
  padding: 22px;
}

.menu-copy h1 {
  margin: 4px 0 10px;
  color: var(--ink);
  font-size: clamp(34px, 5.6vw, 64px);
  line-height: 0.95;
  letter-spacing: 0;
}

.menu-copy p {
  max-width: 580px;
  margin: 0;
  color: #dce7ea;
  font-size: 16px;
  line-height: 1.5;
}

.menu-actions {
  display: grid;
  gap: 10px;
}

.menu-actions button,
.menu-actions a,
.help-head button,
.help-actions button {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(244, 247, 248, 0.22);
  border-radius: 8px;
  background: rgba(244, 247, 248, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
}

.menu-actions .primary-action,
.help-actions .primary-action {
  background: #f2cb57;
  color: #151515;
}

.menu-actions .aibiz-return-action,
.aibiz-site-cta {
  border-color: rgba(101, 228, 255, 0.58);
  background: linear-gradient(135deg, #42f58d 0%, #65e4ff 100%);
  color: #03120a;
  box-shadow: 0 12px 30px rgba(66, 245, 141, 0.24);
}

.aibiz-site-cta {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid rgba(101, 228, 255, 0.58);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}

.menu-actions .aibiz-return-action:hover,
.aibiz-site-cta:hover {
  transform: translateY(-1px);
}

.menu-status {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(244, 247, 248, 0.12);
}

.menu-status span {
  padding: 7px 10px;
  border: 1px solid rgba(185, 246, 255, 0.2);
  border-radius: 8px;
  background: rgba(45, 79, 88, 0.32);
  color: #b9f6ff;
  font-size: 11px;
  font-weight: 850;
}

.menu-best-scores {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 6px;
}

.best-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.best-score-row {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(244, 247, 248, 0.12);
  border-radius: 8px;
  background: rgba(244, 247, 248, 0.055);
}

.best-score-row.is-active {
  border-color: rgba(242, 203, 87, 0.5);
  background: rgba(242, 203, 87, 0.12);
}

.best-score-row span,
.best-score-row small,
.best-score-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.best-score-row span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.best-score-row small {
  margin-top: 6px;
  color: #f2cb57;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.best-score-row strong {
  margin-top: 3px;
  color: #b9f6ff;
  font-size: 15px;
  font-weight: 950;
}

.help-head,
.help-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid rgba(244, 247, 248, 0.12);
}

.help-actions {
  border-top: 1px solid rgba(244, 247, 248, 0.12);
  border-bottom: 0;
}

.help-scroll {
  max-height: min(520px, calc(100vh - 196px));
  overflow: auto;
  padding: 14px;
}

.help-block,
.help-grid article {
  border: 1px solid rgba(244, 247, 248, 0.12);
  border-radius: 8px;
  background: rgba(244, 247, 248, 0.055);
}

.help-block {
  padding: 14px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.help-grid article {
  padding: 12px;
}

.help-block h2,
.help-grid h2 {
  margin: 0 0 7px;
  color: #f2cb57;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0;
}

.help-block p,
.help-grid p,
.help-block li {
  margin: 0;
  color: #dce7ea;
  font-size: 13px;
  line-height: 1.42;
}

.help-block ul {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  padding-left: 18px;
}

#hud {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  pointer-events: none;
}

.hud-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}

.hud-card {
  min-width: 128px;
  height: 52px;
  padding: 8px 10px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
}

.hud-card.compact {
  min-width: 92px;
}

.hud-card.objective {
  min-width: 176px;
}

.hud-card.squad-card {
  min-width: 152px;
}

.hud-card.squad-card strong {
  white-space: nowrap;
  font-size: 12px;
}

.hud-card.renderer-card {
  min-width: 104px;
}

.hud-card.renderer-card strong {
  color: #b9f6ff;
  font-size: 13px;
}

.hud-card.atomic-card {
  min-width: 104px;
  border-color: rgba(242, 203, 87, 0.34);
}

.hud-card.atomic-card strong {
  color: #f2cb57;
  font-size: 13px;
}

.hud-card.atomic-card.hud-card-active {
  border-color: rgba(237, 91, 71, 0.88);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 20px rgba(237, 91, 71, 0.34);
}

.hud-card.hud-card-ready {
  border-color: rgba(185, 246, 255, 0.58);
  animation: phantom-ready-pulse 1.35s ease-in-out infinite;
}

.hud-card.hud-card-active {
  border-color: rgba(185, 246, 255, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 18px rgba(185, 246, 255, 0.28);
}

.hud-card.hud-card-warning {
  border-color: rgba(255, 140, 56, 0.78);
  animation: hud-warning-pulse 0.9s ease-in-out infinite;
}

.hud-card.hud-card-warning strong {
  color: #ffb36c;
}

.hud-card.hud-card-ammo-low {
  border-color: rgba(242, 203, 87, 0.74);
  background: rgba(82, 58, 16, 0.72);
}

.hud-card.hud-card-ammo-low strong {
  color: #f2cb57;
}

.hud-card.hud-card-ammo-empty {
  border-color: rgba(237, 91, 71, 0.76);
  background: rgba(76, 20, 17, 0.74);
}

.hud-card.hud-card-ammo-empty strong {
  color: #ffb36c;
}

.hud-card.hud-card-ammo-pulse {
  animation: hud-ammo-pulse 0.72s ease-in-out infinite;
}

.hud-card.hud-card-ammo-capacity {
  border-color: rgba(185, 246, 255, 0.76);
  background: rgba(18, 58, 66, 0.76);
  animation: hud-ammo-capacity-pulse 0.62s ease-out infinite;
}

.hud-card.hud-card-ammo-capacity strong {
  color: #b9f6ff;
}

.hud-card.hud-card-rescue {
  border-color: rgba(92, 231, 126, 0.78);
  animation: hud-rescue-pulse 0.72s ease-in-out infinite;
}

.hud-card.hud-card-rescue strong {
  color: #f2cb57;
}

@keyframes phantom-ready-pulse {
  0%,
  100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 0 rgba(185, 246, 255, 0);
  }

  50% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 16px rgba(185, 246, 255, 0.3);
  }
}

@keyframes hud-rescue-pulse {
  0%,
  100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 0 rgba(92, 231, 126, 0);
  }

  50% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 18px rgba(92, 231, 126, 0.34), 0 0 10px rgba(242, 203, 87, 0.24);
  }
}

@keyframes hud-warning-pulse {
  0%,
  100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 0 rgba(255, 140, 56, 0);
  }

  50% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 18px rgba(255, 140, 56, 0.34);
  }
}

@keyframes hud-ammo-pulse {
  0%,
  100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 0 rgba(242, 203, 87, 0);
  }

  50% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 18px rgba(242, 203, 87, 0.28), 0 0 10px rgba(237, 91, 71, 0.14);
  }
}

@keyframes hud-ammo-capacity-pulse {
  0%,
  100% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 0 rgba(185, 246, 255, 0);
  }

  50% {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 0 18px rgba(185, 246, 255, 0.3), 0 0 10px rgba(92, 231, 126, 0.14);
  }
}

.label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.meter {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 1px solid rgba(244, 247, 248, 0.25);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.26);
}

.meter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4bd37b, #f2cb57, #ed5b47);
  transform-origin: left center;
}

.meter.stamina-meter span {
  background: linear-gradient(90deg, #ed5b47, #f2cb57 42%, #78a5b9);
}

#toast {
  position: absolute;
  left: 50%;
  bottom: 30px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(8px);
}

#run-share {
  position: absolute;
  left: 50%;
  top: 16px;
  z-index: 5;
  display: grid;
  gap: 5px;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 104px);
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid rgba(185, 246, 255, 0.38);
  border-radius: 8px;
  background: rgba(9, 14, 18, 0.86);
  color: var(--ink);
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(8px);
}

#run-share.hidden {
  display: none;
}

#run-share span {
  color: var(--steel);
  font-size: 10px;
  font-weight: 900;
}

.run-lane-badge {
  justify-self: center;
  min-width: 118px;
  padding: 5px 10px;
  border: 1px solid rgba(141, 255, 177, 0.42);
  border-radius: 999px;
  background: rgba(141, 255, 177, 0.11);
  color: #8dffb1;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.run-lane-badge.is-continued {
  border-color: rgba(242, 203, 87, 0.58);
  background: rgba(242, 203, 87, 0.16);
  color: var(--gold);
  box-shadow: 0 0 18px rgba(242, 203, 87, 0.16);
}

.run-best-delta {
  justify-self: center;
  color: rgba(185, 246, 255, 0.82);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
}

.run-best-delta.is-ahead {
  color: #8dffb1;
}

.run-best-delta.is-matched {
  color: var(--gold);
}

.run-best-delta.is-short {
  color: rgba(167, 180, 184, 0.9);
}

#run-share code {
  overflow-wrap: anywhere;
  color: var(--gold);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  user-select: text;
}

#run-share .feedback-notes,
#run-share .feedback-tester {
  display: grid;
  gap: 5px;
  text-align: left;
}

#run-share input,
#run-share textarea {
  width: 100%;
  border: 1px solid rgba(244, 247, 248, 0.18);
  border-radius: 8px;
  background: rgba(244, 247, 248, 0.08);
  color: var(--ink);
  font: 800 12px/1.35 "Segoe UI", Arial, sans-serif;
  padding: 8px 10px;
}

#run-share textarea {
  min-height: 58px;
  resize: vertical;
}

.feedback-checklist {
  margin: -2px 0 0;
  color: rgba(244, 247, 248, 0.72);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.35;
  text-transform: uppercase;
}

.feedback-checklist strong {
  color: #b9f6ff;
}

.feedback-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.feedback-tags button {
  min-height: 26px;
  padding: 0 9px;
  border-color: rgba(185, 246, 255, 0.28);
  background: rgba(185, 246, 255, 0.08);
  color: rgba(185, 246, 255, 0.88);
  font-size: 10px;
}

.feedback-tags button.is-selected {
  border-color: rgba(141, 255, 177, 0.58);
  background: rgba(141, 255, 177, 0.2);
  color: #8dffb1;
}

#run-share input::placeholder,
#run-share textarea::placeholder {
  color: rgba(167, 180, 184, 0.78);
}

.run-share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.feedback-queue-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

#run-share .feedback-queue-status span {
  color: #b9f6ff;
  font-size: 11px;
  font-weight: 900;
}

#run-share .feedback-queue-status a {
  min-height: 28px;
  padding: 0 10px;
  border-color: rgba(185, 246, 255, 0.34);
  background: rgba(185, 246, 255, 0.08);
  color: #b9f6ff;
}

#run-share .feedback-queue-status button {
  min-height: 28px;
  padding: 0 10px;
  border-color: rgba(185, 246, 255, 0.34);
  background: rgba(185, 246, 255, 0.1);
  color: #b9f6ff;
}

#run-share .feedback-queue-status button:disabled {
  border-color: rgba(167, 180, 184, 0.2);
  background: rgba(167, 180, 184, 0.07);
  color: rgba(167, 180, 184, 0.64);
  cursor: not-allowed;
}

.feedback-pending-status {
  margin: -4px 0 0;
  color: rgba(185, 246, 255, 0.78);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.3;
  text-transform: uppercase;
}

.feedback-pending-status.is-alert {
  color: #ffd36d;
  text-shadow: 0 0 10px rgba(255, 211, 109, 0.25);
}

.feedback-pending-status.is-clear {
  color: rgba(141, 255, 177, 0.82);
}

.feedback-handoff-time {
  margin: -5px 0 0;
  color: rgba(167, 180, 184, 0.82);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.3;
  text-transform: uppercase;
}

.feedback-helper-note {
  margin: -2px 0 0;
  color: rgba(185, 246, 255, 0.78);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

#run-share button,
#run-share a {
  display: grid;
  justify-self: center;
  min-height: 32px;
  place-items: center;
  padding: 0 12px;
  border: 1px solid rgba(242, 203, 87, 0.48);
  border-radius: 8px;
  background: rgba(242, 203, 87, 0.16);
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
}

#run-share button:focus-visible,
#run-share a:focus-visible {
  outline: 3px solid var(--steel);
  outline-offset: 3px;
}

#demo-panel {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

#demo-panel button {
  min-width: 118px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(244, 247, 248, 0.2);
  border-radius: 8px;
  background: rgba(13, 18, 22, 0.84);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

#demo-panel button:first-child {
  background: #f2cb57;
  color: #151515;
}

#demo-panel button:nth-child(2) {
  background: rgba(13, 18, 22, 0.84);
  color: var(--ink);
}

button:focus-visible,
.quality-control select:focus-visible,
.control-bind:focus-visible {
  outline: 3px solid var(--steel);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(120, 165, 185, 0.18);
}

#demo-panel button:disabled {
  cursor: wait;
  opacity: 0.72;
}

#perf-snapshot {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 6;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid rgba(185, 246, 255, 0.34);
  border-radius: 8px;
  background: rgba(9, 14, 18, 0.88);
  color: var(--ink);
  backdrop-filter: blur(8px);
}

#perf-snapshot.hidden {
  display: none;
}

#perf-snapshot > span {
  color: var(--steel);
  font-size: 10px;
  font-weight: 900;
}

#perf-snapshot dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
}

#perf-snapshot div {
  min-width: 0;
}

#perf-snapshot dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

#perf-snapshot dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  color: #f2cb57;
  font-size: 11px;
  font-weight: 900;
}

#perf-snapshot div:last-child {
  grid-column: 1 / -1;
}

#settings-panel {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(6, 9, 12, 0.58);
  backdrop-filter: blur(5px);
}

#settings-panel.hidden {
  display: none;
}

.settings-card {
  width: min(560px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  background: rgba(13, 18, 22, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.settings-head,
.settings-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid rgba(244, 247, 248, 0.12);
}

.settings-actions {
  flex-wrap: wrap;
  border-top: 1px solid rgba(244, 247, 248, 0.12);
  border-bottom: 0;
}

.settings-head button,
.settings-actions button,
.quality-control select,
.control-bind {
  min-height: 36px;
  border: 1px solid rgba(244, 247, 248, 0.2);
  border-radius: 8px;
  background: rgba(244, 247, 248, 0.08);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.settings-head button,
.settings-actions button {
  padding: 0 12px;
}

.audio-cue-test-control {
  display: grid;
  gap: 6px;
  min-width: 126px;
}

.audio-cue-meter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  height: 7px;
}

.audio-cue-meter i {
  display: block;
  border-radius: 999px;
  background: rgba(185, 246, 255, 0.26);
  transform: scaleY(0.5);
  transform-origin: bottom;
}

.audio-cue-meter.is-flashing i {
  animation: settings-audio-meter 620ms ease-out both;
}

.audio-cue-meter.is-flashing i:nth-child(2) {
  animation-delay: 80ms;
}

.audio-cue-meter.is-flashing i:nth-child(3) {
  animation-delay: 160ms;
}

.audio-cue-status {
  color: #b9f6ff;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.audio-cue-status.is-muted {
  color: #ffb36c;
}

@keyframes settings-audio-meter {
  0% { background: rgba(185, 246, 255, 0.24); transform: scaleY(0.5); }
  35% { background: rgba(242, 203, 87, 0.92); transform: scaleY(1); }
  100% { background: rgba(185, 246, 255, 0.28); transform: scaleY(0.5); }
}

.quality-control {
  display: grid;
  gap: 4px;
  min-width: 174px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.quality-control select {
  width: 100%;
  padding: 0 10px;
  background: rgba(244, 247, 248, 0.1);
}

#controls-list {
  display: grid;
  gap: 1px;
  max-height: min(490px, calc(100vh - 210px));
  overflow: auto;
  background: rgba(244, 247, 248, 0.08);
}

#settings-summary {
  padding: 9px 14px;
  border-top: 1px solid rgba(244, 247, 248, 0.1);
  color: var(--muted);
  background: rgba(6, 9, 12, 0.38);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

#settings-summary.settings-saved {
  color: #f4f7f8;
  background: rgba(45, 79, 88, 0.58);
  box-shadow: inset 0 0 0 1px rgba(185, 246, 255, 0.22);
}

.control-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(13, 18, 22, 0.94);
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.control-row:focus-within {
  background: rgba(21, 31, 36, 0.98);
  box-shadow: inset 3px 0 0 #f2cb57, inset 0 0 0 1px rgba(242, 203, 87, 0.22);
}

.control-row span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.control-row:focus-within span {
  color: #ffffff;
}

.control-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.control-row:focus-within small {
  color: #dce7ea;
}

.control-bind {
  width: 100%;
  padding: 0 10px;
  background: #f2cb57;
  color: #151515;
}

.control-bind.waiting {
  background: #78a5b9;
  color: #081014;
}

.control-bind:disabled {
  cursor: default;
  background: rgba(244, 247, 248, 0.12);
  color: var(--muted);
}

#run-over-actions {
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 7;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(360px, calc(100vw - 28px));
  transform: translateX(-50%);
}

#run-over-actions button {
  min-width: 146px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(244, 247, 248, 0.2);
  border-radius: 8px;
  background: rgba(13, 18, 22, 0.88);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

#run-over-actions button:first-child {
  background: #f2cb57;
  color: #151515;
}

.hidden {
  display: none;
}

@media (max-width: 700px) {
  #main-menu,
  #help-panel {
    padding: 10px;
  }

  .menu-card {
    grid-template-columns: 1fr;
    gap: 16px;
    width: min(480px, calc(100vw - 20px));
    padding: 16px;
  }

  .menu-copy h1 {
    font-size: 36px;
  }

  .menu-copy p {
    font-size: 14px;
  }

  .best-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-card {
    width: calc(100vw - 20px);
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .help-actions {
    flex-wrap: wrap;
  }

  #hud {
    top: 8px;
    left: 8px;
    right: 8px;
  }

  .hud-row {
    gap: 6px;
  }

  .hud-card {
    min-width: 100px;
    height: 46px;
    padding: 7px 8px;
  }

  .hud-card.compact {
    min-width: 78px;
  }

  #demo-panel {
    right: 8px;
    bottom: 8px;
  }

  #demo-panel button {
    min-width: 96px;
    height: 36px;
    padding: 0 9px;
    font-size: 11px;
  }

  #perf-snapshot {
    left: 8px;
    right: 8px;
    bottom: 88px;
    width: auto;
  }

  #perf-snapshot dl {
    grid-template-columns: 1fr;
  }

  .control-row {
    grid-template-columns: 1fr 104px;
    gap: 8px;
    padding: 9px 10px;
  }

  .control-row span {
    font-size: 13px;
  }

  strong {
    font-size: 14px;
  }
}

/* The sequel keeps its title readable in both graphics modes. */
#helicopter-controls[hidden] { display: none; }
body:has(#main-menu:not(.hidden)) #helicopter-controls,
body:has(#settings-panel:not(.hidden)) #helicopter-controls,
body:has(#help-panel:not(.hidden)) #helicopter-controls,
body:has(#run-over-actions:not(.hidden)) #helicopter-controls { display: none; }
#helicopter-controls {
  position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%);
  width: min(710px, calc(100% - 32px)); z-index: 8; padding: 12px 16px;
  border: 1px solid #779582; border-radius: 10px; background: rgba(9, 23, 20, .94);
  color: #dce9df; box-shadow: 0 7px 26px #0007; text-align: center;
}
#helicopter-telemetry { display: block; color: #d8d49c; font-size: 13px; letter-spacing: .06em; }
.helicopter-armaments { display: flex; gap: 6px; margin: 8px 0; justify-content: center; flex-wrap: wrap; }
.helicopter-armaments button { padding: 7px 11px; font-size: 11px; min-height: 32px; }
.helicopter-armaments button[aria-pressed="true"] { background: #dccb90; color: #10231c; border-color: #e8ddb8; }
#helicopter-controls p { margin: 3px 0; font-size: 11px; line-height: 1.35; }
#helicopter-controls small { display: block; font-size: 10px; color: #b2c1b6; margin-top: 5px; }
#helicopter-controls:not([hidden]) ~ #toast { bottom: 222px; }
@media (max-height: 650px) {
  #helicopter-controls { bottom: 46px; padding: 6px 10px; }
  #helicopter-controls small { display: none; }
  .helicopter-armaments { margin: 4px 0; }
}
/* Leave room for the graphics switch and replay controls on narrow screens. */
@media (max-width: 700px) {
  #helicopter-controls {
    bottom: 132px; padding: 8px 10px;
    max-height: 240px; overflow-y: auto;
  }
  #helicopter-telemetry { font-size: 11px; letter-spacing: 0; }
  .helicopter-armaments { display: grid; grid-template-columns: 1fr 1fr; }
  #helicopter-controls:not([hidden]) ~ #toast { bottom: 385px; }
}
.menu-copy h1 .sequel-mark {
  display: inline-block;
  padding: .02em .19em .08em;
  margin-left: .08em;
  color: #13251d;
  background: #d3c18a;
  border: 1px solid #ebdeb4;
  border-radius: .08em;
  line-height: .95;
  vertical-align: baseline;
}
