/* ===============================================================
   Sky Hub ATC — styles
   =============================================================== */
:root {
  --bg1: #0f3b63; --bg2: #08131f; --panel: #fff; --panel-ink: #1f2933; --accent: #0a84ff; --accent2: #ffd166; --muted: #6b7280;
  --font-head: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font-body); color: var(--panel-ink); overflow: hidden;
  background: linear-gradient(160deg, #06101c, #0f3b63 55%, #1c7c9c) fixed, #06101c;
}
.screen { position: fixed; inset: 0; display: none; overflow: auto; }
/* size screens to the visible area so iPhone Safari's toolbar never covers the bottom */
@supports (height: 100dvh) { .screen { bottom: auto; height: 100dvh; } }
.screen.active { display: flex; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
kbd { font: 800 11px var(--font-body); background: rgba(0,0,0,.1); border: 1px solid rgba(0,0,0,.15); border-radius: 5px; padding: 1px 6px; }
code { background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 4px; }

/* ---------- buttons & inputs ---------- */
.btn {
  font: 800 15px var(--font-body); border: 0; border-radius: 12px; padding: 10px 16px; cursor: pointer;
  background: #fff; color: #1f2933; box-shadow: 0 3px 0 rgba(0,0,0,.22), 0 6px 16px rgba(0,0,0,.12);
  transition: transform .12s, filter .12s, box-shadow .12s; display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.22); }
.btn:focus-visible { outline: 3px solid var(--accent2); outline-offset: 2px; }
.btn.primary { background: linear-gradient(180deg, #4fb0ff, var(--accent)); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.btn.good { background: linear-gradient(180deg, #4ade80, #16a34a); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.btn.danger { background: linear-gradient(180deg, #ef4444, #b91c1c); color: #fff; }
.btn.ghost { background: transparent; color: inherit; box-shadow: none; border: 1.5px solid currentColor; opacity: .85; }
.btn.big { font-size: 19px; padding: 14px 26px; border-radius: 16px; }
.btn.sm { font-size: 13px; padding: 6px 10px; border-radius: 9px; box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn.ghost.sm { box-shadow: none; }
input[type=text], input[type=number], select, textarea {
  font: 700 14px var(--font-body); padding: 7px 10px; border-radius: 9px; border: 1.5px solid rgba(0,0,0,.18); background: #fff; color: #1f2933; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=color] { width: 46px; height: 34px; padding: 2px; border: 1.5px solid rgba(0,0,0,.2); border-radius: 8px; background: #fff; cursor: pointer; }
input[type=range] { accent-color: var(--accent); width: 160px; }
.switch { position: relative; display: inline-block; width: 48px; height: 27px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #c3c9cf; border-radius: 27px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 21px; height: 21px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(21px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent2); outline-offset: 2px; }
.chip { border: 0; padding: 7px 14px; border-radius: 20px; background: rgba(0,0,0,.07); color: inherit; font: 800 14px var(--font-body); cursor: pointer; }
.chip.on { background: var(--accent); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; padding: 6px 10px; background: rgba(0,0,0,.05); border-radius: 12px; cursor: pointer; }

/* ---------- modals ---------- */
#modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.modal-back { position: fixed; inset: 0; background: rgba(25,5,15,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; pointer-events: auto; animation: fadein .2s; }
.modal-back.closing { animation: fadeout .16s forwards; }
.modal { background: var(--panel); color: var(--panel-ink); border-radius: 22px; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.5); animation: pop .3s cubic-bezier(.2, 1.4, .4, 1); overflow: hidden; }
.modal.wide { max-width: min(760px, 100%); }
.modal-head { display: flex; align-items: center; padding: 16px 20px 0; gap: 10px; }
.modal-head h2 { flex: 1; margin: 0; font: 600 23px var(--font-head); }
.modal-head .x { border: 0; background: rgba(0,0,0,.06); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; }
.modal-body { padding: 14px 20px; overflow: auto; }
.modal-body p { margin: 0 0 10px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 20px 18px; flex-wrap: wrap; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.pause-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 12px; }
.pause-stats div { background: rgba(0,0,0,.05); border-radius: 12px; padding: 8px 10px; text-align: center; }
.pause-stats b { display: block; font: 600 20px var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pause-stats small { color: var(--muted); font-weight: 800; font-size: 11.5px; }
.pause-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- toasts, confetti, loading ---------- */
#toasts { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 60; pointer-events: none; align-items: center; width: max-content; max-width: 92vw; }
.toast { background: rgba(17,12,34,.92); color: #fff; padding: 9px 18px; border-radius: 30px; font-weight: 800; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35); border-left: 5px solid var(--tc, var(--accent)); animation: pop .35s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .4s, transform .4s; text-align: center; }
.toast.out { opacity: 0; transform: translateY(-10px); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
#confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
#loading { position: fixed; inset: 0; z-index: 80; background: rgba(20,8,40,.6); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.spinner { font-size: 54px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: grayscale(.4); }

/* ---------- title ---------- */
#screen-title { align-items: center; justify-content: center; color: #fff; text-align: center; padding: 20px; }
#title-cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.title-wrap { position: relative; z-index: 1; background: rgba(6,18,32,.55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); border-radius: 28px; padding: 26px 30px 22px; max-width: 700px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.title-logo { font-size: clamp(40px, 8vw, 64px); line-height: 1; animation: bob 1.6s ease-in-out infinite; display: inline-block; filter: drop-shadow(0 8px 14px rgba(0,0,0,.35)); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
#title-name {
  font: 700 clamp(44px, 10vw, 86px)/1 var(--font-head); margin: 8px 0 6px;
  background: linear-gradient(90deg, #ffe066, #7ce0ff 45%, #4fb0ff 75%, #b388ff); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,.35));
}
.title-sub { font-size: clamp(15px, 2.4vw, 20px); font-weight: 800; margin: 0 0 22px; text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.title-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.title-foot { margin: 18px 0 0; font-size: 13px; opacity: .8; font-weight: 700; }
.title-stats { position: fixed; z-index: 2; top: max(12px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); display: flex; gap: 8px; color: #fff; }
.title-stats span { background: rgba(0,0,0,.45); border-radius: 20px; padding: 6px 12px; font-weight: 900; font-size: 14px; backdrop-filter: blur(4px); }

/* ---------- shared menu layout ---------- */
#screen-levels, #screen-setup { flex-direction: column; color: #fff; }
.setup-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px 10px; flex-wrap: wrap; }
.setup-head h2 { flex: 1; margin: 0; font: 600 28px var(--font-head); white-space: nowrap; }
.setup-head .btn.ghost { color: #fff; }
.tabs { display: flex; gap: 6px; padding: 0 20px; flex-wrap: wrap; }
.tabs button { font: 800 15px var(--font-body); border: 0; padding: 10px 18px; border-radius: 14px 14px 0 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.tabs button:hover { background: rgba(255,255,255,.24); }
.tabs button.active { background: var(--panel); color: var(--panel-ink); }
.tab-body { flex: 1 0 auto; margin: 0 20px 20px; background: var(--panel); color: var(--panel-ink); border-radius: 0 18px 18px 18px; padding: 22px 26px; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.form { column-width: 420px; column-gap: 48px; }
.fsec { font: 600 19px var(--font-head); margin: 18px 0 4px; break-after: avoid; color: var(--accent); }
.fsec:first-child { margin-top: 0; }
.frow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid rgba(127,127,127,.18); break-inside: avoid; }
.frow > label { font-weight: 800; }
.frow > label small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.fin { display: flex; align-items: center; gap: 8px; flex: none; }
.fin output { min-width: 48px; text-align: right; font-weight: 800; font-size: 13px; }
.fin select { max-width: 260px; }
.ff { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 800; color: var(--muted); }
.lv-car { display: flex; align-items: center; gap: 8px; border: 2px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: #fff; border-radius: 14px; padding: 3px 12px 3px 4px; cursor: pointer; font: 800 15px var(--font-body); text-align: left; }
.lv-car:hover { background: rgba(255,255,255,.22); }
.lv-car canvas { width: 76px; height: 40px; }
.lv-car small { display: block; font-size: 11px; opacity: .75; }

/* ---------- car park map ---------- */
.lv-sum { margin: 0 0 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.world-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.world { border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.14); border: 1px solid rgba(0,0,0,.06); display: flex; flex-direction: column; }
.w-art { display: flex; gap: 12px; align-items: center; padding: 14px 16px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.4); }
.w-art h3 { margin: 0; font: 600 22px var(--font-head); }
.w-art p { margin: 2px 0 0; font-weight: 700; font-size: 13px; opacity: .95; }
.w-icon { font-size: 42px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.3)); }
.w-store .w-art { background: linear-gradient(135deg, #43aa8b, #277da1); }
.w-street .w-art { background: linear-gradient(135deg, #f8961e, #c75146); }
.w-pit .w-art { background: linear-gradient(135deg, #3d405b, #14141f); }
.w-tower .w-art { background: linear-gradient(135deg, #577590, #2b2d42); }
.w-roof .w-art { background: linear-gradient(135deg, #8ecae6, #3a6ea5); }
.w-air .w-art { background: linear-gradient(135deg, #4cc9f0, #4361ee); }
.w-round .w-art { background: linear-gradient(135deg, #90be6d, #43aa8b 50%, #f9c74f); }
.w-helix .w-art { background: conic-gradient(from 30deg at 30% 50%, #4361ee, #4cc9f0, #3a0ca3, #4361ee); }
.w-columns .w-art { background: repeating-linear-gradient(90deg, #4a4e57 0 34px, #6c7079 34px 44px); }
.w-lift .w-art { background: linear-gradient(180deg, #b08968 0 45%, #2b2d42 45%); }
.chal { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff4e5; border: 2px solid #ffb347; border-radius: 12px; padding: 4px 6px 4px 12px; }
.pill.hot { background: #e8431f; }
.w-hell .w-art { background: radial-gradient(circle at 30% 120%, #ffb703, #e85d04 30%, #9d0208 60%, #370617); }
.w-levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 12px; }
.lvl { border: 0; border-radius: 12px; background: #f3f4f6; cursor: pointer; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 800 12px var(--font-body); color: #374151; min-width: 0; transition: transform .12s, background .12s; }
.lvl:hover:not(:disabled) { transform: translateY(-2px); background: #ffe8e0; }
.lvl b { font: 700 22px var(--font-head); color: var(--accent); }
.lvl.done b { color: #16a34a; }
.lvl .lv-n { font-size: 10.5px; line-height: 1.15; text-align: center; min-height: 24px; overflow: hidden; }
.lvl small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.lvl.lk { opacity: .45; cursor: not-allowed; }
.lvl.lk b::after { content: '🔒'; font-size: 13px; margin-left: 2px; }
.world.locked { filter: grayscale(.7); opacity: .75; }
.w-foot { padding: 0 14px 12px; font-weight: 900; font-size: 13px; color: #4b5563; }
.stars { font-size: 14px; letter-spacing: 1px; }
.stars span, .done-stars span { color: #d1d5db; }
.stars span.got, .done-stars span.got { color: #ffc107; text-shadow: 0 0 6px rgba(255,200,0,.6); }
.mode-card { display: flex; gap: 22px; align-items: flex-start; max-width: 760px; }
.mode-card h3 { font: 600 28px var(--font-head); margin: 0 0 8px; color: var(--accent); }
.mode-card p { font-weight: 700; line-height: 1.5; color: #374151; }
.mode-ico { font-size: 72px; line-height: 1; filter: drop-shadow(0 6px 8px rgba(0,0,0,.2)); }
.big-stat { font-size: 17px; }
.lv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.lv-chips b { font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 20px; background: #f1f1f4; color: #374151; }
.rnd { max-width: 780px; }
.rnd > p { margin-top: 0; }
.rrow { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(127,127,127,.15); }
.rrow > b { font-weight: 900; }
.rrow select { max-width: 300px; }
.togs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.seed { display: flex; gap: 8px; align-items: center; }
.seed input { width: 120px; }
.rbtns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; align-items: center; }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.trophy { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; background: rgba(0,0,0,.04); opacity: .5; filter: grayscale(1); }
.trophy.got { opacity: 1; filter: none; background: #fff7d6; }
.trophy > span { font-size: 28px; }
.trophy small { display: block; color: var(--muted); font-weight: 700; }

/* ---------- garage ---------- */
.car-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.car-card { border-radius: 20px; border: 3px solid transparent; background: rgba(0,0,0,.04); overflow: hidden; display: flex; flex-direction: column; }
.car-card.on { border-color: var(--accent); background: #fff4f1; }
.car-stage { position: relative; height: 150px; background: repeating-linear-gradient(90deg, #5d6472 0 30px, #626977 30px 60px); }
.car-stage canvas { width: 100%; height: 100%; display: block; }
.car-card.locked .car-stage canvas { filter: grayscale(.6) brightness(.85); }
.price { position: absolute; right: 10px; top: 10px; background: rgba(0,0,0,.6); color: #ffd60a; font-weight: 900; padding: 4px 10px; border-radius: 20px; }
.car-body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.car-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.car-top h3 { margin: 0; font: 600 22px var(--font-head); }
.car-bio { margin: 0; font-weight: 700; font-size: 14px; color: #4b5563; }
.stats { display: grid; grid-template-columns: 70px 1fr; gap: 4px 10px; align-items: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.sbar { height: 8px; border-radius: 6px; background: #e5e7eb; overflow: hidden; }
.sbar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb347, var(--accent)); border-radius: 6px; }
.car-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.car-colors select, .car-colors input[type=text] { width: 100%; }
.horn-row { display: flex; gap: 6px; }
.horn-row select { flex: 1; min-width: 0; }
.char-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.data-tab section { margin-bottom: 22px; }
.data-tab h3 { font: 600 19px var(--font-head); margin: 0 0 6px; color: var(--accent); }
.data-tab .btn { margin: 4px 4px 4px 0; }
.code-box { display: block; width: 100%; min-height: 110px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }
.tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 800; padding: 6px 10px; background: rgba(0,0,0,.05); border-radius: 12px; cursor: pointer; }

/* ---------- game ---------- */
#screen-game { background: #111; touch-action: none; user-select: none; -webkit-user-select: none; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); pointer-events: none; color: #fff; }
.hud-btn { pointer-events: auto; width: 44px; height: 44px; flex: none; border-radius: 14px; border: 0; background: rgba(0,0,0,.4); color: #fff; font-size: 20px; cursor: pointer; display: grid; place-items: center; position: relative; backdrop-filter: blur(4px); }
.hud-btn:hover { background: rgba(0,0,0,.55); }
.hud-btn small { position: absolute; right: 3px; bottom: 1px; font: 900 12px var(--font-body); }
.hud-mid { flex: 1; min-width: 0; text-align: center; }
.hud-name { font: 600 16px var(--font-head); text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-goal { display: inline-block; font: 800 12.5px var(--font-body); background: rgba(0,0,0,.45); padding: 2px 10px; border-radius: 20px; margin-top: 2px; white-space: nowrap; }
.hud-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.hud-row { display: flex; align-items: center; gap: 6px; }
.hud-time { font: 700 22px var(--font-head); text-shadow: 0 2px 4px rgba(0,0,0,.6); min-width: 52px; text-align: right; }
.hud-time.late { color: #ffb4a8; }
.hud-gear, .hud-floor { font: 900 13px var(--font-body); background: rgba(0,0,0,.5); border-radius: 7px; padding: 2px 7px; }
.hud-floor { background: #ffd60a; color: #222; }
.hud-par { font-size: 11px; font-weight: 800; opacity: .85; text-shadow: 0 1px 2px #000; }
.hud-hp { width: 70px; height: 8px; border-radius: 6px; background: rgba(0,0,0,.45); border: 1.5px solid rgba(255,255,255,.8); overflow: hidden; }
.hud-hp i { display: block; height: 100%; width: 100%; background: #4ade80; transition: width .2s; }
.hud-rush { position: absolute; z-index: 2; left: 50%; top: max(66px, calc(env(safe-area-inset-top) + 56px)); transform: translateX(-50%); background: #16a34a; color: #fff; font: 800 15px var(--font-body); padding: 3px 14px; border-radius: 20px; pointer-events: none; }
#minimap { position: absolute; z-index: 2; right: max(12px, env(safe-area-inset-right)); top: max(64px, calc(env(safe-area-inset-top) + 54px)); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.4); pointer-events: none; opacity: .92; }
.banner { position: absolute; z-index: 3; left: 50%; top: 32%; transform: translate(-50%, -50%) scale(.6); background: rgba(20,6,14,.78); color: #fff; font: 700 24px var(--font-head); padding: 10px 24px; border-radius: 18px; pointer-events: none; opacity: 0; transition: opacity .2s, transform .25s cubic-bezier(.2, 1.4, .4, 1); white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.controls { position: absolute; inset: auto 0 0 0; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); pointer-events: none; }
.steer-area > * { display: none; }
.controls[data-steer=wheel] .wheel { display: block; }
.controls[data-steer=buttons] .steer-btns { display: flex; }
.controls[data-steer=slider] .steer-slide { display: block; }
.wheel { width: clamp(118px, 30vmin, 170px); height: clamp(118px, 30vmin, 170px); border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,.08) 60%, rgba(0,0,0,.2)); pointer-events: auto; touch-action: none; filter: drop-shadow(0 6px 12px rgba(0,0,0,.45)); }
.wheel svg { width: 100%; height: 100%; display: block; }
.steer-btns { gap: 12px; }
.steer-btns button, .pedal, .horn { pointer-events: auto; touch-action: none; border: 0; color: #fff; font: 900 26px var(--font-head); cursor: pointer; -webkit-user-select: none; user-select: none; }
.steer-btns button { width: 78px; height: 78px; border-radius: 22px; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.4); }
.steer-btns button.on { background: rgba(255,90,60,.8); }
.steer-slide { width: clamp(200px, 40vw, 300px); height: 64px; border-radius: 32px; background: rgba(0,0,0,.45); border: 2px solid rgba(255,255,255,.4); position: relative; pointer-events: auto; touch-action: none; }
.steer-slide i { position: absolute; top: 6px; left: 50%; width: 48px; height: 48px; margin-left: -24px; border-radius: 50%; background: #ff5a3c; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
.pedals { display: flex; gap: 12px; align-items: flex-end; }
.pedal { width: clamp(70px, 17vmin, 92px); height: clamp(96px, 26vmin, 128px); border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 5px 0 rgba(0,0,0,.35), 0 10px 20px rgba(0,0,0,.3); transition: transform .06s; }
.pedal small { font: 800 11px var(--font-body); opacity: .9; text-transform: uppercase; letter-spacing: 1px; }
.pedal.gas { background: linear-gradient(180deg, #4ade80, #15803d); }
.pedal.rev { background: linear-gradient(180deg, #fbbf24, #b45309); height: clamp(80px, 21vmin, 104px); }
.pedal.on { transform: translateY(4px) scale(.97); box-shadow: 0 1px 0 rgba(0,0,0,.35); filter: brightness(1.15); }
.horn { position: absolute; right: calc(max(14px, env(safe-area-inset-right)) + clamp(166px, 38vmin, 210px)); bottom: max(18px, env(safe-area-inset-bottom)); width: 48px; height: 48px; border-radius: 50%; background: rgba(0,0,0,.45); font-size: 22px; }

/* ---------- finish dialog ---------- */
.done-modal { text-align: center; }
.done-modal .modal-foot { justify-content: center; }
.done-hero { padding: 14px 0 4px; background: radial-gradient(circle, #e6f4ff, #dff7ef 55%, transparent 72%); border-radius: 16px; }
.done-big { font: 700 36px var(--font-head); background: linear-gradient(90deg, #0a84ff, #00b894, #4fb0ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.done-name { font: 600 20px var(--font-head); margin: 8px 0 !important; }
.done-stars { font-size: 38px; letter-spacing: 8px; }
.done-stars span { display: inline-block; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.done-stars span:nth-child(2) { animation-delay: .22s; }
.done-stars span:nth-child(3) { animation-delay: .44s; }
.acc { display: flex; align-items: center; gap: 8px; margin: 6px auto 10px; max-width: 320px; }
.acc-bar { flex: 1; height: 12px; border-radius: 8px; background: #e5e7eb; overflow: hidden; }
.acc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #facc15, #4ade80); border-radius: 8px; }
.acc b { font: 700 20px var(--font-head); }
.acc small { font-weight: 800; color: var(--muted); }
.goals { display: grid; gap: 4px; text-align: left; max-width: 340px; margin: 0 auto; }
.goal { font-weight: 800; color: #9ca3af; display: flex; gap: 8px; }
.goal.ok { color: #1f2933; }
.done-coins { font: 700 22px var(--font-head); margin: 12px 0 0 !important; }
.pill { display: inline-block; font: 800 12px var(--font-body); background: #16a34a; color: #fff; padding: 3px 10px; border-radius: 20px; vertical-align: middle; }
.howto { display: flex; flex-direction: column; gap: 10px; }
.how-row { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; line-height: 1.45; }
.how-ico { font-size: 26px; width: 36px; flex: none; text-align: center; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .tab-body { margin: 0 8px 12px; padding: 16px 14px; }
  .tabs { padding: 0 8px; }
  .tabs button { padding: 9px 11px; font-size: 13.5px; }
  .setup-head { padding: 10px 12px 8px; }
  .setup-head h2 { font-size: 22px; }
  .form { column-width: auto; }
  .frow { flex-wrap: wrap; }
  .rrow { grid-template-columns: 1fr; gap: 6px; }
  .title-wrap { padding: 18px 16px; }
  .btn.big { font-size: 17px; padding: 12px 20px; }
  .world-grid, .car-grid { grid-template-columns: 1fr; }
  .mode-card { flex-direction: column; gap: 6px; }
  .mode-ico { font-size: 54px; }
  .hud-name { font-size: 14px; }
  .hud-goal { font-size: 11px; }
  .hud-btn { width: 40px; height: 40px; font-size: 18px; }
  #hud-cam { display: none; }
}
@media (max-height: 520px) {
  .title-logo, .title-foot { display: none; }
  #title-name { font-size: 44px; margin-top: 0; }
  .title-sub { margin-bottom: 12px; }
  .title-wrap { padding: 14px 20px; }
  .btn.big { font-size: 16px; padding: 10px 18px; }
  .hud-goal { display: none; }
  #minimap { transform: scale(.8); transform-origin: top right; }
  .banner { font-size: 20px; top: 30%; }
}
@media (orientation: portrait) and (max-width: 640px) {
  #minimap { transform: scale(.75); transform-origin: top right; }
}
@media (prefers-reduced-motion: reduce) { .title-logo, .spinner { animation: none; } }

/* =============== Sky Hub ATC additions =============== */
#screen-airports { flex-direction: column; color: #fff; }
.ap-rank { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border-radius: 14px; padding: 6px 12px; font-weight: 800; font-size: 14px; }
.ap-rank small { opacity: .8; }
.xp-bar { display: inline-block; width: 160px; height: 9px; border-radius: 6px; background: rgba(0,0,0,.25); overflow: hidden; vertical-align: middle; }
.xp-bar.small { width: 90px; }
.xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffd166, #4fb0ff); }
.xp { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 4px; font-weight: 900; }
.xp span { color: #0a84ff; }
.xp .xp-bar { background: #e5e7eb; }
.done-big.bad { background: linear-gradient(90deg, #ef4444, #f97316); -webkit-background-clip: text; background-clip: text; }
.done-why { font-weight: 900; color: #b91c1c; margin: 6px 0 !important; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.apc { border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.14); border: 1px solid rgba(0,0,0,.06); display: flex; flex-direction: column; }
.apc.locked { filter: grayscale(.8); opacity: .7; }
.apc-art { position: relative; display: flex; gap: 12px; align-items: center; padding: 14px 16px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5);
  background: radial-gradient(circle at 85% 20%, hsla(var(--h1), 70%, 55%, .55), transparent 55%), linear-gradient(135deg, hsl(var(--h2), 45%, 22%), #08131f); }
.apc-art h3 { margin: 0; font: 600 22px var(--font-head); }
.apc-art p { margin: 2px 0 0; font-weight: 700; font-size: 13px; opacity: .9; }
.apc-iata { font: 700 30px ui-monospace, Consolas, monospace; letter-spacing: 2px; color: #7ce0ff; }
.apc-flag { position: absolute; right: 14px; top: 10px; font-size: 30px; }
.apc-shifts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; }
.shf { border: 0; border-radius: 12px; background: #f1f5f9; cursor: pointer; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font: 800 12px var(--font-body); color: #334155; }
.shf:hover:not(:disabled) { background: #e0f0ff; transform: translateY(-2px); }
.shf-ic { font-size: 22px; }
.shf b { font-size: 12px; }
.shf small { font-size: 10.5px; color: var(--muted); }
.shf.lk { opacity: .45; cursor: not-allowed; }
.shf.done { background: #e8f8ef; }
.apc-foot { padding: 0 14px 12px; font-weight: 900; font-size: 13px; color: #475569; }
.rush-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 16px; }
.rush { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; text-align: left; gap: 0 8px; border: 0; border-radius: 14px; background: #f1f5f9; padding: 10px 12px; cursor: pointer; font: 800 14px var(--font-body); }
.rush span { grid-row: span 2; font-size: 30px; align-self: center; }
.rush small { color: var(--muted); font-weight: 700; }
.rush:hover:not(:disabled) { background: #e0f0ff; }
.rush.lk { opacity: .5; cursor: not-allowed; }
.spot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.spot { background: #0b1d2e; color: #cfe8ff; border-radius: 14px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.spot canvas { width: 100%; height: 90px; }
.spot b { font-size: 13px; }
.spot small { font-size: 11px; opacity: .75; }
.spot.unseen { opacity: .55; }
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.al { display: grid; grid-template-columns: 30px 1fr; grid-template-rows: auto auto; gap: 0 6px; padding: 6px 10px; border-radius: 12px; background: #f1f5f9; border-left: 5px solid var(--al); }
.al span { grid-row: span 2; font-size: 22px; align-self: center; }
.al small { color: var(--muted); font-weight: 700; font-size: 11.5px; }
.al.unseen { opacity: .45; filter: grayscale(1); }
.accent-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.accent-grid .missing { opacity: .4; }

/* ---------- game ---------- */
#screen-game { background: #08131f; touch-action: none; user-select: none; -webkit-user-select: none; }
#radar { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#screen-game .hud { gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.hud-info { display: flex; flex-direction: column; line-height: 1.1; text-shadow: 0 1px 3px #000; padding: 2px 4px; }
.hud-info b { font: 600 15px var(--font-head); }
.hud-info small { font-size: 11.5px; font-weight: 800; opacity: .85; }
.hud-chip { background: rgba(6,18,32,.72); border: 1px solid rgba(124,224,255,.25); color: #cfe8ff; border-radius: 10px; padding: 5px 9px; font: 800 13px ui-monospace, Consolas, monospace; pointer-events: none; white-space: nowrap; backdrop-filter: blur(4px); }
.hud-chip.score b { font-size: 15px; color: #fff; }
.hud-chip.score small { color: #ffd166; margin-left: 5px; }
.hud-chip.bad { color: #ffb4a8; border-color: rgba(255,80,80,.6); }
.hud-gap { flex: 1; }
.strips { position: absolute; z-index: 2; right: max(10px, env(safe-area-inset-right)); top: 64px; bottom: 12px; width: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; scrollbar-width: thin; }
.strip { display: grid; grid-template-columns: 1fr auto; gap: 0 6px; text-align: left; border: 0; border-left: 6px solid var(--al); border-radius: 8px; background: rgba(8,24,40,.86); color: #cfe8ff; padding: 5px 8px; cursor: pointer; font: 700 12px ui-monospace, Consolas, monospace; }
.strip b { font-size: 13px; color: #62d0ff; }
.strip.dep b { color: #5dff9a; }
.strip.emerg { background: rgba(120,10,10,.85); }
.strip.emerg b { color: #fff; }
.strip span { opacity: .75; }
.strip small { grid-column: span 2; opacity: .85; }
.strip.on { outline: 2px solid #ffd166; }
.strip-empty { color: rgba(207,232,255,.6); font-weight: 800; padding: 8px; }
.radiolog { position: absolute; z-index: 2; left: max(10px, env(safe-area-inset-left)); bottom: 12px; width: min(560px, calc(100% - 270px)); display: flex; flex-direction: column; gap: 3px; }
.rl { background: rgba(6,18,32,.78); color: #e6f1ff; border-radius: 8px; padding: 4px 9px; font: 700 12.5px var(--font-body); line-height: 1.3; animation: fadein .25s; cursor: pointer; }
.rl b { font-family: ui-monospace, Consolas, monospace; margin-right: 4px; }
.rl.atc { background: rgba(10,60,110,.82); }
.rl.atc b { color: #ffd166; }
.rl.emerg { background: rgba(150,15,15,.9); }
.rl:nth-last-child(n+4) { opacity: .55; }
.loglist { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.loglist .rl { cursor: default; color: #e6f1ff; opacity: 1 !important; }
.zoom { position: absolute; z-index: 2; right: 250px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(124,224,255,.3); background: rgba(6,18,32,.75); color: #cfe8ff; font: 800 20px var(--font-body); cursor: pointer; }
.cmd { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: 12px; width: min(560px, calc(100% - 20px)); background: rgba(8,20,34,.95); color: #e6f1ff; border: 1px solid rgba(124,224,255,.35); border-radius: 18px; padding: 10px 12px 8px; box-shadow: 0 16px 40px rgba(0,0,0,.5); backdrop-filter: blur(6px); }
.cmd-head { display: flex; gap: 10px; align-items: flex-start; }
.cmd-pic { width: 56px; height: 56px; flex: none; background: radial-gradient(circle, rgba(124,224,255,.15), transparent 70%); border-radius: 12px; }
.cmd-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cmd-id b { font: 800 18px ui-monospace, Consolas, monospace; color: #ffd166; }
.cmd-id span { font-weight: 800; font-size: 13px; }
.cmd-id small { font-size: 11.5px; opacity: .8; font-weight: 700; }
.cmd-now { color: #7ce0ff; opacity: 1 !important; }
.cmd-rows { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 6px; }
.cmd-row { display: flex; align-items: center; gap: 4px; }
.cmd-row label { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; opacity: .7; width: 58px; }
.cmd-row output { min-width: 70px; text-align: center; font: 800 15px ui-monospace, Consolas, monospace; color: #fff; }
.cb { border: 0; border-radius: 10px; background: #1b3a55; color: #e6f1ff; font: 800 13px var(--font-body); padding: 8px 10px; cursor: pointer; min-width: 40px; touch-action: manipulation; }
.cb:hover { background: #24507a; }
.cb:active { transform: translateY(1px); }
.cb.go { background: #0b6b3a; }
.cb.go.on { background: #16a34a; outline: 2px solid #5dff9a; }
.cb.warn { background: #92400e; }
.cb.wide { flex: 1; font-size: 15px; padding: 11px; }
.cb.x { background: transparent; font-size: 16px; }
.cmd-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.cmd-tip { margin: 6px 0 0; font-size: 11px; opacity: .6; font-weight: 700; }
#screen-game .banner { top: 22%; font-size: 20px; white-space: normal; max-width: 90vw; text-align: center; }

@media (max-width: 900px) {
  .strips { display: none; }
  body.strips-open .strips { display: flex; top: 96px; bottom: auto; max-height: 45vh; }
  .zoom { right: max(10px, env(safe-area-inset-right)); bottom: 96px; }
  .radiolog { width: calc(100% - 70px); bottom: 10px; }
  .rl:nth-last-child(n+3) { display: none; }
  .hud-chip.wide, .hud-chip.clock { display: none; }
  body:has(.cmd:not([hidden])) .radiolog { display: none; }
}
@media (max-width: 520px) {
  .hud-info small { display: none; }
  .hud-chip { font-size: 12px; padding: 4px 7px; }
  .cmd-row label { width: auto; }
  .cmd-rows { gap: 4px 10px; }
  .cb { padding: 7px 8px; }
  .ap-grid { grid-template-columns: 1fr; }
}
@media (max-height: 520px) {
  .cmd { padding: 6px 10px; bottom: 6px; }
  .cmd-pic, .cmd-tip { display: none; }
  .cmd-rows { margin: 4px 0; }
}

@media (max-width: 520px) {
  .cmd { padding: 8px 10px 6px; }
  .cmd [data-h="-30"], .cmd [data-h="30"] { display: none; }
  .cmd-pic { width: 42px; height: 42px; }
  .cmd-tip { display: none; }
  .cmd-id small:not(.cmd-now):not(.cmd-route) { display: none; }
}
#screen-game .rotate-hint { display: none; position: absolute; left: 50%; transform: translateX(-50%); top: 98px; z-index: 1; background: rgba(0,0,0,.55); color: #fff; padding: 5px 12px; border-radius: 20px; font-weight: 800; font-size: 12px; pointer-events: none; white-space: nowrap; }
@media (orientation: portrait) and (max-width: 700px) { #screen-game .rotate-hint { display: block; } }
body:has(.cmd:not([hidden])) #screen-game .rotate-hint { display: none; }

@media (max-height: 520px) and (orientation: landscape) {
  .cmd { left: auto; right: max(8px, env(safe-area-inset-right)); top: 54px; bottom: 8px; transform: none; width: 310px; overflow-y: auto; padding: 8px; }
  .cmd-rows { flex-direction: column; gap: 4px; }
  .cmd-row label { width: 56px; }
  .cmd { overflow-x: hidden; }
  .cmd [data-h="-30"], .cmd [data-h="30"] { display: none; }
  .cmd-id span { font-size: 12px; }
  .cb { padding: 6px 8px; font-size: 12px; }
  body:has(.cmd:not([hidden])) .zoom { right: 330px; }
  .radiolog { width: min(460px, calc(100% - 80px)); }
  body:has(.cmd:not([hidden])) .radiolog { display: none; }
}

/* =============== coach, routes, briefing =============== */
.coach { position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); top: 62px; width: min(520px, calc(100% - 20px)); display: flex; flex-direction: column; gap: 4px; pointer-events: auto; }
.coach[hidden] { display: none; }
.coach-head { align-self: flex-start; display: flex; align-items: center; gap: 6px; background: rgba(255,209,102,.92); color: #3b2a00; font: 900 11px var(--font-body); text-transform: uppercase; letter-spacing: .6px; border-radius: 9px 9px 0 0; padding: 2px 4px 2px 9px; margin-bottom: -4px; }
.coach-x { border: 0; background: rgba(0,0,0,.12); color: inherit; border-radius: 6px; font: 900 12px var(--font-body); padding: 0 6px; cursor: pointer; }
.coach-item { display: flex; align-items: center; gap: 8px; background: rgba(8,20,34,.92); color: #e6f1ff; border: 1px solid rgba(255,209,102,.55); border-left: 5px solid #ffd166; border-radius: 12px; padding: 6px 8px 6px 10px; font: 700 13px/1.3 var(--font-body); box-shadow: 0 8px 20px rgba(0,0,0,.35); cursor: pointer; animation: fadein .25s; }
.coach-item.phi { border-left-color: #ff5d5d; border-color: rgba(255,93,93,.6); }
.coach-item.plo { opacity: .8; border-color: rgba(124,224,255,.25); border-left-color: #62d0ff; }
.coach-item b { color: #ffd166; font-family: ui-monospace, Consolas, monospace; }
.coach-ic { font-size: 18px; flex: none; }
.coach-msg { flex: 1; min-width: 0; }
.coach-item .cb { flex: none; padding: 6px 10px; }
.coach-done { align-self: center; background: rgba(11,107,58,.88); color: #eafff1; border-radius: 10px; padding: 3px 10px; font: 800 12px var(--font-body); animation: fadein .25s; }
.coach-done b { font-family: ui-monospace, Consolas, monospace; }
.hud-btn.off { opacity: .45; }
.cb.go.pulse { animation: cbpulse 1.1s ease-in-out infinite; }
@keyframes cbpulse { 50% { box-shadow: 0 0 0 4px rgba(93,255,154,.45); background: #11804a; } }
.cmd-route { color: #ffd166; opacity: 1 !important; }
.apc-info { position: absolute; right: 12px; bottom: 10px; border: 0; border-radius: 10px; background: rgba(255,255,255,.18); color: #fff; font: 800 12px var(--font-body); padding: 4px 9px; cursor: pointer; text-shadow: none; }
.apc-info:hover { background: rgba(255,255,255,.3); }
.brief-modal { max-width: min(980px, 100%) !important; }
.brief { display: grid; grid-template-columns: minmax(240px, 360px) 1fr; gap: 16px; align-items: start; }
.brief-side { position: sticky; top: 0; }
.brief-map { width: 100%; aspect-ratio: 1; border-radius: 16px; background: #08131f; display: block; }
.brief-legend { font-size: 11.5px; font-weight: 800; color: var(--muted); margin: 6px 0 0 !important; }
.brief-info h4 { margin: 12px 0 4px; font: 600 16px var(--font-head); }
.brief-info h4:first-child { margin-top: 0; }
.brief-goal { font-weight: 900; background: #fff4d6; border-radius: 10px; padding: 6px 10px; }
.brief-job { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; }
.brief-job li { background: #f1f5f9; border-radius: 10px; padding: 6px 10px; }
.brief-rw { width: 100%; border-collapse: collapse; font-size: 13px; }
.brief-rw th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 2px 6px; }
.brief-rw td { padding: 4px 6px; border-top: 1px solid rgba(0,0,0,.08); }
.rr { display: inline-block; border-radius: 8px; padding: 1px 6px; font-size: 11.5px; font-weight: 900; }
.rr.arr { background: #dbeeff; color: #0063b8; }
.rr.dep { background: #ddf7e6; color: #0b8a3d; }
.brief-list { margin: 0; padding-left: 18px; font-size: 13px; }
.brief-list li { margin: 2px 0; }
.brief-list li.on { font-weight: 800; }
.brief-list i { color: var(--muted); }
.brief details { margin: 8px 0; font-size: 13px; }
.brief summary { cursor: pointer; }
@media (max-width: 720px) {
  .brief { grid-template-columns: 1fr; }
  .brief-side { position: static; max-width: 340px; margin: 0 auto; width: 100%; }
}
@media (max-width: 900px) {
  .coach { top: 92px; }
  .coach-item { font-size: 12px; padding: 5px 6px 5px 8px; }
  body:has(.cmd:not([hidden])) .coach-item:nth-child(n+3) { display: none; }
}
@media (max-height: 520px) {
  .coach { top: 52px; width: min(440px, calc(100% - 300px)); left: 10px; transform: none; }
  .coach-item:nth-child(n+3) { display: none; }
}

/* iPhone: text fields under 16px make Safari zoom in and stay zoomed */
@media (pointer: coarse) { input[type=text], input[type=number], select, textarea { font-size: 16px; } }
.tab-body { margin-bottom: max(20px, calc(12px + env(safe-area-inset-bottom))); }
.strip.ovf b { color: #d0a8ff; }

/* airline logos and type icons */
.logo { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-right: 5px; border-radius: 5px; overflow: hidden; vertical-align: -4px; background: var(--al, #345); color: #fff; font: 800 7.5px ui-monospace, Consolas, monospace; box-shadow: 0 0 0 1px rgba(255,255,255,.15); flex: none; }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.logo.lg { width: 30px; height: 30px; border-radius: 8px; font-size: 10px; vertical-align: -9px; margin-right: 7px; }
.al .logo.lg { margin: 0; }
.strip .tic { width: 15px; height: 15px; vertical-align: -3px; margin-right: 3px; opacity: .85; }
.mixal { white-space: nowrap; }

/* tutorial */
.tut { position: absolute; z-index: 4; left: 10px; top: 62px; width: min(380px, calc(100% - 20px)); max-height: calc(100% - 140px); overflow: auto; background: rgba(6,18,32,.94); color: #e6f2ff; border: 1px solid rgba(98,208,255,.35); border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.45); font: 600 13px var(--font-body); }
.tut-head { display: flex; align-items: center; gap: 8px; padding: 9px 10px 9px 12px; cursor: pointer; position: sticky; top: 0; background: rgba(6,18,32,.98); border-radius: 14px 14px 0 0; }
.tut-head span:first-child { flex: 1; font-size: 14px; }
.tut-prog { font: 800 12px ui-monospace, Consolas, monospace; color: #62d0ff; }
.tut .cb { font: 800 12px var(--font-body); border: 0; border-radius: 8px; padding: 6px 9px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; }
.tut .cb:hover { background: rgba(255,255,255,.22); }
.tut-steps { list-style: none; margin: 0; padding: 4px 12px 6px; display: flex; flex-direction: column; gap: 7px; }
.tut-steps li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; line-height: 1.35; }
.tut-steps li.next { opacity: .5; }
.tut-steps li.done { opacity: .7; }
.tut-steps li.now { background: rgba(98,208,255,.1); border-radius: 10px; padding: 6px; margin: 0 -6px; }
.tut-steps small { display: block; opacity: .8; margin-top: 2px; }
.tut-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 800 11px ui-monospace, Consolas, monospace; background: rgba(255,255,255,.12); }
.tut-steps li.now .tut-dot { background: #62d0ff; color: #06223a; }
.tut-steps li.done .tut-dot { background: #22c55e; color: #fff; }
.tut-quiz { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.tut-quiz .cb { text-align: left; white-space: normal; line-height: 1.3; }
.tut-quiz .cb.wrong { background: rgba(239,68,68,.4); }
.tut-real { margin: 2px 12px 8px; background: rgba(255,255,255,.05); border-radius: 10px; padding: 6px 10px; }
.tut-real summary { cursor: pointer; font-weight: 800; }
.tut-real ul { margin: 6px 0 2px; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.tut-foot { display: flex; gap: 6px; padding: 0 12px 10px; flex-wrap: wrap; }
.tut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tut-card { position: relative; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; gap: 0 8px; text-align: left; padding: 10px; border-radius: 12px; border: 1.5px solid rgba(0,0,0,.1); background: #f6f9fc; cursor: pointer; font: inherit; color: inherit; }
.tut-card:hover { border-color: var(--accent); }
.tut-card.done { background: #ecfdf3; border-color: #86efac; }
.tut-ic { grid-row: span 2; font-size: 24px; align-self: center; }
.tut-card small { color: var(--muted); }
.tut-ok { position: absolute; top: 6px; right: 9px; color: #16a34a; font-weight: 900; }
@media (max-width: 900px) { .tut { top: 92px; max-height: 45%; } }
@media (max-height: 520px) { .tut { top: 52px; width: min(330px, 45%); max-height: calc(100% - 70px); } }
.tut { z-index: 6; }
@media (max-height: 520px), (max-width: 600px) {
  .tut { font-size: 12px; max-height: calc(100% - 150px); }
  .tut-steps li.done, .tut-steps li.next ~ li.next, .tut-real { display: none; }
  .tut-steps { padding-top: 0; }
  .tut-foot { padding-bottom: 8px; }
}

.strip .ldg { color: #ffb020; }

/* radio log text hidden until the call ends / a tap */
.rl.hidden-text { cursor: pointer; }
.rl-wait { opacity: .75; font-style: italic; }
.rl-again { opacity: .6; font-weight: 600; }

.hud-closed { color: #ff8a8a; }

/* diversions */
.div-row { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; margin-top: 4px; }
.div-row > small { width: 100%; opacity: .8; font-weight: 700; }
.div-row .cb small { opacity: .7; font-weight: 700; margin-left: 4px; }
.cmd-div { font-weight: 700; font-size: 13px; line-height: 1.35; }
