:root {
  --amber: #FFB547;
  --mint: #7FD6A8;
  --paper: #F4EADD;
  --ink: #0B131A;
  --night: #16202A;
  --slate: #26343D;
  --haze: #E8B27A;
  --river: #2E5A63;
  --font-display: 'Saira Condensed', 'Arial Narrow', sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-cn: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --line: color-mix(in srgb, var(--amber) 56%, transparent);
  --line-dim: rgba(244, 234, 221, 0.18);
  --scrim: rgba(9, 16, 22, 0.74);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body { overscroll-behavior: none; }
button { font: inherit; color: inherit; }
button:focus-visible { outline: 1px solid var(--amber); outline-offset: 3px; }
::selection { background: var(--amber); color: var(--ink); }

#app { position: fixed; inset: 0; isolation: isolate; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }

#screen-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.08;
  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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

body.is-interior #sky-wash {
  background:
    radial-gradient(110% 90% at 50% 44%, transparent 48%, rgba(5, 10, 15, 0.24) 100%),
    linear-gradient(180deg, rgba(255, 181, 71, 0.05), transparent 28%, rgba(10, 15, 20, 0.08));
}

#sky-wash {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 72% 12%, rgba(255, 200, 130, 0.06), transparent 48%),
    linear-gradient(180deg, transparent 62%, rgba(8, 14, 20, 0.22) 100%);
  transition: background 1.6s ease;
}

.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.42s ease, visibility 0.42s step-end;
}
.screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s step-start;
}

/* Shared type */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  font-weight: 400;
  color: rgba(244, 234, 221, 0.7);
  text-transform: uppercase;
}
.eyebrow-line { display: inline-block; width: 28px; height: 1px; background: var(--amber); }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 34px; height: 34px; color: var(--amber); flex: 0 0 auto; }
.brand-lockup b { display: block; font-family: var(--font-display); font-size: 17px; line-height: 1; letter-spacing: 0.17em; font-weight: 700; }
.brand-lockup span { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.22em; color: rgba(244, 234, 221, 0.55); }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(10, 18, 24, 0.48);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn small { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.08em; color: var(--amber); }
.btn:hover { background: rgba(255, 181, 71, 0.13); border-color: var(--amber); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--ink); font-weight: 700; }
.btn-primary small { color: rgba(11, 19, 26, 0.64); }
.btn-primary:hover { background: #ffc66d; border-color: #ffc66d; }
.btn-quiet { border-color: rgba(244, 234, 221, 0.22); color: rgba(244, 234, 221, 0.72); background: transparent; }
.btn-quiet:hover { border-color: rgba(244, 234, 221, 0.55); background: rgba(244, 234, 221, 0.055); }
.icon-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(244, 234, 221, 0.26);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--amber); color: var(--amber); }
.text-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  cursor: pointer;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 20, 0.34);
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
}

/* Boot */
.boot-screen {
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(90deg, rgba(7, 13, 19, 0.9), rgba(7, 13, 19, 0.52) 52%, rgba(7, 13, 19, 0.86)),
    radial-gradient(90% 90% at 50% 40%, rgba(232, 178, 122, 0.11), transparent 70%);
  transition: opacity 0.7s ease, visibility 0.7s step-end;
}
.boot-inner { width: min(640px, 82vw); text-align: center; }
.boot-mark { color: var(--amber); width: 76px; height: 76px; margin: 0 auto 22px; }
.boot-mark svg { width: 100%; height: 100%; }
.boot-kicker { font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.32em; color: rgba(244, 234, 221, 0.64); }
.boot-title { margin: 14px 0 0; font-family: var(--font-display); font-size: clamp(54px, 8.2vw, 104px); line-height: 0.86; letter-spacing: 0.01em; font-weight: 800; }
.boot-title span { color: var(--amber); }
.title-rule { display: flex; align-items: center; gap: 0; margin: 18px auto 0; max-width: 390px; color: var(--amber); }
.title-rule span { display: block; height: 1px; background: var(--amber); flex: 1; }
.title-rule svg { width: 25px; height: 25px; flex: 0 0 auto; margin-left: -1px; }
.boot-location { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: rgba(244, 234, 221, 0.68); margin-top: 24px; }
.boot-location b { font-family: var(--font-cn); font-weight: 400; color: var(--paper); letter-spacing: 0.06em; }
.boot-progress { height: 1px; background: rgba(244, 234, 221, 0.16); margin-top: 42px; position: relative; overflow: hidden; }
.boot-progress i { display: block; width: 0%; height: 100%; background: var(--amber); transition: width 0.2s ease; }
.boot-status { margin-top: 10px; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.18em; color: rgba(244, 234, 221, 0.54); }
.boot-corner { position: absolute; bottom: 24px; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.18em; color: rgba(244, 234, 221, 0.4); }
.boot-corner-l { left: 28px; }
.boot-corner-r { right: 28px; }

/* Menu */
.menu-screen {
  z-index: 15;
  display: flex;
  flex-direction: column;
  padding: calc(24px + var(--safe-top)) clamp(24px, 4vw, 64px) calc(22px + var(--safe-bottom));
  background:
    linear-gradient(90deg, rgba(6, 13, 19, 0.86) 0%, rgba(6, 13, 19, 0.54) 34%, rgba(6, 13, 19, 0.015) 64%, rgba(6, 13, 19, 0.48) 100%),
    linear-gradient(180deg, rgba(6, 13, 19, 0.42) 0%, transparent 20%, transparent 68%, rgba(6, 13, 19, 0.78) 100%);
}
.menu-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex: 0 0 auto; }
.menu-meta { display: flex; align-items: center; gap: 28px; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.17em; color: rgba(244, 234, 221, 0.62); }
#pilot-name { color: var(--amber); text-align: right; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-grid { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 430px); gap: clamp(30px, 6vw, 120px); align-items: center; min-height: 0; }
.menu-copy { align-self: center; padding-top: 10px; max-width: 750px; }
.wordmark { margin: 16px 0 0; font-family: var(--font-display); font-size: clamp(68px, 8.8vw, 150px); line-height: 0.82; font-weight: 700; letter-spacing: -0.018em; color: var(--paper); text-shadow: 0 0 34px rgba(255, 181, 71, 0.18); }
.wordmark span { color: var(--amber); }
.menu-copy .title-rule { margin: 20px 0 0; max-width: 360px; }
.menu-lede { max-width: 500px; margin: 26px 0 0; font-family: var(--font-display); font-size: 18px; line-height: 1.42; font-weight: 300; letter-spacing: 0.025em; color: rgba(244, 234, 221, 0.78); }
.menu-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; align-items: stretch; }
.menu-actions .btn-primary { min-width: 218px; }
.menu-actions .btn { min-width: 130px; }
.time-block { margin-top: 38px; width: min(560px, 100%); }
.time-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 9px; border-bottom: 1px solid rgba(244, 234, 221, 0.16); font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.18em; color: rgba(244, 234, 221, 0.58); }
.time-head span:last-child { color: var(--amber); }
.time-row { display: flex; gap: 11px; margin-top: 12px; padding-bottom: 17px; align-items: flex-start; flex-wrap: wrap; }
.sky-disc { position: relative; width: 51px; height: 51px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; flex: 0 0 auto; }
.sky-disc::after { content: ""; position: absolute; inset: -4px; border: 1px solid transparent; border-radius: 50%; transition: border-color 0.2s ease; }
.sky-disc canvas { width: 100%; height: 100%; display: block; border-radius: 50%; }
.sky-disc span { display: block; position: absolute; top: 56px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.1em; color: rgba(244, 234, 221, 0.55); text-transform: uppercase; }
.sky-disc:hover::after { border-color: rgba(255, 181, 71, 0.5); }
.sky-disc.is-active::after { border-color: var(--amber); }
.sky-disc.is-active span { color: var(--amber); }

.map-panel { align-self: center; border-top: 1px solid rgba(244, 234, 221, 0.3); background: rgba(8, 16, 23, 0.54); padding: 18px 20px 16px; max-height: calc(100dvh - 230px); overflow: auto; scrollbar-width: thin; }
.panel-head, .panel-foot { display: flex; justify-content: space-between; gap: 14px; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.18em; color: rgba(244, 234, 221, 0.55); }
.panel-head { padding-bottom: 13px; border-bottom: 1px solid rgba(244, 234, 221, 0.12); }
.panel-foot { margin-top: 15px; padding-top: 12px; border-top: 1px solid rgba(244, 234, 221, 0.12); color: rgba(244, 234, 221, 0.48); }
.panel-foot b { color: var(--amber); font-weight: 400; }
.map-card { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; min-height: 58px; padding: 11px 0; border: 0; border-bottom: 1px solid rgba(244, 234, 221, 0.12); background: transparent; text-align: left; cursor: pointer; }
.map-card.is-live { position: relative; }
.map-card.is-live::before { content: ""; position: absolute; left: -20px; top: 10px; bottom: 10px; width: 2px; background: var(--amber); }
.map-card.is-live:hover .map-copy b { color: var(--amber); }
.map-card.is-locked { cursor: default; opacity: 0.47; }
.map-index { font-family: var(--font-mono); font-size: 8px; color: rgba(244, 234, 221, 0.52); }
.map-copy { min-width: 0; }
.map-copy b { display: block; font-family: var(--font-display); font-size: 16px; line-height: 1.1; letter-spacing: 0.04em; font-weight: 600; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-copy em { display: block; margin-top: 2px; font-family: var(--font-cn); font-size: 9px; line-height: 1.4; font-style: normal; color: rgba(244, 234, 221, 0.56); letter-spacing: 0.06em; }
.map-copy small { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.08em; color: rgba(244, 234, 221, 0.4); }
.map-state { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.1em; color: rgba(244, 234, 221, 0.4); }
.map-card.is-live .map-state { color: var(--amber); }
.menu-foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex: 0 0 auto; padding-top: 12px; font-family: var(--font-mono); font-size: 7.5px; letter-spacing: 0.16em; color: rgba(244, 234, 221, 0.4); }
#flight-log { color: rgba(244, 234, 221, 0.65); }

/* Garage */
.garage-screen {
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: calc(24px + var(--safe-top)) clamp(22px, 4vw, 60px) calc(18px + var(--safe-bottom));
  background:
    linear-gradient(180deg, rgba(6, 12, 18, 0.9) 0%, rgba(6, 12, 18, 0.28) 24%, rgba(6, 12, 18, 0.15) 55%, rgba(6, 12, 18, 0.94) 90%),
    linear-gradient(90deg, rgba(6, 12, 18, 0.82) 0%, rgba(6, 12, 18, 0.06) 62%);
}
.garage-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.garage-heading { text-align: right; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.18em; color: rgba(244, 234, 221, 0.55); }
.garage-heading b { display: block; color: var(--amber); font-weight: 400; margin-top: 5px; }
.garage-side { width: min(390px, 38vw); margin-top: clamp(30px, 7vh, 90px); }
.garage-side h2 { margin: 15px 0 0; font-family: var(--font-display); font-size: clamp(46px, 5.8vw, 82px); line-height: 0.88; font-weight: 700; letter-spacing: 0.01em; }
.garage-zh { margin: 9px 0 0; font-family: var(--font-cn); font-size: 12px; letter-spacing: 0.12em; color: var(--amber); }
.garage-copy { max-width: 350px; margin: 23px 0 0; font-family: var(--font-display); font-size: 15px; line-height: 1.45; color: rgba(244, 234, 221, 0.7); }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 26px 0 0; border-top: 1px solid rgba(244, 234, 221, 0.2); }
.spec-grid div { padding: 11px 0 10px; border-bottom: 1px solid rgba(244, 234, 221, 0.13); }
.spec-grid dt { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.15em; color: rgba(244, 234, 221, 0.45); }
.spec-grid dd { margin: 4px 0 0; font-family: var(--font-mono); font-size: 17px; color: var(--paper); }
.spec-grid dd small { font-size: 8px; color: var(--amber); letter-spacing: 0.06em; }
.garage-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.garage-actions .btn-primary { min-width: 200px; }
.garage-tiles { margin-top: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; position: relative; z-index: 2; }
.vehicle-tile { position: relative; display: flex; flex-direction: column; text-align: left; min-height: 164px; padding: 12px 13px 10px; border: 1px solid rgba(244, 234, 221, 0.17); background: rgba(10, 18, 24, 0.62); color: var(--paper); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; overflow: hidden; }
.vehicle-tile:not(:disabled):hover { border-color: rgba(255, 181, 71, 0.72); background: rgba(20, 29, 36, 0.8); }
.vehicle-tile.is-active { border-color: var(--amber); background: rgba(31, 29, 24, 0.78); }
.vehicle-tile:disabled { cursor: default; color: rgba(244, 234, 221, 0.38); }
.tile-tag { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.12em; color: rgba(244, 234, 221, 0.4); }
.is-active .tile-tag { color: var(--amber); }
.vehicle-silhouette { width: 100%; height: auto; aspect-ratio: 240/90; margin: auto 0; color: currentColor; }
.vehicle-tile:not(:disabled) .vehicle-silhouette { color: var(--paper); }
.vehicle-tile.is-active .vehicle-silhouette { color: var(--amber); }
.tile-name { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(244, 234, 221, 0.12); padding-top: 8px; }
.tile-name b { font-family: var(--font-display); font-size: 14px; letter-spacing: 0.09em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-name small { font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.1em; color: rgba(244, 234, 221, 0.42); }
.tile-lock { position: absolute; top: 12px; right: 13px; display: flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.1em; color: rgba(244, 234, 221, 0.4); }
.tile-lock svg { width: 12px; height: 12px; }
.garage-foot { display: flex; justify-content: space-between; gap: 18px; margin-top: 12px; font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.16em; color: rgba(244, 234, 221, 0.36); }

/* Flight */
.game-screen { z-index: 25; pointer-events: none; }
.flight-top {
  position: absolute;
  left: calc(24px + var(--safe-left));
  right: calc(24px + var(--safe-right));
  top: calc(18px + var(--safe-top));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  pointer-events: none;
}
.flight-brand { display: flex; align-items: center; gap: 10px; }
.flight-brand .brand-mark { width: 29px; height: 29px; }
.flight-brand b { display: block; font-family: var(--font-display); font-size: 12px; letter-spacing: 0.17em; font-weight: 700; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35); }
.flight-brand span { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.16em; color: rgba(244, 234, 221, 0.55); }
.flight-top-mid { display: flex; gap: 18px; align-items: center; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.16em; color: rgba(244, 234, 221, 0.55); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }
.flight-top-mid #flight-solar { color: var(--amber); }
.flight-top-right { display: flex; align-items: center; gap: 15px; pointer-events: auto; }
.flight-top-right #view-label { font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.16em; color: rgba(244, 234, 221, 0.64); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }
.assist-badge {
  position: absolute;
  right: calc(26px + var(--safe-right));
  bottom: calc(31px + var(--safe-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 178px;
  padding: 9px 11px;
  border: 1px solid rgba(244, 234, 221, 0.2);
  background: rgba(9, 16, 22, 0.56);
  color: rgba(244, 234, 221, 0.54);
  pointer-events: none;
}
.assist-badge svg { width: 25px; height: 25px; }
.assist-badge b { display: block; font-family: var(--font-display); font-size: 11px; letter-spacing: 0.14em; font-weight: 600; }
.assist-badge span { display: block; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.1em; margin-top: 3px; color: rgba(244, 234, 221, 0.45); }
.assist-badge.is-on { color: var(--mint); border-color: rgba(127, 214, 168, 0.54); background: rgba(10, 26, 23, 0.54); }
.assist-badge.is-on span { color: rgba(127, 214, 168, 0.72); }
.assist-badge.is-on svg { filter: drop-shadow(0 0 6px rgba(127, 214, 168, 0.24)); }
.hold-badge {
  position: absolute;
  left: 50%;
  bottom: calc(105px + var(--safe-bottom));
  transform: translateX(-50%);
  padding: 5px 12px;
  border: 1px solid rgba(255, 181, 71, 0.5);
  background: rgba(9, 16, 22, 0.4);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.17em;
  color: var(--amber);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.hold-badge.is-visible { opacity: 1; }
.takeoff-hint {
  position: absolute;
  left: 50%;
  top: 31%;
  transform: translate(-50%, -50%);
  width: min(330px, 70vw);
  text-align: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.takeoff-hint.is-hidden { opacity: 0; }
.takeoff-hint b { display: block; margin-top: 11px; font-family: var(--font-mono); font-size: 8px; font-weight: 500; letter-spacing: 0.3em; color: var(--amber); }
.takeoff-hint p { margin: 9px 0 0; font-family: var(--font-display); font-size: 18px; letter-spacing: 0.045em; line-height: 1.35; color: rgba(244, 234, 221, 0.9); }
.takeoff-hint kbd { margin: 0 3px; }
.hint-line { display: block; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 181, 71, 0.65), transparent); }
.controls-panel {
  position: absolute;
  left: calc(24px + var(--safe-left));
  bottom: calc(24px + var(--safe-bottom));
  width: min(455px, 46vw);
  pointer-events: auto;
}
.controls-title { display: flex; justify-content: space-between; align-items: center; padding-bottom: 8px; border-bottom: 1px solid rgba(244, 234, 221, 0.18); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.17em; color: rgba(244, 234, 221, 0.5); }
.key-chips { display: flex; flex-wrap: wrap; gap: 7px 11px; margin-top: 9px; }
.chip-group { display: inline-flex; align-items: center; gap: 5px; }
.chip-group kbd { background: rgba(8, 14, 20, 0.38); }
.chip-group em { font-family: var(--font-mono); font-size: 6.5px; font-style: normal; letter-spacing: 0.1em; color: rgba(244, 234, 221, 0.6); }
.drag-hint { position: absolute; right: calc(26px + var(--safe-right)); top: 75px; font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.17em; color: rgba(244, 234, 221, 0.44); pointer-events: none; }
.touch-controls { display: none; }

/* Sheets */
.sheet-screen {
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  background: rgba(4, 10, 15, 0.66);
  pointer-events: auto;
}
.sheet {
  width: min(980px, 94vw);
  max-height: min(88dvh, 900px);
  overflow: auto;
  background: rgba(10, 17, 23, 0.94);
  border: 1px solid rgba(244, 234, 221, 0.18);
  border-top-color: rgba(255, 181, 71, 0.68);
  padding: 27px clamp(20px, 3vw, 38px) 24px;
  scrollbar-width: thin;
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid rgba(244, 234, 221, 0.15); }
.sheet-head h2 { margin: 7px 0 0; font-family: var(--font-display); font-size: clamp(34px, 5vw, 58px); font-weight: 700; letter-spacing: 0.03em; line-height: 0.9; }
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; margin-top: 22px; }
.setting-block { min-width: 0; }
.setting-block.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; grid-column: 1 / -1; border-top: 1px solid rgba(244, 234, 221, 0.11); padding-top: 17px; }
.setting-block.reserved { opacity: 0.48; }
.setting-head { display: flex; justify-content: space-between; gap: 15px; align-items: baseline; margin-bottom: 10px; font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.16em; color: rgba(244, 234, 221, 0.5); }
.setting-head b { color: var(--amber); font-weight: 400; font-size: 7px; letter-spacing: 0.1em; text-align: right; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid rgba(244, 234, 221, 0.18); }
.segmented button { min-height: 39px; padding: 0 10px; border: 0; border-right: 1px solid rgba(244, 234, 221, 0.13); background: transparent; color: rgba(244, 234, 221, 0.5); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.08em; cursor: pointer; }
.segmented button:last-child { border-right: 0; }
.segmented button.is-active { background: rgba(255, 181, 71, 0.14); color: var(--amber); }
.time-row-sheet { margin-top: 0; padding-bottom: 17px; gap: 12px; }
.time-row-sheet .sky-disc { width: 43px; height: 43px; }
.time-row-sheet .sky-disc span { top: 47px; font-size: 6px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 42px; }
.switch-row > div:first-child span { display: block; font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; }
.switch-row small { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 6px; letter-spacing: 0.07em; color: rgba(244, 234, 221, 0.4); }
.switch { display: flex; align-items: center; gap: 8px; min-width: 92px; padding: 4px 7px 4px 4px; border: 1px solid rgba(244, 234, 221, 0.24); background: transparent; color: rgba(244, 234, 221, 0.55); cursor: pointer; }
.switch i { display: block; width: 27px; height: 17px; border: 1px solid rgba(244, 234, 221, 0.3); position: relative; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; background: rgba(244, 234, 221, 0.5); transition: transform 0.18s ease, background 0.18s ease; }
.switch b { font-family: var(--font-mono); font-size: 7px; font-weight: 500; letter-spacing: 0.1em; }
.switch.is-on { border-color: rgba(127, 214, 168, 0.55); color: var(--mint); }
.switch.is-on i { border-color: rgba(127, 214, 168, 0.55); }
.switch.is-on i::after { transform: translateX(10px); background: var(--mint); }
.switch.is-on#toggle-sound { border-color: rgba(255, 181, 71, 0.55); color: var(--amber); }
.switch.is-on#toggle-sound i { border-color: rgba(255, 181, 71, 0.55); }
.switch.is-on#toggle-sound i::after { background: var(--amber); }
.reserved-row { display: flex; justify-content: space-between; gap: 15px; min-height: 39px; align-items: center; padding: 0 11px; border: 1px solid rgba(244, 234, 221, 0.11); font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.1em; color: rgba(244, 234, 221, 0.45); }
.reserved-row em { font-style: normal; color: rgba(255, 181, 71, 0.56); }
.meter { width: 106px; height: 4px; background: rgba(244, 234, 221, 0.13); }
.meter i { display: block; width: 10%; height: 100%; background: var(--amber); transition: width 0.2s linear; }
.sheet-foot { display: flex; justify-content: flex-end; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 27px; padding-top: 18px; border-top: 1px solid rgba(244, 234, 221, 0.15); }
.sheet-foot .btn-primary { min-width: 150px; }

/* Debrief */
.debrief-sheet { width: min(700px, 92vw); text-align: center; border-top-color: var(--amber); }
.debrief-mark { width: 54px; height: 54px; margin: 0 auto 17px; color: var(--amber); }
.debrief-mark svg { width: 100%; height: 100%; }
.debrief-sheet h2 { margin: 9px 0 0; font-size: clamp(52px, 8vw, 86px); line-height: 0.84; letter-spacing: 0.02em; }
.debrief-sheet > p { margin: 10px 0 0; font-family: var(--font-mono); font-size: 8px; letter-spacing: 0.14em; color: rgba(244, 234, 221, 0.5); }
.debrief-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 31px; border-top: 1px solid rgba(244, 234, 221, 0.18); border-bottom: 1px solid rgba(244, 234, 221, 0.18); }
.debrief-stats div { padding: 15px 7px 14px; border-right: 1px solid rgba(244, 234, 221, 0.12); }
.debrief-stats div:last-child { border-right: 0; }
.debrief-stats span { display: block; font-family: var(--font-mono); font-size: 6.5px; letter-spacing: 0.15em; color: rgba(244, 234, 221, 0.45); }
.debrief-stats b { display: block; margin-top: 5px; font-family: var(--font-mono); font-size: 19px; font-weight: 500; color: var(--paper); }
.debrief-stats b small { font-size: 8px; color: var(--amber); }
.debrief-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; margin-top: 27px; }
.debrief-actions .btn-primary { min-width: 175px; }

/* Manual */
.manual-sheet { width: min(900px, 94vw); }
.manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 21px; }
.manual-grid h3 { margin: 0 0 8px; font-family: var(--font-mono); font-size: 8px; font-weight: 400; letter-spacing: 0.18em; color: var(--amber); }
.manual-grid p { margin: 0 0 20px; font-family: var(--font-display); font-size: 15px; line-height: 1.5; color: rgba(244, 234, 221, 0.68); }
.manual-controls { display: grid; grid-template-columns: 1fr; border-top: 1px solid rgba(244, 234, 221, 0.16); margin-bottom: 17px; }
.manual-controls div { display: flex; align-items: center; gap: 7px; min-height: 33px; border-bottom: 1px solid rgba(244, 234, 221, 0.1); }
.manual-controls span { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.09em; color: rgba(244, 234, 221, 0.6); }
.manual-controls kbd { min-width: 27px; }
.manual-note { padding: 11px 13px; border-left: 2px solid var(--mint); background: rgba(127, 214, 168, 0.07); font-family: var(--font-mono); font-size: 7px; line-height: 1.6; letter-spacing: 0.07em; color: rgba(244, 234, 221, 0.62); }

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: calc(26px + var(--safe-bottom));
  z-index: 80;
  transform: translate(-50%, 12px);
  max-width: min(480px, 84vw);
  padding: 10px 15px;
  border: 1px solid rgba(255, 181, 71, 0.55);
  background: rgba(8, 15, 21, 0.93);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--paper);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Narrow screens */
@media (max-width: 1080px) {
  .menu-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 350px); gap: 34px; }
  .menu-lede { font-size: 16px; }
  .garage-side { width: min(340px, 43vw); }
  .vehicle-tile { min-height: 148px; }
  .tile-name b { font-size: 12px; }
}

@media (max-width: 820px) {
  .menu-screen { overflow-y: auto; padding: calc(18px + var(--safe-top)) 18px calc(18px + var(--safe-bottom)); }
  .menu-top { position: relative; z-index: 2; }
  .menu-meta span:first-child { display: none; }
  .menu-grid { display: block; }
  .menu-copy { padding-top: 7vh; }
  .wordmark { font-size: clamp(62px, 15vw, 110px); }
  .menu-lede { font-size: 15px; }
  .menu-actions { margin-top: 24px; }
  .menu-actions .btn-primary { flex: 1 1 100%; }
  .menu-actions .btn { flex: 1 1 auto; }
  .time-block { margin-top: 28px; padding-bottom: 24px; }
  .map-panel { margin: 0 0 28px; max-height: none; background: rgba(8, 16, 23, 0.66); }
  .map-card { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .menu-foot { position: relative; flex-wrap: wrap; gap: 9px; padding-bottom: 6px; }
  .garage-screen { overflow-y: auto; }
  .garage-side { width: auto; max-width: 420px; margin-top: 28px; }
  .garage-side h2 { font-size: clamp(46px, 12vw, 68px); }
  .garage-tiles { grid-template-columns: repeat(5, minmax(142px, 1fr)); overflow-x: auto; padding-bottom: 6px; margin-top: 32px; }
  .garage-foot { flex-wrap: wrap; }
  .sheet-grid { grid-template-columns: 1fr; }
  .setting-block.two-col { grid-template-columns: 1fr; }
  .time-row-sheet { gap: 16px; }
  .debrief-stats { grid-template-columns: 1fr 1fr; }
  .debrief-stats div:nth-child(2) { border-right: 0; }
  .debrief-stats div:nth-child(-n+2) { border-bottom: 1px solid rgba(244, 234, 221, 0.12); }
  .manual-grid { grid-template-columns: 1fr; gap: 8px; }
  .flight-top-mid { display: none; }
  .flight-top-right #view-label { display: none; }
  .controls-panel { width: min(350px, 58vw); }
  .assist-badge { min-width: 150px; padding: 7px 9px; }
  .assist-badge b { font-size: 9px; }
}

@media (max-width: 560px) {
  .brand-lockup span { display: none; }
  .brand-mark { width: 28px; height: 28px; }
  .menu-meta { font-size: 7px; }
  .menu-top { gap: 10px; }
  .wordmark { font-size: clamp(57px, 17vw, 88px); }
  .menu-lede { display: none; }
  .menu-copy { padding-top: 4vh; }
  .menu-actions { gap: 7px; }
  .menu-actions .btn { min-width: 0; padding: 0 11px; font-size: 13px; }
  .sky-disc { width: 45px; height: 45px; }
  .sky-disc span { top: 49px; font-size: 6px; }
  .time-row { gap: 9px; }
  .time-block { margin-top: 22px; }
  .map-copy b { font-size: 14px; }
  .map-copy small { display: none; }
  .garage-heading { display: none; }
  .garage-top { align-items: center; }
  .garage-side p.garage-copy { display: none; }
  .garage-side .spec-grid { margin-top: 17px; }
  .garage-actions { margin-top: 18px; }
  .garage-side h2 { font-size: 48px; }
  .garage-tiles { grid-template-columns: repeat(5, 138px); }
  .sheet { padding: 20px 15px 17px; }
  .sheet-head { padding-bottom: 15px; }
  .sheet-grid { gap: 18px; margin-top: 17px; }
  .sheet-foot { justify-content: stretch; }
  .sheet-foot .btn { flex: 1 1 auto; }
  .sheet-foot .btn-primary { flex: 1 1 100%; }
  .debrief-actions .btn { flex: 1 1 auto; }
  .debrief-actions .btn-primary { flex: 1 1 100%; }
  .manual-grid p { font-size: 14px; }
  .flight-brand b { font-size: 10px; }
  .flight-brand span { display: none; }
  .controls-panel { display: none; }
  .drag-hint { top: 66px; right: 18px; }
  .assist-badge { bottom: calc(11px + var(--safe-bottom)); right: calc(12px + var(--safe-right)); min-width: 0; }
  .assist-badge svg { width: 21px; height: 21px; }
  .assist-badge span { display: none; }
  .hold-badge { bottom: calc(94px + var(--safe-bottom)); }
}

@media (hover: none), (pointer: coarse) {
  .controls-panel { display: none; }
  .touch-controls {
    display: flex;
    position: absolute;
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    bottom: calc(12px + var(--safe-bottom));
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    pointer-events: auto;
    touch-action: none;
  }
  .touch-cluster { display: flex; align-items: center; gap: 7px; }
  .touch-turn { align-self: flex-end; }
  .touch-throttle { flex-direction: column-reverse; gap: 5px; }
  .touch-throttle-read { font-family: var(--font-mono); font-size: 7px; letter-spacing: 0.1em; color: var(--amber); text-align: center; }
  .touch-throttle-read span { display: block; font-size: 5.5px; color: rgba(244, 234, 221, 0.5); }
  .touch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 181, 71, 0.66);
    border-radius: 0;
    background: rgba(7, 14, 20, 0.58);
    color: var(--amber);
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 500;
    touch-action: none;
  }
  .touch-btn.is-held { background: rgba(255, 181, 71, 0.25); color: #fff; }
  .touch-small { width: 46px; height: 46px; font-size: 13px; }
  .touch-small em { display: block; margin-top: 1px; font-family: var(--font-mono); font-size: 5px; font-style: normal; letter-spacing: 0.05em; color: rgba(244, 234, 221, 0.58); }
  .touch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .assist-badge { right: calc(12px + var(--safe-right)); bottom: calc(126px + var(--safe-bottom)); }
  .hold-badge { bottom: calc(124px + var(--safe-bottom)); }
  .drag-hint { top: 64px; }
  .time-row-sheet .sky-disc { width: 39px; height: 39px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  #takeoff-hint { top: 94px; width: auto; max-width: 260px; }
  #takeoff-hint p { display: none; }
  #takeoff-hint .hint-line { display: none; }
  #takeoff-hint b { margin-top: 0; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .menu-copy { padding-top: 0; }
  .wordmark { font-size: clamp(52px, 8.4vw, 96px); margin-top: 7px; }
  .menu-copy .title-rule { margin-top: 11px; }
  .menu-lede { margin-top: 12px; font-size: 14px; }
  .menu-actions { margin-top: 16px; }
  .time-block { margin-top: 16px; }
  .time-row { margin-top: 7px; }
  .sky-disc { width: 42px; height: 42px; }
  .sky-disc span { top: 45px; font-size: 5.5px; }
  .map-panel { max-height: calc(100dvh - 132px); padding: 12px 17px; }
  .map-card { min-height: 46px; padding: 7px 0; }
  .garage-side { margin-top: 12px; }
  .garage-side h2 { font-size: 52px; }
  .garage-copy { display: none; }
  .spec-grid { margin-top: 13px; }
  .garage-actions { margin-top: 14px; }
  .garage-tiles { min-height: 135px; }
  .vehicle-tile { min-height: 135px; }
  .garage-foot { display: none; }
  .controls-panel { bottom: 14px; }
}
