/* Create23 drone game — interface. Brand: ink #0a0b0f, lime #7ff454, paper #f3f3ef. */
:root {
  --ink: #0a0b0f;
  --lime: #7ff454;
  --lime-deep: #3c7d20;
  --paper: #f3f3ef;
  --orange: #ff5c38;
  --amber: #ffb547;
  --glass: rgba(10, 11, 15, 0.8);
  --line: rgba(243, 243, 239, 0.14);
  --muted: rgba(243, 243, 239, 0.72);
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --gap: clamp(12px, 2.2vw, 24px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); font-family: var(--sans); overflow: hidden; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
button, a { font: inherit; }
#app { position: fixed; inset: 0; touch-action: none; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 600; }
.lime { color: var(--lime); }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--lime); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 0; background: var(--lime); color: var(--ink); font-size: 16px; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn:hover { background: #a2fb80; }
.btn:focus-visible, .card:focus-visible, .ghost:focus-visible, .iconbtn:focus-visible { outline: 3px solid var(--paper); outline-offset: 3px; }
.ghost { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid rgba(243, 243, 239, 0.32); background: transparent; color: var(--paper); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; }
.ghost:hover { border-color: var(--paper); }

/* full screens over the 3D scene */
.screen { position: absolute; inset: 0; display: flex; padding: var(--gap); overflow-y: auto; background: linear-gradient(90deg, rgba(10, 11, 15, 0.92) 0%, rgba(10, 11, 15, 0.7) 55%, rgba(10, 11, 15, 0.35) 100%); }
.screen.solid { background: radial-gradient(ellipse 60% 55% at 40% 52%, #1d2430 0%, var(--ink) 72%); }
.screen.red { background: radial-gradient(ellipse 60% 55% at 30% 52%, #2a1d1d 0%, var(--ink) 72%); }

/* loading + intro */
.intro { flex-direction: column; justify-content: safe center; gap: 22px; max-width: 760px; }
.intro h1 { margin: 0; font-size: clamp(40px, 7vw, 84px); font-weight: 800; letter-spacing: -0.055em; line-height: 0.96; }
.intro p { margin: 0; max-width: 560px; font-size: clamp(15px, 1.6vw, 18px); line-height: 1.55; color: var(--muted); }
.intro .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.small { font-size: 12px; line-height: 1.5; color: rgba(243, 243, 239, 0.6); max-width: 620px; }
.progress { width: min(420px, 80vw); height: 6px; border-radius: 3px; background: rgba(243, 243, 239, 0.15); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--lime); transition: width 0.25s; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 16px; max-width: 620px; font-size: 13px; font-weight: 600; color: var(--muted); }
.keys span { display: flex; align-items: center; gap: 8px; }
kbd { padding: 3px 8px; border-radius: 6px; background: rgba(243, 243, 239, 0.14); font: 700 12px var(--sans); color: var(--paper); }

/* hangar */
.hangar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); grid-template-rows: auto 1fr auto; gap: var(--gap); }
.hangar-head { grid-column: 1; display: flex; flex-direction: column; gap: 10px; }
.hangar h2, .big-title { margin: 0; font-size: clamp(30px, 4.2vw, 48px); font-weight: 800; letter-spacing: -0.05em; line-height: 1; }
.hangar-stage { grid-column: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 180px; }
.hangar-stage::before { content: ""; position: absolute; left: 10%; right: 10%; bottom: 14%; height: 70px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(127, 244, 84, 0.3), rgba(127, 244, 84, 0) 70%); }
.hangar-stage svg { position: relative; width: min(100%, 520px); height: auto; max-height: 34vh; }
.hangar-stage .name { position: relative; display: flex; gap: 10px; align-items: baseline; }
.hangar-stage .name b { font-size: 28px; font-weight: 900; letter-spacing: -0.04em; }
.panel { grid-column: 2; grid-row: 1 / span 2; align-self: start; padding: 22px; border-radius: 20px; background: rgba(243, 243, 239, 0.06); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.panel .kicker { color: rgba(243, 243, 239, 0.65); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.check svg { flex-shrink: 0; margin-top: 1px; }
.panel .note { padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: rgba(243, 243, 239, 0.62); }
.cards { grid-column: 1 / span 2; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.card { padding: 10px 12px 12px; border-radius: 16px; background: rgba(243, 243, 239, 0.05); border: 2px solid var(--line); color: var(--paper); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.card svg { width: 100%; max-width: 116px; height: auto; }
.card b { font-size: 15px; font-weight: 800; }
.card small { font-size: 12px; color: var(--muted); }
.card[aria-pressed="true"] { background: rgba(127, 244, 84, 0.12); border-color: var(--lime); }
.card:hover { border-color: rgba(243, 243, 239, 0.4); }

/* grounded */
.grounded { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 460px); gap: var(--gap); align-items: stretch; }
.grounded .stage { position: relative; display: flex; flex-direction: column; gap: 8px; }
.grounded .stage svg { width: min(100%, 560px); opacity: 0.55; margin-top: auto; margin-bottom: auto; }
.stamp { position: absolute; left: 12%; top: 46%; transform: rotate(-12deg); padding: 10px 26px; border: 6px solid var(--orange); border-radius: 12px; color: var(--orange); font-size: clamp(30px, 5vw, 56px); font-weight: 900; letter-spacing: 0.08em; }
.needs { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.45; }
.needs div { display: flex; gap: 10px; }
.needs i { flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; background: rgba(255, 181, 71, 0.18); color: var(--amber); font: 800 12px var(--sans); display: flex; align-items: center; justify-content: center; font-style: normal; }
.needs i.r { background: rgba(255, 92, 56, 0.2); color: #ff8a6e; }

/* modal cards (briefing, rule, complete) */
.modal { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: var(--gap); background: rgba(10, 11, 15, 0.55); }
.sheet { width: min(560px, 100%); max-height: 100%; overflow-y: auto; padding: clamp(20px, 3vw, 30px); border-radius: 22px; background: var(--paper); color: var(--ink); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.sheet.dark { background: var(--ink); color: var(--paper); border: 1px solid var(--line); }
.sheet h3 { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.sheet p { margin: 0; font-size: 15px; line-height: 1.55; color: rgba(10, 11, 15, 0.75); }
.sheet.dark p { color: var(--muted); }
.sheet .kicker { color: var(--lime-deep); }
.sheet.dark .kicker { color: var(--lime); }
.sheet .kicker.bad { color: #b23a1e; }
.sheet .steps { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.sheet .fine { font-size: 12px; color: rgba(10, 11, 15, 0.6); }
.sheet .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sheet .ghost { color: var(--ink); border-color: rgba(10, 11, 15, 0.3); }
.sheet.dark .ghost { color: var(--paper); border-color: rgba(243, 243, 239, 0.32); }
.stats { display: flex; gap: 22px; font-size: 13px; font-weight: 700; }
.stats b { display: block; font-size: 26px; font-weight: 900; letter-spacing: -0.04em; }

/* HUD */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud > * { position: absolute; }
.hud .box { border-radius: 14px; background: var(--glass); backdrop-filter: blur(6px); }
.mission { left: var(--gap); top: var(--gap); width: min(360px, 40vw); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.mission .t { font-size: 19px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.mission .s { font-size: 13px; line-height: 1.4; color: var(--muted); }
.pills { display: flex; gap: 6px; }
.pills i { width: 30px; height: 7px; border-radius: 4px; background: rgba(243, 243, 239, 0.25); }
.pills i.on { background: var(--lime); }
.chips { right: var(--gap); top: var(--gap); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.chips .row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { padding: 7px 11px; border-radius: 10px; background: var(--glass); font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip.sub { font-size: 12px; font-weight: 600; color: var(--muted); }
.chip .ok { color: var(--lime); }
.chip .low { color: var(--orange); }
.iconbtn { pointer-events: auto; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--glass); color: var(--paper); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.alt { left: var(--gap); top: 50%; transform: translateY(-50%); width: 64px; height: min(300px, 42vh); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.alt .lbl { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; color: var(--muted); }
.alt .bar { position: relative; width: 10px; flex-grow: 1; border-radius: 5px; background: rgba(243, 243, 239, 0.18); }
.alt .fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 5px; background: var(--lime); }
.alt .fill.warn { background: var(--amber); }
.alt .fill.bad { background: var(--orange); }
.alt .limit { position: absolute; left: -12px; right: -12px; height: 3px; background: var(--orange); }
.alt .v { font-size: 20px; font-weight: 900; letter-spacing: -0.04em; }
.alt .v small { font-size: 11px; font-weight: 700; }
.alt .m { font-size: 10px; font-weight: 700; color: #ff8a6e; }
.arrow { left: 50%; top: var(--gap); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 13px; font-weight: 800; }
.arrow svg { transition: transform 0.08s linear; }
.toasts { left: 50%; bottom: calc(var(--gap) + 4px); transform: translateX(-50%); width: min(560px, 54vw); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { width: 100%; padding: 14px 18px; border-radius: 16px; background: var(--paper); color: var(--ink); display: flex; gap: 14px; align-items: flex-start; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35); animation: pop 0.25s ease-out; }
.toast .ic { flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.toast .k { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lime-deep); }
.toast .h { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.toast .x { font-size: 13px; line-height: 1.45; color: rgba(10, 11, 15, 0.72); }
.warnbar { width: auto; padding: 9px 16px; border-radius: 12px; background: var(--orange); color: var(--ink); font-size: 14px; font-weight: 800; }
.warnbar.amber { background: var(--amber); }
.flash { padding: 8px 14px; border-radius: 10px; background: var(--glass); font-size: 14px; font-weight: 800; color: var(--lime); }
.flash.bad { color: var(--amber); }
.photo-card { pointer-events: auto; display: flex; gap: 12px; align-items: center; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--glass); animation: pop 0.25s ease-out; }
.photo-card img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
.pc-row { display: flex; gap: 6px; flex-wrap: wrap; }
.small-btn { min-height: 38px; padding: 8px 14px; font-size: 13px; }
.sheet .gallery-wrap .kicker { color: rgba(243, 243, 239, 0.65); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.gallery > div { display: flex; flex-direction: column; gap: 6px; }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; display: block; }
.gallery-wrap { display: flex; flex-direction: column; }
@keyframes pop { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.minimap { right: var(--gap); bottom: var(--gap); width: 168px; height: 168px; border-radius: 50%; overflow: hidden; background: var(--glass); border: 2px solid var(--line); }
.minimap canvas { width: 100%; height: 100%; display: block; }
.hints { left: var(--gap); bottom: var(--gap); display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: rgba(243, 243, 239, 0.9); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); }
.hints span { display: flex; gap: 6px; align-items: center; }
.credit { right: calc(var(--gap) + 180px); bottom: calc(var(--gap) + 2px); font-size: 10px; color: rgba(243, 243, 239, 0.7); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); text-align: right; max-width: 260px; }
.whiteout { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.35s; }
.whiteout.on { opacity: 0.85; transition: none; }
.viewfinder { position: absolute; inset: 12% 18%; border: 2px solid rgba(243, 243, 239, 0.6); border-radius: 6px; pointer-events: none; }
.viewfinder::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; border: 2px solid var(--lime); border-radius: 50%; }

/* touch controls */
.touch { position: absolute; inset: 0; pointer-events: none; }
.stick { position: absolute; bottom: calc(var(--gap) + 8px); width: 128px; height: 128px; border-radius: 50%; background: rgba(10, 11, 15, 0.42); border: 2px solid rgba(243, 243, 239, 0.35); display: flex; align-items: center; justify-content: center; pointer-events: auto; touch-action: none; }
.stick > i { width: 54px; height: 54px; border-radius: 50%; background: rgba(243, 243, 239, 0.88); }
.stick.l { left: calc(var(--gap) + 8px); }
.stick.r { right: calc(var(--gap) + 8px); }
.stick b { position: absolute; bottom: -18px; font-size: 10px; font-weight: 700; color: var(--paper); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); white-space: nowrap; }
.tbtn { position: absolute; pointer-events: auto; touch-action: none; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; }
.tbtn.photo { right: calc(var(--gap) + 152px); bottom: calc(var(--gap) + 40px); width: 64px; height: 64px; background: var(--lime); color: var(--ink); border: 4px solid var(--ink); }
.tbtn.walk { right: calc(var(--gap) + 160px); bottom: calc(var(--gap) + 116px); width: 52px; height: 52px; background: var(--glass); color: var(--paper); }
.tbtn.view { left: calc(var(--gap) + 152px); bottom: calc(var(--gap) + 40px); width: 48px; height: 48px; background: var(--glass); color: var(--paper); }
body.is-touch .hints { display: none; }
body.is-touch .minimap { width: 120px; height: 120px; bottom: auto; top: calc(var(--gap) + 96px); }
body.is-touch .credit { right: var(--gap); bottom: auto; top: calc(var(--gap) + 220px); width: 120px; max-width: none; font-size: 9px; text-align: center; }

/* debrief */
.debrief { flex-direction: column; justify-content: safe center; gap: 18px; max-width: 760px; }
.rules-met { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rules-met div { padding: 12px 14px; border-radius: 14px; background: rgba(243, 243, 239, 0.06); border: 1px solid var(--line); font-size: 13px; line-height: 1.4; }
.rules-met b { display: block; font-size: 14px; margin-bottom: 2px; }

/* rotate notice */
.rotate { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 32px; text-align: center; background: var(--ink); font-size: 18px; font-weight: 700; flex-direction: column; gap: 18px; }
@media (orientation: portrait) and (pointer: coarse) { .rotate { display: flex; } }

/* small landscape screens (phones) */
@media (max-height: 520px) {
  :root { --gap: 10px; }
  .intro { gap: 12px; }
  .intro h1 { font-size: clamp(30px, 5.4vw, 44px); }
  .intro p { font-size: 14px; }
  .small { font-size: 11px; }
  .arrow { top: calc(var(--gap) + 46px); padding: 5px 10px; }
  .chip { padding: 6px 9px; font-size: 12px; }
  .hangar { grid-template-rows: auto 1fr auto; }
  .hangar h2, .big-title { font-size: clamp(24px, 3.6vw, 32px); }
  .hangar-head p { display: none; }
  .hangar-stage { min-height: 0; }
  .hangar-stage .name b { font-size: 20px; }
  .panel { grid-row: 1 / span 3; max-height: calc(100vh - 2 * var(--gap)); overflow-y: auto; }
  .cards { grid-column: 1; gap: 6px; }
  .grounded .stage svg { max-height: 40vh; }
  .mission { width: min(300px, 38vw); padding: 10px 12px; }
  .mission .t { font-size: 15px; }
  .mission .s { font-size: 12px; }
  .alt { width: 52px; height: 40vh; }
  .alt .v { font-size: 16px; }
  .toasts { width: min(440px, 46vw); bottom: calc(var(--gap) + 70px); }
  .toast { padding: 10px 12px; }
  .toast .x { display: none; }
  .stick { width: 112px; height: 112px; }
  .hangar { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 10px; }
  .hangar-stage svg { max-height: 22vh; }
  .panel { padding: 14px; gap: 8px; }
  .check { font-size: 12px; }
  .card { padding: 6px 8px 8px; }
  .card svg { max-width: 70px; }
  .card b { font-size: 12px; }
  .card small { font-size: 10px; }
  .sheet { gap: 8px; }
  .sheet p { font-size: 13px; }
}
@media (max-width: 760px) and (min-height: 521px) {
  .hangar, .grounded { grid-template-columns: 1fr; }
  .panel { grid-column: 1; grid-row: auto; }
  .cards { grid-column: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* DJI RC-N3 training controls. Bottom center, clear of both Mode 2 virtual sticks. */
.rc-bar {
  position: absolute; z-index: 6; bottom: calc(var(--gap) + 9px);
  left: 50%; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 5px;
  width: min(490px, 52vw); pointer-events: auto;
}
.rc-key {
  background: rgba(10, 11, 15, .88); color: var(--paper); border: 1px solid rgba(243,243,239,.36);
  border-radius: 8px; padding: 8px 10px; min-height: 35px;
  font: 800 11px var(--sans); cursor: pointer; touch-action: none;
}
.rc-key:active, .rc-key:focus-visible { background: var(--lime); color: var(--ink); }
.rc-rth:empty { display: none; }
.rc-rth:not(:empty) { background: #ffb547; color: var(--ink); }
.rc-help { max-height: min(43vh, 400px); overflow: auto; display: grid; gap: 6px; }
.rc-help-row { display: grid; grid-template-columns: minmax(125px, 42%) 1fr; gap: 12px;
  font-size: 12px; line-height: 1.5; padding: 7px 0; border-bottom: 1px solid rgba(243,243,239,.2); }
.rc-help-row b { color: #7ff454; }
.rc-help-row span { color: var(--paper); }
.rc-telemetry .chip { font-size: 11px; }
body.is-touch .rc-bar { width: min(285px, 34vw); bottom: calc(var(--gap) + 2px); }
body.is-touch .rc-key { min-height: 30px; padding: 5px 7px; font-size: 10px; }
@media (max-height: 520px) {
  .rc-bar { width: min(460px, 50vw); bottom: calc(var(--gap) + 2px); }
  body.is-touch .rc-bar { width: min(280px, 34vw); }
  .rc-help { max-height: 32vh; }
  .rc-telemetry .chip { font-size: 10px; padding: 4px 6px; }
}
@media (max-width: 950px) {
  .rc-telemetry { max-width: 32vw; }
}

/* Visible release marker on the opening screen, so stale Hostinger deploys are obvious. */
.intro .rc-intro-badge {
  display: inline-block; width: fit-content;
  border: 1px solid rgba(127, 244, 84, .52);
  background: rgba(127, 244, 84, .10);
  border-radius: 12px; padding: 10px 14px;
  color: #eaffdf; font-size: clamp(12px, 1.35vw, 14px); font-weight: 800; line-height: 1.4;
}

/* Imported drone showroom model, rendered on a transparent canvas. */
.hangar-stage { position: relative; }
.hangar-stage .drone-glb-preview { display: block; width: 100%; height: clamp(180px, 27vh, 330px); background: transparent; touch-action: pan-y; }
@media(max-height: 520px) { .hangar-stage .drone-glb-preview { height: 22vh; min-height: 105px; } }

/* Show model status until the imported geometry is visibly rendered. */
.drone-glb-status {
  position: relative; z-index: 3; padding: 5px 10px; border-radius: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: rgba(10, 11, 15, .75); color: #b7ff9d;
  text-align: center; max-width: 100%; overflow-wrap: anywhere;
}
.drone-glb-status.error { color: #ffbc86; }

/* Mobile landscape cockpit: prioritize the scene and Mode 2 joysticks. */
.mission-toggle, .mobile-alt, .tbtn.map, .tbtn.rc-toggle { display: none; }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  :root { --gap: 8px; }
  .hud .mission {
    top: 8px; left: 8px; width: min(250px, 37vw);
    padding: 8px 32px 8px 10px; gap: 3px;
    border-radius: 10px; min-height: 48px; max-height: min(95px, 28vh);
    overflow: hidden;
  }
  .mission .kicker { font-size: 9px; letter-spacing: .09em; }
  .mission .t { font-size: 13px; line-height: 1.18; }
  .mission .s, .mission .pills { display: none; }
  .hud.mission-expanded .mission { max-height: 60vh; overflow: auto; }
  .hud.mission-expanded .mission .s,
  .hud.mission-expanded .mission .pills { display: flex; }
  .hud .mission-toggle {
    display: block; position: absolute; right: 3px; top: 4px;
    border: 0; border-radius: 7px; width: 28px; height: 28px;
    background: rgba(243,243,239,.12); color: var(--paper);
    font-size: 19px; pointer-events: auto;
  }
  .hud .chips {
    top: 8px; right: 8px; width: min(450px, 57vw);
    display: flex; flex-direction: row; flex-wrap: wrap;
    justify-content: flex-end; gap: 3px;
  }
  .chips > .row { flex-wrap: nowrap; gap: 4px; }
  .chips > .row:last-child { display: none; }
  .chips .chip { padding: 5px 7px; font-size: 10px; border-radius: 7px; }
  .chips .row:nth-child(2) > .chip:nth-child(1),
  .chips .row:nth-child(2) > .chip:nth-child(2) { display: none; }
  .chips .rc-telemetry > .chip:nth-child(n+3) { display: none; }
  .chips .iconbtn { width: 27px; height: 27px; border-radius: 7px; }
  .chips [data-a="rc-help"] { display: none; }
  .mobile-alt { display: inline-flex; }
  .hud .alt, .hud .hints, .hud .credit { display: none; }
  .hud .arrow { top: 55px; padding: 5px 9px; font-size: 11px; }
  .hud .toasts {
    top: 33%; bottom: auto; width: min(380px, 52vw);
    transform: translateX(-50%); pointer-events: none;
  }
  .toasts .toast { padding: 8px 10px; }
  .toasts .warnbar { padding: 6px 9px; font-size: 11px; }
  .hud .minimap { display: none; }
  .hud.show-minimap .minimap {
    display: block; top: 56px; right: 8px; bottom: auto;
    width: min(94px, 17vh); height: min(94px, 17vh);
  }
  .touch .stick { bottom: 8px; width: min(98px, 29vh); height: min(98px, 29vh); }
  .touch .stick > i { width: 42px; height: 42px; }
  .touch .stick.l { left: 12px; }
  .touch .stick.r { right: 12px; }
  .touch .stick b { bottom: -13px; font-size: 9px; opacity: .85; }
  .touch .tbtn { font-size: 10px; z-index: 7; }
  .touch .tbtn.photo {
    right: clamp(116px, 18vw, 170px); bottom: 16px;
    width: 54px; height: 54px;
  }
  .touch .tbtn.walk {
    right: clamp(119px, 18vw, 174px); bottom: 76px;
    width: 40px; height: 40px;
  }
  .touch .tbtn.view {
    left: clamp(112px, 18vw, 180px); bottom: 28px;
    width: 42px; height: 42px;
  }
  .touch .tbtn.map, .touch .tbtn.rc-toggle {
    display: flex; align-items: center; justify-content: center;
    width: auto; height: 32px; border-radius: 9px;
    padding: 0 12px; bottom: 8px;
    background: var(--glass); border: 1px solid var(--line); color: var(--paper);
  }
  .touch .tbtn.map { left: 42%; transform: translateX(-50%); }
  .touch .tbtn.rc-toggle { left: 58%; transform: translateX(-50%); }
  .touch .tbtn[aria-expanded="true"],
  .touch .tbtn[aria-pressed="true"] { border-color: var(--lime); color: var(--lime); }
  body.is-touch .rc-bar { display: none; }
  body.is-touch .rc-bar.mobile-open {
    display: flex; bottom: 47px; left: 50%; transform: translateX(-50%);
    width: min(410px, 58vw); max-height: 65vh; padding: 8px;
    overflow-y: auto; border: 1px solid rgba(243,243,239,.28);
    border-radius: 12px; background: rgba(10,11,15,.96); gap: 6px;
    z-index: 9; box-shadow: 0 12px 35px rgba(0,0,0,.5);
  }
  body.is-touch .rc-key { min-height: 34px; padding: 7px 9px; font-size: 11px; }
  .viewfinder { inset: 18% 28%; }
}
/* Very narrow landscape: remove noncritical status chips before they overlap. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) and (max-width: 680px) {
  .chips .rc-telemetry > .chip:nth-child(2) { display: none; }
  .chips .row:nth-child(2) > .chip[data-h="lives"] { display: none; }
  .hud .mission { width: 38vw; }
  .hud .chips { width: 54vw; }
  .touch .tbtn.photo { right: 18vw; }
  .touch .tbtn.view { left: 18vw; }
}

/* Actual uploaded 3D aircraft in the hangar and miniature selection cards. */
.hangar:has(.drone-model-card) .cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 12px);
}
.drone-model-card {
  min-width: 0;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 9px 10px;
  text-align: center;
  gap: 4px;
}
.drone-model-card .model-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(54px, 12vh, 110px);
  overflow: hidden;
  border-radius: 10px;
  background: radial-gradient(ellipse at 50% 82%, rgba(127,244,84,.13), transparent 72%);
}
.drone-model-card .model-thumb > svg {
  display: block;
  width: min(100%, 136px);
  height: 100%;
  max-width: none;
  object-fit: contain;
}
.drone-model-card .model-thumb > svg.model-fallback-hidden { display: none; }
.drone-model-card .drone-card-preview {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.drone-model-card .drone-card-preview.ready { display: block; }
.drone-model-card b { font-size: clamp(12px, 1.25vw, 15px); line-height: 1.22; }
.drone-model-card small { font-size: 11px; line-height: 1.25; }
.hangar-stage .name { flex-wrap: wrap; justify-content: center; text-align: center; }
.hangar .panel .btn { margin-top: auto; }
.hangar-stage .drone-glb-preview { max-height: 29vh; }
/* Compact landscape phone hangar: keep all four models visible side-by-side. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  .hangar:has(.drone-model-card) { gap: 6px 10px; }
  .hangar:has(.drone-model-card) .cards {
    grid-column: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }
  .drone-model-card { padding: 5px 3px 7px; border-radius: 10px; gap: 2px; }
  .drone-model-card .model-thumb { height: clamp(42px, 11vh, 76px); border-radius: 7px; }
  .drone-model-card b { font-size: 10px; line-height: 1.16; }
  .drone-model-card small { display: none; }
  .hangar-stage .drone-glb-preview { height: clamp(92px, 21vh, 156px); min-height: 0; }
  .hangar-stage .name { gap: 4px 8px; }
  .hangar-stage .name b { font-size: clamp(15px, 2.1vw, 20px); }
  .hangar-stage .name span { font-size: 11px; }
  .hangar .panel { gap: 7px; }
  .hangar .panel .check { font-size: 12px; line-height: 1.35; }
}
@media (max-width: 760px) and (min-height: 601px) {
  .hangar:has(.drone-model-card) .cards { grid-column: 1; }
  .drone-model-card small { display: none; }
}

/* Light, airy 3D selection hangar — flight scene and other screens stay dark. */
.screen.solid.hangar {
  background: radial-gradient(ellipse 95% 86% at 38% 37%,
    #effef4 0%, #daf6ef 34%, #b9e5f0 68%, #a2d0ee 100%);
  color: #12272b;
}
.screen.solid.hangar .kicker,
.screen.solid.hangar .lime { color: #176a3c; }
.screen.solid.hangar .muted { color: #35565b; }
.screen.solid.hangar .hangar-head p { color: #35565b; }
.screen.solid.hangar .hangar-stage::before {
  background: radial-gradient(ellipse at center, rgba(82, 181, 131, .25),
    rgba(82, 181, 131, 0) 73%);
}
.screen.solid.hangar .hangar-stage .name {
  color: #173338;
}
.screen.solid.hangar .panel {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(24, 83, 89, .20);
  box-shadow: 0 18px 46px rgba(20, 68, 73, .10);
  color: #193b40;
}
.screen.solid.hangar .panel .kicker { color: #28734e; }
.screen.solid.hangar .panel .note {
  color: #47636a;
  border-top-color: rgba(35, 96, 103, .18);
}
.screen.solid.hangar .panel .check svg {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25));
}
.screen.solid.hangar .drone-model-card {
  background: rgba(255, 255, 255, .74);
  border-color: rgba(30, 86, 96, .18);
  color: #17373d;
  box-shadow: 0 8px 23px rgba(36, 93, 103, .08);
}
.screen.solid.hangar .drone-model-card:hover {
  background: #fff;
  border-color: #4f9d7a;
}
.screen.solid.hangar .drone-model-card[aria-pressed="true"] {
  background: rgba(217, 255, 223, .95);
  border-color: #239456;
  box-shadow: 0 0 0 1px rgba(35,148,86,.2), 0 9px 24px rgba(37,114,81,.12);
}
.screen.solid.hangar .drone-model-card small { color: #547176; }
.screen.solid.hangar .drone-model-card .model-thumb {
  background: radial-gradient(ellipse at 50% 80%, rgba(38, 126, 101, .17), transparent 72%);
}
.screen.solid.hangar .drone-glb-status {
  color: #195438;
  background: rgba(255, 255, 255, .7);
}
.screen.solid.hangar .drone-glb-status.error { color: #9c3b24; }
.screen.solid.hangar .card:focus-visible { outline-color: #183e48; }
/* Pinch on clear flight-view areas; joystick/button pointer controls remain independent. */
#gl { touch-action: none; }

/* Pinch zoom on the full-size 3D preview, separate from joystick gestures. */
.screen.solid.hangar .drone-glb-preview { touch-action: none; }


/* Contrast correction: muted showroom shell, dark model display surfaces.
   White and light-gray drone geometry is no longer lost on a pale background. */
.screen.solid.hangar {
  background: radial-gradient(ellipse 95% 100% at 36% 42%,
    #d3e0df 0%, #b7ced0 54%, #8ba9b1 100%);
  color: #142c32;
}
.screen.solid.hangar .hangar-stage {
  background: radial-gradient(ellipse 90% 80% at 49% 38%,
    #354e58 0%, #20353e 60%, #12242d 100%);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  box-shadow: 0 20px 55px rgba(9,32,42,.24),
    inset 0 1px 0 rgba(255,255,255,.09);
  padding: clamp(8px,1.4vw,18px);
  overflow: hidden;
}
.screen.solid.hangar .hangar-stage::before {
  left: 12%;
  right: 12%;
  bottom: 20%;
  height: 48%;
  background: radial-gradient(ellipse at center,
    rgba(97,158,168,.19) 0%, rgba(22,43,52,0) 70%);
  pointer-events: none;
}
.screen.solid.hangar .hangar-stage .name,
.screen.solid.hangar .hangar-stage .name b {
  color: #f4f8f8;
}
.screen.solid.hangar .hangar-stage .name .muted {
  color: #b6d3da;
}
.screen.solid.hangar .hangar-stage .drone-glb-status {
  color: #c8f9de;
  background: rgba(15,36,44,.72);
}
.screen.solid.hangar .hangar-stage .drone-glb-status.error {
  color: #ffc4aa;
}
.screen.solid.hangar .drone-model-card {
  background: #e8f0f0;
  border-color: rgba(23,65,77,.24);
  box-shadow: 0 7px 22px rgba(12,38,47,.12);
}
.screen.solid.hangar .drone-model-card:hover {
  background: #f7fbfb;
  border-color: #2b765c;
}
.screen.solid.hangar .drone-model-card[aria-pressed="true"] {
  background: #dbefe5;
  border-color: #278b57;
  box-shadow: 0 0 0 2px rgba(39,139,87,.15), 0 10px 22px rgba(17,63,50,.16);
}
.screen.solid.hangar .drone-model-card .model-thumb {
  background: radial-gradient(ellipse 90% 100% at 50% 43%,
    #425962 0%, #2b414c 55%, #182c35 100%);
  border: 1px solid rgba(18,46,56,.24);
}
.screen.solid.hangar .drone-model-card b { color: #16313a; }
.screen.solid.hangar .drone-model-card small { color: #4a6771; }
.screen.solid.hangar .hangar-stage .drone-glb-preview {
  filter: contrast(1.12) saturate(.90);
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 600px) {
  .screen.solid.hangar .hangar-stage {
    border-radius: 13px;
    padding: 5px 8px;
  }
}
