/* Menus and screens. Dark glass over the live 3D world, warm amber actions.
   Tokens come from base.css; spacing scale and motion live here. */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --gutter: clamp(16px, 3.6vw, 56px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-back: cubic-bezier(.3, 1.45, .45, 1);
  --glass: linear-gradient(180deg, rgba(22, 28, 48, .74) 0%, rgba(10, 14, 26, .70) 100%);
  --glass-line: rgba(255, 255, 255, .10);
  --glass-shadow: 0 24px 60px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .06);
  --amber-grad: linear-gradient(180deg, #FFCF77 0%, #FFB547 52%, #F39330 100%);
  --ink: #1B1206;
  --safe-t: env(safe-area-inset-top, 0px);
}

/* ── Layers ─────────────────────────────────────────────────────────────── */
/* Screens stay clear of notches and home indicators; their shades still reach the edges. */
.ui-layer { position: absolute; inset: 0 var(--safe-r) var(--safe-b) var(--safe-l); }
.ui-layer [class*="-shade"] { margin: 0 calc(-1 * var(--safe-r)) calc(-1 * var(--safe-b)) calc(-1 * var(--safe-l)); }
.screen { position: absolute; inset: 0; display: flex; pointer-events: auto; animation: screen-in .45s var(--ease) both; }
/* Big monitors: menus keep their 1280×720 proportions and scale up (--ui-scale from ui.js). The
   title is fluid already. */
.ui-layer > .screen:not(.scr-title):not(.scr-loading), .ui-layer > .modal-backdrop { zoom: var(--ui-scale, 1); }
/* In flight the mouse does nothing: its pointer hides while it is still (ui.js _idleCursor). */
body.efs-cursor-off, body.efs-cursor-off * { cursor: none !important; }
/* Short / long text variants (narrow phones get the short one) */
.t-short { display: none; }
@media (max-width: 480px) { .t-long { display: none; } .t-short { display: inline; } }
/* Scroll affordance (dom.js scrollFade): an edge fades out while there is more beyond it */
.fade-bottom { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 44px), rgba(0, 0, 0, .08)); mask-image: linear-gradient(180deg, #000 calc(100% - 44px), rgba(0, 0, 0, .08)); }
.fade-top { -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .08), #000 36px); mask-image: linear-gradient(180deg, rgba(0, 0, 0, .08), #000 36px); }
.fade-top.fade-bottom { -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .08), #000 36px, #000 calc(100% - 44px), rgba(0, 0, 0, .08));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .08), #000 36px, #000 calc(100% - 44px), rgba(0, 0, 0, .08)); }
.screen.is-leaving { animation: screen-out .3s ease forwards; pointer-events: none; }
@keyframes screen-in { from { opacity: 0; } }
@keyframes screen-out { to { opacity: 0; } }
.rise { animation: rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms + 40ms); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
:where(#ui) .i { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scroll { overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

/* Legibility gradients that keep the right/top of the scenery open */
.menu-shade { position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 8, 16, .88) 0%, rgba(5, 8, 16, .66) 24%, rgba(5, 8, 16, .22) 50%, rgba(5, 8, 16, 0) 68%),
    linear-gradient(0deg, rgba(5, 8, 16, .5) 0%, rgba(5, 8, 16, 0) 32%); }
.menu-shade.shade-full { background:
    linear-gradient(180deg, rgba(5, 8, 16, .72) 0%, rgba(5, 8, 16, .25) 34%, rgba(5, 8, 16, .35) 58%, rgba(5, 8, 16, .9) 100%),
    linear-gradient(90deg, rgba(5, 8, 16, .5), rgba(5, 8, 16, 0) 60%); }

.glass { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-shadow); }

/* ── Buttons, chips, keys ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: var(--text);
  font: 700 14px/1 var(--font); letter-spacing: .03em; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .25s, filter .2s; }
.btn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn .i { width: 18px; height: 18px; }
.btn-primary { background: var(--amber-grad); color: var(--ink); border-color: rgba(255, 220, 160, .55); text-transform: uppercase; letter-spacing: .1em; font-weight: 800;
  box-shadow: 0 10px 28px rgba(255, 145, 40, .28), inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(150, 70, 0, .25); }
.btn-primary:hover { background: var(--amber-grad); filter: brightness(1.07); box-shadow: 0 12px 36px rgba(255, 145, 40, .45), inset 0 1px 0 rgba(255, 255, 255, .55); }
.btn-primary .i { stroke-width: 2.2; }
.btn-xl { height: 58px; padding: 0 34px; font-size: 18px; border-radius: 15px; }
.btn-xl .i { width: 20px; height: 20px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 15px; }
.btn-sm { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: linear-gradient(180deg, #FF7A88, #E23B4F); border-color: rgba(255, 160, 170, .5); color: #fff; }
.btn-danger:hover { background: linear-gradient(180deg, #FF8794, #EA4458); }
.btn-danger-ghost { color: #FF97A2; border-color: rgba(255, 92, 108, .38); background: rgba(255, 92, 108, .08); }
.btn-danger-ghost:hover { background: rgba(255, 92, 108, .16); border-color: rgba(255, 92, 108, .6); }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(9, 13, 24, .72); color: var(--text); cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .2s, border-color .2s; }
.btn-icon:hover { background: rgba(30, 38, 60, .85); border-color: rgba(255, 255, 255, .3); }
.btn-icon .i { width: 20px; height: 20px; }

kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; font: 700 11px/1 var(--font);
  color: var(--text); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); border-bottom-width: 2px; letter-spacing: .02em; text-transform: none; }
.btn-primary kbd { color: var(--ink); background: rgba(40, 20, 0, .1); border-color: rgba(60, 30, 0, .3); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; background: rgba(9, 13, 24, .6);
  border: 1px solid rgba(255, 255, 255, .12); font-weight: 700; font-variant-numeric: tabular-nums; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.chip .i { width: 16px; height: 16px; color: var(--accent); }
.chip .of { color: var(--dim); font-weight: 600; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 800 10px/1 var(--font); letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); background: rgba(255, 181, 71, .1); border: 1px solid rgba(255, 181, 71, .35); }
.tag .i { width: 13px; height: 13px; }
.tag-new { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--amber-grad); color: var(--ink);
  font: 800 11px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; box-shadow: 0 0 18px rgba(255, 181, 71, .45); }
.new-dot { display: inline-block; width: 9px; height: 9px; margin-left: 8px; vertical-align: 4px; border-radius: 50%; background: #FF5C6C;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 0 12px rgba(255, 92, 108, .8); animation: new-pulse 1.8s ease-in-out infinite; }
@keyframes new-pulse { 50% { transform: scale(.75); } }
.mm-tile { position: relative; }
.tile-new { position: absolute; top: 12px; right: 12px; height: 20px; font-size: 9.5px; }
.cc-new { position: absolute; top: 14px; right: 70px; height: 20px; font-size: 9.5px; z-index: 1; }
.hg-new { position: absolute; top: 8px; left: 8px; margin: 0; }
.sw-new { position: absolute; top: -2px; right: -2px; margin: 0; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font: 800 10px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; }
.pill-bronze { background: rgba(229, 154, 98, .18); color: var(--bronze); }
.pill-silver { background: rgba(217, 226, 242, .16); color: var(--silver); }
.pill-gold { background: rgba(255, 210, 74, .18); color: var(--gold); }
.pill-ace { background: rgba(183, 140, 255, .2); color: var(--ace); }
.bar { display: block; position: relative; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: transform .8s var(--ease); }

/* Focus: visible whenever the keyboard or a gamepad is in use */
.ui-layer :is(button, [data-nav]):focus { outline: none; }
.ui-layer :is(button, [data-nav]):focus-visible,
body.nav-kb .ui-layer :is(button, [data-nav]):focus { outline: 2px solid var(--accent); outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(255, 181, 71, .16), 0 14px 34px rgba(0, 0, 0, .3); }
.ui-layer :is(.btn-primary, .mm-play, .pv-primary):focus-visible,
body.nav-kb .ui-layer :is(.btn-primary, .mm-play, .pv-primary):focus { outline-color: #fff; box-shadow: 0 0 0 7px rgba(255, 255, 255, .14), 0 14px 40px rgba(255, 145, 40, .45); }

/* ── Header used by sub-screens ─────────────────────────────────────────── */
.scr-head { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; min-height: 52px; }
.btn-back { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(9, 13, 24, .55); color: var(--text); font: 700 13px var(--font); letter-spacing: .04em;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .2s, border-color .2s; }
.btn-back:hover { background: rgba(30, 38, 60, .8); border-color: rgba(255, 255, 255, .3); }
.btn-back .i { width: 18px; height: 18px; stroke-width: 2.2; }
.head-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.head-text small { font: 700 11px var(--font); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.head-text h2 { font: 900 30px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 2px 20px rgba(0, 0, 0, .35); }
.head-right { margin-left: auto; }

/* ── Title ──────────────────────────────────────────────────────────────── */
.scr-title { cursor: pointer; }
.title-shade { position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 18%, rgba(5, 8, 16, .5) 0%, rgba(5, 8, 16, .12) 45%, rgba(5, 8, 16, 0) 70%),
    linear-gradient(180deg, rgba(5, 8, 16, .55) 0%, rgba(5, 8, 16, 0) 40%, rgba(5, 8, 16, 0) 62%, rgba(5, 8, 16, .75) 100%); }
.title-brand { position: absolute; left: 0; right: 0; top: clamp(28px, 12vh, 140px); display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 16px; }
.wordmark { display: flex; justify-content: center; gap: .2em; font: 900 clamp(60px, 11.2vw, 170px)/.84 var(--font); letter-spacing: .035em; text-transform: uppercase;
  filter: drop-shadow(0 10px 36px rgba(0, 0, 0, .4)) drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.wm-a { background: linear-gradient(180deg, #FFFFFF 0%, #EEF2FC 55%, #BFCAE2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm-b { background: linear-gradient(100deg, #FF8A4C 0%, #FFB547 28%, #FFE7B8 46%, #FFFFFF 50%, #FFE7B8 54%, #FFB547 70%, #FF7A59 100%);
  background-size: 300% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: wm-shine 8s ease-in-out 1.2s infinite; }
@keyframes wm-shine { 0% { background-position: 100% 0; } 40%, 100% { background-position: 0 0; } }
.title-trail { width: min(68vw, 880px); height: 34px; margin-top: 4px; overflow: visible; }
.title-trail path { fill: none; stroke: url(#efs-trail); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: trail-draw 1.8s .55s var(--ease) forwards; }
@keyframes trail-draw { to { stroke-dashoffset: 0; } }
.title-sub { display: flex; align-items: center; gap: 18px; margin-top: 6px; font: 700 clamp(12px, 1.3vw, 16px)/1 var(--font); letter-spacing: .52em;
  text-transform: uppercase; color: #EEF3FF; text-shadow: 0 2px 12px rgba(0, 0, 0, .55); padding-left: .52em; }
.kline { width: clamp(28px, 6vw, 80px); height: 1px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .7)); }
.kline:last-child { background: linear-gradient(90deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)); }
.title-press { position: absolute; left: 50%; bottom: clamp(70px, 15vh, 150px); transform: translateX(-50%); display: grid; place-items: center; }
.tp-text { position: relative; font: 800 clamp(12px, 1.25vw, 15px)/1 var(--font); letter-spacing: .34em; text-transform: uppercase; color: #fff; white-space: nowrap;
  padding: 15px 26px 15px calc(26px + .34em); border-radius: 999px; background: rgba(9, 13, 24, .42); border: 1px solid rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); text-shadow: 0 1px 8px rgba(0, 0, 0, .5); animation: press-pulse 2.4s ease-in-out infinite; }
.tp-glow { position: absolute; inset: -10px -30px; border-radius: 999px; background: radial-gradient(closest-side, rgba(255, 181, 71, .35), rgba(255, 181, 71, 0));
  animation: press-glow 2.4s ease-in-out infinite; }
@keyframes press-pulse { 0%, 100% { opacity: .62; } 50% { opacity: 1; } }
@keyframes press-glow { 0%, 100% { opacity: .2; transform: scale(.9); } 50% { opacity: .9; transform: scale(1); } }
.title-foot { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(242, 245, 255, .62); font-size: 12px; letter-spacing: .04em; text-align: center; padding: 0 16px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }   /* (the sky behind cycles through the day: bright at noon) */
.tf-inputs { display: flex; gap: 12px; color: rgba(242, 245, 255, .75); filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .5)); }
.tf-inputs .i { width: 18px; height: 18px; }

/* ── Main menu ──────────────────────────────────────────────────────────── */
.scr-main { padding: clamp(18px, 4.5vh, 44px) var(--gutter) var(--gutter); }
.main-col { position: relative; z-index: 1; width: min(452px, 100%); display: flex; flex-direction: column; gap: 14px; max-height: calc(100% - 26px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.bl-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); background: var(--amber-grad);
  box-shadow: 0 6px 22px rgba(255, 150, 40, .4), inset 0 1px 0 rgba(255, 255, 255, .5); }
.bl-mark .i { width: 24px; height: 24px; transform: rotate(45deg); }
.bl-text { display: flex; flex-direction: column; gap: 4px; }
.bl-name { font: 900 21px/1 var(--font); letter-spacing: .18em; text-transform: uppercase; }
.bl-name b { color: var(--accent); }
.bl-sub { font: 700 10px/1 var(--font); letter-spacing: .4em; text-transform: uppercase; color: var(--muted); }

.pilot-card { display: grid; grid-template-columns: 60px 1fr; gap: 6px 14px; padding: 14px 16px 12px; border-radius: 18px; }
.pc-badge { grid-row: span 1; width: 60px; height: 60px; filter: drop-shadow(0 4px 12px rgba(255, 150, 40, .25)); }
.pc-badge svg { width: 100%; height: 100%; }
.pc-body { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.pc-body > small { font: 700 10px var(--font); letter-spacing: .24em; text-transform: uppercase; color: var(--dim); }
.pc-rank { font: 800 19px/1.1 var(--font); letter-spacing: .02em; }
.pc-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 3px; }
.pc-next { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-next .i { width: 12px; height: 12px; color: var(--accent); stroke: none; fill: currentColor; }
.pc-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.pcs { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 0 6px; }
.pcs + .pcs { border-left: 1px solid rgba(255, 255, 255, .08); padding-left: 12px; }
.pcs-ic { grid-row: span 2; width: 26px; height: 26px; display: grid; place-items: center; }
.pcs-ic .i { width: 20px; height: 20px; }
.pcs-ic.star { color: var(--accent); }
.pcs-ic.star .i { fill: currentColor; stroke: none; }
.pcs-ic.shard { color: var(--cyan); }
.pcs-ic.gold svg { width: 26px; height: 26px; }
.pcs b { font: 800 17px/1 var(--font); font-variant-numeric: tabular-nums; }
.pcs b em { font-style: normal; color: var(--dim); font-weight: 600; font-size: 13px; }
.pcs small { font: 700 9px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }

.main-nav { display: flex; flex-direction: column; gap: 10px; }
.mm-play { position: relative; display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 14px; height: 86px; padding: 0 20px 0 16px;
  border-radius: 18px; border: 1px solid rgba(255, 225, 170, .6); background: var(--amber-grad); color: var(--ink); text-align: left; cursor: pointer; overflow: hidden;
  box-shadow: 0 16px 40px rgba(255, 140, 30, .3), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -3px 0 rgba(140, 60, 0, .22);
  transition: transform .25s var(--ease), box-shadow .3s, filter .2s; }
.mm-play::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .45) 45%, rgba(255, 255, 255, 0) 60%);
  transform: translateX(-120%); animation: sheen 5s ease-in-out 1.5s infinite; pointer-events: none; }
@keyframes sheen { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.mm-play:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 20px 48px rgba(255, 140, 30, .42), inset 0 1px 0 rgba(255, 255, 255, .6); }
.mp-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: rgba(27, 18, 6, .88); color: var(--accent);
  box-shadow: 0 6px 16px rgba(80, 40, 0, .35); }
.mp-icon .i { width: 24px; height: 24px; margin-left: 3px; }
.mp-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.mp-text b { font: 900 25px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; }
.mp-text small { font: 600 12.5px/1.2 var(--font); color: rgba(27, 18, 6, .72); }
.mp-stars { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border-radius: 999px; background: rgba(27, 18, 6, .14); font: 800 15px var(--font); font-variant-numeric: tabular-nums; }
.mp-stars .i { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.mp-stars em { font-style: normal; opacity: .6; font-weight: 700; }
/* First-time hero: "Start flying" straight into First Flight */
.mp-plane { width: 50px; height: 50px; display: grid; place-items: center; color: rgba(27, 18, 6, .78); transform: rotate(90deg); }
.mp-plane svg { width: 100%; height: 100%; }
.mm-start .mp-text b { letter-spacing: .06em; }
.mc-right b em { font-style: normal; font-size: 12px; color: var(--dim); font-weight: 700; }
.mm-chal .mc-right b { color: var(--text); }

.mm-card, .mm-tile, .mm-link, .now-flying { color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.mm-card { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; height: 70px; padding: 0 16px 0 13px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-shadow);
  transition: transform .25s var(--ease), border-color .2s, background .2s; }
.mm-card:hover, .mm-tile:hover, .now-flying:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .26); }
.mc-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--accent); background: rgba(255, 181, 71, .1); border: 1px solid rgba(255, 181, 71, .28); }
.mc-icon .i { width: 22px; height: 22px; }
.mc-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mc-text b { font: 800 16px/1 var(--font); letter-spacing: .03em; }
.mc-text small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.mc-right small { font: 700 9px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.mc-right b { font: 800 16px var(--font); font-variant-numeric: tabular-nums; color: var(--accent); }
.mm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mm-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 15px 13px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--glass-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-shadow);
  transition: transform .25s var(--ease), border-color .2s; }
.mt-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 6px; background: rgba(255, 255, 255, .07); color: #fff; transition: color .2s, background .2s; }
.mt-icon .i { width: 20px; height: 20px; }
.mm-tile:hover .mt-icon, .mm-tile:focus .mt-icon { color: var(--accent); background: rgba(255, 181, 71, .12); }
.mm-tile b { font: 800 15px/1.1 var(--font); letter-spacing: .03em; }
.mm-tile small { font-size: 12px; color: var(--muted); }
.mm-links { display: flex; gap: 8px; }
.mm-link { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 13px; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(9, 13, 24, .45); font: 700 13px var(--font); letter-spacing: .03em; color: var(--muted); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: color .2s, background .2s, border-color .2s; }
.mm-link:hover { color: var(--text); background: rgba(30, 38, 60, .7); border-color: rgba(255, 255, 255, .22); }
.mm-link .i { width: 18px; height: 18px; }
.now-flying { position: absolute; right: var(--gutter); bottom: calc(var(--gutter) + var(--safe-b)); z-index: 1; display: flex; align-items: center; gap: 12px;
  padding: 10px 14px 10px 12px; border-radius: 16px; transition: transform .25s var(--ease), border-color .2s; }
.nf-plane { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.nf-plane svg { width: 40px; height: 40px; color: var(--liv, #fff); filter: drop-shadow(0 0 1px rgba(0, 0, 0, .9)) drop-shadow(0 2px 6px rgba(0, 0, 0, .4)); }
.nf-text { display: flex; flex-direction: column; gap: 3px; }
.nf-text small { font: 700 9px var(--font); letter-spacing: .22em; text-transform: uppercase; color: var(--dim); }
.nf-text b { font: 800 15px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; }
.nf-liv { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.nf-liv i { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.nf-go { width: 18px; height: 18px; color: var(--dim); }
.main-foot { position: absolute; left: var(--gutter); bottom: calc(14px + var(--safe-b)); display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: rgba(242, 245, 255, .55); }
.main-foot .i { width: 13px; height: 13px; color: var(--good); }
.main-foot b { color: rgba(242, 245, 255, .8); font-weight: 700; font-variant-numeric: tabular-nums; }
.main-foot .dot { opacity: .5; }

/* ── Challenges ─────────────────────────────────────────────────────────── */
.scr-challenges { flex-direction: column; gap: 14px; padding: clamp(16px, 3.5vh, 36px) var(--gutter) calc(var(--gutter) + var(--safe-b)); }
.tier-tabs { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.tier-tab { position: relative; display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 12px; min-width: 210px; height: 62px; padding: 0 16px 0 12px;
  border-radius: 15px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(9, 13, 24, .55); color: var(--text); cursor: pointer; text-align: left; overflow: hidden;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background .25s, border-color .25s, transform .25s var(--ease); }
.tier-tab:hover { border-color: rgba(255, 255, 255, .28); }
.tier-tab.is-on { background: linear-gradient(180deg, rgba(255, 181, 71, .2), rgba(255, 181, 71, .07)); border-color: rgba(255, 181, 71, .7);
  box-shadow: 0 10px 30px rgba(255, 150, 40, .16), inset 0 1px 0 rgba(255, 220, 160, .25); }
.tt-num { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font: 900 14px/1 var(--font); letter-spacing: .04em;
  background: rgba(255, 255, 255, .08); color: var(--muted); }
.tier-tab.is-on .tt-num { background: var(--amber-grad); color: var(--ink); }
.tt-text { display: flex; flex-direction: column; gap: 4px; }
.tt-text b { font: 900 16px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; }
.tt-text small { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.tt-text small .i { width: 12px; height: 12px; }
.tt-text small:not(.tt-lock) .i { fill: var(--accent); stroke: none; }
.tt-lock { color: var(--dim) !important; }
.tt-lock .i:last-child { fill: currentColor; stroke: none; }
.tt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .06); }
.tt-bar i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.tier-tab.is-locked { color: var(--muted); }
.tier-tab.is-locked .tt-text b { color: var(--muted); }
.tier-info { position: relative; z-index: 1; max-width: 640px; }
.tier-blurb { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 15px; line-height: 1.5; color: #D8DEEE; text-shadow: 0 1px 10px rgba(0, 0, 0, .6); }
.tier-blurb .i { width: 15px; height: 15px; }
.tier-blurb .i:not(:first-child) { fill: var(--accent); stroke: none; color: var(--accent); }
.tier-blurb b { color: var(--accent); }

.card-row { position: relative; z-index: 1; margin-top: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 14px; }
.card-row.is-in .ch-card { animation: card-in .6s var(--ease) both; animation-delay: calc(var(--k, 0) * 65ms); }
@keyframes card-in { from { opacity: 0; transform: translateY(26px) scale(.98); } }
.ch-card { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 0; min-height: 252px; padding: 16px 16px 14px; border-radius: 20px;
  text-align: left; color: var(--text); cursor: pointer; overflow: hidden; font: inherit;
  background: linear-gradient(180deg, rgba(24, 31, 52, .8) 0%, rgba(10, 14, 26, .78) 100%); border: 1px solid rgba(255, 255, 255, .11);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glass-shadow);
  transition: transform .3s var(--ease), border-color .25s, box-shadow .3s; }
.ch-card::before { content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: rgba(255, 255, 255, .1); }
.ch-card.medal-bronze::before { background: linear-gradient(90deg, transparent, var(--bronze), transparent); }
.ch-card.medal-silver::before { background: linear-gradient(90deg, transparent, var(--silver), transparent); }
.ch-card.medal-gold::before { background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.ch-card.medal-ace::before { background: linear-gradient(90deg, transparent, var(--ace), transparent); }
.ch-card:hover, .ch-card:focus { transform: translateY(-5px); border-color: rgba(255, 255, 255, .26); box-shadow: 0 30px 60px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .08); }
.cc-glow { position: absolute; inset: auto -20% -50% -20%; height: 70%; background: radial-gradient(closest-side, rgba(255, 181, 71, .22), rgba(255, 181, 71, 0)); opacity: 0; transition: opacity .3s; pointer-events: none; }
.ch-card:hover .cc-glow, .ch-card:focus .cc-glow { opacity: 1; }
.cc-head { display: flex; align-items: center; gap: 10px; }
.cc-num { font: 800 12px/1 var(--mono); color: var(--dim); letter-spacing: .06em; }
.cc-kind { display: inline-flex; align-items: center; gap: 5px; font: 800 10px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.cc-kind .i { width: 13px; height: 13px; }
.cc-medal { position: absolute; top: 10px; right: 12px; width: 50px; height: 50px; }
.cc-medal svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.cc-plane { position: absolute; right: -16px; top: 54px; width: 150px; height: 150px; color: #fff; opacity: .06; transform: rotate(-28deg); transition: opacity .3s, transform .5s var(--ease); pointer-events: none; }
.cc-plane svg { width: 100%; height: 100%; }
.ch-card:hover .cc-plane, .ch-card:focus .cc-plane { opacity: .12; transform: rotate(-28deg) translate(-6px, -8px); }
.cc-body { position: relative; display: flex; flex-direction: column; gap: 7px; margin-top: auto; padding-top: 44px; }
.cc-title { font: 900 20px/1.05 var(--font); letter-spacing: .05em; text-transform: uppercase; text-wrap: balance; }
.cc-loc { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.cc-loc .i { width: 13px; height: 13px; color: var(--accent); }
.cc-cond { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-cond > span { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 7px; background: rgba(255, 255, 255, .06); font-size: 11.5px; color: #CDD5E8; font-weight: 600; }
.cc-cond .i { width: 14px; height: 14px; }
.cc-foot { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(255, 255, 255, .08); }
.cc-pl { display: inline-flex; align-items: center; gap: 5px; font: 700 12px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cc-pl .i { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.cc-best { display: inline-flex; align-items: baseline; gap: 6px; }
.cc-best small { font: 700 9.5px var(--font); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.cc-best b { font: 800 15px var(--font); font-variant-numeric: tabular-nums; }
/* Locked: a lock badge takes the medal's place, the title stays readable (dimmed), and the
   requirement sits in the footer. Nothing is drawn over the text. */
.ch-card.is-locked { cursor: not-allowed; background: linear-gradient(180deg, rgba(18, 22, 38, .72) 0%, rgba(8, 11, 20, .74) 100%); }
.ch-card.is-locked .cc-head, .ch-card.is-locked .cc-loc { opacity: .5; }
.ch-card.is-locked .cc-title { color: rgba(242, 245, 255, .62); }
.ch-card.is-locked .cc-plane { opacity: .03; }
.ch-card.is-locked:hover, .ch-card.is-locked:focus { transform: translateY(-2px); }
.cc-lockbadge { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; background: rgba(9, 13, 24, .7); border: 1px dashed rgba(255, 255, 255, .22); color: rgba(242, 245, 255, .8); }
.cc-lockbadge .i { width: 22px; height: 22px; }
.cc-lockline { display: inline-flex; align-items: center; gap: 5px; font: 800 12px var(--font); letter-spacing: .04em; color: var(--muted); }
.cc-lockline .i { width: 14px; height: 14px; }
.cc-lockline .i:nth-of-type(2) { fill: var(--accent); stroke: none; color: var(--accent); margin-left: -2px; }
.cc-lockline b { font: 900 15px var(--font); color: var(--text); }
.cc-lockline span { font-weight: 600; letter-spacing: .02em; }
.cc-need { font: 700 11.5px var(--font); color: var(--accent); white-space: nowrap; }
.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px; text-align: center; }
.empty .i { width: 28px; height: 28px; color: var(--accent); }
.empty small { color: var(--muted); }

/* ── Briefing ───────────────────────────────────────────────────────────── */
.scr-briefing, .scr-free, .scr-settings, .scr-hangar { padding: clamp(16px, 3.5vh, 36px) var(--gutter) calc(var(--gutter) + var(--safe-b)); }
.brief-col, .setup-col, .settings-col, .hangar-col { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 14px; max-height: 100%; min-height: 0; }
.brief-col { width: min(620px, 100%); }
.brief { padding: 20px 24px 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 0; touch-action: pan-y; }
.bf-main, .bf-side { display: contents; }
.bf-kicker { display: flex; align-items: center; gap: 12px; font: 700 11px var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.bf-title { font: 900 clamp(32px, 4.4vw, 48px)/.95 var(--font); letter-spacing: .04em; text-transform: uppercase; text-wrap: balance; }
.bf-loc { display: inline-flex; align-items: center; gap: 6px; margin-top: -6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.bf-loc .i { width: 15px; height: 15px; color: var(--accent); }
.bf-rings { display: inline-flex; align-items: center; gap: 5px; margin-left: 12px; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .15); }
.bmm b .spin { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; }
.bf-desc { font-size: 15px; line-height: 1.55; color: #D6DCEC; max-width: 52ch; }
.bf-cond { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; }
.cond { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 13px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .07); min-width: 0; }
.cond-ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: rgba(255, 181, 71, .1); color: var(--accent); }
.cond-ic .i { width: 22px; height: 22px; }
.cond-plane .cond-ic { color: #fff; background: rgba(255, 255, 255, .08); }
.cond-plane .cond-ic svg { width: 34px; height: 34px; }
.cond-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cond-t small { font: 700 9.5px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.cond-t b { font: 800 14px/1.15 var(--font); }
.cond-t em { font-style: normal; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 2px; font: 800 11px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.bf-sec em { font: 600 12px var(--font); letter-spacing: 0; text-transform: none; color: var(--dim); font-style: normal; }
.bf-medals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bmm { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 9px; border-radius: 13px; background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07); text-align: center; }
.bmm-medal { position: relative; width: 42px; height: 42px; margin-bottom: 1px; }
.bmm-medal svg.medal { width: 100%; height: 100%; }
.bmm-check { position: absolute; right: -6px; bottom: -2px; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--good); color: #062812; stroke-width: 3; }
.bmm small { font: 800 9.5px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.bmm b { font: 800 15px var(--font); font-variant-numeric: tabular-nums; }
.bmm b .q { color: var(--dim); letter-spacing: .2em; }
.bmm.is-earned.medal-bronze { border-color: rgba(229, 154, 98, .45); background: rgba(229, 154, 98, .08); }
.bmm.is-earned.medal-silver { border-color: rgba(217, 226, 242, .4); background: rgba(217, 226, 242, .07); }
.bmm.is-earned.medal-gold { border-color: rgba(255, 210, 74, .5); background: rgba(255, 210, 74, .09); }
.bmm.is-earned.medal-ace { border-color: rgba(183, 140, 255, .55); background: rgba(183, 140, 255, .1); }
.bf-best { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px; border-radius: 13px; background: rgba(255, 255, 255, .04); font-size: 14px; color: var(--muted); }
.bf-best > .i { width: 18px; height: 18px; color: var(--accent); }
.bf-best b { color: var(--text); font: 800 16px var(--font); font-variant-numeric: tabular-nums; }
.ghost-tag { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font: 700 12px var(--font); color: var(--cyan); }
.ghost-tag .i { width: 16px; height: 16px; }
.bf-actions, .setup-actions { position: relative; z-index: 1; flex: none; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.bf-hint { font-size: 12.5px; color: rgba(242, 245, 255, .62); display: inline-flex; align-items: center; gap: 6px; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }

/* ── Option rows (free flight, settings) ────────────────────────────────── */
.opt { display: grid; grid-template-columns: minmax(130px, 1fr) auto; align-items: center; gap: 8px 18px; padding: 9px 12px; border-radius: 13px;
  cursor: default; transition: background .2s; }
.opt:hover, .opt:focus { background: rgba(255, 255, 255, .05); }
.opt-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.opt-label > span { font: 700 14px/1.2 var(--font); }
.opt-label small { flex-basis: 100%; font-size: 12px; line-height: 1.35; color: var(--dim); font-weight: 500; }
.opt-value { font-style: normal; font: 700 13px var(--font); color: var(--accent); }
.opt-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .08); justify-self: end; }
.seg { position: relative; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 13px; border-radius: 9px; cursor: pointer;
  font: 700 13px var(--font); color: var(--muted); white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s; }
.seg:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.seg.is-on { color: #fff; background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .1)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 3px 10px rgba(0, 0, 0, .25); }
.opt:focus .seg.is-on, body.nav-kb .opt:focus .seg.is-on { background: var(--amber-grad); color: var(--ink); box-shadow: 0 4px 14px rgba(255, 150, 40, .35); }
/* Browsing a commit-on-Enter row (graphics quality): the highlighted choice is not applied yet */
.seg.is-pending { color: var(--text); background: rgba(255, 181, 71, .12); box-shadow: inset 0 0 0 2px rgba(255, 181, 71, .85); }
.opt:focus .seg.is-on:has(~ .seg.is-pending), .opt:focus .seg.is-pending ~ .seg.is-on { background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .1)); color: #fff; box-shadow: none; }
.seg .i { width: 18px; height: 18px; }
.icon-only .seg { width: 42px; padding: 0; }
.icon-only .seg .i { width: 21px; height: 21px; }
.seg.is-locked { cursor: not-allowed; color: var(--dim); }
.seg.is-locked > :not(.seg-lock) { opacity: .35; }
.seg-lock { position: absolute; top: -7px; right: -5px; display: inline-flex; align-items: center; gap: 2px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #0B1020; border: 1px solid rgba(255, 255, 255, .2); font: 800 9.5px/1 var(--font); color: var(--muted); }
.opt .seg .seg-lock .i { width: 10px; height: 10px; }
.opt-planes { grid-template-columns: 1fr; }
.opt-planes .opt-seg { justify-self: stretch; display: grid; grid-template-columns: repeat(var(--n), 1fr); }
.opt-planes .seg { flex-direction: column; gap: 1px; min-height: 60px; padding: 5px 4px; }
.opt-planes .seg > svg.plane-sil { width: 34px; height: 34px; }
.opt-planes .seg .seg-label { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.opt-swatches .seg { width: 44px; }
.swatch { display: block; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%);
  box-shadow: 0 0 0 2px var(--c), 0 0 0 3px rgba(255, 255, 255, .3), 0 2px 6px rgba(0, 0, 0, .4); }
.opt-airports .seg { padding: 0 11px; font-size: 12.5px; }

.opt-slider .slider { display: flex; align-items: center; gap: 14px; width: min(290px, 42vw); padding: 10px 0; cursor: pointer; touch-action: none; }
.sl-track { position: relative; flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .12); }
.sl-fill { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.sl-thumb { position: absolute; top: 50%; left: calc(var(--p, 0) * 100%); width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 181, 71, .22), 0 2px 8px rgba(0, 0, 0, .45); transition: box-shadow .2s, transform .2s var(--ease); }
.opt-slider:focus .sl-thumb, .opt-slider.is-drag .sl-thumb { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(255, 181, 71, .35), 0 2px 8px rgba(0, 0, 0, .45); }
.sl-out { min-width: 52px; text-align: right; font: 800 13.5px var(--font); font-variant-numeric: tabular-nums; color: var(--text); }
.opt-toggle { cursor: pointer; }
.switch { display: flex; align-items: center; gap: 10px; }
.sw-text { font: 800 11px var(--font); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); min-width: 26px; text-align: right; }
.sw-knob { position: relative; width: 48px; height: 28px; border-radius: 14px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4); transition: background .25s; }
.sw-knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #E9EDF7; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .3s var(--ease-back), background .2s; }
.opt-toggle.is-on .sw-knob { background: var(--amber-grad); }
.opt-toggle.is-on .sw-knob::after { transform: translateX(20px); background: #fff; }
.opt-toggle.is-on .sw-text { color: var(--accent); }

/* ── Free flight ────────────────────────────────────────────────────────── */
.setup-col { width: min(620px, 100%); }
.setup { padding: 10px 10px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; touch-action: pan-y; }
.setup-intro { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; margin: 0 2px 4px; padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(92, 225, 255, .1), rgba(92, 225, 255, .02)); border: 1px solid rgba(92, 225, 255, .2); }
.si-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(92, 225, 255, .14); color: var(--cyan); }
.si-ic .i { width: 22px; height: 22px; }
.si-t { display: flex; flex-direction: column; gap: 2px; }
.si-t b { font: 800 14px var(--font); }
.si-t small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.si-count { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font: 600 13px var(--font); color: var(--muted); min-width: 70px; }
.si-count b { font: 900 20px var(--font); color: var(--cyan); }
.si-count .bar { width: 70px; }
.si-count .bar i { background: linear-gradient(90deg, #2EA8D6, var(--cyan)); }


/* ── Hangar ─────────────────────────────────────────────────────────────── */
.hangar-col { width: min(500px, 100%); }
.hangar-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hg-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 9px; border-radius: 14px; cursor: pointer; color: var(--text); font: inherit;
  background: rgba(9, 13, 24, .6); border: 1px solid rgba(255, 255, 255, .12); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: border-color .2s, background .2s, transform .25s var(--ease); }
.hg-tab:hover { border-color: rgba(255, 255, 255, .28); }
.hg-tab.is-on { border-color: rgba(255, 181, 71, .75); background: linear-gradient(180deg, rgba(255, 181, 71, .2), rgba(255, 181, 71, .05)); }
.hg-sil { width: 44px; height: 44px; }
.hg-sil svg { width: 100%; height: 100%; }
.hg-tab.is-on .hg-sil { color: var(--accent); }
.hg-t { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.hg-t b { font: 900 12.5px var(--font); letter-spacing: .1em; text-transform: uppercase; }
.hg-t small { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.hg-t small .i { width: 11px; height: 11px; }
.hg-t small .i:last-child { fill: var(--accent); stroke: none; color: var(--accent); }
.hg-tab.is-locked .hg-sil { opacity: .4; }
.hg-sel { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; display: none; place-items: center; background: var(--good); color: #062812; }
.hg-sel .i { width: 12px; height: 12px; stroke-width: 3; }
.hg-tab.is-mine .hg-sel { display: grid; }
.hangar-detail { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; min-height: 0; touch-action: pan-y; }
.hangar-detail > * { animation: rise .45s var(--ease) both; }
.hd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hd-head small { font: 700 11px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.hd-head h1 { font: 900 36px/.95 var(--font); letter-spacing: .06em; text-transform: uppercase; margin-top: 5px; }
.hd-status { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 999px; font: 800 11px var(--font); letter-spacing: .08em; white-space: nowrap; }
.hd-status .i { width: 14px; height: 14px; }
.hd-status.is-mine { background: rgba(74, 222, 128, .14); color: var(--good); }
.hd-status.is-locked { background: rgba(255, 255, 255, .07); color: var(--muted); }
.hd-status.is-locked .i:last-child { fill: var(--accent); stroke: none; color: var(--accent); }
/* Specs toggle: portrait phones only (see the portrait hangar rules) */
.hd-more { display: none; align-items: center; gap: 5px; height: 30px; padding: 0 11px 0 8px; border-radius: 999px; cursor: pointer; flex: none;
  font: 800 11px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text);
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); transition: background .2s, border-color .2s; }
.hd-more .i { width: 15px; height: 15px; color: var(--accent); }
.hd-more[aria-expanded="true"] { background: rgba(255, 181, 71, .16); border-color: rgba(255, 181, 71, .55); }
.hd-blurb { font-size: 14px; line-height: 1.5; color: #D2D9EA; }
.hd-stats { display: grid; gap: 7px; }
.hs { display: grid; grid-template-columns: 90px 1fr; align-items: center; }
.hs > span { font: 800 11px var(--font); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.rating { display: flex; gap: 5px; }
.rating i { width: 30px; height: 8px; border-radius: 2px; background: rgba(255, 255, 255, .1); transform: skewX(-20deg); }
.rating i.on { background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 10px rgba(255, 181, 71, .3); animation: seg-fill .5s var(--ease) both; animation-delay: calc(var(--k) * 60ms + 120ms); }
@keyframes seg-fill { from { opacity: 0; transform: skewX(-20deg) scaleX(.2); } }
.hd-figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hd-figs > div { padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, .045); display: flex; flex-direction: column; gap: 3px; }
.hd-figs small { font: 700 9px var(--font); letter-spacing: .18em; text-transform: uppercase; color: var(--dim); }
.hd-figs b { font: 800 14px var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hd-liv-label { display: flex; align-items: center; justify-content: space-between; font: 800 11px var(--font); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.hd-liv-label span { display: inline-flex; align-items: center; gap: 6px; }
.hd-liv-label .i { width: 15px; height: 15px; color: var(--accent); }
.hd-liv-label em { font-style: normal; letter-spacing: .06em; color: var(--text); }
.hd-liveries { display: flex; gap: 12px; flex-wrap: wrap; }
.swatch-btn { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; border: 2px solid transparent;
  background: rgba(255, 255, 255, .05); transition: border-color .2s, transform .25s var(--ease); }
.swatch-btn .swatch { width: 34px; height: 34px; }
.swatch-btn:hover { transform: scale(1.06); }
.swatch-btn.is-on { border-color: var(--accent); box-shadow: 0 0 18px rgba(255, 181, 71, .35); }
.swatch-btn.is-locked .swatch { filter: saturate(.35) brightness(.6); }
.sw-lock { position: absolute; bottom: -6px; display: inline-flex; align-items: center; gap: 2px; height: 18px; padding: 0 6px; border-radius: 999px; background: #0B1020;
  border: 1px solid rgba(255, 255, 255, .2); font: 800 10px/1 var(--font); color: var(--text); }
.sw-lock .i { width: 10px; height: 10px; }
.hd-actions { position: relative; z-index: 1; flex: none; display: flex; gap: 10px; }

/* ── Settings & help ────────────────────────────────────────────────────── */
.settings-col { width: min(660px, 100%); }
.tabs { position: relative; z-index: 1; flex: none; display: flex; gap: 4px; padding: 5px; width: fit-content; max-width: 100%; border-radius: 15px; overflow-x: auto;
  background: rgba(5, 8, 16, .6); border: 1px solid rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 0; background: transparent; color: var(--muted);
  font: 700 13px var(--font); letter-spacing: .03em; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.tab:hover { color: var(--text); }
.tab .i { width: 17px; height: 17px; }
.tab.is-on { background: rgba(255, 255, 255, .13); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.tab.is-on .i { color: var(--accent); }
.ui-layer .tab:focus-visible, body.nav-kb .ui-layer .tab:focus { outline-offset: -2px; box-shadow: none; }
.chip-shard .i { color: var(--cyan); }
.settings-panel { flex: 0 1 auto; min-height: 0; padding: 8px; }
.rows.is-in > * { animation: rise .45s var(--ease) both; }
.rows-sec { margin: 14px 14px 4px; font: 800 10.5px var(--font); letter-spacing: .24em; text-transform: uppercase; color: var(--accent); opacity: .9; }
.rows-sec:first-child { margin-top: 6px; }
.danger-row { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 14px 12px; }
.rows-note { padding: 0 14px 10px; font-size: 12px; color: var(--dim); }

.scr-help { padding: clamp(16px, 3.5vh, 36px) var(--gutter) calc(var(--gutter) + var(--safe-b)); justify-content: center; }
.help-col { position: relative; z-index: 1; width: min(1040px, 100%); display: flex; flex-direction: column; gap: 14px; max-height: 100%; min-height: 0; }
.help-body { flex: 1 1 auto; min-height: 0; padding: 20px 24px 22px; }
.help-content.is-in > * { animation: rise .45s var(--ease) both; }
.help-lead { font-size: 15px; line-height: 1.5; color: #D6DCEC; max-width: 70ch; }
.help-lead b { color: var(--accent); }
.diagram { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 16px 0 6px; }
.diagram svg { display: block; max-width: 100%; height: auto; }
.kb-svg { width: min(780px, 100%); }
.kb-svg .k rect { fill: rgba(255, 255, 255, .03); stroke: rgba(255, 255, 255, .13); stroke-width: 1.2; }
.kb-svg .k text { fill: rgba(242, 245, 255, .38); font: 700 13px var(--font); text-anchor: middle; }
.kb-svg .k-fly rect { fill: rgba(255, 181, 71, .16); stroke: rgba(255, 181, 71, .85); }
.kb-svg .k-fly text { fill: #FFD58F; }
.kb-svg .k-sys rect { fill: rgba(92, 225, 255, .12); stroke: rgba(92, 225, 255, .8); }
.kb-svg .k-sys text { fill: #A9F0FF; }
.kb-svg .k-run rect { fill: rgba(183, 140, 255, .14); stroke: rgba(183, 140, 255, .85); }
.kb-svg .k-run text { fill: #D9C6FF; }
.legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 12px; }
.lg-group { padding: 14px 14px 10px; border-radius: 14px; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .07); }
.lg-group h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font: 800 11px var(--font); letter-spacing: .2em; text-transform: uppercase; }
.lg-group h4::before { content: ''; width: 10px; height: 10px; border-radius: 3px; }
.lg-fly h4 { color: var(--accent); } .lg-fly h4::before { background: var(--accent); }
.lg-sys h4 { color: var(--cyan); } .lg-sys h4::before { background: var(--cyan); }
.lg-run h4 { color: var(--ace); } .lg-run h4::before { background: var(--ace); }
.lg-row { display: grid; grid-template-columns: minmax(64px, auto) 1fr; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; color: #D6DCEC; }
.lg-row + .lg-row { border-top: 1px solid rgba(255, 255, 255, .05); }
.lg-keys { display: flex; flex-wrap: wrap; gap: 4px; }
.lg-keys .i { width: 22px; height: 22px; color: var(--accent); }
.lg-text b { color: #fff; }
.lg-text kbd { height: 19px; min-width: 19px; font-size: 10px; }
.pad-svg, .touch-svg { width: min(900px, 100%); }
.pad-svg .p-body { fill: rgba(255, 255, 255, .05); stroke: rgba(255, 255, 255, .5); stroke-width: 2; }
.pad-svg .p-trig, .pad-svg .p-bump { fill: rgba(255, 181, 71, .14); stroke: rgba(255, 181, 71, .8); stroke-width: 1.5; }
.pad-svg .p-well { fill: rgba(0, 0, 0, .25); stroke: rgba(255, 255, 255, .25); stroke-width: 1.5; }
.pad-svg .p-stick { fill: rgba(255, 181, 71, .2); stroke: rgba(255, 181, 71, .9); stroke-width: 1.5; }
.pad-svg .p-dpad { fill: rgba(92, 225, 255, .12); stroke: rgba(92, 225, 255, .85); stroke-width: 1.5; }
.pad-svg .p-small, .pad-svg .p-home { fill: rgba(183, 140, 255, .18); stroke: rgba(183, 140, 255, .85); stroke-width: 1.5; }
.pad-svg .fb { stroke-width: 1.8; }
.pad-svg .fb-a { fill: rgba(74, 222, 128, .2); stroke: #4ADE80; }
.pad-svg .fb-b { fill: rgba(255, 92, 108, .2); stroke: #FF5C6C; }
.pad-svg .fb-x { fill: rgba(96, 165, 250, .2); stroke: #60A5FA; }
.pad-svg .fb-y { fill: rgba(250, 204, 21, .2); stroke: #FACC15; }
.pad-svg .fb-t { fill: #fff; font: 800 12px var(--font); text-anchor: middle; }
.pad-svg .co, .touch-svg .co { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1.2; }
.pad-svg .co-dot, .touch-svg .co-dot { fill: #fff; }
.pad-svg .co-t, .touch-svg .co-t { fill: #fff; font: 800 15px var(--font); }
.pad-svg .co-s, .touch-svg .co-s { fill: var(--muted); font: 600 13px var(--font); }
.touch-svg .t-phone { fill: rgba(255, 255, 255, .04); stroke: rgba(255, 255, 255, .45); stroke-width: 2; }
.touch-svg .t-screen { fill: rgba(92, 160, 255, .06); stroke: rgba(255, 255, 255, .1); }
.touch-svg .t-horizon { fill: none; stroke: rgba(255, 255, 255, .15); stroke-width: 1.5; }
.touch-svg .t-base { fill: rgba(255, 255, 255, .05); stroke: rgba(255, 255, 255, .4); stroke-width: 1.5; stroke-dasharray: 5 5; }
.touch-svg .t-knob { fill: rgba(255, 181, 71, .3); stroke: var(--accent); stroke-width: 2; }
.touch-svg .t-lever { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .4); stroke-width: 1.5; }
.touch-svg .t-handle { fill: rgba(255, 181, 71, .45); stroke: var(--accent); stroke-width: 2; }
.touch-svg .t-btn { fill: rgba(255, 255, 255, .07); stroke: rgba(255, 255, 255, .5); stroke-width: 1.5; }
.touch-svg .t-boost { fill: rgba(255, 122, 89, .25); stroke: var(--accent-2); }
.touch-svg .t-bt { fill: #fff; font: 800 14px var(--font); text-anchor: middle; }
.touch-svg .t-ic { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.touch-svg .t-boost + .t-ic { stroke: #1B1206; }
.touch-svg .t-panel { fill: rgba(92, 225, 255, .06); stroke: rgba(92, 225, 255, .35); stroke-width: 1.2; }
.touch-svg .t-map { fill: rgba(92, 225, 255, .08); stroke: rgba(92, 225, 255, .55); stroke-width: 1.5; }
/* Touch legend: the same round glyphs as the on-screen buttons */
.tglyph { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: linear-gradient(160deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 255, 255, .28); }
.tglyph .i { width: 17px; height: 17px; color: #fff !important; }
.tg-boost { background: radial-gradient(circle at 40% 30%, #FFE3AE, #FFB547 55%, #F08A2C); border-color: rgba(255, 230, 180, .8); }
.tg-boost .i { color: #1B1206 !important; }
.tg-square { border-radius: 10px; }
.tg-stick { background: radial-gradient(circle at 38% 32%, rgba(255, 226, 170, .9), rgba(255, 181, 71, .75) 50%, rgba(214, 120, 30, .7)); }
.tg-stick .i { color: #1B1206 !important; }
.tg-lever { width: 18px; height: 34px; border-radius: 9px; margin: 0 7px; position: relative; }
.tg-lever i { position: absolute; left: 2px; right: 2px; top: 13px; height: 8px; border-radius: 4px; background: linear-gradient(180deg, #FFF3DC, #FFC66E); }
.legend-compact { display: none; }
.lg-keys kbd { white-space: nowrap; }
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.tip { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.45; color: #CBD3E6; }
.tip .i { flex: none; width: 20px; height: 20px; color: var(--accent); margin-top: 1px; }
.tip b { color: #fff; }
/* Landing guide (How to fly) */
.land-guide { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.lgd-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.lgd-head h4 { font: 800 12px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 3px; }
.lgd-head p { margin: 0; font-size: 13px; line-height: 1.45; color: #CBD3E6; }
.lg-ils { flex: none; width: 52px; height: 52px; overflow: visible; }
.lg-ils rect { fill: rgba(3, 12, 22, .45); stroke: rgba(92, 225, 255, .45); stroke-width: 1.2; }
.lg-ils .ils-ax { stroke: rgba(92, 225, 255, .4); stroke-width: 1; fill: none; }
.lg-ils .ils-d-gs { fill: none; stroke: var(--accent); stroke-width: 2; filter: drop-shadow(0 0 3px rgba(255, 181, 71, .8)); }
.lg-ils .ils-d-cl { fill: none; stroke: var(--good); stroke-width: 2; filter: drop-shadow(0 0 3px rgba(74, 222, 128, .8)); }
.lgd-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.lgd-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 9px; row-gap: 3px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06); font-size: 12.5px; line-height: 1.45; color: #CBD3E6; }
.lgd-n { grid-row: span 2; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; font: 800 11.5px var(--font); color: #1B1206;
  background: linear-gradient(180deg, #FFCF77, #FFB547); }
.lgd-steps li > b { font: 800 13px/22px var(--font); color: #fff; }
.lgd-steps li > span:last-child b { color: #fff; }
.lgd-steps kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; font: 800 11px/1 var(--font); color: #fff;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .3); border-bottom-width: 2px; vertical-align: 1px; }

/* ── Pause ──────────────────────────────────────────────────────────────── */
.scr-pause { align-items: center; padding: var(--gutter); }
.pause-shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(4, 6, 12, .9) 0%, rgba(4, 6, 12, .66) 32%, rgba(4, 6, 12, .3) 70%, rgba(4, 6, 12, .2) 100%); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.pause-col { position: relative; z-index: 1; width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; max-height: 100%; }
.pause-head small { display: block; font: 800 12px var(--font); letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.pause-head h1 { font: 900 60px/.9 var(--font); letter-spacing: .08em; text-transform: uppercase; }
.pause-info { display: flex; padding: 12px 6px; border-radius: 15px; }
.pi { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 0 14px; }
.pi + .pi { border-left: 1px solid rgba(255, 255, 255, .08); }
.pi small { font: 700 9.5px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.pi b { font: 800 20px var(--font); font-variant-numeric: tabular-nums; }
.pi b em { font-style: normal; font-size: 14px; color: var(--dim); }
.pause-nav { display: flex; flex-direction: column; gap: 8px; }
.pv { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 14px; height: 52px; padding: 0 16px; border-radius: 14px; cursor: pointer; text-align: left;
  font: 700 15px var(--font); letter-spacing: .03em; color: var(--text); background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09);
  transition: background .2s, border-color .2s, transform .25s var(--ease); }
.pv:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .22); transform: translateX(3px); }
.pv .i { width: 20px; height: 20px; }
.pv kbd { opacity: .7; }
.pv-primary { background: var(--amber-grad); color: var(--ink); border-color: rgba(255, 225, 170, .6); font-weight: 900; letter-spacing: .12em; text-transform: uppercase;
  box-shadow: 0 10px 30px rgba(255, 145, 40, .3), inset 0 1px 0 rgba(255, 255, 255, .5); }
.pv-primary:hover { background: var(--amber-grad); filter: brightness(1.06); }
.pv-primary kbd { color: var(--ink); background: rgba(40, 20, 0, .1); border-color: rgba(60, 30, 0, .3); }
.pv-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.pv-quiet:hover { color: var(--text); }

/* ── Results ────────────────────────────────────────────────────────────── */
.scr-results { --mc: 255, 210, 74; align-items: center; justify-content: center; padding: var(--gutter); overflow-y: auto; touch-action: pan-y; }
.scr-results.medal-none { --mc: 163, 172, 198; }
.scr-results.medal-bronze { --mc: 229, 154, 98; }
.scr-results.medal-silver { --mc: 217, 226, 242; }
.scr-results.medal-ace { --mc: 183, 140, 255; }
.results-shade { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(60% 70% at 28% 45%, rgba(var(--mc), .16) 0%, rgba(5, 8, 16, .5) 45%, rgba(5, 8, 16, .88) 100%), rgba(5, 8, 16, .3);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.res-wrap { position: relative; z-index: 1; width: min(1160px, 100%); display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(20px, 4vw, 56px); align-items: center; margin: auto; }
.res-left { display: flex; flex-direction: column; align-items: center; text-align: center; }
.res-kicker { font: 800 11.5px var(--font); letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }
.res-title { margin-top: 6px; font: 900 clamp(26px, 3.2vw, 38px)/1 var(--font); letter-spacing: .06em; text-transform: uppercase; text-wrap: balance; }
.res-medal { position: relative; width: clamp(150px, 19vw, 220px); aspect-ratio: 1; margin: 6px 0 2px; display: grid; place-items: center; perspective: 600px; }
.rm-rays { position: absolute; inset: -30%; border-radius: 50%; opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(var(--mc), .38) 0deg 6deg, rgba(var(--mc), 0) 6deg 22deg);
  -webkit-mask: radial-gradient(closest-side, #000 20%, transparent 100%); mask: radial-gradient(closest-side, #000 20%, transparent 100%); }
.rm-glow { position: absolute; inset: -10%; border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--mc), .5), rgba(var(--mc), 0)); opacity: 0; }
.rm-art { position: relative; width: 78%; height: 78%; opacity: 0; transform: scale(.35) rotateY(80deg); }
.rm-art svg { width: 100%; height: 100%; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45)); }
.is-s1 .rm-art { animation: medal-pop 1s var(--ease-back) forwards; }
.is-s1 .rm-glow { animation: glow-in 1.2s ease-out forwards; }
.is-s1 .rm-rays { animation: rays-in 1s ease-out forwards, rays-spin 24s linear infinite; }
.medal-none.is-s1 .rm-rays, .medal-none.is-s1 .rm-glow { animation: none; }
@keyframes medal-pop { 0% { opacity: 0; transform: scale(.35) rotateY(80deg); } 55% { opacity: 1; transform: scale(1.12) rotateY(-10deg); } 100% { opacity: 1; transform: scale(1) rotateY(0); } }
@keyframes glow-in { 0% { opacity: 0; transform: scale(.5); } 40% { opacity: 1; transform: scale(1.15); } 100% { opacity: .7; transform: scale(1); } }
@keyframes rays-in { to { opacity: 1; } }
@keyframes rays-spin { to { rotate: 360deg; } }
.res-medal-name { display: flex; align-items: center; gap: 12px; min-height: 40px; opacity: 0; }
.res-medal-name > span { font: 900 clamp(26px, 3vw, 36px)/1 var(--font); letter-spacing: .26em; text-transform: uppercase; padding-left: .26em;
  background: linear-gradient(180deg, #fff 0%, rgb(var(--mc)) 75%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.medal-none .res-medal-name > span { background: none; color: var(--muted); }
.is-s1 .res-medal-name { animation: reveal .6s .15s var(--ease) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.res-stars { display: inline-flex; align-items: center; gap: 3px; height: 28px; padding: 0 10px; border-radius: 999px; font: 900 14px var(--font); font-style: normal;
  background: var(--amber-grad); color: var(--ink); box-shadow: 0 0 20px rgba(255, 181, 71, .4); }
.res-stars .i { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.res-value { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.rv-num { font: 800 clamp(46px, 5.6vw, 72px)/1 var(--font); font-variant-numeric: tabular-nums; letter-spacing: .01em; text-shadow: 0 4px 30px rgba(0, 0, 0, .4); }
.res-value small { font: 700 14px var(--font); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.res-sub { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; min-height: 36px; margin-top: 10px; opacity: 0; }
.is-s2 .res-sub { animation: reveal .55s var(--ease) both; }
.res-pb { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--amber-grad); color: var(--ink);
  font: 900 12px var(--font); letter-spacing: .16em; text-transform: uppercase; box-shadow: 0 0 26px rgba(255, 181, 71, .5); }
.res-pb .i { width: 16px; height: 16px; }
/* The badge pops on its own beat, with its chime, after the medal has landed (screens-flight.js) */
.is-best .res-pb { opacity: 0; }
.is-best.is-pb .res-pb { animation: pb-pop .55s var(--ease-back, ease-out) both; }
@keyframes pb-pop { 0% { opacity: 0; transform: scale(.55); } 55% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
.res-delta { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font: 800 15px var(--font); font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, .08); }
.res-delta small { font: 700 10px var(--font); letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.res-delta .i { width: 15px; height: 15px; }
.res-delta.is-good { color: var(--good); background: rgba(74, 222, 128, .12); }
.res-delta.is-bad { color: var(--bad); background: rgba(255, 92, 108, .12); }
.res-right { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.res-right > .glass, .unlock-card { opacity: 0; }
.is-s3 .res-right > .glass { animation: reveal .6s var(--ease) both; }
.is-s3 .res-right > .glass:nth-child(2) { animation-delay: .08s; }
.is-s3 .res-right > .glass:nth-child(3) { animation-delay: .16s; }
/* One card at a time, each with its own 'unlock' chime (screens-flight.js) */
.is-s4 .unlock-card { animation: reveal .6s var(--ease) both; animation-delay: calc(var(--k, 0) * 200ms); }
.unlock-card.uc-rank .uc-ic svg.rank-badge { width: 40px; height: 40px; }
.res-track { padding: 16px 20px 14px; }
.rt-head, .rb-head { display: flex; justify-content: space-between; align-items: baseline; font: 800 11px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.rt-head em, .rb-head em { font-style: normal; letter-spacing: .04em; color: var(--text); font-variant-numeric: tabular-nums; }
.mt-bar { position: relative; height: 8px; margin: 34px 10px 34px; border-radius: 4px; background: rgba(255, 255, 255, .09); }
.mt-fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--x) * 100%); border-radius: inherit; background: linear-gradient(90deg, rgba(var(--mc), .25), rgb(var(--mc)));
  transform-origin: left; transform: scaleX(0); }
.is-s3 .mt-fill { animation: fill-in 1s .2s var(--ease) forwards; }
@keyframes fill-in { to { transform: scaleX(1); } }
.mt-mark { position: absolute; left: calc(var(--x) * 100%); top: 50%; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -7px); }
.mt-pip { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #0B1020; box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); }
.mt-mark.medal-bronze .mt-pip { background: var(--bronze); }
.mt-mark.medal-silver .mt-pip { background: var(--silver); }
.mt-mark.medal-gold .mt-pip { background: var(--gold); }
.mt-mark.medal-ace .mt-pip { background: var(--ace); }
.mt-mark.is-got .mt-pip { box-shadow: 0 0 0 2px rgba(255, 255, 255, .8), 0 0 12px rgba(255, 255, 255, .4); }
.mt-mark small { margin-top: 6px; font: 700 11px var(--font); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
/* Close-together markers: every other label drops to a second line with a short leader */
.mt-mark.is-low small { margin-top: 22px; position: relative; }
.mt-mark.is-low small::before { content: ''; position: absolute; left: 50%; bottom: 100%; width: 1px; height: 15px; margin-bottom: 2px; background: rgba(255, 255, 255, .25); }
.mt-bar.has-low { margin-bottom: 50px; }
.mt-mark.is-got small { color: var(--text); }
.mt-you { position: absolute; left: calc(var(--x) * 100%); bottom: 100%; transform: translate(-50%, -6px); }
.mt-you b { position: relative; display: block; padding: 3px 7px; border-radius: 6px; background: #fff; color: #0B1020; font: 900 9.5px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; }
.mt-you b::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -4px; border: 4px solid transparent; border-top-color: #fff; }
.mt-legend { display: none; justify-content: space-between; gap: 6px; margin: -14px 2px 12px; }
.mtl { display: inline-flex; align-items: center; gap: 5px; font: 700 11.5px var(--font); font-variant-numeric: tabular-nums; color: var(--muted); }
.mtl .mt-pip { width: 10px; height: 10px; border-width: 1.5px; }
.mtl.medal-bronze .mt-pip { background: var(--bronze); } .mtl.medal-silver .mt-pip { background: var(--silver); }
.mtl.medal-gold .mt-pip { background: var(--gold); } .mtl.medal-ace .mt-pip { background: var(--ace); }
.mtl.is-got { color: var(--text); }
.rt-next { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #D6DCEC; }
.rt-next svg.medal { width: 30px; height: 30px; flex: none; }
.rt-next > .i { width: 18px; height: 18px; color: var(--accent); }
.rt-next b { color: #fff; }
.res-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; padding: 12px; }
.rs { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 9px; row-gap: 2px; align-items: center; padding: 8px 10px; border-radius: 11px; background: rgba(255, 255, 255, .035); min-width: 0; }
.rs .i { grid-row: span 2; width: 20px; height: 20px; color: var(--accent); }
/* Labels never spill out of their cell: tighter tracking, and two lines if they must */
.rs small { font: 700 9.5px/1.15 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.rs b { font: 800 18px/1.15 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs b em { font-style: normal; font-size: 13px; color: var(--dim); }
.rs.is-good b, .rs.is-good .i { color: var(--good); }
.rs.is-good { background: rgba(74, 222, 128, .07); }
.rs.is-bad b { color: #FF8A96; }
/* Desktop's four-column grid: the Perfect bonus label fits on one line beside Penalties */
@media (min-width: 1101px) and (min-height: 561px), (min-width: 761px) and (max-width: 900px) and (min-height: 561px) { .rs.rs-wide { grid-column: span 2; } }
.res-break { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.rb-row { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 12px; font-size: 13px; color: #D6DCEC; }
.rb-row b { text-align: right; font-variant-numeric: tabular-nums; }
.rb-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.rb-bar i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.is-s3 .rb-bar i { animation: rb-in .9s var(--ease) forwards; animation-delay: calc(var(--k) * 90ms + .2s); }
@keyframes rb-in { to { transform: scaleX(var(--p)); } }
.res-unlocks { display: flex; gap: 10px; flex-wrap: wrap; }
.unlock-card { position: relative; flex: 1 1 200px; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 15px; overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 181, 71, .2), rgba(255, 122, 89, .08)); border: 1px solid rgba(255, 181, 71, .5); box-shadow: 0 10px 30px rgba(255, 140, 40, .15); }
.uc-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: rgba(27, 18, 6, .5); color: var(--accent); flex: none; }
.uc-ic .i { width: 22px; height: 22px; }
.uc-ic svg.plane-sil { width: 38px; height: 38px; }
.uc-t { display: flex; flex-direction: column; gap: 3px; }
.uc-t small { font: 800 10px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.uc-t b { font: 900 16px var(--font); letter-spacing: .05em; text-transform: uppercase; }
.uc-shine { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .35) 50%, transparent 65%); transform: translateX(-120%); }
.is-s4 .uc-shine { animation: sheen-once 1.4s .3s ease-out forwards; animation-delay: calc(var(--k, 0) * 200ms + 300ms); }
@keyframes sheen-once { to { transform: translateX(120%); } }
/* Retry / Next / Menu stay on screen even when the results scroll (phones) */
.res-actions { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

/* ── Map ────────────────────────────────────────────────────────────────── */
.scr-map { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; padding: clamp(14px, 2.6vh, 28px) var(--gutter) calc(clamp(14px, 2.6vh, 28px) + var(--safe-b)); }
.map-shade { position: absolute; inset: 0; pointer-events: none; background: rgba(4, 7, 14, .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.scr-map.is-live .map-shade { background: rgba(4, 7, 14, .55); -webkit-backdrop-filter: none; backdrop-filter: none; }
.map-stage { position: relative; z-index: 1; display: grid; place-items: center; min-height: 0; min-width: 0; container-type: size; }
/* The largest square that fits the stage, whatever the layout (container query units) */
.map-box { position: relative; width: min(100%, calc(100vh - var(--pixelrain-bar, 0px) - 60px)); width: min(100cqw, 100cqh); aspect-ratio: 1; }
.map-view { position: absolute; inset: 0; border-radius: 24px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14); box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .3); cursor: grab; touch-action: none; background: #0A1B2C; }
.map-view.is-drag { cursor: grabbing; }
.map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
/* Labels are laid out in JS (screens-flight.js buildLabels): boxes come pre-positioned. */
.mlt { position: absolute; left: 0; top: 0; white-space: nowrap; font: 700 11.5px/14px var(--font); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .95), 0 0 10px rgba(0, 0, 0, .7); }
.mlt-air { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.mlt-air b { font-weight: 800; letter-spacing: .04em; color: #FFE2A8; line-height: 13px; }
.mlt-air small { font: 700 9.5px/11px var(--font); letter-spacing: .14em; color: rgba(255, 226, 168, .7); }
.mlt-cross { font-size: 10px; line-height: 12px; color: #DCE3F2; font-weight: 600; }
.mld { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(8, 12, 20, .8); }
.map-wait { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px;
  background: rgba(9, 13, 24, .8); font-size: 12.5px; color: var(--muted); transition: opacity .4s; }
.map-wait.is-off { opacity: 0; }
.spin, .ld-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.map-tools { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; }  /* bottom left is open sea */
.map-north { position: absolute; top: 14px; left: 14px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgba(9, 13, 24, .72);
  border: 1px solid rgba(255, 255, 255, .16); font: 900 13px var(--font); color: var(--accent); }
.map-north::before { content: ''; position: absolute; top: 4px; border: 4px solid transparent; border-bottom: 7px solid var(--accent); border-top: 0; }
.map-north span { margin-top: 6px; }
.map-side { position: relative; z-index: 1; align-self: center; display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 20px; max-height: 100%; overflow-y: auto; }
.ms-head small { font: 800 10.5px var(--font); letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }
.ms-head h2 { margin-top: 4px; font: 900 22px var(--font); letter-spacing: .06em; text-transform: uppercase; }
.ms-legend { display: flex; flex-direction: column; gap: 9px; }
.ml { display: grid; grid-template-columns: 22px 1fr; align-items: center; column-gap: 10px; font-size: 13px; color: #D6DCEC; }
.ml em { grid-column: 2; font-style: normal; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ml-ic { width: 22px; height: 22px; display: grid; place-items: center; position: relative; }
.ml-you::before { content: ''; border: 7px solid transparent; border-bottom: 16px solid #fff; border-top: 0; filter: drop-shadow(0 0 4px var(--cyan)); }
.ml-runway::before { content: ''; width: 18px; height: 5px; border-radius: 1px; background: #F0F4FC; box-shadow: 0 0 0 1.5px rgba(10, 14, 22, .8); transform: rotate(-25deg); }
.ml-place::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(8, 12, 20, .8); }
.ml-bridge::before { content: ''; width: 8px; height: 8px; background: #E9EEF8; box-shadow: 0 0 0 1.5px rgba(8, 12, 20, .85), 10px 0 0 0 #E8855A; margin-left: -10px; }
.ml-shard { color: var(--cyan); }
.ml-shard .i { width: 18px; height: 18px; }
.ml-search::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 1.5px dashed rgba(92, 225, 255, .8); background: rgba(92, 225, 255, .08); }
.ml-ring::before { content: ''; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(8, 12, 20, .9); }
.ms-shards { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 13px; background: rgba(92, 225, 255, .07); border: 1px solid rgba(92, 225, 255, .18); }
.ms-shards > div { display: flex; justify-content: space-between; align-items: baseline; }
.ms-shards small { font: 800 10px var(--font); letter-spacing: .2em; text-transform: uppercase; color: var(--cyan); }
.ms-shards b { font: 900 20px var(--font); }
.ms-shards b em { font-style: normal; font-size: 14px; color: var(--dim); }
.ms-shards .bar i { background: linear-gradient(90deg, #2EA8D6, var(--cyan)); }
.ms-close { width: 100%; }

/* ── Loading ────────────────────────────────────────────────────────────── */
.scr-loading { pointer-events: none !important; flex-direction: column; align-items: center; justify-content: flex-end; gap: 12px; padding-bottom: calc(12vh + var(--safe-b));
  background: linear-gradient(0deg, rgba(5, 8, 16, .6), rgba(5, 8, 16, 0) 45%); }
.ld-card { display: flex; align-items: center; gap: 14px; padding: 14px 22px 14px 18px; border-radius: 999px; }
.ld-spin { width: 22px; height: 22px; border-width: 2.5px; }
.ld-t { display: flex; flex-direction: column; gap: 3px; }
.ld-t small { font: 800 10px var(--font); letter-spacing: .24em; text-transform: uppercase; color: var(--accent); }
.ld-t b { font: 800 16px var(--font); letter-spacing: .04em; }
.ld-tip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(242, 245, 255, .7); text-shadow: 0 1px 6px rgba(0, 0, 0, .7); padding: 0 16px; text-align: center; }
.ld-tip .i { width: 16px; height: 16px; color: var(--accent); flex: none; }

/* ── Dialogs ────────────────────────────────────────────────────────────── */
.modal-backdrop { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; pointer-events: auto;
  background: rgba(3, 5, 10, .58); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: screen-in .25s ease both; }
.modal-backdrop.is-leaving { animation: screen-out .2s ease forwards; }
.modal { width: min(430px, 100%); padding: 28px 26px 22px; text-align: center; animation: modal-in .4s var(--ease-back) both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }
.modal-icon { width: 54px; height: 54px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 181, 71, .14); color: var(--accent); }
.modal-icon .i { width: 26px; height: 26px; }
.modal-icon.is-danger { background: rgba(255, 92, 108, .14); color: var(--bad); }
.modal h3 { font: 900 21px/1.2 var(--font); letter-spacing: .02em; }
.modal p { margin-top: 10px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.modal-actions .btn { min-width: 132px; }

/* ── Toasts ─────────────────────────────────────────────────────────────── */
.ui-toasts { position: absolute; left: 50%; top: 16px; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
body[data-ui-screen="none"] .ui-toasts { top: 76px; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 18px 10px 13px; border-radius: 999px; background: rgba(9, 13, 24, .86); border: 1px solid rgba(255, 255, 255, .13);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 12px 34px rgba(0, 0, 0, .35); font: 700 13.5px var(--font); color: var(--text);
  animation: toast-in .4s var(--ease-back) both; }
.toast.is-out { animation: toast-out .35s ease forwards; }
.toast .toast-ic { width: 18px; height: 18px; color: var(--accent); fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.toast-good .toast-ic { color: var(--good); }
.toast-bad .toast-ic, .toast-warn .toast-ic { color: var(--bad); }
.toast-camera .toast-ic, .toast-shard .toast-ic { color: var(--cyan); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px) scale(.97); } }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .card-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-card { min-height: 200px; }
  .legend, .tips, .lgd-steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) and (min-height: 560px) {
  .scr-challenges .card-row { overflow-y: auto; touch-action: pan-y; margin-top: 4px; padding: 6px 2px 2px; }
}
@media (max-width: 900px) {
  .res-wrap { grid-template-columns: 1fr; gap: 18px; }
  .res-right { width: min(620px, 100%); margin: 0 auto; }
  .scr-results { align-items: flex-start; }
  .scr-map { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .map-side { align-self: stretch; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; }
  .map-side .ms-legend { display: none; }
  .ms-head h2 { font-size: 18px; }
  .ms-shards { flex: 1; min-width: 160px; }
  .ms-close { width: auto; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .head-text h2 { font-size: 24px; }
  .head-text small { font-size: 9.5px; letter-spacing: .16em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chip { white-space: nowrap; height: 32px; padding: 0 11px; }
  .cc-plane { opacity: .045; }
  .btn-back span { display: none; }
  .btn-back { padding: 0; width: 42px; justify-content: center; }
  .menu-shade { background: linear-gradient(180deg, rgba(5, 8, 16, .55) 0%, rgba(5, 8, 16, .35) 30%, rgba(5, 8, 16, .82) 62%, rgba(5, 8, 16, .94) 100%); }
  .scr-main { padding-top: 16px; }
  .main-col { width: 100%; height: 100%; max-height: none; overflow-y: auto; touch-action: pan-y; padding-bottom: 8px; }
  .main-nav { margin-top: auto; }
  .now-flying, .main-foot { display: none; }
  .mm-play { height: 76px; }
  .mp-text b { font-size: 21px; }
  .tier-tabs { flex-wrap: nowrap; gap: 6px; }
  .tier-tab { flex: 1; min-width: 0; grid-template-columns: 1fr; height: 56px; padding: 0 10px; justify-items: center; text-align: center; }
  .tt-num { display: none; }
  .tt-text { align-items: center; }
  .tt-text b { font-size: 13px; letter-spacing: .1em; }
  .tt-text small { font-size: 11px; }
  .tier-blurb { font-size: 13.5px; }
  .card-row { grid-template-columns: 1fr; gap: 10px; overflow-y: auto; touch-action: pan-y; margin-top: 0; padding: 4px 2px 2px; min-height: 0; flex: 1; }
  .ch-card { min-height: 0; display: grid; grid-template-columns: 1fr 56px; grid-template-areas: "head medal" "body medal" "foot foot"; padding: 14px; }
  .cc-head { grid-area: head; }
  .cc-medal { position: static; grid-area: medal; width: 52px; height: 52px; align-self: center; }
  .cc-body { grid-area: body; padding-top: 8px; gap: 6px; }
  .cc-foot { grid-area: foot; margin-top: 10px; padding-top: 9px; }
  .cc-plane { top: auto; bottom: -30px; right: 30px; width: 120px; height: 120px; }
  .cc-title { font-size: 18px; }
  .brief { padding: 18px 16px; }
  .bf-cond { grid-template-columns: 1fr 1fr; }
  .cond-plane { grid-column: 1 / -1; }
  .bf-medals { gap: 6px; }
  .bmm-medal { width: 38px; height: 38px; }
  .bmm b { font-size: 13px; }
  .bf-actions .btn-xl { width: 100%; }
  .opt { grid-template-columns: 1fr; gap: 8px; padding: 10px; }
  .opt-seg { justify-self: stretch; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .seg { padding: 0 6px; font-size: 12px; white-space: normal; text-align: center; line-height: 1.15; }
  .icon-only .seg { width: auto; }
  .opt-slider .slider { width: 100%; }
  .opt-label small { font-size: 11.5px; }
  .setup-intro { grid-template-columns: 36px 1fr; }
  .si-count { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .si-count .bar { flex: 1; margin-left: 12px; }
  .setup-actions .btn { width: 100%; }
  .hangar-col { width: 100%; }
  .hangar-detail { padding: 16px; }
  .hd-head h1 { font-size: 30px; }
  .hd-figs { grid-template-columns: repeat(2, 1fr); }
  .tabs { width: 100%; }
  .tab { flex: 1 0 auto; justify-content: center; padding: 0 10px; }
  .tab span { font-size: 12.5px; }
  .legend-compact { display: block; margin-top: 4px; }
  .diagram-callouts .co, .diagram-callouts .co-dot, .diagram-callouts .co-t, .diagram-callouts .co-s { display: none; }
  .help-body { padding: 16px; }
  .legend, .tips, .lgd-steps { grid-template-columns: 1fr; }
  .pause-head h1 { font-size: 46px; }
  .pause-shade { background: rgba(4, 6, 12, .74); }
  .pause-col { margin: 0 auto; }
  .res-medal { width: 140px; }
  .rv-num { font-size: 44px; }
  .res-actions .btn { flex: 1; }
  .rb-row { grid-template-columns: 96px 1fr 38px; }
  .mt-mark small { display: none; }
  .mt-bar { margin-bottom: 24px; }
  .mt-legend { display: flex; }
  .res-stats { grid-template-columns: repeat(2, 1fr); }
  .rs small { letter-spacing: .12em; }
  .map-side { padding: 12px; }
  .ms-head { display: none; }
  .scr-map { gap: 10px; }
}
@media (max-width: 760px) and (orientation: portrait) {
  .scr-hangar .menu-shade { background: linear-gradient(180deg, rgba(5, 8, 16, .5) 0%, rgba(5, 8, 16, .0) 24%, rgba(5, 8, 16, .0) 46%, rgba(5, 8, 16, .9) 68%); }
  .hangar-col { height: 100%; gap: 10px; }
  .hangar-tabs { margin-bottom: auto; gap: 6px; }
  .hg-tab { padding: 7px 4px 6px; gap: 2px; }
  .hg-sil { width: 34px; height: 34px; }
  /* A bottom sheet: name, ratings and paint; Specs opens the blurb and figures over the plane */
  .hangar-detail { max-height: 60%; gap: 10px; padding: 14px 16px; }
  /* Name on the left; the status chip and the Specs toggle stacked on the right */
  .hd-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; }
  .hd-head > div:first-child { grid-row: 1 / span 2; }
  .hd-head .hd-status, .hd-more { grid-column: 2; justify-self: end; }
  .hd-head small { letter-spacing: .14em; }
  .hangar-detail:not(.is-expanded) .hd-eng { display: none; }   /* the engine type is a spec */
  .hd-more { display: inline-flex; }
  .hangar-detail:not(.is-expanded) .hd-blurb, .hangar-detail:not(.is-expanded) .hd-figs { display: none; }
  .hd-liveries { gap: 10px; }
}
@media (max-width: 760px) and (orientation: portrait) and (max-height: 780px) {
  .hangar-col .head-text small { display: none; }
  .hangar-detail { gap: 8px; padding: 12px 14px; }
  .hd-head h1 { font-size: 26px; }
  .hd-stats { gap: 5px; }
  .swatch-btn { width: 46px; height: 46px; }
  .swatch-btn .swatch { width: 30px; height: 30px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .scr-main { padding: 14px var(--gutter) 14px; }
  .main-col { width: min(860px, 100%); max-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); grid-template-rows: auto 1fr;
    gap: 10px 16px; align-items: start; overflow-y: auto; touch-action: pan-y; }
  .brand-lockup { grid-column: 1; margin: 0; }
  .pilot-card { grid-column: 1; }
  .main-nav { grid-column: 2; grid-row: 1 / span 2; gap: 8px; }
  .now-flying, .main-foot { display: none; }
  .mm-play { height: 64px; grid-template-columns: 44px 1fr auto; }
  .mp-icon { width: 44px; height: 44px; border-radius: 13px; }
  .mp-text b { font-size: 20px; }
  .mp-text small { display: none; }
  .mm-card { height: 56px; }
  .mc-icon { width: 36px; height: 36px; }
  .mm-tile { padding: 9px 12px; flex-direction: row; align-items: center; gap: 10px; }
  .mm-tile small { display: none; }
  .mt-icon { margin: 0; }
  .mm-links .mm-link { height: 38px; }
  .scr-challenges { gap: 8px; }
  .tier-tab { height: 48px; }
  .tier-info { display: none; }
  .ch-card { min-height: 0; }
  .cc-body { padding-top: 10px; }
  .card-row { overflow-y: auto; touch-action: pan-y; margin-top: 0; flex: 1; min-height: 0; }
  .wordmark { font-size: clamp(48px, 9vw, 110px); }
  .title-press { bottom: 52px; }
  .title-foot { display: none; }

  /* Sub-screen headers: one compact row */
  .scr-briefing, .scr-free, .scr-settings, .scr-hangar, .scr-help, .scr-challenges { padding: 10px var(--gutter) calc(10px + var(--safe-b)); }
  .scr-head { min-height: 44px; gap: 12px; }
  .head-text h2 { font-size: 22px; }
  .head-text small { font-size: 9.5px; letter-spacing: .16em; }

  /* Pause: title and run info on the left, the actions as a 2-column grid on the right */
  .scr-pause { padding: 12px var(--gutter) calc(12px + var(--safe-b)); }
  .pause-col { width: min(780px, 100%); display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); grid-template-areas: "head nav" "info nav";
    grid-template-rows: auto 1fr; align-items: start; gap: 12px 22px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
  .pause-head { grid-area: head; }
  .pause-head h1 { font-size: 38px; }
  .pause-info { grid-area: info; padding: 10px 4px; }
  .pi { padding: 0 10px; }
  .pi b { font-size: 17px; }
  .pause-nav { grid-area: nav; align-self: center; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .pv { height: 46px; gap: 10px; padding: 0 12px; font-size: 14px; }
  .pv-primary { letter-spacing: .08em; }

  /* Briefing: header with Fly beside it, then text left, conditions and medals right */
  .brief-col { width: min(920px, 100%); height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); gap: 10px 16px; }
  .brief-col > .scr-head { grid-column: 1; grid-row: 1; }
  .bf-actions { grid-column: 2; grid-row: 1; align-self: center; }
  .bf-actions .bf-hint, .setup-actions .bf-hint { display: none; }
  .bf-actions .btn-xl, .setup-actions .btn-xl { width: auto; height: 48px; padding: 0 26px; font-size: 16px; }
  .brief { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 12px 22px; padding: 14px 18px; align-items: start; }
  .bf-main, .bf-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  .bf-title { font-size: clamp(24px, 3.6vw, 32px); }
  .bf-loc { margin-top: -2px; font-size: 13px; }
  .bf-desc { font-size: 13.5px; line-height: 1.45; }
  .bf-cond { grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; }
  .cond-plane { grid-column: auto; }
  .cond { padding: 6px 8px; gap: 8px; border-radius: 11px; }
  .cond-ic { width: 30px; height: 30px; border-radius: 9px; }
  .cond-ic .i { width: 18px; height: 18px; }
  .cond-plane .cond-ic svg { width: 26px; height: 26px; }
  .cond-t b { font-size: 12.5px; }
  .cond-t em { display: none; }
  .bf-sec { margin-top: 0; }
  .bf-sec em { display: none; }
  .bf-medals { gap: 6px; }
  .bmm { padding: 6px 4px 7px; }
  .bmm-medal { width: 32px; height: 32px; }
  .bmm b { font-size: 13px; }
  .bf-best { padding: 7px 12px; font-size: 13px; }

  /* Free flight: header with Take off beside it, option rows in two columns */
  .setup-col { width: min(920px, 100%); height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); gap: 10px 16px; }
  .setup-col > .scr-head { grid-column: 1; grid-row: 1; }
  .setup-actions { grid-column: 2; grid-row: 1; align-self: center; }
  .setup-actions .btn { width: auto; }
  .setup { grid-column: 1 / -1; grid-row: 2; padding: 6px; }
  .setup-rows { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 0 10px; }
  .setup .opt { grid-template-columns: 1fr; gap: 4px; padding: 5px 8px; }
  .setup .opt-seg { justify-self: stretch; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .setup .seg { padding: 0 4px; min-height: 44px; white-space: normal; text-align: center; line-height: 1.15; font-size: 12px; }
  .setup .icon-only .seg { width: auto; }
  .setup .opt-planes .seg { min-height: 48px; }
  .setup .opt-planes .seg > svg.plane-sil { width: 26px; height: 26px; }
  .cond-t small { letter-spacing: .12em; }

  /* Hangar: a compact column on the left, the plane itself on the right */
  .hangar-col { width: min(480px, 58%); height: 100%; gap: 8px; }
  .hangar-col .head-text small { display: none; }
  .hangar-tabs { gap: 6px; }
  .hg-tab { flex-direction: row; justify-content: center; gap: 6px; padding: 6px; min-height: 44px; }
  .hg-sil { width: 26px; height: 26px; }
  .hg-t small { display: none; }
  .hg-t b { font-size: 11px; letter-spacing: .08em; }
  .hg-sel { top: -5px; right: -5px; }
  .hangar-detail { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; align-content: start; gap: 8px 16px; padding: 10px 14px; }
  .hd-head { grid-column: 1 / -1; }
  .hd-head h1 { font-size: 24px; margin-top: 2px; }
  .hd-blurb, .hd-figs { display: none; }
  .hd-stats { grid-column: 1; grid-row: 2 / span 2; gap: 5px; }
  .hs { grid-template-columns: 72px 1fr; }
  .hs > span { font-size: 10px; letter-spacing: .12em; }
  .rating { gap: 3px; }
  .rating i { width: 18px; height: 7px; }
  .hd-liv-label { grid-column: 2; grid-row: 2; font-size: 10px; }
  .hd-liveries { grid-column: 2; grid-row: 3; gap: 8px; }
  .swatch-btn { width: 44px; height: 44px; }
  .swatch-btn .swatch { width: 28px; height: 28px; }
  .hd-actions .btn { height: 44px; }

  /* Settings and help: compact headers, the panels scroll (with edge fades) */
  .settings-col, .help-col { gap: 10px; }
  .tab { height: 38px; }

  /* Results: medal on the left (stays put), details on the right, actions pinned at the bottom */
  .scr-results { align-items: flex-start; padding: 10px var(--gutter) 0; }
  .res-wrap { grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); gap: 18px; align-items: start; margin: 0 auto; }
  .res-left { position: sticky; top: 0; padding-top: 4px; }
  .res-right { width: auto; margin: 0; gap: 8px; }
  .res-kicker { font-size: 10px; }
  .res-title { font-size: 22px; margin-top: 3px; }
  .res-medal { width: 96px; margin: 2px 0 0; }
  .res-medal-name { min-height: 28px; gap: 8px; }
  .res-medal-name > span { font-size: 22px; }
  .res-stars { height: 24px; font-size: 12px; }
  .rv-num { font-size: 36px; }
  .res-value { margin-top: 2px; }
  .res-sub { margin-top: 6px; min-height: 28px; gap: 6px; }
  .res-pb, .res-delta { height: 26px; font-size: 11px; padding: 0 10px; }
  .res-delta { font-size: 13px; }
  .res-track { padding: 10px 14px 10px; }
  .mt-bar { margin: 28px 8px 30px; }
  .mt-bar.has-low { margin-bottom: 44px; }
  .rt-next { font-size: 12.5px; }
  .res-stats { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); padding: 8px; }
  .rs { padding: 6px 8px; }
  .rs b { font-size: 15px; }
  .res-break { padding: 10px 14px; gap: 6px; }
  .unlock-card { flex-basis: 170px; padding: 8px 10px; gap: 10px; }
  .uc-ic { width: 34px; height: 34px; }
  .uc-t b { font-size: 13px; }
  .res-actions .btn { height: 44px; padding: 0 16px; font-size: 14px; }

  /* Map: as big as the height allows, a slim side panel (no legend) */
  .scr-map { grid-template-columns: minmax(0, 1fr) 210px; grid-template-rows: none; gap: 12px; padding: 10px var(--gutter) calc(10px + var(--safe-b)); }
  .map-side { align-self: center; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 10px; padding: 12px; }
  .map-side .ms-legend, .ms-head { display: none; }
  .ms-shards { flex: none; min-width: 0; }
  .ms-close { width: 100%; }
  .map-tools { left: 8px; bottom: 8px; gap: 6px; }
  .map-north { top: 10px; left: 10px; width: 34px; height: 34px; }
  .map-view { border-radius: 18px; }
}
/* Results on phones and narrow windows: the action bar floats over the content it scrolls past */
@media (max-width: 900px), (max-height: 560px) {
  .res-actions { margin: 0 calc(-1 * var(--gutter)); padding: 16px var(--gutter) calc(12px + var(--safe-b)); flex-wrap: nowrap; }
  /* Frosted strip behind the pinned buttons; its top edge fades so scrolled content slides under */
  .res-actions::before { content: ''; position: absolute; inset: -14px 0 0; z-index: -1; pointer-events: none; background: rgba(5, 8, 16, .88);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30px); mask-image: linear-gradient(180deg, transparent 0, #000 30px); }
  .res-actions .btn:not(.btn-ghost) { min-width: 0; }
  .res-actions .btn span { overflow: hidden; text-overflow: ellipsis; }
  .res-actions .btn-ghost { flex: 0 1 auto; }
  .scr-results { padding-bottom: 0; }
}
@media (max-height: 560px) and (max-width: 640px) and (orientation: landscape) {
  .pause-col { grid-template-columns: minmax(0, .6fr) minmax(0, 1.4fr); gap: 10px 14px; }
  .pause-head h1 { font-size: 30px; }
  .pv { font-size: 13px; padding: 0 10px; }
  .pv span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-height: 340px) and (orientation: landscape) {
  .pause-head h1 { font-size: 32px; }
  .pause-info { display: none; }
  .pv { height: 44px; }
}
@media (max-width: 480px) {
  .mm-play { grid-template-columns: 46px 1fr auto; gap: 12px; padding: 0 14px 0 12px; }
  .res-actions .btn { padding: 0 12px; }
  .is-fresh .mm-link { gap: 6px; font-size: 12.5px; }
  .mp-icon { width: 46px; height: 46px; }
  .mp-text b { font-size: 19px; letter-spacing: .06em; }
  .mp-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mp-stars { padding: 5px 8px; font-size: 13px; }
  .tab .i { display: none; }
  .tab { padding: 0 8px; }
}
@media (max-width: 600px) {
  .wordmark { flex-direction: column; align-items: center; gap: 0; font-size: 21vw; line-height: .88; }
  .title-trail { width: 86vw; }
  .title-sub { letter-spacing: .36em; gap: 12px; }
  .tf-inputs + span { font-size: 11px; }
}

/* Touch devices have no keyboard: hide the key hints */
body.touch .ui-layer :is(.btn, .pv) kbd, body.touch .bf-hint kbd { display: none; }
@media (pointer: coarse) and (hover: none) { .ui-layer :is(.btn, .pv) kbd { display: none; } }
/* Fingers: every target at least 44 px */
.btn-back { flex: none; }
@media (pointer: coarse) {
  .seg { min-height: 44px; }
  .icon-only .seg, .opt-swatches .seg { min-width: 44px; }
  .btn-back { min-width: 44px; height: 44px; }
  .btn-icon { width: 44px; height: 44px; }
  .tab { min-height: 44px; }
  .btn-sm { height: 44px; }
  .mm-links .mm-link { min-height: 44px; }
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .screen, .rise, .card-row.is-in .ch-card, .rows.is-in > *, .help-content.is-in > *, .hangar-detail > *, .toast, .modal, .modal-backdrop { animation: fade .2s ease both !important; }
  @keyframes fade { from { opacity: 0; } }
  .wm-b, .mm-play::after, .tp-text, .tp-glow, .rating i.on, .is-s1 .rm-rays, .new-dot { animation: none !important; }
  .title-trail path { animation: none; stroke-dashoffset: 0; }
  .rm-art, .rm-glow, .rm-rays, .res-medal-name, .res-sub, .res-pb, .res-right > .glass, .unlock-card { opacity: 1 !important; transform: none !important; animation: none !important; }
  .mt-fill { transform: none; animation: none !important; }
  .rb-bar i { transform: scaleX(var(--p)); animation: none !important; }
  .ch-card, .mm-play, .mm-card, .mm-tile, .pv, .btn { transition: none; }
  .ch-card:hover, .ch-card:focus, .mm-play:hover, .mm-card:hover, .mm-tile:hover, .pv:hover { transform: none; }
}
