@import url('fonts.css');

:root {
  color-scheme: dark;
  --void: #070d12;
  --void-deep: #05090d;
  --bone: #e9e9dc;
  --muted: #829495;
  --quiet: #597478;
  --cyan: #85d9d3;
  --cyan-bright: #b5f4ea;
  --amber: #f3bd77;
  --coral: #dc796b;
  --line: rgba(149, 215, 210, .22);
  --display: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--void); color: var(--bone); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
button:disabled { cursor: default; opacity: .45; }
svg { display: block; }
[hidden], .hidden, .is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.game { position: relative; width: 100%; height: 100%; height: 100dvh; overflow: hidden; isolation: isolate; background: radial-gradient(circle at 68% 48%, #12272b 0%, #081319 38%, #050a0f 81%); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#gameCanvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; touch-action: none; }
.screen-grain { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .025; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }
.screen-edge { position: absolute; inset: 0; z-index: 2; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(170, 244, 227, .035), inset 0 0 80px rgba(0,0,0,.18); }

.hud { position: absolute; z-index: 10; left: 0; right: 0; pointer-events: none; }
.hud button { pointer-events: auto; }
.hud-top { top: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 20px; padding: max(27px, env(safe-area-inset-top)) max(31px, env(safe-area-inset-right)) 0 max(31px, env(safe-area-inset-left)); }
.brand-block { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-mark { position: relative; display: block; width: 27px; height: 27px; flex: 0 0 auto; }
.brand-mark i { display: block; position: absolute; width: 16px; height: 16px; border: 1.5px solid var(--cyan); transform: rotate(45deg); }
.brand-mark i:nth-child(1) { left: 0; top: 5px; }
.brand-mark i:nth-child(2) { left: 9px; top: 5px; opacity: .5; }
.brand-mark i:nth-child(3) { left: 5px; top: 8px; width: 7px; height: 7px; border-color: var(--bone); opacity: .7; }
.brand-copy strong { display: block; font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: .11em; line-height: .95; }
.brand-copy span { display: block; margin-top: 6px; font-size: 7px; font-weight: 700; letter-spacing: .18em; color: var(--quiet); white-space: nowrap; }
.brand-copy b { color: var(--amber); margin: 0 4px; }
.mission-chip { min-width: 190px; padding-top: 1px; text-align: center; }
.mini-label { display: block; color: #779195; font-size: 9px; font-weight: 700; letter-spacing: .19em; line-height: 1.1; }
.mission-chip strong { display: block; margin-top: 7px; font: 600 20px/.9 var(--display); letter-spacing: .08em; color: var(--bone); }
.mission-chip .mission-name { color: var(--cyan); }
.flight-telemetry { position: absolute; top: calc(max(27px, env(safe-area-inset-top)) + 51px); right: max(31px, env(safe-area-inset-right)); display: flex; align-items: start; gap: 17px; text-align: right; }
#game:has(#titleScreen:not(.is-hidden):not([hidden])) .flight-telemetry { display: none; }
.telemetry-item { min-width: 80px; padding-top: 6px; border-top: 1px solid rgba(167, 224, 214, .2); }
.telemetry-item .mini-label { font-size: 8px; letter-spacing: .14em; }
.telemetry-item strong { display: block; margin-top: 4px; font: 600 19px/.95 var(--display); letter-spacing: .04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.telemetry-boost strong { color: var(--amber); }
.telemetry-boost:has(#hudBoost[data-tier="4"]) strong, .telemetry-boost:has(#hudBoost[data-tier="5"]) strong, .telemetry-boost:has(#hudBoost[data-tier="6"]) strong, .telemetry-boost:has(#hudBoost[data-tier="7"]) strong { color: #ffd39b; text-shadow: 0 0 12px rgba(243,189,119,.28); }
.telemetry-boost:has(#hudBoost[data-tier="8"]) strong, .telemetry-boost:has(#hudBoost[data-tier="9"]) strong, .telemetry-boost:has(#hudBoost[data-tier="10"]) strong { color: #fff0bf; text-shadow: 0 0 17px rgba(243,189,119,.55); }
.telemetry-altitude strong { color: var(--cyan); }
.telemetry-altitude strong.is-space { color: var(--cyan-bright); text-shadow: 0 0 14px rgba(133,217,211,.53); }
.space-burn { display: none; margin-top: 5px; color: var(--coral); font-size: 7px; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.telemetry-altitude:has(#hudAltitude.is-space) .space-burn { display: block; }
.hud-actions { justify-self: end; display: flex; gap: 5px; }
.icon-button { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid rgba(130, 201, 196, .18); background: rgba(6, 17, 22, .54); color: #a1c7c4; transition: background .2s, color .2s, border-color .2s, transform .2s; }
.icon-button:hover { color: var(--bone); border-color: rgba(180, 234, 225, .55); background: rgba(20, 54, 57, .85); }
.icon-button:active { transform: scale(.93); }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }
.icon-button.is-muted .sound-wave, .icon-button[aria-pressed="true"] .sound-wave { opacity: .2; }
.hud-bottom { bottom: 0; display: flex; align-items: end; justify-content: space-between; gap: 25px; padding: 0 max(31px, env(safe-area-inset-right)) max(27px, env(safe-area-inset-bottom)) max(31px, env(safe-area-inset-left)); }
#game:has(.overlay:not(.is-hidden):not([hidden])) .hud-bottom { display: none; }
.ship-readouts { display: flex; align-items: end; gap: clamp(18px, 3.1vw, 54px); }
.readout { min-width: 58px; border-top: 1px solid rgba(167, 224, 214, .18); padding-top: 8px; }
.readout strong { display: block; margin-top: 5px; font: 500 27px/.9 var(--display); letter-spacing: .045em; color: var(--bone); font-variant-numeric: tabular-nums; }
.readout-crew strong { color: var(--amber); }
.readout-fuel strong { color: var(--cyan); }
.readout-hull strong { color: #d7ddd1; }
.readout-shield strong { color: #afd9d3; }
.readout .unit { font-size: .55em; margin-left: 2px; color: var(--quiet); }
.readout strong.is-low { color: var(--coral); text-shadow: 0 0 11px rgba(220, 121, 107, .28); }
.readout-fuel:has(#hudFuel.is-low) .mini-label { color: var(--coral); }
.readout-fuel #hudFuel.is-low { animation: low-fuel-pulse 1.25s ease-in-out infinite; }
@keyframes low-fuel-pulse { 50% { opacity: .56; } }
.objective-strip { display: flex; align-items: center; gap: 11px; max-width: 40%; min-height: 32px; padding: 6px 0 6px 14px; border-left: 1px solid rgba(243, 189, 119, .35); color: var(--amber); font-size: 9px; font-weight: 700; letter-spacing: .17em; line-height: 1.5; text-align: right; text-transform: uppercase; }
.objective-sigil { font: 24px/1 var(--display); }

.overlay { position: absolute; inset: 0; z-index: 6; }
.title-screen { display: flex; align-items: center; overflow: hidden; }
.title-backdrop { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5,10,14,.98) 0%, rgba(5,10,14,.93) 22%, rgba(5,10,14,.71) 46%, rgba(5,10,14,.15) 83%); pointer-events: none; }
.title-backdrop::after { content: ''; position: absolute; left: 47%; top: 11%; bottom: 10%; width: 1px; background: linear-gradient(transparent, rgba(123, 201, 198, .12), transparent); }
.title-content { position: relative; z-index: 2; width: min(55vw, 780px); padding: 4.5vh 0 0 clamp(34px, 7.3vw, 132px); }
.eyebrow { display: flex; align-items: center; gap: 13px; margin: 0; color: var(--amber); font-size: 10px; font-weight: 700; letter-spacing: .21em; white-space: nowrap; }
.eyebrow-line { display: block; width: 35px; height: 1px; flex: 0 0 auto; background: var(--amber); }
.eyebrow-index { color: var(--quiet); }
.title-content h1 { position: relative; margin: 21px 0 18px -5px; font: 800 clamp(105px, 12.8vw, 224px)/.68 var(--display); letter-spacing: -.025em; text-transform: uppercase; }
.title-content h1 > span { display: block; width: max-content; }
.title-content .light-word { margin-left: .18em; color: var(--bone); }
.title-period { color: var(--amber); }
.title-description { width: min(430px, 90%); margin: 32px 0 0; color: #a7b9b5; font-size: clamp(13px, 1vw, 16px); line-height: 1.72; }
.title-actions { display: flex; align-items: center; gap: 23px; margin-top: 30px; }
.primary-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 36px; min-width: 235px; min-height: 58px; padding: 0 17px 0 22px; border: 1px solid var(--amber); background: var(--amber); color: #0c1619; font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: .11em; text-align: left; text-transform: uppercase; transition: background .2s, color .2s, box-shadow .2s, transform .2s; }
.primary-button:hover { background: #ffdb9d; box-shadow: 0 0 25px rgba(243, 189, 119, .22); transform: translateY(-2px); }
.primary-button:active { transform: translateY(1px); }
.primary-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.edition { color: var(--quiet); font-size: 9px; font-weight: 700; letter-spacing: .18em; white-space: nowrap; }
.control-guide { margin-top: clamp(34px, 5.2vh, 65px); padding-top: 13px; width: min(515px, 95%); border-top: 1px solid var(--line); }
.guide-title { color: var(--cyan); font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: .14em; }
.guide-title b { margin: 0 4px; color: var(--quiet); }
.guide-lines { display: flex; flex-wrap: wrap; gap: 9px 18px; margin-top: 13px; color: #acbdb7; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-right: 2px; padding: 1px 4px; border: 1px solid rgba(146, 204, 196, .35); color: var(--cyan); font: 600 11px/1 var(--display); letter-spacing: .02em; }
.control-guide p { margin: 12px 0 0; color: #627c7d; font-size: 10px; letter-spacing: .02em; }
.title-art { position: absolute; z-index: 1; width: min(68vw, 1050px); aspect-ratio: 900 / 850; right: -8%; top: 50%; transform: translateY(-50%); pointer-events: none; opacity: .95; }
.title-art svg { width: 100%; height: 100%; filter: drop-shadow(0 0 13px rgba(67, 209, 197, .25)); }
.art-coordinate { position: absolute; color: rgba(145, 210, 203, .42); font: 600 9px/1 var(--display); letter-spacing: .2em; }
.art-coordinate-one { right: 20%; bottom: 14%; }
.art-coordinate-two { left: 13%; top: 25%; transform: rotate(-54deg); }
.title-footer { position: absolute; z-index: 2; left: max(31px, env(safe-area-inset-left)); right: max(31px, env(safe-area-inset-right)); bottom: max(25px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; color: #506c6c; font-size: 8px; font-weight: 700; letter-spacing: .18em; pointer-events: none; }
.title-footer b { margin-left: 5px; color: var(--amber); font-weight: 700; font-variant-numeric: tabular-nums; }

.info-screen { display: grid; place-items: center; z-index: 12; padding: 24px; background: rgba(4, 10, 13, .78); backdrop-filter: blur(10px); }
.info-panel { position: relative; width: min(540px, 100%); padding: clamp(30px, 5vw, 58px); background: rgba(7, 20, 24, .96); border: 1px solid rgba(139, 217, 211, .25); box-shadow: 0 20px 90px rgba(0,0,0,.35), inset 0 0 38px rgba(93, 198, 185, .025); }
.info-panel::before { content: ''; position: absolute; inset: 9px; border: 1px solid rgba(123, 194, 189, .065); pointer-events: none; }
.panel-corner { position: absolute; width: 25px; height: 25px; pointer-events: none; }
.panel-corner-top { top: -1px; left: -1px; border-top: 2px solid var(--cyan); border-left: 2px solid var(--cyan); }
.panel-corner-bottom { right: -1px; bottom: -1px; border-right: 2px solid var(--amber); border-bottom: 2px solid var(--amber); }
.info-panel .eyebrow { font-size: 9px; }
.info-panel .eyebrow-line { width: 23px; }
.panel-sequence { display: block; margin-top: 49px; color: #66898a; font: 600 11px/1 var(--display); letter-spacing: .2em; }
.panel-sequence span { color: var(--cyan); }
.info-panel h2 { margin: 11px 0 16px; color: var(--bone); font: 800 clamp(68px, 8vw, 112px)/.82 var(--display); letter-spacing: -.015em; text-transform: uppercase; }
#briefingTitle { font-size: clamp(55px, 6vw, 84px); overflow-wrap: anywhere; }
#resultTitle { font-size: clamp(54px, 6.6vw, 88px); overflow-wrap: anywhere; }
.info-panel p:not(.eyebrow):not(.panel-note) { width: 95%; margin: 0; color: #9fb5b0; font-size: 14px; line-height: 1.7; }
.info-panel .primary-button { margin-top: 33px; }
.panel-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 33px; }
.pause-panel .panel-actions .primary-button { margin-top: 0; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 58px; padding: 0 20px; border: 1px solid rgba(133, 217, 211, .43); background: transparent; color: var(--cyan); font: 700 15px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; transition: color .2s, border-color .2s, background .2s; }
.secondary-button:hover { color: var(--bone); border-color: var(--cyan); background: rgba(133, 217, 211, .1); }
.panel-note { margin: 31px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: #6f9794; font-size: 9px; font-weight: 700; letter-spacing: .19em; }
.panel-controls { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: #9db5af; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.result-panel .panel-sequence span { color: var(--amber); }
.panel-settings-link { align-self: center; border: 0; border-bottom: 1px solid rgba(133, 217, 211, .48); padding: 0 0 3px; background: transparent; color: var(--cyan); font: 700 11px/1 var(--display); letter-spacing: .13em; white-space: nowrap; }
.panel-settings-link:hover { color: var(--bone); border-color: var(--bone); }
.panel-settings-link span { margin-left: 3px; color: var(--amber); }

#settingsScreen { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.info-panel.settings-panel { --settings-pad-x: 32px; --settings-pad-y: 26px; display: flex; flex-direction: column; width: min(700px, 100%); max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; touch-action: pan-y; }
.settings-topbar { z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; padding: 13px var(--settings-pad-x) 10px; border-bottom: 1px solid rgba(133, 217, 211, .18); background: rgba(7, 20, 24, .98); }
.settings-body { min-height: 0; flex: 1 1 auto; padding: 0 var(--settings-pad-x) var(--settings-pad-y); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-color: rgba(133, 217, 211, .4) transparent; scrollbar-width: thin; touch-action: pan-y; }
.settings-topbar .eyebrow { min-width: 0; font-size: 9px; letter-spacing: .18em; }
.settings-scroll-hint { display: none; margin-left: auto; color: var(--amber); font: 700 9px/1 var(--display); letter-spacing: .12em; white-space: nowrap; }
.settings-close { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid rgba(133, 217, 211, .35); background: rgba(9, 32, 36, .7); color: var(--cyan); }
.settings-close:hover { border-color: var(--cyan-bright); color: var(--bone); }
.settings-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
#settingsTitle { margin: 20px 0 13px; font: 800 clamp(58px, 7vw, 78px)/.82 var(--display); letter-spacing: -.015em; }
#settingsScreen .settings-intro { width: min(560px, 100%); margin: 0; color: #9fb5b0; font-size: 13px; line-height: 1.55; }
.settings-ratio { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 20px; padding: 10px 13px; border: 1px solid rgba(243, 189, 119, .24); color: var(--amber); }
.settings-ratio span { font: 700 10px/1.25 var(--body); letter-spacing: .13em; }
.settings-ratio output { font: 700 26px/.9 var(--display); letter-spacing: .05em; white-space: nowrap; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px 30px; margin-top: 24px; }
.setting-field { min-width: 0; padding-top: 12px; border-top: 1px solid rgba(133, 217, 211, .22); }
.setting-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.setting-heading label { color: var(--bone); font: 700 15px/1 var(--display); letter-spacing: .13em; }
.setting-heading output { color: var(--amber); font: 700 24px/.9 var(--display); letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.setting-field input[type="range"] { display: block; width: 100%; height: 38px; margin: 5px 0 0; padding: 0; appearance: none; -webkit-appearance: none; background: transparent; cursor: pointer; touch-action: none; }
.setting-field input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: rgba(133, 217, 211, .29); border: 0; }
.setting-field input[type="range"]::-moz-range-track { height: 4px; background: rgba(133, 217, 211, .29); border: 0; }
.setting-field input[type="range"]::-webkit-slider-thumb { width: 21px; height: 21px; margin-top: -9px; appearance: none; -webkit-appearance: none; border: 2px solid var(--amber); border-radius: 50%; background: #152d30; box-shadow: 0 0 0 4px rgba(243, 189, 119, .12); }
.setting-field input[type="range"]::-moz-range-thumb { width: 19px; height: 19px; border: 2px solid var(--amber); border-radius: 50%; background: #152d30; box-shadow: 0 0 0 4px rgba(243, 189, 119, .12); }
.setting-field input[type="range"]:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.setting-hint { display: block; color: #799b98; font-size: 10px; line-height: 1.4; }
.setting-select-wrap { position: relative; margin-top: 10px; }
.setting-select-wrap::after { content: '⌄'; position: absolute; top: 4px; right: 14px; color: var(--amber); font: 26px/1 var(--display); pointer-events: none; }
.setting-select-wrap select { width: 100%; min-height: 42px; padding: 7px 35px 7px 11px; appearance: none; -webkit-appearance: none; border: 1px solid rgba(133, 217, 211, .35); border-radius: 0; background: #0b2025; color: var(--bone); font: 500 16px/1.2 var(--body); cursor: pointer; }
.setting-select-wrap select:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.setting-select-wrap + .setting-hint { margin-top: 8px; }
#settingsScreen .settings-footnote { width: 100%; margin: 22px 0 0; color: #789895; font-size: 10px; line-height: 1.45; }
.settings-actions { z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex: 0 0 auto; margin: 0; padding: 13px var(--settings-pad-x); border-top: 1px solid rgba(133, 217, 211, .18); background: rgba(7, 20, 24, .98); }
.settings-actions .primary-button, .settings-actions .secondary-button { min-height: 48px; margin: 0; }
.settings-actions .primary-button { min-width: 220px; }
.settings-actions .secondary-button { font-size: 13px; }

.touch-controls { display: none; position: absolute; z-index: 11; left: 0; right: 0; bottom: 0; align-items: end; justify-content: space-between; gap: 20px; padding: 0 max(22px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); pointer-events: none; touch-action: none; }
.touch-actions { display: flex; align-items: end; gap: 8px; pointer-events: auto; }
.touch-traditional { display: none; width: 124px; height: 124px; flex: 0 0 auto; grid-template-columns: repeat(2, 1fr); grid-template-rows: 62px 56px; gap: 6px; justify-items: center; pointer-events: auto; touch-action: none; }
#game[data-control-type="traditional"] .flight-joystick { display: none; }
#game[data-control-type="traditional"] .touch-traditional { display: grid; }
.touch-traditional .touch-button { width: 56px; height: 56px; border-color: rgba(133, 217, 211, .65); background: rgba(6, 28, 32, .74); color: var(--cyan); box-shadow: 0 0 0 4px rgba(133, 217, 211, .035), inset 0 0 13px rgba(133, 217, 211, .07); }
.touch-traditional .touch-button svg { width: 24px; height: 24px; }
.touch-traditional .touch-button span { font-size: 8px; letter-spacing: .09em; }
.touch-traditional .touch-button:active, .touch-traditional .touch-button.is-pressed { background: rgba(82, 195, 187, .28); border-color: var(--cyan-bright); color: var(--cyan-bright); }
.touch-traditional .touch-thrust { grid-column: 1 / -1; width: 62px; height: 62px; border-color: rgba(243, 189, 119, .75); background: rgba(36, 27, 17, .72); color: var(--amber); box-shadow: 0 0 0 4px rgba(243, 189, 119, .04), inset 0 0 14px rgba(243, 189, 119, .08); }
.touch-traditional .touch-thrust:active, .touch-traditional .touch-thrust.is-pressed { background: rgba(243, 189, 119, .3); border-color: #ffd59f; color: #ffd59f; }
.flight-joystick { --stick-x: 0px; --stick-y: 0px; position: relative; width: 124px; height: 124px; flex: 0 0 auto; border: 1px solid rgba(133, 217, 211, .64); border-radius: 50%; background: radial-gradient(circle, rgba(11, 37, 41, .2) 0 37%, rgba(11, 35, 39, .63) 38% 66%, rgba(5, 20, 26, .73) 67%); box-shadow: 0 0 0 5px rgba(133, 217, 211, .035), inset 0 0 28px rgba(5, 19, 25, .6), 0 0 23px rgba(39, 175, 170, .11); color: var(--cyan); pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.flight-joystick::before { content: ''; position: absolute; inset: 14px; border: 1px dashed rgba(133, 217, 211, .2); border-radius: 50%; pointer-events: none; }
.flight-joystick::after { content: ''; position: absolute; left: 50%; top: 0; height: 9px; border-left: 2px solid var(--amber); transform: translateX(-50%); box-shadow: 0 0 10px rgba(243, 189, 119, .43); pointer-events: none; }
.joystick-direction { position: absolute; z-index: 1; left: 50%; transform: translateX(-50%); white-space: nowrap; pointer-events: none; font: 700 9px/1 var(--display); letter-spacing: .13em; text-shadow: 0 1px 5px var(--void-deep); }
.joystick-direction-up { top: 16px; color: var(--amber); }
.joystick-direction-side { bottom: 13px; color: #9acac6; }
.joystick-knob { position: absolute; z-index: 2; left: calc(50% - 26px); top: calc(50% - 26px); display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid rgba(181, 244, 234, .87); border-radius: 50%; background: radial-gradient(circle at 36% 31%, #294e50 0%, #12333a 52%, #0a2028 100%); box-shadow: 0 0 0 4px rgba(133, 217, 211, .07), inset 0 0 15px rgba(133, 217, 211, .07), 0 0 16px rgba(133, 217, 211, .22); transform: translate(var(--stick-x), var(--stick-y)); pointer-events: none; }
.joystick-knob-core { display: block; width: 11px; height: 11px; border: 1px solid var(--cyan-bright); transform: rotate(45deg); box-shadow: 0 0 8px rgba(181, 244, 234, .5); }
.flight-joystick:active, .flight-joystick.is-active { border-color: var(--cyan-bright); box-shadow: 0 0 0 5px rgba(133, 217, 211, .065), 0 0 27px rgba(133, 217, 211, .27); }
.touch-button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 86px; height: 86px; flex: 0 0 auto; border: 1px solid rgba(220, 121, 107, .79); border-radius: 50%; background: rgba(32, 16, 22, .76); color: var(--coral); box-shadow: 0 0 0 5px rgba(220, 121, 107, .035), inset 0 0 17px rgba(220, 121, 107, .08), 0 0 24px rgba(220, 121, 107, .1); user-select: none; -webkit-user-select: none; touch-action: none; pointer-events: auto; transition: border-color .12s, background .12s, transform .12s, color .12s; }
.touch-button svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: miter; }
.touch-button span { font: 700 10px/1 var(--display); letter-spacing: .16em; }
.touch-button:active, .touch-button.active, .touch-button.is-active, .touch-button.is-pressed { background: rgba(220, 121, 107, .3); border-color: #ff9b8c; color: #ff9b8c; transform: scale(.95); }
.touch-button.touch-utility { width: 58px; height: 58px; border-color: rgba(133, 217, 211, .66); background: rgba(8, 28, 32, .78); color: var(--cyan); box-shadow: 0 0 0 4px rgba(133, 217, 211, .035), inset 0 0 14px rgba(133, 217, 211, .07); }
.touch-utility svg { width: 24px; height: 24px; }
.touch-utility span { font-size: 8px; letter-spacing: .08em; }
.touch-utility::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; pointer-events: none; background: conic-gradient(from -90deg, var(--cyan-bright) var(--shield-charge, 100%), rgba(133, 217, 211, .11) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); }
.touch-utility:active, .touch-utility.is-active, .touch-utility.is-pressed { background: rgba(58, 159, 153, .28); border-color: var(--cyan-bright); color: var(--cyan-bright); box-shadow: 0 0 20px rgba(133, 217, 211, .22); }
.touch-utility.is-depleted { color: #9c8885; border-color: rgba(220, 121, 107, .47); }
.touch-utility.is-depleted::before { background: conic-gradient(from -90deg, var(--coral) var(--shield-charge, 0%), rgba(220, 121, 107, .15) 0); }
.touch-utility.is-depleted.is-pressed, .touch-utility.is-depleted.is-active { background: rgba(35, 22, 27, .75); color: #9c8885; border-color: rgba(220, 121, 107, .47); box-shadow: none; }

@media (pointer: coarse) {
  #game, #gameCanvas, .overlay, .hud, .touch-controls { touch-action: none; }
  #game:has(#settingsScreen:not(.is-hidden):not([hidden])), #settingsScreen { touch-action: pan-y; }
  .touch-controls { display: flex; }
  .hud-bottom { bottom: 145px; }
  .readout-shield { display: none; }
  #game:has(#titleScreen:not(.is-hidden):not([hidden])) .mission-chip { display: none; }
  .control-guide .guide-lines, .panel-controls > span { display: none; }
  .control-guide p { color: #9fb5b0; font-size: 11px; line-height: 1.5; }
  .control-guide .touch-guide-traditional, #game[data-control-type="traditional"] .control-guide .touch-guide-joystick { display: none; }
  #game[data-control-type="traditional"] .control-guide .touch-guide-traditional { display: block; }
  .panel-controls::before { content: 'LEFT STICK / FLY     RIGHT / FIRE + SHIELD'; color: #9db5af; }
  #game[data-control-type="traditional"] .panel-controls::before { content: 'LEFT/RIGHT TURN · THRUST CLIMB · FIRE/SHIELD RIGHT'; }
  .overlay:not(.is-hidden):not([hidden]) ~ .touch-controls { display: none; }
}
@media (pointer: fine) { .control-guide p { display: none; } }
@media (max-width: 900px) {
  .title-content { width: min(62vw, 610px); padding-left: 6vw; }
  .title-content h1 { font-size: clamp(100px, 13vw, 165px); }
  .title-art { width: 77vw; right: -24%; }
  .title-description { font-size: 13px; }
  .title-backdrop { background: linear-gradient(90deg, rgba(5,10,14,.99), rgba(5,10,14,.85) 42%, rgba(5,10,14,.17)); }
  .readout-score { display: none; }
}
@media (max-width: 650px) {
  .hud-top { grid-template-columns: 1fr auto; align-items: center; padding: max(17px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left)); }
  .brand-copy strong { font-size: 16px; }
  .brand-copy span { font-size: 6px; }
  .brand-mark { transform: scale(.8); transform-origin: left center; width: 23px; }
  .mission-chip { position: absolute; top: calc(max(17px, env(safe-area-inset-top)) + 48px); left: 18px; min-width: 0; text-align: left; }
  .mission-chip .mini-label { font-size: 7px; }
  .mission-chip strong { font-size: 17px; margin-top: 4px; }
  .flight-telemetry { top: calc(max(17px, env(safe-area-inset-top)) + 48px); right: max(18px, env(safe-area-inset-right)); gap: 10px; }
  .telemetry-item { min-width: 66px; padding-top: 4px; }
  .telemetry-item .mini-label { font-size: 7px; letter-spacing: .1em; }
  .telemetry-item strong { font-size: 15px; }
  .space-burn { font-size: 6px; letter-spacing: .06em; }
  .hud-actions { gap: 4px; }
  .icon-button { width: 34px; height: 34px; }
  .icon-button svg { width: 16px; height: 16px; }
  .hud-bottom { padding: 0 18px max(18px, env(safe-area-inset-bottom)); }
  .ship-readouts { width: 100%; justify-content: space-between; gap: 9px; }
  .readout { min-width: 45px; }
  .readout strong { font-size: 22px; }
  .readout .mini-label { font-size: 7px; }
  .objective-strip { display: none; }
  .title-content { width: 100%; padding: 0 24px 28px; }
  .title-content h1 { font-size: clamp(95px, 21.4vw, 150px); margin-top: 24px; }
  .title-description { width: min(355px, 92%); margin-top: 30px; font-size: 13px; }
  .title-backdrop { background: linear-gradient(90deg, rgba(5,10,14,.98), rgba(5,10,14,.83) 68%, rgba(5,10,14,.45)); }
  .title-art { width: 135vw; right: -72%; opacity: .52; }
  .title-actions { gap: 13px; margin-top: 26px; }
  .primary-button { min-width: 206px; min-height: 54px; font-size: 15px; }
  .edition { display: none; }
  .control-guide { margin-top: 42px; }
  .title-footer { left: 24px; right: 24px; bottom: 18px; font-size: 7px; }
  .title-footer span:nth-child(3) { display: none; }
}
@media (max-width: 650px) and (pointer: coarse) {
  .hud-bottom { bottom: max(143px, calc(env(safe-area-inset-bottom) + 130px)); align-items: start; }
  .objective-strip { align-self: end; }
  .touch-controls { padding: 0 max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
}
@media (max-width: 499px) {
  .info-panel.settings-panel { --settings-pad-x: 22px; --settings-pad-y: 18px; }
  .settings-grid { grid-template-columns: 1fr; gap: 17px; margin-top: 19px; }
  #settingsTitle { font-size: 60px; }
  .settings-actions .primary-button { min-width: 0; padding: 0 9px; gap: 5px; font-size: 12px; }
  .settings-actions .primary-button svg { width: 18px; height: 18px; }
  .settings-actions .secondary-button { min-height: 44px; padding: 0 9px; font-size: 12px; }
  .settings-actions .primary-button { min-height: 44px; }
}
@media (max-width: 450px) {
  .title-content { padding-top: 56px; }
  .eyebrow { font-size: 8px; letter-spacing: .16em; gap: 8px; }
  .eyebrow-line { width: 23px; }
  .title-content h1 { font-size: clamp(86px, 21.9vw, 110px); }
  .title-description { font-size: 12px; line-height: 1.62; }
  .control-guide { margin-top: 34px; }
  .guide-lines { gap: 8px 12px; font-size: 8px; }
  .info-panel { padding: 28px; }
  .info-panel h2 { font-size: 66px; }
  #briefingTitle { font-size: 55px; }
  #resultTitle { font-size: 54px; }
  .panel-sequence { margin-top: 38px; }
  .info-panel p:not(.eyebrow):not(.panel-note) { font-size: 12px; }
  .readout-score { display: none; }
  .touch-button { width: 82px; height: 82px; }
}
@media (max-height: 600px) and (min-width: 651px) {
  .hud-top { padding-top: max(13px, env(safe-area-inset-top)); }
  .flight-telemetry { top: max(64px, calc(env(safe-area-inset-top) + 47px)); }
  .hud-bottom { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .title-content { padding-top: 8px; }
  .title-content h1 { font-size: clamp(82px, 15vh, 120px); margin-top: 14px; margin-bottom: 12px; }
  .title-description { margin-top: 14px; max-width: 430px; font-size: 12px; line-height: 1.5; }
  .title-actions { margin-top: 17px; }
  .primary-button { min-height: 44px; }
  .control-guide { margin-top: 17px; padding-top: 9px; }
  .control-guide p { display: none; }
  .title-footer { bottom: max(9px, env(safe-area-inset-bottom)); }
  .info-panel { padding: 26px 34px; }
  .panel-sequence { margin-top: 21px; }
  .info-panel h2 { font-size: 70px; }
  .info-panel .primary-button { margin-top: 19px; }
  .panel-actions { margin-top: 19px; }
  .secondary-button { min-height: 44px; }
  .panel-note, .panel-controls { margin-top: 18px; }
}
@media (max-height: 450px) {
  #briefingScreen .info-panel { padding-top: 20px; padding-bottom: 18px; }
  #briefingScreen .panel-sequence { margin-top: 12px; }
  #briefingScreen .primary-button { margin-top: 14px; }
  #briefingScreen .panel-note { margin-top: 11px; padding-top: 10px; }
}
@media (max-height: 350px) and (pointer: coarse) {
  #briefingScreen { padding: 8px 20px; }
  #briefingScreen .info-panel { padding: 12px 27px; }
  #briefingScreen .eyebrow { font-size: 8px; }
  #briefingScreen .panel-sequence { margin-top: 7px; }
  #briefingScreen h2 { margin: 6px 0 8px; font-size: 39px; }
  #briefingScreen p:not(.eyebrow):not(.panel-note) { font-size: 11px; line-height: 1.37; }
  #briefingScreen .primary-button { min-height: 36px; margin-top: 10px; }
  #briefingScreen .panel-note { display: none; }
}
@media (max-height: 450px) and (pointer: coarse) {
  .info-panel.settings-panel { --settings-pad-x: 22px; --settings-pad-y: 13px; max-height: calc(100dvh - 16px); }
  #settingsScreen { padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
  #settingsTitle { margin-top: 13px; font-size: 48px; }
  #settingsScreen .settings-intro { font-size: 11px; }
  .settings-ratio { margin-top: 12px; padding: 7px 11px; }
  .settings-grid { gap: 12px 20px; margin-top: 14px; }
  .setting-field { padding-top: 8px; }
  .settings-actions { padding-top: 9px; padding-bottom: 9px; }
  .settings-actions .primary-button, .settings-actions .secondary-button { min-height: 40px; }
  #pauseScreen, #resultScreen { padding: 12px 20px; }
  .pause-panel, .result-panel { padding: 18px 28px; }
  .pause-panel .panel-sequence, .result-panel .panel-sequence { margin-top: 12px; }
  .pause-panel h2, #resultTitle { margin: 9px 0 11px; font-size: 48px; }
  .pause-panel p:not(.eyebrow), .result-panel p:not(.eyebrow) { font-size: 12px; line-height: 1.45; }
  .pause-panel .panel-actions, .result-panel .primary-button { margin-top: 15px; }
  .pause-panel .primary-button, .pause-panel .secondary-button, .result-panel .primary-button { min-height: 42px; }
  .pause-panel .panel-controls { margin-top: 13px; padding-top: 11px; }
  .touch-controls { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .hud-bottom { left: 50%; right: auto; bottom: max(11px, env(safe-area-inset-bottom)); width: auto; padding: 0; transform: translateX(-50%); }
  .ship-readouts { width: auto; gap: 15px; padding: 5px 13px 3px; background: rgba(3, 12, 16, .72); border: 1px solid rgba(133, 217, 211, .13); }
  .readout { min-width: 55px; border-top: 0; padding-top: 0; }
  .readout strong { margin-top: 4px; font-size: 20px; }
  .objective-strip { display: none; }
  .flight-joystick { width: 116px; height: 116px; }
  .touch-traditional { width: 116px; height: 116px; grid-template-rows: 58px 54px; gap: 4px; }
  .touch-traditional .touch-button { width: 54px; height: 54px; }
  .touch-traditional .touch-thrust { width: 58px; height: 58px; }
  .touch-button { width: 80px; height: 80px; }
  .touch-button.touch-utility { width: 54px; height: 54px; }
  .title-content { padding-top: 45px; }
  .title-content h1 { font-size: clamp(76px, 16vh, 95px); }
  .title-description { max-width: 390px; }
  .control-guide { display: none; }
}
@media (max-width: 650px) and (max-height: 450px) and (pointer: coarse) {
  .hud-bottom { left: 50%; }
  .ship-readouts { gap: 7px; padding: 4px 7px 3px; }
  .readout { min-width: 45px; }
  .readout strong { font-size: 17px; }
  .readout .mini-label { font-size: 6px; letter-spacing: .05em; white-space: nowrap; }
  .readout-crew .mini-label { font-size: 0; }
  .readout-crew .mini-label::after { content: 'CREW'; font-size: 6px; }
}
@media (max-width: 350px) and (pointer: coarse) {
  .hud-actions .fullscreen-button { display: none; }
  .touch-traditional { width: 112px; height: 112px; grid-template-rows: 58px 50px; gap: 4px; }
  .touch-traditional .touch-button { width: 50px; height: 50px; }
  .touch-traditional .touch-thrust { width: 58px; height: 58px; }
  #briefingScreen .info-panel { padding: 20px 24px; }
  #briefingScreen .panel-sequence { margin-top: 24px; }
  .ship-readouts { gap: 6px; }
  .readout { min-width: 42px; }
  .readout strong { font-size: 19px; }
  .readout .mini-label { letter-spacing: .07em; }
  .flight-joystick { width: 112px; height: 112px; }
  .touch-button { width: 76px; height: 76px; }
  .touch-button.touch-utility { width: 52px; height: 52px; }
  .hud-bottom { bottom: max(132px, calc(env(safe-area-inset-bottom) + 124px)); }
}
@media (max-height: 350px) and (pointer: coarse) {
  .settings-scroll-hint { display: block; }
  #pauseScreen, #resultScreen { padding: 8px 20px; }
  .pause-panel, .result-panel { padding: 11px 24px; }
  .pause-panel .eyebrow, .result-panel .eyebrow { font-size: 8px; }
  .pause-panel .panel-sequence, .result-panel .panel-sequence { margin-top: 6px; }
  .pause-panel h2, #resultTitle { margin: 5px 0 7px; font-size: 39px; }
  .pause-panel p:not(.eyebrow), .result-panel p:not(.eyebrow) { font-size: 10px; line-height: 1.35; }
  .pause-panel .panel-actions, .result-panel .primary-button { margin-top: 8px; }
  .pause-panel .primary-button, .pause-panel .secondary-button, .result-panel .primary-button { min-height: 36px; }
  .pause-panel .panel-controls { margin-top: 8px; padding-top: 7px; font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
