@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700;900&display=swap");

:root {
  color-scheme: dark;
  --ink: #f4f8ff;
  --muted: #8fa0b7;
  --cyan: #57e9ff;
  --cyan-2: #11b8ec;
  --orange: #ff9e45;
  --red: #ff5067;
  --panel: rgba(7, 15, 30, .74);
  --line: rgba(169, 214, 255, .16);
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-side: max(22px, env(safe-area-inset-left));
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  margin: 0;
  background: #03050c;
  color: var(--ink);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  overscroll-behavior: none;
  user-select: none;
}
button, a { font: inherit; -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.game-shell { position: relative; width: 100%; height: 100%; min-height: 520px; overflow: hidden; background: #03050c; }
#gameCanvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
.vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(circle at center, transparent 44%, rgba(2, 4, 10, .24) 73%, rgba(1, 2, 7, .72) 100%);
}
.vignette::after {
  content: ""; position: absolute; inset: 0; opacity: .09;
  background-image: linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 100% 4px;
  mix-blend-mode: soft-light;
}
.damage-flash { position: absolute; inset: 0; z-index: 18; pointer-events: none; box-shadow: inset 0 0 0 0 rgba(255,55,76,0); transition: box-shadow .18s, background .18s; }
.damage-flash.active { background: rgba(255,20,54,.09); box-shadow: inset 0 0 110px 18px rgba(255,40,63,.58); }
.event-flash { position: absolute; inset: 0; z-index: 16; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.event-flash.supernova { opacity: .78; background: radial-gradient(circle at 18% 42%, #fff8dd 0, rgba(255,174,76,.62) 7%, rgba(235,55,22,.24) 32%, transparent 72%); mix-blend-mode: screen; }
.event-flash.pulsar { opacity: .58; background: linear-gradient(90deg, transparent 0 38%, rgba(125,226,255,.72) 48%, #fff 50%, rgba(101,196,255,.66) 52%, transparent 62%); mix-blend-mode: screen; }
body.nebula-event .vignette { background: radial-gradient(circle at center, rgba(90,48,125,.1) 16%, rgba(29,15,52,.62) 62%, rgba(5,2,15,.96) 100%); }
body.nebula-event #gameCanvas { filter: saturate(.78) contrast(1.16) brightness(.78); }
.speed-lines {
  position: absolute; inset: -20%; z-index: 1; pointer-events: none; opacity: 0;
  background: repeating-conic-gradient(from 0deg at 50% 50%, transparent 0deg 5deg, rgba(101,221,255,.22) 5.2deg 5.35deg, transparent 5.55deg 9deg);
  mask-image: radial-gradient(circle, transparent 0 24%, #000 72%);
  transition: opacity .25s;
  animation: rush .42s linear infinite;
}
.speed-lines.active { opacity: .38; }
@keyframes rush { to { transform: rotate(.6deg) scale(1.045); } }

.topbar {
  position: absolute; z-index: 20; top: 0; left: 0; right: 0; height: 72px;
  padding: var(--safe-top) var(--safe-side) 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; pointer-events: none;
}
.topbar::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.back-link, .top-actions, .brand-lockup { pointer-events: auto; }
.back-link {
  justify-self: start; display: inline-flex; align-items: center; gap: 9px; min-height: 36px; padding: 0 12px;
  color: #b9c8da; text-decoration: none; border: 1px solid var(--line); border-radius: 4px; background: rgba(6,12,24,.5);
  font-size: 12px; letter-spacing: .08em; backdrop-filter: blur(12px); transition: .2s ease;
}
.back-link:hover { color: #fff; border-color: rgba(87,233,255,.55); background: rgba(15,41,61,.72); }
.brand-lockup { align-self: start; display: grid; grid-template-columns: 12px auto; column-gap: 8px; align-items: center; font-family: "Barlow Condensed", sans-serif; letter-spacing: .16em; }
.brand-lockup strong { font-size: 14px; line-height: 1; }
.brand-lockup small { grid-column: 2; color: var(--muted); font-family: "Noto Sans SC", sans-serif; letter-spacing: .32em; font-size: 8px; margin-top: 4px; }
.brand-mark { grid-row: 1 / 3; width: 7px; height: 32px; clip-path: polygon(50% 0, 100% 28%, 84% 100%, 16% 100%, 0 28%); background: linear-gradient(var(--cyan), #2a60ff); box-shadow: 0 0 18px var(--cyan); }
.top-actions { justify-self: end; display: flex; gap: 6px; }
.icon-button { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: rgba(6,12,24,.5); color: #a9b9ce; font-size: 10px; letter-spacing: .12em; cursor: pointer; backdrop-filter: blur(12px); transition: .2s ease; }
.icon-button:hover { color: #fff; border-color: rgba(87,233,255,.55); }

.hud { position: absolute; inset: 92px 28px auto; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; pointer-events: none; transition: opacity .3s; }
.hud-left { width: min(260px, 28vw); }
.metric { padding-left: 12px; border-left: 2px solid rgba(87,233,255,.72); }
.metric span, .status-head span { display: block; color: #8798af; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; }
.metric strong { display: block; margin-top: 2px; font: 700 34px/1 "Barlow Condensed", sans-serif; letter-spacing: .08em; text-shadow: 0 0 24px rgba(87,233,255,.22); }
.metric-row { display: flex; gap: 24px; margin-top: 14px; }
.metric.compact strong { margin-top: 4px; font-size: 18px; color: #bfd3e9; }
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 11px; }
.combo-panel { transform: translateY(-14px) scale(.8); opacity: 0; text-align: center; transition: .24s ease; }
.combo-panel.active { transform: translateY(0) scale(1); opacity: 1; }
.combo-panel span { color: var(--orange); font: 700 10px/1 "Barlow Condensed", sans-serif; letter-spacing: .28em; }
.combo-panel strong { display: block; margin-top: 4px; font: 800 34px/1 "Barlow Condensed", sans-serif; color: #fff; text-shadow: 0 0 18px rgba(255,158,69,.54); }
.mission-card { min-width: 230px; padding: 8px 18px 10px; text-align: center; border-top: 1px solid rgba(87,233,255,.28); background: linear-gradient(90deg, transparent, rgba(8,34,54,.52), transparent); transition: .25s ease; }
.mission-card span { display: block; color: var(--cyan); font: 600 8px "Barlow Condensed", sans-serif; letter-spacing: .26em; }
.mission-card strong { display: block; margin-top: 3px; color: #dfedfa; font-size: 11px; letter-spacing: .08em; }
.mission-card i { display: block; margin-top: 3px; color: #71849a; font-size: 8px; font-style: normal; }
.mission-card.alert { border-color: rgba(255,158,69,.48); background: linear-gradient(90deg, transparent, rgba(105,51,16,.46), transparent); }
.mission-card.alert span { color: var(--orange); }
.mission-card.warp { border-color: rgba(165,111,255,.55); background: linear-gradient(90deg, transparent, rgba(65,31,126,.58), transparent); }
.mission-card.warp span { color: #bd8fff; }
.mission-card.target { min-width: 360px; border-color: rgba(255,69,91,.72); background: linear-gradient(90deg, transparent, rgba(104,13,31,.72), transparent); box-shadow: 0 12px 36px rgba(255,35,70,.08); }
.mission-card.target span { color: #ff7185; }
.mission-card.target strong { color: #fff; font-size: 13px; }
.mission-card.target i { color: #ffb4bf; font-size: 9px; }
.boss-hud { width: 340px; margin-top: 3px; padding: 9px 14px 10px; border: 1px solid rgba(255,85,104,.3); background: linear-gradient(90deg, transparent, rgba(97,18,35,.62), transparent); text-align: center; }
.boss-hud > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.boss-hud span { color: #ff8092; font: 700 8px "Barlow Condensed", sans-serif; letter-spacing: .2em; }
.boss-hud strong { color: #fff1f3; font-size: 11px; letter-spacing: .08em; }
.boss-meter { height: 5px; margin-top: 7px; border: 1px solid rgba(255,175,188,.24); background: rgba(12,0,4,.72); }
.boss-meter i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, #ff385b, #ffb259); box-shadow: 0 0 15px rgba(255,66,91,.72); transition: width .18s ease; }
.boss-hud small { display: block; margin-top: 5px; color: #a06c77; font: 600 8px "Barlow Condensed", sans-serif; letter-spacing: .12em; }
.hud-right { justify-self: end; width: min(244px, 27vw); }
.status-block + .status-block { margin-top: 11px; }
.status-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.status-head strong { font: 600 13px "Barlow Condensed", sans-serif; color: #dceaff; letter-spacing: .08em; }
.meter { height: 5px; padding: 1px; border: 1px solid rgba(255,255,255,.13); background: rgba(1,5,12,.66); overflow: hidden; }
.meter i { display: block; width: 100%; height: 100%; transform-origin: left; transition: width .2s, background .2s; }
.meter.hull i { background: linear-gradient(90deg, #3ee3a7, #a2ffc8); box-shadow: 0 0 10px rgba(62,227,167,.45); }
.meter.energy i { background: linear-gradient(90deg, #1e79f2, var(--cyan)); box-shadow: 0 0 10px rgba(87,233,255,.6); }
.shield-badge { display: inline-flex; align-items: center; gap: 7px; margin-top: 13px; color: #6d7a8e; font-size: 9px; letter-spacing: .13em; }
.shield-badge i { width: 7px; height: 7px; border: 1px solid currentColor; transform: rotate(45deg); }
.shield-badge.active { color: var(--cyan); text-shadow: 0 0 10px rgba(87,233,255,.5); }
.route-badge { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); text-align: right; }
.route-badge span { display: block; color: #668099; font: 600 8px "Barlow Condensed", sans-serif; letter-spacing: .2em; }
.route-badge strong { display: block; margin-top: 2px; color: #b8d7ed; font-size: 9px; font-weight: 500; letter-spacing: .06em; }

.target-marker {
  --marker-scale: 1;
  position: absolute; z-index: 14; left: 50%; top: 50%; width: 142px;
  transform: translate(-50%, -50%) scale(var(--marker-scale)); transform-origin: center;
  color: #ff647a; text-align: center; pointer-events: none; filter: drop-shadow(0 0 12px rgba(255,35,66,.55));
}
.target-caption { display: grid; gap: 2px; margin-bottom: 7px; text-shadow: 0 1px 5px #000; }
.target-caption span { color: #ff4d68; font: 800 8px/1 "Barlow Condensed", sans-serif; letter-spacing: .28em; }
.target-caption strong { color: #fff0f2; font-size: 11px; letter-spacing: .12em; }
.target-reticle { position: relative; width: 76px; height: 76px; margin: auto; border: 1px solid rgba(255,65,91,.22); border-radius: 50%; animation: targetPulse 1.1s ease-in-out infinite; }
.target-reticle::before, .target-reticle::after { content: ""; position: absolute; inset: -7px; border: 2px solid #ff4a64; clip-path: polygon(0 0, 28% 0, 28% 2px, 2px 2px, 2px 28%, 0 28%, 0 72%, 2px 72%, 2px calc(100% - 2px), 28% calc(100% - 2px), 28% 100%, 0 100%, 100% 100%, 72% 100%, 72% calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) 72%, 100% 72%, 100% 28%, calc(100% - 2px) 28%, calc(100% - 2px) 2px, 72% 2px, 72% 0); }
.target-reticle::after { inset: 17px; border-width: 1px; opacity: .62; transform: rotate(45deg); }
.target-reticle i, .target-reticle i::before { position: absolute; content: ""; left: 50%; top: 50%; background: rgba(255,101,122,.85); transform: translate(-50%, -50%); }
.target-reticle i { width: 18px; height: 1px; }
.target-reticle i::before { width: 1px; height: 18px; }
.target-readout { display: flex; justify-content: center; gap: 9px; margin-top: 7px; font: 700 8px/1 "Barlow Condensed", sans-serif; letter-spacing: .08em; text-shadow: 0 1px 5px #000; }
.target-readout b { color: #ff8394; }
.target-readout span { color: #b8c7d8; }
.target-marker small { display: inline-block; margin-top: 7px; padding: 4px 8px; color: #fff; border: 1px solid rgba(255,84,108,.5); background: rgba(57,4,15,.78); font-size: 9px; letter-spacing: .08em; }
.target-marker small kbd { padding: 1px 4px; border-color: rgba(255,171,184,.56); background: rgba(255,70,96,.18); }
.target-marker.hit { filter: brightness(1.9) drop-shadow(0 0 22px rgba(255,65,82,.95)); }
.target-marker.hit .target-reticle { transform: scale(1.16); }
@keyframes targetPulse { 50% { box-shadow: 0 0 24px rgba(255,41,70,.28), inset 0 0 18px rgba(255,41,70,.1); } }

.flight-hint { position: absolute; z-index: 8; left: 24px; bottom: 22px; display: flex; gap: 16px; color: rgba(181,200,224,.68); font-size: 10px; letter-spacing: .04em; transition: opacity .4s; pointer-events: none; }
kbd { padding: 2px 5px; color: #deedff; border: 1px solid rgba(255,255,255,.18); border-bottom-width: 2px; border-radius: 3px; background: rgba(10,20,36,.68); font: 600 9px "Noto Sans SC", sans-serif; }
.event-toast { position: absolute; z-index: 17; left: 50%; top: 35%; min-width: 220px; padding: 10px 20px; transform: translate(-50%, 10px); opacity: 0; text-align: center; color: #e9faff; font: 700 13px "Noto Sans SC", sans-serif; letter-spacing: .12em; background: linear-gradient(90deg, transparent, rgba(22,91,124,.5), transparent); transition: .22s ease; pointer-events: none; }
.event-toast.active { opacity: 1; transform: translate(-50%, 0); }

.overlay { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; padding: max(86px, calc(var(--safe-top) + 64px)) max(28px, env(safe-area-inset-right)) 28px; background: linear-gradient(90deg, rgba(3,7,17,.82), rgba(3,7,17,.44) 55%, rgba(3,7,17,.24)); backdrop-filter: blur(4px); transition: opacity .3s, visibility .3s; }
.overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.menu-grid { width: min(1160px, 100%); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .72fr); gap: clamp(36px, 7vw, 110px); align-items: center; }
.menu-copy { max-width: 690px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--cyan); font: 600 11px "Barlow Condensed", sans-serif; letter-spacing: .28em; }
.eyebrow span { width: 26px; height: 1px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.eyebrow.danger { color: var(--red); }
h1 { margin: 0; font: 700 clamp(52px, 7vw, 94px)/.92 "Barlow Condensed", "Noto Sans SC", sans-serif; letter-spacing: -.015em; text-transform: uppercase; }
h1 em { color: transparent; font-style: normal; -webkit-text-stroke: 1px rgba(200,232,255,.65); text-shadow: 0 0 44px rgba(71,173,255,.13); }
.lead { max-width: 620px; margin: 24px 0 0; color: #9eafc3; font-size: 14px; line-height: 1.85; }
.feature-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.feature-chips span { padding: 5px 10px; border: 1px solid rgba(106,198,255,.2); background: rgba(39,101,149,.1); color: #9fc6e6; border-radius: 2px; font: 500 10px "Noto Sans SC", sans-serif; letter-spacing: .08em; }
.mode-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 20px; max-width: 650px; }
.mode-switch button { position: relative; min-height: 52px; padding: 8px 11px; text-align: left; border: 1px solid rgba(136,185,224,.16); border-radius: 2px; background: rgba(6,15,29,.58); color: #8294aa; cursor: pointer; transition: .18s ease; }
.mode-switch button:hover, .mode-switch button.active { color: #eafbff; border-color: rgba(87,233,255,.55); background: linear-gradient(120deg, rgba(28,92,124,.46), rgba(16,37,67,.62)); box-shadow: inset 2px 0 var(--cyan); }
.mode-switch b, .mode-switch small { display: block; }
.mode-switch b { font-size: 11px; letter-spacing: .08em; }
.mode-switch small { margin-top: 3px; color: #61738b; font-size: 8px; }
.mode-switch button.active small { color: #92b8cf; }
.ship-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 650px; margin-top: 7px; }
.ship-switch button { position: relative; min-height: 50px; padding: 7px 10px; text-align: left; color: #74869c; border: 1px solid rgba(128,175,210,.12); background: rgba(7,13,25,.55); cursor: pointer; overflow: hidden; }
.ship-switch button:hover:not(.locked), .ship-switch button.active { color: #eaf8ff; border-color: rgba(255,158,69,.45); background: rgba(83,47,22,.24); }
.ship-switch button.locked { opacity: .48; cursor: not-allowed; }
.ship-switch span, .ship-switch strong, .ship-switch i { display: block; }
.ship-switch span { color: #59758e; font: 600 7px "Barlow Condensed", sans-serif; letter-spacing: .16em; }
.ship-switch strong { margin-top: 2px; font-size: 10px; }
.ship-switch i { margin-top: 2px; color: #607087; font-size: 8px; font-style: normal; }
.ship-lock { position: absolute; right: 6px; top: 6px; color: #d4a265; font-size: 7px; font-style: normal; }
.mission-brief { display: flex; align-items: stretch; gap: 14px; margin: 28px 0 24px; }
.mission-brief > span { display: grid; place-items: center; width: 64px; border: 1px solid rgba(255,158,69,.36); color: var(--orange); font: 700 11px "Barlow Condensed", sans-serif; letter-spacing: .1em; transform: skewX(-6deg); }
.mission-brief div { display: grid; gap: 3px; }
.mission-brief strong { font-size: 13px; letter-spacing: .05em; }
.mission-brief small { color: #72839a; font-size: 10px; }
.mission-brief b { color: #a8def1; }
.primary-button { min-width: 230px; height: 52px; display: inline-flex; align-items: center; justify-content: space-between; gap: 36px; padding: 0 18px 0 22px; border: 1px solid rgba(110,242,255,.7); border-radius: 2px; color: #041018; background: linear-gradient(100deg, #5beeff, #4db7ff); box-shadow: 0 0 32px rgba(58,199,255,.2), inset 0 0 0 1px rgba(255,255,255,.32); font-weight: 800; letter-spacing: .09em; cursor: pointer; clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px)); transition: .2s ease; }
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 10px 36px rgba(58,199,255,.3); }
.primary-button i { padding: 4px 6px; color: rgba(2,13,20,.7); border: 1px solid rgba(2,13,20,.28); font: 700 9px "Barlow Condensed", sans-serif; font-style: normal; }
.menu-actions { display: flex; align-items: center; gap: 10px; }
.secondary-button { min-width: 160px; height: 52px; display: inline-flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 14px; color: #abc2d8; border: 1px solid rgba(144,191,226,.24); border-radius: 2px; background: rgba(7,17,31,.72); cursor: pointer; }
.secondary-button:hover { color: #fff; border-color: rgba(87,233,255,.5); }
.secondary-button span { font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.secondary-button i { color: var(--orange); font: 700 9px "Barlow Condensed", sans-serif; font-style: normal; letter-spacing: .08em; }
.telemetry-card { align-self: stretch; min-height: 460px; padding: 20px; display: flex; flex-direction: column; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(11,27,47,.62), rgba(4,10,21,.78)); clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px)); box-shadow: inset 0 0 54px rgba(35,123,177,.05); }
.telemetry-top { display: flex; justify-content: space-between; color: #8da0b7; font: 600 10px "Barlow Condensed", sans-serif; letter-spacing: .18em; }
.telemetry-top b { color: #67efad; font-weight: 600; }
.rocket-schematic { position: relative; flex: 1; min-height: 260px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle, rgba(38,141,192,.12), transparent 60%); }
.rocket-schematic::before, .rocket-schematic::after { content: ""; position: absolute; background: rgba(88,194,241,.11); }
.rocket-schematic::before { width: 1px; height: 88%; }
.rocket-schematic::after { width: 88%; height: 1px; }
.orbit { position: absolute; width: 210px; aspect-ratio: 1; border: 1px solid rgba(80,207,255,.17); border-radius: 50%; animation: orbit 14s linear infinite; }
.orbit::after { content: ""; position: absolute; width: 5px; height: 5px; top: 18px; left: 43px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.orbit-b { width: 156px; animation-direction: reverse; animation-duration: 9s; }
.orbit-b::after { top: auto; left: auto; right: 6px; bottom: 60px; background: var(--orange); box-shadow: 0 0 12px var(--orange); }
@keyframes orbit { to { transform: rotate(360deg); } }
.schematic-rocket { position: relative; z-index: 2; width: 34px; height: 142px; border: 1px solid rgba(108,227,255,.84); border-radius: 50% 50% 20% 20%; background: linear-gradient(90deg, rgba(56,151,194,.05), rgba(118,226,255,.25), rgba(56,151,194,.05)); box-shadow: 0 0 24px rgba(55,198,255,.13); }
.schematic-rocket::before, .schematic-rocket::after { content: ""; position: absolute; bottom: 22px; width: 29px; height: 48px; border: 1px solid rgba(108,227,255,.58); }
.schematic-rocket::before { right: 26px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.schematic-rocket::after { left: 26px; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.schematic-rocket i { position: absolute; left: 8px; right: 8px; bottom: -32px; height: 32px; background: linear-gradient(var(--cyan), transparent); filter: blur(2px); clip-path: polygon(10% 0, 90% 0, 50% 100%); animation: engine 1s ease-in-out infinite alternate; }
@keyframes engine { to { height: 44px; bottom: -44px; opacity: .55; } }
.scan-line { position: absolute; z-index: 3; left: 8%; right: 8%; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); box-shadow: 0 0 14px var(--cyan); animation: scan 3.6s ease-in-out infinite; }
@keyframes scan { 0%,100% { top: 14%; opacity: .1; } 50% { top: 84%; opacity: .8; } }
.telemetry-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.telemetry-stats div { padding: 9px 8px; border-top: 1px solid var(--line); background: rgba(255,255,255,.015); }
.telemetry-stats span { display: block; color: #607189; font-size: 8px; }
.telemetry-stats strong { display: block; margin-top: 3px; color: #c5e6fb; font: 600 12px "Barlow Condensed", sans-serif; letter-spacing: .08em; }
.control-note { margin: 14px 0 0; color: #64758b; font-size: 9px; line-height: 1.6; }
.daily-board { margin-top: 12px; padding: 10px 12px; border-top: 1px solid rgba(87,233,255,.18); background: rgba(22,61,86,.12); }
.daily-board > span { color: var(--cyan); font: 600 8px "Barlow Condensed", sans-serif; letter-spacing: .18em; }
.daily-board ol { margin: 6px 0 0; padding: 0; list-style: none; counter-reset: daily-rank; }
.daily-board li { display: flex; justify-content: space-between; gap: 12px; color: #758aa1; font-size: 8px; line-height: 1.7; counter-increment: daily-rank; }
.daily-board li::before { content: "0" counter(daily-rank); color: #a3c1d9; }
.menu-footer { position: absolute; left: var(--safe-side); right: var(--safe-side); bottom: 18px; display: flex; justify-content: space-between; color: #4c5f77; font: 500 8px "Barlow Condensed", sans-serif; letter-spacing: .24em; }

.compact-overlay { background: rgba(2,5,12,.68); backdrop-filter: blur(12px); }
.choice-overlay { z-index: 34; background: radial-gradient(circle at 50% 45%, rgba(19,45,75,.52), rgba(2,5,12,.9) 72%); backdrop-filter: blur(14px); }
.choice-dialog { width: min(1120px, 100%); }
.choice-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.choice-heading small { color: #71869d; font-size: 9px; letter-spacing: .12em; }
.choice-heading h2 { margin: 4px 0 0; font: 700 42px/1 "Barlow Condensed", "Noto Sans SC", sans-serif; letter-spacing: .01em; }
.choice-heading > b { color: #687c91; font: 600 9px "Barlow Condensed", sans-serif; letter-spacing: .2em; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.choice-card { position: relative; min-height: 260px; padding: 22px; overflow: hidden; text-align: left; color: #ddecf9; border: 1px solid rgba(133,190,229,.2); background: linear-gradient(145deg, rgba(12,27,46,.94), rgba(5,10,21,.94)); cursor: pointer; clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px)); transition: transform .2s ease, border-color .2s, filter .2s; }
.choice-card::after { content: ""; position: absolute; inset: auto -20% -45% 30%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(85,212,255,.16), transparent 67%); }
.choice-card:hover { transform: translateY(-5px); border-color: rgba(87,233,255,.66); filter: brightness(1.1); }
.choice-card.safe::after { background: radial-gradient(circle, rgba(82,239,178,.18), transparent 67%); }
.choice-card.battle::after { background: radial-gradient(circle, rgba(255,83,75,.22), transparent 67%); }
.choice-card.anomaly::after { background: radial-gradient(circle, rgba(166,91,255,.23), transparent 67%); }
.choice-card > span { color: #68839b; font: 600 9px "Barlow Condensed", sans-serif; letter-spacing: .18em; }
.choice-card > strong { display: block; margin-top: 28px; font: 700 31px/1 "Barlow Condensed", "Noto Sans SC", sans-serif; }
.choice-card > p { min-height: 48px; margin: 13px 0 22px; color: #8294a9; font-size: 11px; line-height: 1.7; }
.choice-card ul { display: grid; gap: 6px; margin: 0; padding: 13px 0 0; border-top: 1px solid rgba(255,255,255,.08); list-style: none; color: #a6bdd1; font-size: 9px; }
.choice-card li::before { content: "+"; margin-right: 8px; color: var(--cyan); }
.choice-card.battle li::before { color: var(--orange); }
.choice-card.anomaly li::before { color: #b184ff; }
.module-card .module-level { position: absolute; top: 20px; right: 22px; color: var(--orange); font: 700 9px "Barlow Condensed", sans-serif; letter-spacing: .12em; }
.module-card .module-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-top: 23px; border: 1px solid rgba(87,233,255,.42); border-radius: 50%; color: var(--cyan); font: 700 18px "Barlow Condensed", sans-serif; box-shadow: 0 0 25px rgba(87,233,255,.1); }
.module-card > strong { margin-top: 16px; }
.module-card > p { min-height: 58px; }
.loadout-strip { display: flex; align-items: center; gap: 16px; min-height: 44px; margin-top: 14px; padding: 8px 12px; border-top: 1px solid var(--line); color: #6f8196; font-size: 9px; }
.loadout-strip > span { letter-spacing: .14em; }
.loadout-strip > div { display: flex; flex-wrap: wrap; gap: 6px; }
.loadout-strip b { padding: 4px 8px; color: #a9cce3; border: 1px solid rgba(110,183,225,.18); background: rgba(31,78,108,.14); font-weight: 500; }
.hangar-overlay { z-index: 42; align-items: center; background: rgba(2,5,12,.92); backdrop-filter: blur(18px); }
.hangar-dialog { width: min(1160px, 100%); max-height: calc(100vh - 118px); overflow: auto; padding: 28px; border: 1px solid rgba(119,190,234,.2); background: linear-gradient(145deg, rgba(11,24,42,.97), rgba(4,9,19,.98)); box-shadow: 0 30px 100px rgba(0,0,0,.72); }
.hangar-head { display: flex; align-items: end; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.hangar-head .eyebrow { margin-bottom: 7px; }
.hangar-head h2 { margin: 0; font: 700 44px/1 "Barlow Condensed", "Noto Sans SC", sans-serif; }
.hangar-head > div:last-child { display: flex; align-items: center; gap: 12px; }
.hangar-head > div:last-child > strong { color: var(--orange); font: 700 15px "Barlow Condensed", sans-serif; letter-spacing: .12em; }
.hangar-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; margin-top: 20px; }
.hangar-layout h3 { margin: 0 0 10px; color: #91a8bd; font-size: 10px; font-weight: 600; letter-spacing: .16em; }
.hangar-layout h3 span { float: right; color: #5f7488; }
.hangar-ship-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hangar-ship { min-height: 126px; padding: 13px; text-align: left; color: #7f91a5; border: 1px solid var(--line); background: rgba(8,17,31,.7); cursor: pointer; }
.hangar-ship.selected { border-color: rgba(87,233,255,.52); background: rgba(26,72,99,.26); box-shadow: inset 2px 0 var(--cyan); }
.hangar-ship.locked { opacity: .58; }
.hangar-ship span, .hangar-ship strong, .hangar-ship small, .hangar-ship em { display: block; }
.hangar-ship span { font: 600 8px "Barlow Condensed", sans-serif; letter-spacing: .16em; }
.hangar-ship strong { margin-top: 12px; color: #dceaf6; font-size: 14px; }
.hangar-ship small { margin-top: 5px; min-height: 28px; font-size: 8px; line-height: 1.5; }
.hangar-ship em { margin-top: 8px; color: var(--orange); font-size: 8px; font-style: normal; }
.upgrade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.upgrade-item { padding: 12px; border: 1px solid var(--line); background: rgba(8,17,30,.58); }
.upgrade-item span { display: block; color: #6c8095; font-size: 8px; }
.upgrade-item strong { display: block; margin-top: 4px; color: #d1e6f5; font-size: 11px; }
.upgrade-item button { width: 100%; margin-top: 9px; padding: 7px; color: #acd5e9; border: 1px solid rgba(87,233,255,.24); background: rgba(22,72,96,.23); font-size: 8px; cursor: pointer; }
.upgrade-item button:disabled { opacity: .35; cursor: not-allowed; }
.archive-column { display: grid; align-content: start; gap: 20px; }
.archive-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.archive-item { min-height: 76px; padding: 10px; border: 1px solid rgba(129,179,214,.12); background: rgba(8,16,29,.55); opacity: .35; }
.archive-item.unlocked { opacity: 1; border-color: rgba(255,158,69,.26); }
.archive-item b { display: block; color: #adc3d6; font-size: 9px; }
.archive-item small { display: block; margin-top: 5px; color: #65778c; font-size: 7px; line-height: 1.5; }
.archive-item.unlocked::before { content: "◆"; float: right; color: var(--orange); font-size: 8px; }
.log-grid { display: grid; gap: 5px; max-height: 205px; overflow: auto; }
.log-item { padding: 8px 10px; border-left: 1px solid rgba(93,163,207,.16); color: #56697f; background: rgba(5,12,23,.5); font-size: 8px; line-height: 1.5; }
.log-item.unlocked { color: #9db3c7; border-color: var(--cyan); }
.dialog-card { width: min(480px, 100%); padding: 38px; text-align: center; border: 1px solid rgba(112,201,255,.22); background: linear-gradient(145deg, rgba(12,27,47,.94), rgba(4,9,20,.96)); clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px)); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.dialog-card .eyebrow { justify-content: center; }
.dialog-card h2 { margin: 0; font: 700 48px/1 "Barlow Condensed", "Noto Sans SC", sans-serif; }
.dialog-card > p:not(.eyebrow) { color: #8fa0b7; font-size: 13px; }
.dialog-card .primary-button { margin-top: 22px; }
.text-button { display: block; margin: 16px auto 0; padding: 6px; border: 0; background: none; color: #7f92aa; font-size: 11px; cursor: pointer; text-decoration: none; }
.text-button:hover { color: #fff; }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 24px; border-block: 1px solid var(--line); }
.end-stats div { padding: 16px 6px; }
.end-stats div + div { border-left: 1px solid var(--line); }
.end-stats span { display: block; color: #708198; font-size: 8px; letter-spacing: .1em; }
.end-stats strong { display: block; margin-top: 5px; font: 700 21px "Barlow Condensed", sans-serif; }
.record-banner { margin-top: 14px; color: var(--orange); font: 700 11px "Noto Sans SC", sans-serif; letter-spacing: .22em; }
.victory-card { border-color: rgba(87,233,255,.42); box-shadow: 0 30px 100px rgba(0,0,0,.68), 0 0 80px rgba(62,213,255,.08); }
.link-button { width: fit-content; }
.fallback { position: absolute; z-index: 60; inset: 0; display: grid; place-content: center; gap: 10px; padding: 28px; text-align: center; background: #050916; }
.fallback strong { font-size: 20px; }
.fallback span { color: var(--muted); font-size: 13px; }
.hidden { display: none; }
.overlay.hidden { display: grid; }

.touch-controls { display: none; position: absolute; z-index: 14; inset: auto 22px max(22px, env(safe-area-inset-bottom)); align-items: end; justify-content: space-between; pointer-events: none; }
.touch-pad, .dash-button, .fire-button { pointer-events: auto; touch-action: none; }
.touch-pad { position: relative; width: 112px; height: 112px; border-radius: 50%; border: 1px solid rgba(132,205,255,.25); background: rgba(8,22,41,.28); box-shadow: inset 0 0 25px rgba(57,148,205,.08); }
.touch-pad::before, .touch-pad::after { content: ""; position: absolute; background: rgba(134,209,255,.12); }
.touch-pad::before { left: 50%; top: 12px; bottom: 12px; width: 1px; }
.touch-pad::after { top: 50%; left: 12px; right: 12px; height: 1px; }
.touch-pad i { position: absolute; z-index: 2; left: 50%; top: 50%; width: 42px; height: 42px; transform: translate(-50%,-50%); border-radius: 50%; border: 1px solid rgba(111,229,255,.52); background: rgba(34,141,189,.24); box-shadow: 0 0 20px rgba(87,233,255,.13); }
.touch-actions { display: flex; align-items: end; gap: 10px; }
.dash-button, .fire-button { width: 88px; height: 88px; border-radius: 50%; border: 1px solid rgba(87,233,255,.48); background: rgba(12,46,72,.5); box-shadow: inset 0 0 24px rgba(87,233,255,.08); }
.fire-button { width: 70px; height: 70px; border-color: rgba(255,158,69,.48); background: rgba(75,39,18,.52); }
.dash-button span, .fire-button span { display: block; color: var(--cyan); font: 700 9px "Barlow Condensed", sans-serif; letter-spacing: .16em; }
.fire-button span { color: var(--orange); }
.dash-button strong, .fire-button strong { display: block; margin-top: 3px; font-size: 13px; }
.dash-button:active, .fire-button:active { transform: scale(.94); filter: brightness(1.25); }

body.playing .start-panel { opacity: 0; visibility: hidden; pointer-events: none; }
body:not(.playing) .hud, body:not(.playing) .flight-hint { opacity: 0; }
body:not(.playing) .touch-controls { opacity: 0; pointer-events: none; }
body.decision-open .touch-controls, body.decision-open .flight-hint { opacity: 0; pointer-events: none; }
body.decision-open .hud { opacity: .18; }

@media (max-width: 820px) {
  .game-shell { min-height: 420px; }
  .topbar { height: 62px; grid-template-columns: 1fr auto; }
  .brand-lockup { display: none; }
  .top-actions { grid-column: 2; }
  .icon-button { padding: 0 9px; }
  .hud { inset: 74px 16px auto; grid-template-columns: 1fr 1fr; }
  .hud-left { width: 160px; }
  .hud-right { width: 160px; }
  .metric strong { font-size: 26px; }
  .hud-center { position: absolute; left: 50%; transform: translateX(-50%); }
  .mission-card { min-width: 190px; }
  .flight-hint { display: none; }
  .menu-grid { grid-template-columns: 1fr; }
  .menu-copy { text-align: center; }
  .eyebrow, .feature-chips, .mission-brief { justify-content: center; }
  .lead { margin-inline: auto; }
  .telemetry-card { display: none; }
  h1 { font-size: clamp(46px, 12vw, 76px); }
  .touch-controls { display: flex; }
  .menu-footer { display: none; }
}

@media (max-width: 560px) {
  .topbar { padding-inline: 12px; }
  .back-link span:last-child, #soundButton { display: none; }
  .back-link { width: 36px; justify-content: center; padding: 0; }
  .hud { inset-inline: 12px; }
  .hud-left, .hud-right { width: 142px; }
  .metric-row { gap: 12px; }
  .metric.compact strong { font-size: 14px; }
  .status-head span { font-size: 7px; }
  .overlay { padding: 78px 18px 22px; }
  .lead { font-size: 12px; line-height: 1.7; }
  .mission-brief { align-items: center; }
  .mission-brief > span { height: 42px; }
  .mission-brief div { text-align: left; }
  .primary-button { min-width: 210px; }
  .dialog-card { padding: 32px 22px; }
  .end-stats strong { font-size: 17px; }
}

@media (max-height: 670px) and (min-width: 700px) {
  .overlay { padding-top: 72px; }
  .menu-grid { transform: scale(.88); }
  .telemetry-card { min-height: 400px; }
  h1 { font-size: 62px; }
  .lead { margin-top: 15px; }
  .mission-brief { margin-block: 16px; }
  .mode-switch { margin-top: 12px; }
  .ship-switch { display: none; }
  .choice-card { min-height: 220px; }
}

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