:root {
  color-scheme: dark;
  --bg: #0b0e17;
  --surface: #0b121d;
  --text: #edf2fa;
  --muted: #a6b4c8;
  --border: #304052;
  --lime: #d8fc78;
  --coral: #ff817c;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
button:disabled { cursor: default; }
button:not(:disabled) { cursor: pointer; }
[hidden] { display: none !important; }
.svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 23px; height: 23px; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.site-header { height: 59px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; gap: 20px; background: #080d15; }
.brand { display: inline-flex; align-items: center; gap: 16px; color: #c6d2e4; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 82px; height: 34px; }
.wordmark { font-size: 26px; font-weight: 750; letter-spacing: 1.5px; }
.brand-divider { width: 1px; height: 22px; background: var(--border); }
.brand-cn { font-size: 21px; letter-spacing: 2px; }
.header-actions { display: flex; gap: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; min-height: 40px; padding: 9px 21px; font-size: 15px; font-weight: 600; line-height: 1.25; transition: background .15s, border-color .15s, transform .15s; }
.button-quiet { color: #ccd8e9; background: transparent; border-color: #52657e; border-radius: 12px; }
.button-quiet:hover:not(:disabled) { border-color: var(--lime); background: #d8fc780b; }
.button-quiet:disabled { opacity: .6; }
.button-quiet[aria-pressed="true"] { color: var(--lime); border-color: #758a56; }
.button-primary { background: var(--lime); color: #142009; border-radius: 40px; min-height: 54px; padding: 13px 38px; font-size: 22px; font-weight: 750; min-width: 233px; gap: 19px; }
.button-primary:hover:not(:disabled) { background: #e6ffab; transform: translateY(-2px); }
.button-primary:active:not(:disabled) { transform: translateY(0); }
.button-primary .icon { width: 27px; height: 27px; stroke-width: 2.2; }
.main-shell { max-width: 1660px; margin: 0 auto; padding: 0 12px 12px; }
.page-heading { display: flex; align-items: baseline; gap: 32px; padding: 7px 20px 10px; }
h1 { margin: 0; font-size: clamp(40px, 4.3vw, 66px); font-weight: 800; line-height: 1.13; letter-spacing: 2px; }
.page-heading p { color: #b9c7da; font-size: clamp(15px, 1.4vw, 21px); margin: 0; line-height: 1.7; letter-spacing: .3px; }
.battle-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 23.4%); align-items: start; gap: 10px; }
.game-column { min-width: 0; }
.game-frame { position: relative; border: 1px solid #415d77; border-radius: 6px; padding: 5px; background: #070f19; box-shadow: inset 0 0 0 2px #111b27; overflow: hidden; }
.game-frame::after { content: ""; position: absolute; inset: 5px; border: 1px solid #22364c; border-radius: 3px; pointer-events: none; }
#game { display: block; width: 100%; height: auto; aspect-ratio: 10 / 7; background: #060d19 url("assets/space.png") center / cover; border-radius: 3px; outline-offset: -4px; touch-action: none; }
.game-hud { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: clamp(12px, 1.15vw, 17px); color: #c9d6e8; pointer-events: none; }
.score-block, .hud-right { min-height: 43px; background: #080f1bdc; border: 1px solid #2b465d; border-radius: 7px; display: flex; align-items: center; gap: 18px; padding: 5px 16px; }
.score-block strong { font-family: var(--mono); font-weight: 650; color: var(--lime); font-size: clamp(18px, 1.8vw, 26px); letter-spacing: 1px; }
.hud-right { gap: 32px; }
.hud-level, .lives-block { display: flex; align-items: center; gap: 12px; }
.hud-level strong { font-family: var(--mono); font-size: 20px; font-weight: 500; white-space: nowrap; }
.hud-level em { color: #c7e599; font-style: normal; }
.hearts { display: flex; gap: 7px; color: var(--coral); }
.hearts .icon { width: 23px; height: 23px; filter: drop-shadow(0 0 5px #ff817c33); }
.hearts .empty { color: #3f3541; filter: none; }
.bomb-dock { position: absolute; bottom: 14px; right: 14px; width: 182px; z-index: 1; border: 1px solid #776244; border-radius: 9px; background: #080f1bf0; overflow: hidden; }
.bomb-dock p { margin: 0; padding: 6px 11px; color: #c9bb9d; font-size: 11px; line-height: 1.4; text-align: right; font-variant-numeric: tabular-nums; pointer-events: none; }
.bomb-button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 10px 12px; border: 0; border-top: 1px solid #776244; background: #f6cf78; color: #261c09; font-size: 14px; font-weight: 700; touch-action: manipulation; }
.bomb-button strong { margin-left: auto; font: 700 19px var(--mono); white-space: nowrap; }
.bomb-button:hover:not(:disabled) { background: #ffe2a1; }
.bomb-button:active:not(:disabled) { background: #e7b956; }
.bomb-button:disabled { background: #161e29; color: #8e9caf; }
.bomb-button:focus-visible { outline-offset: -4px; }
.screen-overlay { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 30px 15px; pointer-events: none; }
.screen-overlay.is-paused { background: #070d1780; backdrop-filter: blur(2px); }
.overlay-content { margin-top: -2%; transform: translateY(-24px); text-align: center; pointer-events: auto; text-shadow: 0 2px 16px #000, 0 0 40px #000; }
.overlay-content h2 { font-size: clamp(25px, 3vw, 45px); font-weight: 800; letter-spacing: 1px; line-height: 1.3; margin: 0 0 10px; }
.overlay-content p { font-size: clamp(13px, 1.45vw, 21px); color: #c5d3e7; margin: 0 0 20px; line-height: 1.6; }
.overlay-content .button { text-shadow: none; }
.load-message { display: block; margin-top: 12px; min-height: 16px; color: var(--muted); font-size: 12px; }
.load-message:empty { display: none; }
.game-toast { position: absolute; top: 65px; left: 50%; z-index: 3; transform: translateX(-50%); width: max-content; max-width: 90%; color: var(--lime); background: #0b1329ed; padding: 10px 22px; border: 1px solid #5f7250; border-radius: 7px; font-size: 16px; font-weight: 650; text-align: center; pointer-events: none; }
.controls-strip { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 20px 10px 8px; color: #aebed4; font-size: 14px; white-space: nowrap; }
.control-hint { display: flex; align-items: center; gap: 12px; }
.key-group { display: inline-flex; gap: 7px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 5px; background: #0b131f; border: 1px solid #64788f; border-radius: 5px; font: 13px var(--mono); color: #d0dced; box-shadow: 0 2px 0 #05080d; }
.key-wide { padding: 0 17px; }
.control-divider { height: 20px; width: 1px; background: #4a5d74; }
.auto-fire-note { margin-left: 16px; }
.flight-rail { display: flex; flex-direction: column; align-self: stretch; margin-bottom: 56px; padding: 20px; border: 1px solid #2c4258; border-radius: 5px; background: #080f18; min-width: 0; }
.flight-rail h2 { font-size: clamp(19px, 1.55vw, 24px); line-height: 1.4; margin: 0 0 14px; font-weight: 700; letter-spacing: .5px; }
.flight-rail section { border-bottom: 1px solid #293f52; padding-bottom: 18px; }
.flight-rail section + section { padding-top: 18px; }
.flight-level-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sprite-thumbnail { display: block; max-width: 100%; height: auto; }
.plane-thumbnail { width: 100px; flex-shrink: 0; }
.flight-level { flex: 1; text-align: right; }
.flight-level > div { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; font-family: var(--mono); white-space: nowrap; }
.flight-level span { font-size: 32px; font-weight: 650; }
.flight-level strong { font-size: clamp(54px, 5.4vw, 84px); line-height: 1; letter-spacing: -5px; color: var(--lime); font-weight: 750; }
.flight-level p { font-size: clamp(17px, 1.7vw, 25px); font-weight: 700; margin: 14px 0 0; }
.boss-countdown-row { display: flex; align-items: center; gap: 17px; }
.boss-thumbnail-frame { width: 100px; height: 100px; border: 1px solid #475671; border-radius: 5px; overflow: hidden; flex-shrink: 0; background: #131328; }
.boss-thumbnail-frame canvas { width: 100%; height: 100%; }
.boss-timing { flex: 1; min-width: 0; }
.boss-timing strong { font-size: clamp(29px, 3vw, 46px); color: var(--lime); font-family: var(--mono); font-weight: 750; line-height: 1.2; letter-spacing: -2px; white-space: nowrap; }
.countdown-track { height: 11px; margin-top: 14px; border-radius: 2px; background: repeating-linear-gradient(105deg, #29384a 0 13px, transparent 13px 17px); overflow: hidden; transform: skew(-8deg); }
.countdown-track span { display: block; height: 100%; width: 100%; background: repeating-linear-gradient(105deg, #d8fc78 0 13px, transparent 13px 17px); transition: width .3s linear; }
.boss-detail { margin: 11px 0 0; color: #91a3ba; font-size: 12px; line-height: 1.5; }
.flight-rail .guide { padding-bottom: 0; border: none; }
.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li { display: grid; grid-template-columns: 26px 43px 1fr; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid #293f52; }
.guide-number { font-size: 21px; font-family: var(--mono); color: var(--lime); font-weight: 650; }
.guide-icon { color: #aebed5; width: 39px; height: 39px; }
.mini-keys { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mini-keys span { display: flex; gap: 2px; }
.mini-keys kbd { width: 14px; height: 16px; min-width: 14px; padding: 0; font-size: 10px; border-radius: 2px; }
.guide-list h3 { margin: 0 0 5px; font-size: 15px; font-weight: 650; color: #d7e1ee; line-height: 1.5; }
.guide-list p { margin: 0; font-size: 12px; line-height: 1.6; color: #a5b6cc; }
.guide-bomb { display: flex; align-items: flex-start; gap: 8px; margin: 7px 0 14px; padding-top: 11px; border-top: 1px solid #293f52; color: #d7c493; font-size: 12px; line-height: 1.65; }
.guide-bomb .icon { width: 17px; height: 17px; margin-top: 2px; }
.record { margin-top: auto; padding-top: 21px; border-top: 1px solid #293f52; display: flex; align-items: center; gap: 10px; font-size: 15px; white-space: nowrap; }
.record .icon { color: var(--lime); width: 27px; height: 27px; }
.record strong { margin-left: auto; color: var(--lime); font-family: var(--mono); font-size: clamp(24px, 2.2vw, 34px); letter-spacing: -1px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0,0,0,0); overflow: hidden; white-space: nowrap; border: 0; }
.touch-controls { display: none; }

@media (min-width: 1660px) { .page-heading { padding-top: 20px; padding-bottom: 22px; } }
@media (max-width: 1250px) {
  .site-header { padding-inline: 22px; }
  .flight-rail { padding: 17px; }
  .flight-rail section { padding-bottom: 17px; }
  .flight-rail section + section { padding-top: 16px; }
  .plane-thumbnail { width: 90px; }
  .boss-thumbnail-frame { width: 75px; height: 75px; }
  .guide-list li { padding-block: 14px; gap: 8px; grid-template-columns: 25px 36px 1fr; }
  .guide-icon { width: 32px; height: 32px; }
  .controls-strip { gap: 16px; font-size: 12px; }
  .auto-fire-note { display: none; }
  .hud-right { gap: 18px; padding-inline: 11px; }
  .hud-level strong { font-size: 17px; }
}
@media (min-width: 961px) and (max-height: 850px) {
  .main-shell { max-width: min(1660px, calc((100vh - 155px) * 1.86 + 20px)); }
  .page-heading { padding: 10px 8px 14px; gap: 24px; }
  h1 { font-size: 48px; }
  .page-heading p { font-size: 16px; }
  .flight-rail { padding: 14px; margin-bottom: 43px; }
  .flight-rail h2 { font-size: 17px; margin-bottom: 9px; }
  .flight-rail section { padding-bottom: 12px; }
  .flight-rail section + section { padding-top: 12px; }
  .plane-thumbnail { width: 67px; }
  .flight-level span { font-size: 24px; }
  .flight-level strong { font-size: 52px; letter-spacing: -3px; }
  .flight-level p { font-size: 17px; margin-top: 7px; }
  .boss-thumbnail-frame { width: 58px; height: 58px; }
  .boss-countdown-row { gap: 13px; }
  .boss-timing strong { font-size: 33px; }
  .boss-detail { font-size: 10px; margin-top: 8px; }
  .countdown-track { height: 8px; margin-top: 10px; }
  .guide-list li { grid-template-columns: 22px 29px 1fr; gap: 8px; padding-block: 8px; }
  .guide-icon { width: 27px; height: 27px; }
  .guide-number { font-size: 18px; }
  .guide-list h3 { font-size: 13px; line-height: 1.4; margin-bottom: 3px; }
  .guide-list p { font-size: 10.5px; line-height: 1.5; }
  .record { padding-top: 14px; font-size: 13px; }
  .record strong { font-size: 27px; }
  .record .icon { width: 24px; height: 24px; }
  .controls-strip { padding-top: 16px; gap: 16px; font-size: 12px; }
  .controls-strip .auto-fire-note { display: none; }
}
@media (max-width: 960px) {
  .battle-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .flight-rail { margin-bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 30px; padding: 22px; }
  .flight-rail section { padding: 0 0 20px; }
  .flight-rail section + section { padding-top: 0; }
  .flight-level-row { justify-content: flex-start; }
  .flight-level { text-align: left; }
  .flight-level > div { justify-content: flex-start; }
  .flight-rail h2 { font-size: 21px; margin-bottom: 10px; }
  .flight-level strong { font-size: 58px; }
  .flight-level p { margin-top: 6px; font-size: 18px; }
  .flight-rail .guide { grid-column: 1 / -1; }
  .guide-list { display: flex; gap: 25px; }
  .guide-list li { flex: 1; border-top: 0; }
  .record { grid-column: 1 / -1; padding-top: 17px; }
  .record strong { font-size: 30px; }
  .page-heading { gap: 20px; padding-inline: 8px; }
  .page-heading p { font-size: 15px; }
  .controls-strip { padding-top: 16px; }
  .game-hud { font-size: 14px; }
}
@media (max-width: 600px) {
  .site-header { height: 61px; padding: 0 14px; gap: 10px; }
  .brand { gap: 8px; }
  .brand-mark { width: 43px; height: 27px; }
  .wordmark { font-size: 17px; letter-spacing: 1px; }
  .brand-cn, .brand-divider { display: none; }
  .header-actions { gap: 8px; }
  .button-quiet { width: 39px; min-height: 36px; padding: 7px; border-radius: 8px; }
  .button-quiet span { display: none; }
  .button-quiet .icon { width: 19px; height: 19px; }
  .main-shell { padding: 0 10px 20px; }
  .page-heading { flex-direction: column; gap: 8px; padding: 20px 5px 20px; }
  h1 { font-size: 37px; letter-spacing: 1px; }
  .page-heading p { font-size: 13px; }
  .game-frame { padding: 3px; }
  .game-frame::after { inset: 3px; }
  .game-hud { top: 8px; left: 8px; right: 8px; gap: 5px; font-size: 10px; }
  .score-block, .hud-right { min-height: 29px; border-radius: 4px; padding: 4px 7px; gap: 6px; }
  .score-block strong { font-size: 15px; letter-spacing: 0; }
  .hud-right { gap: 10px; }
  .hud-level { gap: 5px; }
  .hud-level strong { font-size: 12px; }
  .lives-block { gap: 6px; }
  .lives-block > span { display: none; }
  .hearts { gap: 3px; }
  .hearts .icon { width: 13px; height: 13px; }
  .bomb-dock { bottom: 8px; right: 8px; width: 132px; border-radius: 6px; }
  .bomb-dock p { font-size: 10px; padding: 4px 7px; }
  .bomb-button { min-height: 44px; gap: 5px; padding: 8px 7px; font-size: 12px; }
  .bomb-button .icon { width: 18px; height: 18px; }
  .bomb-button strong { font-size: 16px; }
  .overlay-content h2 { font-size: clamp(21px, 5.7vw, 30px); letter-spacing: 0; margin-bottom: 6px; }
  .overlay-content { transform: none; }
  .overlay-content p { font-size: 10px; margin-bottom: 14px; }
  .button-primary { min-width: 160px; min-height: 41px; font-size: 16px; padding: 9px 25px; gap: 13px; }
  .button-primary .icon { width: 20px; height: 20px; }
  .controls-strip { display: none; }
  .touch-controls { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 17px 5px 0; }
  .touch-controls p { color: var(--muted); font-size: 11px; line-height: 1.8; max-width: 116px; margin: 0; }
  .direction-pad { display: flex; align-items: center; gap: 6px; }
  .vertical-directions { display: flex; flex-direction: column; gap: 5px; }
  .direction-button { width: 47px; height: 40px; padding: 7px; background: #101a29; color: #d0dfed; border: 1px solid #435874; border-radius: 7px; touch-action: none; user-select: none; }
  .direction-button.pressed { background: var(--lime); color: var(--bg); border-color: var(--lime); }
  .direction-button .icon { width: 20px; height: 20px; }
  .flight-rail { gap: 20px 17px; padding: 16px; }
  .flight-rail h2 { font-size: 16px; margin-bottom: 14px; }
  .plane-thumbnail { width: 50px; }
  .flight-level-row { gap: 7px; }
  .flight-level span { font-size: 18px; }
  .flight-level strong { font-size: 43px; letter-spacing: -2px; }
  .flight-level p { font-size: 14px; margin-top: 7px; }
  .boss-countdown-row { gap: 9px; }
  .boss-thumbnail-frame { width: 48px; height: 57px; }
  .boss-timing strong { font-size: 25px; letter-spacing: -1px; }
  .countdown-track { height: 7px; margin-top: 10px; }
  .boss-detail { font-size: 10px; margin-top: 12px; }
  .guide-list { display: block; }
  .guide-list li { grid-template-columns: 30px 40px 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid #293f52; }
  .guide-list h3 { font-size: 14px; }
  .guide-list p { font-size: 12px; }
  .record { font-size: 13px; padding-top: 16px; }
  .record strong { font-size: 25px; }
  .game-toast { top: 44px; font-size: 11px; padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
