/* =========================================================
   SKY ISLES — interface
   ========================================================= */
:root {
  --cyan: #7fe9e0;
  --cyan-dim: rgba(127, 233, 224, .45);
  --cyan-line: rgba(127, 233, 224, .22);
  --amber: #ffb15c;
  --danger: #ff5d4e;
  --ink: #eaf7f5;
  --ink-dim: rgba(224, 243, 241, .58);
  --deep: #040d13;
  --glass: rgba(5, 17, 24, .62);
  --glass-2: rgba(6, 20, 28, .82);
  --sans: "Bahnschrift", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  overflow: hidden; background: var(--deep); color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
button { font-family: inherit; color: inherit; }
#app { position: relative; width: 100%; height: 100%; overflow: hidden; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

.vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 42%, rgba(2, 8, 12, .34) 100%),
    linear-gradient(180deg, rgba(2, 8, 12, .25), transparent 18%, transparent 78%, rgba(2, 8, 12, .38));
  mix-blend-mode: multiply;
}
.grain {
  position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* cockpit canopy overlay */
.cockpit-frame {
  position: absolute; inset: 0; z-index: 7; pointer-events: none;
  opacity: 0; transition: opacity .45s ease;
  filter: drop-shadow(0 0 18px rgba(0, 0, 0, .55));
}
body.cockpit .cockpit-frame { opacity: 1; }
.cockpit-frame svg { width: 100%; height: 100%; display: block; }
.cockpit-frame .cf-dark { fill: #050b10; fill-opacity: .86; }
.cockpit-frame .cf-edge {
  fill: none; stroke: var(--cyan); stroke-opacity: .13; stroke-width: 1.3;
}

.screen {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
}
.overlay {
  z-index: 24;
  background: rgba(2, 9, 14, .55);
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
}

/* ============ shared typography ============ */
.brand {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: .06em;
  line-height: .82;
  margin: 0;
  font-size: clamp(46px, 6.4vw, 104px);
  color: #f7fffe;
  text-shadow: 0 0 42px rgba(127, 233, 224, .25);
}
.brand span {
  color: var(--cyan);
  font-weight: 300;
  letter-spacing: .02em;
  margin-left: .1em;
}
.brand.small { font-size: 36px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--cyan);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 9px;
}
.eyebrow .dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--cyan);
  box-shadow: 0 0 9px var(--cyan);
}
.eyebrow.danger { color: var(--danger); }
.eyebrow.danger .dot { background: var(--danger); box-shadow: 0 0 9px var(--danger); }

.btn {
  appearance: none; border: 1px solid var(--cyan-line);
  background: rgba(9, 27, 37, .5);
  color: var(--ink); padding: 13px 21px;
  font-size: 13px; letter-spacing: .09em; text-transform: uppercase;
  border-radius: 3px; cursor: pointer; transition: all .2s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent, rgba(127, 233, 224, .12), transparent);
  transform: translateX(-120%); transition: transform .45s ease;
}
.btn:hover::after { transform: translateX(120%); }
.btn:hover { border-color: var(--cyan-dim); background: rgba(16, 46, 58, .6); }
.btn.primary {
  background: linear-gradient(120deg, rgba(127, 233, 224, .95), rgba(85, 205, 198, .82));
  color: #04161a; font-weight: 700; border-color: transparent;
  box-shadow: 0 6px 30px rgba(127, 233, 224, .18);
}
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 8px 36px rgba(127, 233, 224, .3); }
.btn.ghost { background: rgba(8, 24, 33, .32); }
.btn kbd {
  font-family: var(--mono); font-size: 10px; border: 1px solid currentColor;
  border-radius: 3px; padding: 1px 4px; opacity: .55;
}
.icon-btn {
  background: transparent; border: 1px solid var(--cyan-line); width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; color: var(--ink-dim); font-size: 13px;
  transition: all .2s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--cyan-dim); }

/* ============ loading ============ */
.loading-screen {
  z-index: 40;
  background:
    radial-gradient(circle at 50% 46%, rgba(20, 66, 78, .3), transparent 55%),
    linear-gradient(160deg, #041018, #02090e 70%);
}
.load-inner { text-align: center; width: min(440px, 82vw); }
.logo-mark { color: var(--cyan); opacity: .8; margin-bottom: 20px; animation: spinSlow 14s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.load-inner .brand { font-size: 42px; margin-bottom: 34px; }
.loader {
  height: 2px; background: rgba(127, 233, 224, .12); width: 100%;
  overflow: hidden; position: relative;
}
#load-bar {
  height: 100%; width: 2%; background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan); transition: width .35s ease;
}
#load-label {
  margin-top: 16px; font-family: var(--mono); font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink);
}
.load-hint { margin-top: 8px; font-size: 11px; color: var(--ink-dim); letter-spacing: .04em; }

/* ============ menu ============ */
.menu-screen {
  z-index: 15; align-items: stretch; justify-content: flex-start;
  background:
    linear-gradient(90deg, rgba(3, 12, 18, .95) 0%, rgba(3, 12, 18, .88) 34%, rgba(3, 12, 18, .42) 64%, rgba(3, 12, 18, .12) 100%),
    radial-gradient(ellipse at 78% 48%, transparent 20%, rgba(3, 10, 15, .4) 100%);
  animation: fadeIn .8s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.menu-inner {
  width: 100%; display: grid; grid-template-columns: minmax(0, 640px) 1fr;
  padding: clamp(28px, 5vh, 64px) clamp(24px, 5vw, 88px);
  gap: 30px; position: relative;
}
.menu-main { display: flex; flex-direction: column; justify-content: center; max-width: 660px; }
.menu-main .eyebrow { margin-bottom: 18px; }
.brand.hero { font-size: clamp(58px, 8.4vw, 138px); margin-bottom: 20px; }
.brand.hero span { position: relative; }
.brand.hero span::after {
  content: ''; position: absolute; left: 4%; right: 0; bottom: -.02em; height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent); opacity: .55;
}
.tagline {
  margin: 0 0 clamp(20px, 3.5vh, 36px);
  font-size: clamp(13px, 1.1vw, 16px); line-height: 1.65;
  color: var(--ink-dim); font-weight: 300; letter-spacing: .02em;
}
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.mode-card {
  position: relative; text-align: left; cursor: pointer;
  background: linear-gradient(150deg, rgba(10, 31, 41, .75), rgba(5, 18, 25, .45));
  border: 1px solid var(--cyan-line);
  padding: 19px 18px 16px; border-radius: 4px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .25s, background .25s, transform .25s;
  overflow: hidden; min-height: 178px;
}
.mode-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 10% 0%, rgba(127, 233, 224, .14), transparent 60%);
  opacity: 0; transition: opacity .25s;
}
.mode-card:hover { border-color: var(--cyan-dim); transform: translateY(-3px); background: linear-gradient(150deg, rgba(14, 43, 55, .85), rgba(6, 20, 28, .55)); }
.mode-card:hover::before { opacity: 1; }
.mode-card.alt::before { background: radial-gradient(ellipse at 10% 0%, rgba(255, 177, 92, .13), transparent 60%); }
.mode-card.alt:hover { border-color: rgba(255, 177, 92, .5); }
.mode-card.danger::before { background: radial-gradient(ellipse at 10% 0%, rgba(255, 93, 78, .14), transparent 60%); }
.mode-card.danger:hover { border-color: rgba(255, 93, 78, .55); }
.mode-card.hangar::before { background: radial-gradient(ellipse at 10% 0%, rgba(176, 140, 255, .14), transparent 60%); }
.mode-card.hangar:hover { border-color: rgba(176, 140, 255, .55); }
.mode-icon { color: var(--cyan); opacity: .9; }
.mode-card.alt .mode-icon { color: var(--amber); }
.mode-card.danger .mode-icon { color: var(--danger); }
.mode-card.hangar .mode-icon { color: #b08cff; }
.mode-title { font-size: 19px; letter-spacing: .04em; font-weight: 600; }
.mode-desc { font-size: 11.5px; line-height: 1.5; color: var(--ink-dim); margin-top: 5px; }
.mode-best {
  font-family: var(--mono); font-size: 9px; letter-spacing: .12em;
  color: rgba(224, 243, 241, .38); margin-top: auto;
}
.mode-best b { color: var(--cyan); font-weight: 500; }
.mode-card.alt .mode-best b { color: var(--amber); }
.mode-card.danger .mode-best b { color: var(--danger); }
.mode-card.hangar .mode-best b { color: #b08cff; }
.mode-card.danger .mode-go { border-top-color: rgba(255, 93, 78, .18); }
.mode-card.hangar .mode-go { border-top-color: rgba(176, 140, 255, .18); }
.mode-go {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid rgba(127, 233, 224, .1); padding-top: 10px;
}
.mode-go span { font-size: 16px; transition: transform .25s; }
.mode-card:hover .mode-go span { transform: translateX(4px); }
.menu-actions { display: flex; gap: 10px; margin-bottom: 22px; }
.menu-actions .btn { font-size: 10.5px; padding: 10px 15px; letter-spacing: .1em; }
.menu-foot {
  display: flex; justify-content: space-between; font-family: var(--mono);
  font-size: 8.5px; letter-spacing: .14em; color: rgba(224, 243, 241, .3);
  border-top: 1px solid rgba(127, 233, 224, .08); padding-top: 13px;
}
.menu-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; padding-top: 14px; }
.side-frame {
  position: relative; width: min(280px, 22vw); aspect-ratio: 1;
  margin-top: 8vh; padding: 20px;
  border: 1px solid rgba(127, 233, 224, .16);
  background: rgba(4, 15, 21, .18);
  backdrop-filter: blur(3px);
  display: flex; flex-direction: column; justify-content: center; gap: 13px;
}
.side-corner { position: absolute; width: 13px; height: 13px; border: 1px solid var(--cyan); opacity: .75; }
.side-corner.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.side-corner.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.side-corner.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.side-corner.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.side-stat { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid rgba(127, 233, 224, .1); padding-bottom: 9px; }
.side-stat span { font-family: var(--mono); font-size: 8.5px; letter-spacing: .16em; color: var(--ink-dim); }
.side-stat b { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: .08em; color: var(--ink); }
.side-line { height: 1px; background: linear-gradient(90deg, var(--cyan-dim), transparent); margin: 2px 0 4px; }
.side-coords { font-family: var(--mono); font-size: 8px; line-height: 1.9; letter-spacing: .18em; color: rgba(127, 233, 224, .45); }
.scroll-hint {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .18em; color: rgba(224, 243, 241, .38);
  writing-mode: vertical-rl; position: absolute; right: -18px; bottom: 30px;
}
.scroll-hint span { display: inline-block; margin-top: 12px; color: var(--cyan); }
.menu-credit {
  position: absolute; right: 26px; bottom: 16px; font-family: var(--mono);
  font-size: 8px; letter-spacing: .13em; color: rgba(224, 243, 241, .28);
}

/* ============ HUD ============ */
#hud { position: absolute; inset: 0; z-index: 8; pointer-events: none; font-family: var(--sans); animation: fadeIn .5s ease both; }
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: grid; grid-template-columns: 1fr auto 1fr;
  padding: 17px 24px; gap: 18px; align-items: start;
}
.hud-block { min-width: 150px; }
.hud-block.right { text-align: right; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; }
.hud-label { font-family: var(--mono); font-size: 8px; letter-spacing: .22em; color: rgba(127, 233, 224, .55); margin-bottom: 5px; }
#hud-mode { font-size: 15px; letter-spacing: .12em; font-weight: 600; color: var(--ink); }
.mission-progress { margin-top: 5px; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--ink-dim); }
.mission-progress .sep { color: var(--cyan); margin: 0 5px; }
#hud-score { color: var(--amber); }
.timer { font-family: var(--mono); font-size: 27px; font-weight: 300; letter-spacing: .04em; line-height: 1; color: var(--ink); text-shadow: 0 0 18px rgba(127, 233, 224, .18); }
.best-time { font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; color: var(--ink-dim); margin-top: 4px; }
#minimap {
  width: 148px; height: 148px; margin-top: 13px;
  border: 1px solid var(--cyan-line); border-radius: 50%;
  background: rgba(3, 12, 18, .55);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .35), inset 0 0 30px rgba(0, 40, 50, .4);
}
.compass-wrap { justify-self: center; width: min(430px, 36vw); text-align: center; }
.compass-topline {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 8px; letter-spacing: .18em;
  color: rgba(127, 233, 224, .55); padding: 0 8px;
}
#hud-heading { font-size: 12px; color: var(--ink); letter-spacing: .1em; }
#compass { width: 100%; height: auto; display: block; opacity: .92; }

.hud-bottom {
  position: absolute; bottom: 22px; left: 24px; right: 24px;
  display: flex; justify-content: space-between; align-items: flex-end;
}
.panel {
  background: linear-gradient(150deg, rgba(5, 18, 25, .66), rgba(4, 13, 19, .34));
  border: 1px solid rgba(127, 233, 224, .16);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  border-radius: 3px;
}
.throttle-panel { width: 166px; padding: 13px 14px 11px; }
.bar-row { display: flex; align-items: center; gap: 9px; }
.throttle-track {
  flex: 1; height: 7px; background: rgba(127, 233, 224, .1);
  position: relative; overflow: hidden; border-radius: 1px;
}
#throttle-fill {
  position: absolute; inset: 0 auto 0 0; width: 72%;
  background: linear-gradient(90deg, rgba(127, 233, 224, .5), var(--cyan));
  box-shadow: 0 0 10px rgba(127, 233, 224, .4);
  transition: width .1s linear;
}
#throttle-value { font-family: var(--mono); font-size: 11px; width: 32px; text-align: right; }
.boost-label { margin-top: 12px; display: flex; justify-content: space-between; }
.boost-label span { color: rgba(255, 177, 92, .55); }
.boost-track { height: 4px; background: rgba(255, 177, 92, .12); }
#boost-fill {
  position: absolute; inset: 0 auto 0 0; width: 100%;
  background: linear-gradient(90deg, rgba(255, 177, 92, .6), var(--amber));
  box-shadow: 0 0 10px rgba(255, 177, 92, .4);
  transition: width .08s linear;
}
.throttle-keys { margin-top: 9px; font-family: var(--mono); font-size: 7.5px; letter-spacing: .13em; color: rgba(224, 243, 241, .28); }

.main-panel { display: flex; align-items: center; gap: 15px; padding: 11px 16px 11px 11px; }
#attitude { width: 88px; height: 88px; border-radius: 50%; background: #07131a; box-shadow: inset 0 0 0 1px rgba(127, 233, 224, .22); }
.digits { display: flex; flex-direction: column; min-width: 130px; }
.digit-row { display: flex; align-items: baseline; gap: 5px; line-height: 1; }
.digit-row.alt { margin-top: 5px; }
.digit { font-family: var(--mono); font-size: 31px; font-weight: 300; letter-spacing: -.03em; color: var(--ink); }
.digit-row.alt .digit { color: var(--cyan); font-size: 23px; }
.unit { font-family: var(--mono); font-size: 7.5px; letter-spacing: .12em; color: var(--ink-dim); }
.vs { font-family: var(--mono); font-size: 8.5px; letter-spacing: .1em; color: var(--ink-dim); margin-top: 6px; }
.bank-mark { align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; border-left: 1px solid rgba(127, 233, 224, .12); padding-left: 12px; text-align: right; }
.bank-label { font-family: var(--mono); font-size: 7px; letter-spacing: .16em; color: rgba(127, 233, 224, .45); }
.bank-value { font-family: var(--mono); font-size: 13px; color: var(--ink); margin-top: 3px; }

.hud-center { position: absolute; inset: 0; pointer-events: none; }
.ring-arrow {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--cyan); filter: drop-shadow(0 0 10px rgba(127, 233, 224, .55));
  transition: opacity .15s;
}
.ring-arrow.offscreen .ra-ring { transform: scale(.8); opacity: .7; }
.ring-arrow.offscreen { filter: drop-shadow(0 0 14px rgba(255, 177, 92, .5)); color: var(--amber); }
.ra-ring { line-height: 0; animation: ringPulse 1.6s ease-in-out infinite; }
.ra-ring svg { width: 28px; height: 28px; }
@keyframes ringPulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.1); opacity: .6; } }
.ra-info { text-align: center; }
.ra-info b { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; }
.ra-info span { font-family: var(--mono); font-size: 6.5px; letter-spacing: .18em; opacity: .65; }
.warning {
  position: absolute; left: 50%; top: 63%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 12px; letter-spacing: .24em;
  color: var(--danger); padding: 7px 15px; border: 1px solid rgba(255, 93, 78, .5);
  background: rgba(40, 8, 8, .45); animation: blink .65s steps(2) infinite;
  backdrop-filter: blur(5px); white-space: nowrap;
}
.warning.amber { color: var(--amber); border-color: rgba(255, 177, 92, .5); background: rgba(40, 26, 8, .4); }
.warning.small { font-size: 9px; }
@keyframes blink { 50% { opacity: .35; } }

.hint-bar {
  position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%);
  display: flex; gap: 18px; font-family: var(--mono); font-size: 7px;
  letter-spacing: .08em; color: rgba(224, 243, 241, .32); white-space: nowrap;
}
.hint-bar b { color: rgba(127, 233, 224, .62); font-weight: 400; }

/* ============ toasts ============ */
#toasts {
  position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%);
  z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; width: min(90vw, 520px);
}
.toast {
  background: rgba(4, 17, 24, .72); border: 1px solid var(--cyan-line);
  border-left: 2px solid var(--cyan); padding: 9px 18px;
  backdrop-filter: blur(10px); animation: toastIn .35s cubic-bezier(.2, .8, .3, 1) both;
  min-width: 210px; text-align: left;
}
.toast.out { animation: toastOut .4s ease forwards; }
.toast b { display: block; font-size: 12px; letter-spacing: .09em; font-weight: 600; }
.toast span { display: block; font-family: var(--mono); font-size: 7.5px; letter-spacing: .11em; color: var(--ink-dim); margin-top: 3px; }
.toast.amber { border-left-color: var(--amber); }
.toast.amber b { color: var(--amber); }
.toast.danger { border-left-color: var(--danger); }
.toast.danger b { color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ============ modals ============ */
.modal {
  width: min(520px, 92vw); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(160deg, rgba(7, 22, 30, .94), rgba(3, 12, 18, .92));
  border: 1px solid var(--cyan-line);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(127, 233, 224, .08);
  padding: 28px 30px; position: relative;
  animation: modalIn .38s cubic-bezier(.2, .8, .3, 1) both;
}
.modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.modal-title { font-size: 38px; font-weight: 300; letter-spacing: .16em; margin: 13px 0 17px; }
.modal-title.small { font-size: 27px; margin-bottom: 4px; }
.modal-title.red { color: var(--danger); text-shadow: 0 0 30px rgba(255, 93, 78, .3); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.modal-actions .btn { flex: 1; min-width: 130px; font-size: 11px; }
.pause-stats, .result-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: rgba(127, 233, 224, .1); margin-top: 20px;
}
.pause-stats > div, .result-grid > div {
  background: rgba(4, 15, 21, .8); padding: 13px 12px;
}
.pause-stats span, .result-grid span {
  display: block; font-family: var(--mono); font-size: 7.5px;
  letter-spacing: .16em; color: var(--ink-dim); margin-bottom: 5px;
}
.pause-stats b, .result-grid b { font-family: var(--mono); font-weight: 400; font-size: 13px; }
.pause-modal { width: min(440px, 92vw); }

.crash-modal { width: min(480px, 92vw); text-align: center; }
.crash-modal .eyebrow { justify-content: center; }
.crash-modal p { color: var(--ink-dim); font-size: 13px; line-height: 1.6; }
.crash-signal {
  width: 100%; height: 2px; margin-bottom: 20px;
  background: repeating-linear-gradient(90deg, var(--danger) 0 8px, transparent 8px 18px);
  opacity: .55; animation: signal 1s linear infinite;
}
@keyframes signal { to { background-position: 18px 0; } }

.results-modal { width: min(560px, 94vw); text-align: center; }
.results-modal .eyebrow { justify-content: center; }
.result-time {
  font-family: var(--mono); font-size: clamp(42px, 7vw, 64px); font-weight: 300;
  letter-spacing: -.02em; color: var(--cyan); text-shadow: 0 0 40px rgba(127, 233, 224, .28);
  margin: 10px 0 2px;
}
.result-sub { font-family: var(--mono); font-size: 9px; letter-spacing: .16em; color: var(--amber); }
.result-grid { margin-top: 22px; }

.settings-modal { width: min(620px, 94vw); }
.setting-row {
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
  padding: 14px 0; border-bottom: 1px solid rgba(127, 233, 224, .08);
}
.setting-info b { display: block; font-size: 13px; font-weight: 500; letter-spacing: .02em; }
.setting-info span { display: block; font-size: 10px; color: var(--ink-dim); margin-top: 3px; }
.segmented { display: flex; border: 1px solid rgba(127, 233, 224, .16); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.segmented.wrap { flex-wrap: wrap; border-radius: 3px; }
.segmented.wrap button { border-bottom: 1px solid rgba(127, 233, 224, .1); }
.segmented button {
  background: transparent; border: 0; border-right: 1px solid rgba(127, 233, 224, .1);
  padding: 7px 11px; font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em;
  color: var(--ink-dim); cursor: pointer; transition: all .2s; text-transform: uppercase;
}
.segmented button:last-child { border-right: 0; }
.segmented button:hover { color: var(--ink); background: rgba(127, 233, 224, .06); }
.segmented button.active { background: rgba(127, 233, 224, .16); color: var(--cyan); }
.settings-modal .modal-actions { justify-content: flex-end; }
.settings-modal .modal-actions .btn { flex: 0 1 130px; }

.help-modal { width: min(640px, 94vw); }
.keys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.key-row {
  display: flex; flex-direction: column; gap: 4px; padding: 11px 0;
  border-bottom: 1px solid rgba(127, 233, 224, .07);
}
.key-row > div:last-child { font-size: 10.5px; color: var(--ink-dim); }
.keys { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 8px; color: var(--ink-dim); }
kbd {
  display: inline-block; font-family: var(--mono); font-size: 9px;
  border: 1px solid rgba(127, 233, 224, .28); border-bottom-width: 2px;
  border-radius: 3px; padding: 2px 6px; color: var(--ink); background: rgba(127, 233, 224, .05);
}
.help-tip {
  margin-top: 18px; padding: 13px 15px; font-size: 11px; line-height: 1.6;
  color: var(--ink-dim); background: rgba(127, 233, 224, .04);
  border-left: 2px solid var(--cyan-dim);
}
.help-tip b { color: var(--ink); font-weight: 500; }

/* ============ touch ============ */
#touch { position: absolute; inset: 0; z-index: 12; pointer-events: none; }
.touch-stick {
  position: absolute; left: 26px; bottom: 120px; width: 116px; height: 116px;
  border: 1px solid rgba(127, 233, 224, .25); border-radius: 50%;
  background: rgba(4, 15, 21, .28); pointer-events: auto;
  touch-action: none; backdrop-filter: blur(6px);
}
.touch-knob {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px;
  margin: -23px 0 0 -23px; border-radius: 50%;
  background: rgba(127, 233, 224, .22); border: 1px solid var(--cyan-dim);
  box-shadow: 0 0 22px rgba(127, 233, 224, .2);
}
.touch-buttons { position: absolute; right: 22px; bottom: 118px; display: flex; flex-direction: column; gap: 9px; pointer-events: auto; }
.touch-buttons button, .touch-top button {
  width: 58px; height: 58px; border-radius: 50%;
  border: 1px solid rgba(127, 233, 224, .25);
  background: rgba(5, 18, 25, .42); color: var(--cyan);
  font-family: var(--mono); font-size: 15px; touch-action: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  backdrop-filter: blur(6px);
}
.touch-buttons button span, .touch-top button span { font-size: 6.5px; letter-spacing: .12em; opacity: .65; }
.touch-buttons button.active, .touch-top button.active { background: rgba(127, 233, 224, .2); }
.touch-top { position: absolute; top: 90px; right: 22px; display: flex; gap: 9px; pointer-events: auto; }
.touch-top button { width: 42px; height: 42px; font-size: 11px; }

/* ============ misc ============ */
.reticle {
  position: absolute; left: 50%; top: 50%; width: 104px; height: 104px;
  transform: translate(-50%, -50%); opacity: .22; pointer-events: none;
  display: none; /* убран по просьбе игрока */
}
.reticle span {
  position: absolute; inset: 0; border: 1px solid rgba(127, 233, 224, .5);
  border-radius: 50%; clip-path: polygon(0 0, 100% 0, 100% 32%, 0 32%, 0 68%, 100% 68%, 100% 100%, 0 100%);
}
.reticle i {
  position: absolute; left: 50%; top: 50%; width: 3px; height: 3px;
  margin: -1.5px 0 0 -1.5px; background: var(--cyan);
  border-radius: 50%; box-shadow: 0 0 8px var(--cyan);
}
.reticle.race-reticle { opacity: .3; }
.reticle.combat-reticle { opacity: .55; }
.reticle.combat-reticle span {
  border-color: rgba(255, 93, 78, .55);
  clip-path: none;
}
.reticle.combat-reticle i {
  background: var(--danger); box-shadow: 0 0 10px var(--danger);
  width: 4px; height: 4px; margin: -2px 0 0 -2px;
}
.ra-pointer {
  position: absolute; left: 50%; top: 28px; display: none;
  font-size: 11px; line-height: 1; color: currentColor;
  transform-origin: 50% 50%; pointer-events: none;
}
body.cockpit #hud::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(ellipse at 50% 128%, rgba(3, 9, 13, .97) 0 26%, rgba(3, 9, 13, .55) 42%, transparent 62%),
    linear-gradient(180deg, rgba(2, 8, 12, .42), transparent 18%, transparent 80%, rgba(2, 8, 12, .5));
}
body.cockpit #hud::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: -1;
  box-shadow: inset 0 0 170px rgba(0, 0, 0, .65);
}
body.cockpit .reticle { opacity: .35; }
.fps {
  position: absolute; right: 8px; bottom: 4px; z-index: 50;
  font-family: var(--mono); font-size: 8px; color: rgba(127, 233, 224, .4);
}
#hud-hint { transition: opacity .4s; }

/* ============ responsive ============ */
@media (max-width: 1100px) {
  .menu-inner { grid-template-columns: 1fr; }
  .menu-side { display: none; }
  .menu-screen { background: linear-gradient(90deg, rgba(3, 12, 18, .95), rgba(3, 12, 18, .7)); }
  .mode-grid { max-width: 640px; }
  .compass-wrap { width: 34vw; }
}
@media (max-width: 760px) {
  .hud-top { padding: 10px 12px; grid-template-columns: 1fr auto; }
  .hud-block.mission { min-width: 0; }
  #hud-mode { font-size: 11px; }
  .mission-progress { font-size: 7.5px; }
  .compass-wrap {
    position: absolute; left: 50%; top: 162px; transform: translateX(-50%);
    width: 60vw; padding: 5px 9px 3px; border-radius: 7px;
    background: linear-gradient(180deg, rgba(4, 14, 22, .55), rgba(4, 14, 22, .10));
  }
  .hud-block.right { grid-column: 2; }
  .timer { font-size: 19px; }
  #minimap { width: 92px; height: 92px; margin-top: 7px; }
  .hud-bottom { left: 12px; right: 12px; bottom: 62px; }
  .throttle-panel { width: 122px; padding: 9px 10px; }
  .main-panel { padding: 8px; gap: 9px; }
  #attitude { width: 62px; height: 62px; }
  .digit { font-size: 22px; }
  .digit-row.alt .digit { font-size: 17px; }
  .bank-mark { display: none; }
  .hint-bar { font-size: 6px; gap: 8px; bottom: 5px; }
  .hint-bar span:nth-child(n+5) { display: none; }
  .warning { font-size: 9px; top: 68%; }
  #toasts { bottom: 26%; }
  .menu-main .eyebrow { font-size: 7.5px; }
  .brand.hero { font-size: 17vw; }
  .tagline { font-size: 12px; }
  .mode-grid { grid-template-columns: 1fr; gap: 9px; }
  .mode-card { min-height: 0; padding: 14px; }
  .mode-desc { display: none; }
  .mode-best { margin-top: 2px; }
  .menu-foot { font-size: 7px; gap: 10px; }
  .menu-actions .btn { padding: 8px 11px; font-size: 9px; }
  .modal { padding: 22px 20px; }
  .modal-title { font-size: 28px; }
  .keys-grid { grid-template-columns: 1fr; }
  .setting-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .story-grid { grid-template-columns: 1fr; }
  .menu-credit { display: none; }
  .touch-stick { bottom: 168px; left: 16px; width: 100px; height: 100px; }
  .touch-buttons { bottom: 166px; }
  .touch-top { top: 60px; left: 12px; right: auto; }
}
@media (max-height: 640px) {
  .brand.hero { font-size: 52px; margin-bottom: 10px; }
  .tagline { display: none; }
  .mode-card { min-height: 130px; padding: 13px; }
  .menu-main .eyebrow { margin-bottom: 10px; }
  .menu-actions { margin-bottom: 10px; }
}
@media (pointer: coarse) {
  .hint-bar { display: none; }
}

/* ================= АНГАР (из Fly) ================= */
.hangar-modal { width: min(1180px, 96vw); max-height: 92vh; overflow-y: auto; }
.hangar-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0 16px;
}
.plane-card {
  appearance: none; text-align: left; cursor: pointer;
  position: relative; display: flex; gap: 13px; align-items: flex-start;
  padding: 18px 16px; border-radius: 12px; min-height: 168px;
  background: linear-gradient(150deg, rgba(10, 30, 40, .72), rgba(6, 20, 28, .45));
  border: 1px solid var(--cyan-line); color: var(--ink);
  font-family: inherit; transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.plane-card::before {
  content: ''; position: absolute; inset: 0; border-radius: 10px; pointer-events: none;
  background: radial-gradient(ellipse at 8% 0%, rgba(127, 233, 224, .10), transparent 60%);
  opacity: 0; transition: opacity .18s ease;
}
.plane-card:hover { border-color: var(--cyan-dim); transform: translateY(-2px); }
.plane-card:hover::before { opacity: 1; }
.plane-card.active {
  border-color: var(--cyan); background: linear-gradient(150deg, rgba(16, 52, 64, .8), rgba(6, 20, 28, .6));
  box-shadow: 0 0 22px rgba(127, 233, 224, .12), inset 0 0 18px rgba(127, 233, 224, .05);
}
.plane-card.active .plane-check { opacity: 1; transform: scale(1); }
.plane-icon {
  flex: 0 0 auto; width: 40px; height: 40px; display: grid; place-items: center;
  font-size: 21px; color: var(--cyan);
  border: 1px solid var(--cyan-line); border-radius: 9px; background: rgba(5, 18, 25, .5);
}
.plane-info { min-width: 0; flex: 1; }
.plane-name { font-size: 15.5px; font-weight: 500; letter-spacing: .04em; color: var(--ink); }
.plane-desc {
  font-family: var(--mono); font-size: 9px; letter-spacing: .06em;
  color: rgba(214, 232, 236, .55); margin: 3px 0 8px; line-height: 1.45;
}
.stat-rows { display: grid; gap: 4px; margin-bottom: 7px; }
.stat { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: center; }
.stat span { font-family: var(--mono); font-size: 7.5px; letter-spacing: .14em; color: rgba(233, 240, 242, .45); }
.stat-track { height: 3px; border-radius: 2px; background: rgba(127, 233, 224, .12); overflow: hidden; }
.stat-fill { height: 100%; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan)); border-radius: 2px; }
.plane-phys { font-family: var(--mono); font-size: 8.5px; letter-spacing: .12em; color: var(--amber); opacity: .85; }
.plane-check {
  position: absolute; top: 10px; right: 12px;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; color: #04141c; background: var(--cyan); box-shadow: 0 0 12px var(--cyan);
  opacity: 0; transform: scale(.5); transition: all .18s ease;
}
@media (max-width: 760px) {
  .hangar-grid { grid-template-columns: 1fr; }
}

/* ================= выбор карты в меню ================= */
.map-select {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 18px; flex-wrap: wrap;
}
.map-select-label {
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em;
  color: rgba(224, 243, 241, .5);
}
.map-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.map-chip {
  appearance: none; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 8px; border-radius: 4px;
  background: linear-gradient(150deg, rgba(10, 31, 41, .7), rgba(5, 18, 25, .45));
  border: 1px solid rgba(127, 233, 224, .18); color: var(--ink-dim);
  transition: border-color .2s, background .2s, color .2s, transform .2s;
}
.map-chip:hover { border-color: var(--cyan-dim); transform: translateY(-2px); color: var(--ink); }
.map-chip.active {
  border-color: var(--cyan); color: var(--ink);
  background: linear-gradient(150deg, rgba(16, 52, 64, .85), rgba(6, 20, 28, .55));
  box-shadow: 0 0 16px rgba(127, 233, 224, .14);
}
.map-swatch {
  width: 22px; height: 16px; border-radius: 3px; flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .18);
}
.map-name {
  font-family: var(--mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
}
@media (max-width: 760px) {
  .hangar-grid { grid-template-columns: 1fr 1fr; }
}
