:root {
  color-scheme: dark;
  font-family: "Barlow", "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #f5f0e6;
  background: #10171d;
  --muted: #a7b6bc;
  --line: #34434c;
  --amber: #ffbd73;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(ellipse at 78% 8%, #283331 0, transparent 48%), linear-gradient(150deg, #141e26, #0f161c 66%);
}
main { max-width: 1180px; margin: auto; padding: clamp(26px, 7vh, 74px) clamp(14px, 4vw, 55px) 35px; }
.mast { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
h1 { margin: 0; display: flex; align-items: center; gap: .31em; font-size: clamp(2.2rem, 5vw, 4.25rem); line-height: 1.1; letter-spacing: -.047em; }
html:lang(zh) h1 { letter-spacing: .025em; }
.wing-mark { position: relative; width: .69em; height: .55em; background: var(--amber); clip-path: polygon(0 0,44% 0,96% 94%,53% 77%,40% 54%,26% 49%); }
.mast p { margin: 13px 0 0; max-width: 64ch; font-size: clamp(.88rem, 1.4vw, 1.03rem); color: #bdc8c9; line-height: 1.6; }
.back { align-self: flex-start; margin-top: .65em; display: inline-flex; gap: .55em; align-items: center; color: #c2cccc; text-decoration: none; white-space: nowrap; font-size: .88rem; }
.back:hover { color: var(--amber); }
.cabinet { overflow: hidden; border: 1px solid #43515a; border-radius: 11px; background: #14222c; box-shadow: 0 22px 55px #070b0f5e; }
.instruments, .route { display: flex; align-items: center; gap: 16px; padding-inline: clamp(12px, 2.4vw, 25px); background: #18232b; }
.instruments { height: 47px; justify-content: space-between; border-bottom: 1px solid #43505c; }
.location, .meters, .health, .kills { display: inline-flex; align-items: center; }
.location { gap: 10px; font-size: .96rem; font-weight: 650; }
.signal { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 9px #e3a86167; }
.meters { gap: clamp(12px, 3.7vw, 40px); font-size: .8rem; color: #c3ced0; }
.health, .kills { gap: 9px; }
#shield { display: inline-flex; gap: 4px; }
#shield i { width: 11px; height: 8px; background: var(--amber); transform: skew(-16deg); }
#shield i.empty { background: #44525a; }
.kills strong, #percent { font: 600 .86rem "IBM Plex Mono", ui-monospace, monospace; color: #f4efe3; font-variant-numeric: tabular-nums; }
.screen { position: relative; width: 100%; aspect-ratio: 2.4; isolation: isolate; background: #233d4a; }
canvas { width: 100%; height: 100%; display: block; touch-action: none; outline-offset: -3px; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; background: #0c19268c; }
.overlay[data-mode="ready"], .overlay[data-mode="loading"] { align-items: end; padding: 0 0 clamp(14px, 3vw, 32px); background: linear-gradient(0deg, #101b2955, transparent 33%); }
.dialog { text-align: center; padding: 19px 28px; border-radius: 8px; border: 1px solid #607075; background: #17262ff2; box-shadow: 0 8px 24px #0004; }
.overlay[data-mode="ready"] .dialog, .overlay[data-mode="loading"] .dialog { padding: 0; border: 0; background: transparent; }
h2 { margin: 0 0 13px; font-size: clamp(1.07rem, 2vw, 1.45rem); }
h2:empty { display: none; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .5; }
.launch { pointer-events: auto; display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 45px; padding: 10px 19px; border: 1px solid #ffd3a0; border-radius: 5px; background: var(--amber); color: #281e15; font-weight: 750; box-shadow: 0 4px 17px #09101970; }
.launch:disabled { opacity: .82; }
.launch:hover:enabled { background: #ffd398; }
.launch-arrow { font-size: 1.12em; }
.route { height: 40px; gap: 13px; color: var(--muted); font-size: .76rem; border-top: 1px solid #384652; }
.track { height: 4px; flex: 1; background: #34464d; position: relative; }
.track #fill { height: 100%; width: 0; background: #e7ae70; }
.track i { position: absolute; height: 8px; top: -2px; width: 2px; background: #829392; left: 33.333%; }
.track i:last-child { left: 66.666%; }
#percent { text-align: right; min-width: 4ch; font-size: .79rem; }
.controls, .actions, .hints, .keyboard-hint { display: flex; align-items: center; }
.controls { justify-content: space-between; gap: 12px; margin-top: 15px; }
.hints { flex-wrap: wrap; gap: 9px 22px; color: var(--muted); font-size: .84rem; }
.keyboard-hint { gap: 7px; }
kbd { font: 600 .73rem "IBM Plex Mono", ui-monospace, monospace; color: #e1e5df; border: 1px solid #4a5860; padding: 3px 6px; border-radius: 4px; background: #202b32; }
.touch-hint { display: none; }
.actions { gap: 7px; }
.actions button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; white-space: nowrap; padding: 7px 11px; background: #1c2932; color: #e1e6e2; border: 1px solid #40515a; border-radius: 5px; font-size: .82rem; }
.actions button:enabled:hover { border-color: var(--amber); }
:focus-visible { outline: 2px solid #ffc982; outline-offset: 3px; }
[hidden] { display: none !important; }
@media (max-width: 680px) {
  main { padding: 24px 12px; }
  .mast { margin-bottom: 16px; gap: 6px; }
  .mast p { margin-top: 7px; font-size: .84rem; }
  .back { font-size: .78rem; }
  .screen { aspect-ratio: 1.48; }
  .instruments { height: 40px; }
  .location { font-size: .84rem; }
  .route { height: 35px; }
  .controls { flex-wrap: wrap; margin-top: 10px; }
  .hints { font-size: .78rem; gap: 8px; }
}
@media (pointer: coarse) {
  .keyboard-hint { display: none; }
  .touch-hint { display: inline; }
  .actions button { min-height: 44px; }
}
@media (orientation: landscape) and (max-height: 540px) {
  main { padding: 7px 12px; max-width: min(100%, calc((100svh - 121px) * 2.5 + 24px)); }
  h1 { font-size: 1.35rem; }
  .mast { margin-bottom: 6px; }
  .mast p { display: none; }
  .back { margin: 0; }
  .screen { aspect-ratio: 2.5; }
  .instruments, .route { height: 25px; }
  .controls { margin-top: 3px; }
  .actions button { min-height: 33px; padding-block: 3px; }
}
