
:root {
  --ink: #f4eee1;
  --ink-dim: rgba(244, 238, 225, 0.65);
  --ink-faint: rgba(244, 238, 225, 0.36);
  --line: rgba(244, 238, 225, 0.22);
  --line-strong: rgba(244, 238, 225, 0.42);
  --gold: #f1c474;
  --red: #de765c;
  --sea-deep: #092b38;
}

* { box-sizing: border-box; }
html, body, #root { width: 100%; min-width: 320px; height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--sea-deep);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }

.flight-shell {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #b5c3bd 0%, #739ca0 48%, #0d5268 100%);
  user-select: none;
  touch-action: none;
}
.flight-canvas { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.film-grain, .vignette { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
.film-grain { opacity: .065; mix-blend-mode: screen; 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='.76' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E"); animation: grain .22s steps(2) infinite; }
.vignette { background: radial-gradient(ellipse at 53% 45%, transparent 34%, rgba(3, 22, 29, .11) 70%, rgba(3, 18, 25, .58) 100%); }
@keyframes grain { 0% { transform: translate(0,0) } 25% { transform: translate(1%,-1%) } 50% { transform: translate(-1%,1%) } 75% { transform: translate(1%,1%) } 100% { transform: translate(-1%,-1%) } }

.topbar, .flight-hud, .bottom-ui { position: absolute; z-index: 4; left: 0; right: 0; pointer-events: none; }
.topbar { top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 26px 31px 0; }
.brand-lockup { display: grid; gap: 3px; text-shadow: 0 2px 14px rgba(1, 20, 29, .3); }
.brand-kicker, .eyebrow, .start-overline { color: var(--ink-dim); font-size: 9px; letter-spacing: .24em; font-weight: 700; text-transform: uppercase; }
.brand-title { font-family: Georgia, "Times New Roman", serif; font-size: 18px; letter-spacing: .16em; line-height: 1; }
.brand-subtitle { color: var(--gold); font-size: 10px; letter-spacing: .4em; margin-left: 2px; }
.top-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.sound-toggle, .round-button, .craft-tabs button, .control-button, .start-button, .help-close { cursor: pointer; color: var(--ink); border: 0; }
.sound-toggle { height: 27px; padding: 0 9px; border: 1px solid var(--line); background: rgba(8, 33, 42, .18); color: var(--ink-dim); font-size: 9px; letter-spacing: .14em; transition: .2s ease; }
.sound-toggle:hover, .sound-toggle.active { background: rgba(240, 196, 116, .16); border-color: rgba(240, 196, 116, .6); color: var(--gold); }
.sound-dot { display: inline-block; width: 5px; height: 5px; margin: 0 5px 1px 0; border-radius: 50%; background: var(--ink-faint); }
.sound-toggle.active .sound-dot { background: var(--gold); box-shadow: 0 0 9px var(--gold); }
.round-button { width: 27px; height: 27px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(8, 33, 42, .18); color: var(--ink-dim); font-size: 12px; line-height: 25px; transition: .2s ease; }
.round-button:hover { color: var(--ink); border-color: var(--line-strong); background: rgba(8, 33, 42, .42); }

.flight-hud { top: 94px; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 31px; }
.craft-switcher { pointer-events: auto; }
.eyebrow { display: block; margin-bottom: 8px; color: var(--ink-faint); }
.craft-tabs { display: flex; gap: 3px; }
.craft-tabs button { display: flex; gap: 8px; align-items: center; height: 29px; padding: 0 10px; background: rgba(5, 34, 43, .22); border: 1px solid transparent; color: var(--ink-dim); font-size: 9px; letter-spacing: .13em; transition: .2s ease; }
.craft-tabs button b { color: var(--ink-faint); font-size: 8px; font-weight: 500; }
.craft-tabs button:hover { background: rgba(5, 34, 43, .44); color: var(--ink); }
.craft-tabs button.selected { color: #152e32; background: var(--gold); border-color: var(--gold); box-shadow: 0 5px 18px rgba(13, 38, 39, .2); }
.craft-tabs button.selected b { color: rgba(21, 46, 50, .6); }
.readouts { display: flex; align-items: flex-start; gap: 24px; text-align: right; }
.readout { min-width: 68px; display: grid; gap: 5px; }
.readout span { color: var(--ink-faint); font-size: 8px; letter-spacing: .22em; }
.readout strong { font-family: Georgia, serif; font-size: 26px; font-weight: 400; letter-spacing: .05em; line-height: 1; text-shadow: 0 3px 12px rgba(0, 0, 0, .18); }
.readout small { color: var(--ink-dim); font-family: Inter, sans-serif; font-size: 8px; letter-spacing: .13em; }
.progress-readout { min-width: 96px; }
.progress-readout i { display: block; width: 96px; height: 2px; overflow: hidden; margin-top: 3px; background: rgba(244, 238, 225, .22); }
.progress-readout em { display: block; height: 100%; background: var(--gold); transition: width .35s ease; }

.bottom-ui { bottom: 22px; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 31px; }
.status-line { color: var(--ink-dim); font-size: 10px; letter-spacing: .08em; text-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.status-pip { display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 0; border: 1px solid var(--gold); border-radius: 50%; box-shadow: 0 0 8px rgba(241, 196, 116, .65); }
.minimap { position: relative; width: 190px; height: 104px; overflow: hidden; border: 1px solid rgba(244, 238, 225, .24); background: rgba(7, 38, 47, .22); backdrop-filter: blur(3px); pointer-events: none; }
.map-grid { position: absolute; inset: 0; opacity: .32; background-image: linear-gradient(rgba(244, 238, 225, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(244, 238, 225, .13) 1px, transparent 1px); background-size: 25% 25%; }
.map-label { position: absolute; right: 7px; top: 6px; color: var(--gold); font-size: 7px; letter-spacing: .12em; }
.map-ring { position: absolute; z-index: 2; display: grid; width: 12px; height: 12px; margin: -6px 0 0 -6px; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: 6px; transition: .25s ease; }
.map-ring.cleared { opacity: .28; border-color: var(--ink); color: var(--ink); transform: scale(.65); }
.map-plane { position: absolute; z-index: 3; width: 0; height: 0; margin: -4px 0 0 -3px; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 8px solid var(--ink); filter: drop-shadow(0 0 4px rgba(255,255,255,.8)); transform-origin: 3px 4px; transition: left .15s linear, top .15s linear; }
.map-caption { position: absolute; bottom: 6px; left: 8px; color: var(--ink-faint); font-size: 7px; letter-spacing: .12em; }

.start-overlay { position: absolute; z-index: 5; inset: 0; display: flex; align-items: center; padding: 10vh 8vw 8vh; pointer-events: none; background: linear-gradient(90deg, rgba(5, 26, 34, .46) 0%, rgba(5, 26, 34, .1) 46%, transparent 72%); }
.start-copy { max-width: 570px; margin-top: 5vh; text-shadow: 0 3px 22px rgba(0, 18, 24, .27); pointer-events: auto; }
.start-overline { display: block; margin-bottom: 18px; color: var(--gold); letter-spacing: .28em; }
.start-copy h1 { margin: 0; color: var(--ink); font-family: Georgia, "Songti SC", serif; font-size: clamp(68px, 10vw, 144px); font-weight: 400; letter-spacing: -.08em; line-height: 1.05; }
.start-copy h1 i { color: #f3c58b; font-style: normal; font-weight: 400; letter-spacing: -.1em; }
.start-copy p { margin: 28px 0 23px; color: var(--ink-dim); font-size: 12px; letter-spacing: .03em; line-height: 1.8; }
.start-button { display: flex; align-items: center; justify-content: space-between; width: 158px; height: 41px; padding: 0 12px 0 16px; background: var(--gold); color: #1c3637; font-size: 10px; font-weight: 700; letter-spacing: .17em; box-shadow: 0 10px 28px rgba(7, 26, 30, .22); transition: .2s ease; }
.start-button b { font-size: 17px; font-weight: 400; }
.start-button:hover:not(:disabled) { background: #ffe0a0; transform: translateY(-2px); box-shadow: 0 13px 31px rgba(7, 26, 30, .3); }
.start-button:disabled { cursor: wait; opacity: .68; }
.start-error { width: min(380px, 90vw); margin-top: 12px; padding: 9px 11px; border-left: 2px solid var(--red); background: rgba(45, 22, 24, .34); color: #ffd1bf; font-size: 11px; line-height: 1.5; }
.start-error button { display: block; margin-top: 5px; padding: 0; border: 0; background: none; color: var(--gold); cursor: pointer; font-size: 10px; text-decoration: underline; }
.start-meta { display: flex; gap: 22px; margin-top: 43px; color: var(--ink-faint); font-size: 8px; letter-spacing: .16em; }
.start-rail { position: absolute; right: 31px; bottom: 28px; display: flex; align-items: center; gap: 11px; color: var(--ink-faint); font-size: 8px; letter-spacing: .2em; line-height: 1.45; }
.start-rail i { display: block; width: 50px; height: 1px; background: var(--line); }
.help-card { position: absolute; z-index: 7; top: 105px; right: 31px; width: min(300px, calc(100vw - 40px)); padding: 21px 22px 22px; border: 1px solid var(--line); background: rgba(10, 40, 47, .82); box-shadow: 0 14px 45px rgba(0, 19, 26, .3); backdrop-filter: blur(12px); }
.help-card h2 { margin: 0 0 14px; font-family: Georgia, serif; font-size: 27px; font-weight: 400; }
.help-card p { color: var(--ink-dim); font-size: 12px; line-height: 1.8; }
.help-card p b { color: var(--gold); font-size: 10px; letter-spacing: .09em; }
.help-muted { color: var(--ink-faint) !important; font-size: 10px !important; }
.help-close { position: absolute; top: 13px; right: 13px; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink-dim); font-size: 16px; line-height: 18px; }
.pause-chip { position: absolute; z-index: 6; top: 48%; left: 50%; padding: 12px 17px; transform: translate(-50%, -50%); border: 1px solid rgba(244,238,225,.3); background: rgba(7, 32, 39, .56); color: var(--gold); font-size: 11px; letter-spacing: .18em; backdrop-filter: blur(8px); }
.pause-chip span { margin-left: 9px; color: var(--ink-dim); font-size: 9px; letter-spacing: .06em; }
.mobile-controls { position: absolute; z-index: 5; right: 20px; bottom: 138px; display: none; align-items: flex-end; gap: 10px; pointer-events: auto; }
.mobile-controls.inactive { pointer-events: none; opacity: 0; }
.mobile-controls.active { opacity: 1; }
.control-cluster { display: flex; gap: 5px; }
.control-cluster.vertical { flex-direction: column; }
.control-button { display: grid; min-width: 43px; height: 43px; place-items: center; border: 1px solid rgba(244,238,225,.34); background: rgba(7, 35, 43, .38); color: var(--ink); font-size: 17px; backdrop-filter: blur(4px); }
.control-button:last-child { color: var(--gold); font-size: 8px; letter-spacing: .12em; }
.control-button:active { background: rgba(241,196,116,.3); transform: scale(.95); }

@media (max-width: 760px) {
  .topbar { padding: 17px 17px 0; }
  .brand-title { font-size: 15px; }
  .brand-kicker { font-size: 7px; }
  .sound-toggle { display: block; width: 27px; padding: 0; font-size: 0; }
  .sound-toggle::after { content: "音"; font-size: 10px; letter-spacing: 0; }
  .sound-dot { display: none; }
  .flight-hud { top: 75px; display: block; padding: 0 17px; }
  .craft-tabs { width: 100%; }
  .craft-tabs button { flex: 1; justify-content: center; padding: 0 5px; font-size: 8px; letter-spacing: .07em; }
  .readouts { justify-content: flex-start; gap: 20px; margin-top: 17px; text-align: left; }
  .readout strong { font-size: 21px; }
  .progress-readout { margin-left: auto; text-align: right; }
  .bottom-ui { bottom: 17px; padding: 0 17px; }
  .status-line { max-width: 49vw; font-size: 9px; line-height: 1.5; }
  .minimap { width: 145px; height: 84px; }
  .mobile-controls { display: flex; }
  .start-overlay { align-items: flex-end; padding: 0 22px 90px; background: linear-gradient(0deg, rgba(4, 24, 31, .72) 0%, rgba(5,26,34,.06) 80%); }
  .start-copy { width: 100%; margin: 0; }
  .start-copy h1 { font-size: clamp(63px, 19vw, 108px); }
  .start-copy p { margin: 22px 0 18px; font-size: 11px; }
  .start-meta { justify-content: space-between; gap: 5px; margin-top: 26px; font-size: 7px; }
  .start-rail { display: none; }
  .help-card { top: 84px; right: 17px; }
}
@media (max-height: 620px) and (orientation: landscape) {
  .start-overlay { padding-top: 55px; padding-bottom: 42px; }
  .start-copy { margin-top: 0; }
  .start-copy h1 { font-size: clamp(52px, 13vh, 90px); line-height: 1.05; }
  .start-copy p { margin: 10px 0 11px; }
  .start-meta { margin-top: 15px; }
  .flight-hud { top: 62px; }
  .bottom-ui { bottom: 12px; }
  .mobile-controls { display: flex; bottom: 70px; }
}
@media (max-width: 420px) {
  .mobile-controls { right: 12px; bottom: 120px; gap: 5px; }
  .control-button { min-width: 38px; height: 38px; }
  .minimap { width: 126px; height: 76px; }
  .readouts { gap: 12px; }
  .readout { min-width: 54px; }
  .readout strong { font-size: 18px; }
  .readout small { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .film-grain { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
