/* Inside the Plane v2 (PL2, 2026-10-30): a realistic 3D airliner over photo backgrounds, with dark glass panels in front.
   Upright phone first. Buttons 48px+ for small hands. Nothing tappable on the very bottom edge while playing. */
:root { --ink: #eef3f8; --ink2: #b7c4d1; --glass: rgba(14, 22, 32, .74); --glass2: rgba(22, 32, 45, .9); --line: rgba(255, 255, 255, .14); --amber: #f2b544; --amber-d: #d8972a; --sky: #6fc3ff; --ok: #58d68d; --bad: #ff8a7a; }
[hidden] { display: none !important; }
html, body.game { margin: 0; height: 100%; overflow: hidden; background: #0f1720; overscroll-behavior: none; }
body.game { color: var(--ink); font-family: var(--body, "Nunito", system-ui, sans-serif); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
body.game button:not(.wnav__music) { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; border: 0; }
.wnav { display: none !important; }

/* ── background photo (two layers for a soft cross-fade) + the 3D canvas */
#bg { position: fixed; inset: 0; overflow: hidden; }
.bgl { position: absolute; inset: -3%; background-size: cover; background-position: center; opacity: 0; transition: opacity .9s ease, filter 1.1s ease, transform 1.4s cubic-bezier(.3, .8, .3, 1); will-change: opacity, transform; }
.bgl.on { opacity: 1; }
body.deep .bgl { filter: blur(3px) saturate(1.05); transform: scale(1.06); }
body.inside-engine .bgl { filter: blur(5px) brightness(.85); transform: scale(1.08); }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#flash { position: fixed; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .95), rgba(220, 235, 255, .7)); opacity: 0; pointer-events: none; transition: opacity .28s ease; }
#flash.on { opacity: 1; }

/* ── top bar */
#hud { position: fixed; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 8px; z-index: 20; pointer-events: none; }
#hud > *, .hud__r > * { pointer-events: auto; }
.hud__r { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pbtn { position: relative; min-width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 18px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--line); color: var(--ink); padding: 0 10px; }
.pbtn svg { width: 24px; height: 24px; }
.pbtn--sm { min-width: 48px; font-size: 14px; }
#tSfx .off { display: none; } #tSfx[aria-pressed="false"] .on { display: none; } #tSfx[aria-pressed="false"] .off { display: inline; }
#tJournal { gap: 6px; grid-auto-flow: column; padding: 0 12px 0 10px; font-weight: 800; }
#tJournal svg { width: 26px; height: 26px; }
#jBadge small { opacity: .7; font-weight: 700; }
#tJournal.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }
.newdot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px #0f1720; }
#crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 14px; padding: 0 6px; height: 40px; box-shadow: inset 0 0 0 1px var(--line); }
#crumbs button { background: none; padding: 6px 6px; border-radius: 10px; font-weight: 800; font-size: 14px; white-space: nowrap; color: var(--ink2); }
#crumbs button:last-child { color: var(--ink); }
#crumbs i { color: var(--ink2); opacity: .6; font-style: normal; }
@media (max-width: 480px) { #crumbs button:not(:last-child) { display: none; } #crumbs i { display: none; } #crumbs button { font-size: 13px; } #tLevel { font-size: 12px; padding: 0 8px; } }

/* ── pins over the 3D scene */
#pins { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
.pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: auto; background: none; padding: 0; display: flex; align-items: center; gap: 6px; transition: opacity .35s; }
.pin__dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #0f1720; background: radial-gradient(circle at 35% 30%, #fff3d0, var(--amber) 60%, var(--amber-d)); box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 4px 14px rgba(0, 0, 0, .35); position: relative; }
.pin__dot::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid rgba(242, 181, 68, .8); animation: ping 2.2s ease-out infinite; }
.pin::after { content: ""; position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; transform: translate(-50%, -50%); }
@keyframes ping { 0% { transform: scale(.7); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.pin__lab { background: var(--glass2); color: var(--ink); font-weight: 800; font-size: 13px; padding: 5px 10px; border-radius: 10px; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--line); }
.pin--sec .pin__dot { width: 40px; height: 40px; font-size: 18px; }
.pin--sec .pin__lab { font-size: 15px; padding: 7px 12px; }
.pin.found .pin__dot { background: radial-gradient(circle at 35% 30%, #e9fff1, var(--ok) 60%, #2f9e62); }
.pin.found .pin__dot::before { animation: none; opacity: 0; }
.pin.dim { opacity: .35; }
.pin.hide { opacity: 0; pointer-events: none; }
.pin.glow .pin__dot { box-shadow: 0 0 0 4px #fff, 0 0 28px 10px rgba(255, 220, 120, .9); animation: glowp .8s ease-in-out infinite alternate; }
@keyframes glowp { to { transform: scale(1.15); } }
.pin.wob { animation: wob .5s ease; }
@keyframes wob { 20% { transform: translate(calc(-50% - 8px), -50%) rotate(-6deg); } 60% { transform: translate(calc(-50% + 8px), -50%) rotate(6deg); } }
.pin.quiz .pin__lab { display: none; }
body.carding .pin:not(.cur) { opacity: 0; pointer-events: none; }
body.carding .pin .pin__lab { display: none; }

/* words that pop up on the engine (suck, squeeze, bang, blow) */
#words { position: fixed; inset: 0; pointer-events: none; z-index: 9; }
.word { position: absolute; transform: translate(-50%, -50%); font-weight: 900; font-size: clamp(22px, 6vw, 40px); color: #fff; letter-spacing: .02em; text-shadow: 0 3px 0 rgba(0, 0, 0, .35), 0 0 22px rgba(0, 0, 0, .5); animation: wordin .5s cubic-bezier(.3, 1.6, .5, 1) both; white-space: nowrap; }
.word small { display: block; font-size: .42em; font-weight: 800; text-align: center; color: var(--ink); opacity: .95; }
.word--suck { color: #8fd3ff; } .word--squeeze { color: #c9e9ff; } .word--bang { color: #ffb347; } .word--blow { color: #ff8a5a; } .word--bypass { color: #8fd3ff; font-size: clamp(16px, 4vw, 24px); }
.word.out { animation: wordout .5s ease both; }
@keyframes wordin { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } }
@keyframes wordout { to { transform: translate(-50%, -80%) scale(.9); opacity: 0; } }

/* the four pushes */
#pushes { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9; overflow: visible; }
#pushes .pa { pointer-events: auto; cursor: pointer; }
#pushes text { font: 900 18px var(--body, Nunito, sans-serif); fill: #fff; paint-order: stroke; stroke: rgba(0, 0, 0, .55); stroke-width: 4px; }

/* ── tools row (section) and the plane-level buttons */
#tools { position: fixed; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; padding: 0 10px; z-index: 12; pointer-events: none; }
#tools button { pointer-events: auto; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 6px 18px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--line); font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
#tools button[aria-pressed="true"] { background: rgba(242, 181, 68, .92); color: #0f1720; }
#tools button.fix { background: linear-gradient(#f6c45e, #e3a02f); color: #0f1720; }
#tools button.fix.done { background: rgba(88, 214, 141, .9); }
#tools button.locked { opacity: .75; }
#tools button .lk { font-size: 13px; }
body.carding #tools { display: none; }
#bar { position: fixed; left: 0; right: 0; bottom: max(16px, env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 10px; padding: 0 12px; z-index: 12; }
body:not(.at-plane) #bar, body.gaming #bar, body.carding #bar { display: none; }
.big { height: 58px; padding: 0 18px; border-radius: 18px; display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 17px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 22px rgba(0, 0, 0, .3), inset 0 0 0 1px var(--line); }
.big svg { width: 26px; height: 26px; }
.big--go { background: linear-gradient(#f6c45e, #e3a02f); color: #0f1720; }

/* ── the card */
#card { position: fixed; z-index: 15; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); max-height: 46vh; overflow: auto; background: var(--glass2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 22px; padding: 14px 16px 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 1px var(--line); }
#card.in { animation: cardin .45s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes cardin { from { transform: translateY(30px); opacity: 0; } }
.card__top { display: flex; align-items: center; gap: 6px; }
.card__k { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--amber); flex: 1; }
.cbtn { width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.cbtn svg { width: 22px; height: 22px; }
#cardName { margin: 2px 0 4px; font-size: clamp(26px, 7vw, 34px); line-height: 1.05; font-weight: 900; }
.card__say { margin: 0 0 8px; font-size: 17px; line-height: 1.35; color: var(--ink); }
.card__big { font-size: 15px; line-height: 1.45; color: var(--ink2); margin: 0 0 10px; }
.card__fact { background: rgba(242, 181, 68, .13); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; box-shadow: inset 0 0 0 1px rgba(242, 181, 68, .35); }
.card__fact b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--amber); margin-bottom: 2px; }
.card__fact span { display: block; font-size: 15px; line-height: 1.4; }
.card__fact small { display: block; margin-top: 4px; font-size: 11.5px; color: var(--ink2); }
body:not(.big-level) .card__big, body:not(.big-level) .card__fact { display: none; }
.card__nav { display: flex; gap: 8px; }
.cnav { height: 48px; min-width: 52px; border-radius: 14px; background: rgba(255, 255, 255, .08); font-size: 28px; line-height: 1; font-weight: 800; }
.cnav--try { flex: 1; font-size: 16px; background: rgba(111, 195, 255, .16); }
@media (orientation: landscape) and (min-width: 700px) { #card { left: auto; right: 14px; top: 76px; bottom: 14px; width: 360px; max-height: none; } }
@media (orientation: landscape) and (max-height: 500px) { #card { left: auto; right: 10px; top: 64px; bottom: 10px; width: 330px; max-height: none; padding: 10px 12px; } #cardName { font-size: 24px; } .card__say { font-size: 15px; } }

/* ── ask panel (take-off game, fix-it) and the choice cards */
#ask { position: fixed; z-index: 14; left: 10px; right: 10px; top: calc(max(10px, env(safe-area-inset-top)) + 58px); display: flex; align-items: center; gap: 10px; background: var(--glass2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 18px; padding: 10px 10px 10px 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4), inset 0 0 0 1px var(--line); max-width: 640px; margin: 0 auto; }
#ask.in { animation: cardin .4s ease both; }
#ask p { margin: 0; flex: 1; font-size: 17px; font-weight: 800; line-height: 1.3; }
#ask > button { width: 44px; height: 44px; flex: none; border-radius: 12px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
#ask svg { width: 22px; height: 22px; }
#askPic { width: 64px; height: 64px; flex: none; border-radius: 12px; background-color: rgba(255, 255, 255, .08); background-repeat: no-repeat; }
#askPic:empty:not([style*="background-image"]) { display: none; }
#ask.right { box-shadow: 0 0 0 3px var(--ok), 0 12px 30px rgba(0, 0, 0, .4); }
#choices { position: fixed; z-index: 14; left: 10px; right: 10px; bottom: max(14px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; max-width: 760px; margin: 0 auto; }
.choice { min-height: 64px; border-radius: 16px; background: var(--glass2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line), 0 8px 20px rgba(0, 0, 0, .3); padding: 8px 12px; display: flex; align-items: center; gap: 10px; text-align: left; font-weight: 800; font-size: 15px; }
.choice i { width: 44px; height: 44px; flex: none; border-radius: 10px; background-color: rgba(255, 255, 255, .08); background-repeat: no-repeat; font-style: normal; display: grid; place-items: center; font-size: 18px; }
.choice small { display: block; font-weight: 700; color: var(--ink2); font-size: 12.5px; }
.choice.done { background: rgba(88, 214, 141, .25); box-shadow: inset 0 0 0 2px var(--ok); }
.choice.done i { background: var(--ok); color: #0f1720; }
.choice.wob { animation: wob2 .5s ease; box-shadow: inset 0 0 0 2px var(--bad); }
.choice.glow { box-shadow: inset 0 0 0 3px var(--amber), 0 0 26px rgba(242, 181, 68, .7); animation: glowc .8s ease-in-out infinite alternate; }
@keyframes wob2 { 20% { transform: translateX(-8px) rotate(-2deg); } 60% { transform: translateX(8px) rotate(2deg); } }
@keyframes glowc { to { transform: scale(1.03); } }

/* ── sheets: level picker, take-off done */
.sheet { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(6, 10, 16, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding: 16px; }
.sheetcard { background: var(--glass2); border-radius: 24px; padding: 20px; max-width: 560px; width: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--line); text-align: center; }
.sheet__k { margin: 0; color: var(--amber); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.sheetcard h2 { margin: 4px 0 10px; font-size: 28px; font-weight: 900; }
.sheet__p { margin: 0 0 14px; color: var(--ink2); font-size: 17px; }
.sheet__row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.sheet__row--2 > * { flex: 1 1 200px; }
.pick { height: 52px; padding: 0 18px; border-radius: 14px; background: rgba(255, 255, 255, .1); font-weight: 800; }
#doneAgain { background: linear-gradient(#f6c45e, #e3a02f); color: #0f1720; }
.lvl { border-radius: 18px; background: rgba(255, 255, 255, .07); padding: 16px; text-align: left; box-shadow: inset 0 0 0 1px var(--line); }
.lvl b { display: block; font-size: 19px; margin-bottom: 4px; }
.lvl span { color: var(--ink2); font-size: 14px; line-height: 1.4; }
.lvl[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--amber); }
.sheet__note { color: var(--ink2); font-size: 12.5px; margin: 12px 0 0; }

/* ── the journal */
#journal { position: fixed; inset: 0; z-index: 28; background: rgba(6, 10, 16, .7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); overflow: auto; padding: max(14px, env(safe-area-inset-top)) 12px 20px; }
.jbook { max-width: 860px; margin: 0 auto; background: var(--glass2); border-radius: 24px; padding: 18px 16px; position: relative; box-shadow: inset 0 0 0 1px var(--line); }
.jclose { position: absolute; right: 10px; top: 10px; width: 48px; height: 48px; border-radius: 14px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.jclose svg { width: 24px; height: 24px; }
.jkick { margin: 0; color: var(--amber); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; }
#jT { margin: 2px 0 8px; font-size: 24px; }
.jbar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-bottom: 12px; }
.jbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), #ffd98a); border-radius: 6px; transition: width .6s; }
.jfix { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.jfix span { font-size: 13px; font-weight: 800; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .07); }
.jfix span.ok { background: rgba(88, 214, 141, .22); color: #bff5d3; }
.jsec { margin: 14px 0 6px; font-size: 15px; font-weight: 900; color: var(--ink2); }
.jgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.jcard { border-radius: 14px; background: rgba(255, 255, 255, .06); padding: 6px 6px 8px; text-align: center; font-size: 12.5px; font-weight: 800; line-height: 1.2; }
.jcard i { display: block; aspect-ratio: 1; border-radius: 10px; margin-bottom: 6px; background-color: rgba(0, 0, 0, .3); background-repeat: no-repeat; }
.jcard--off { color: var(--ink2); }
.jcard--off i { filter: grayscale(1) brightness(.35) blur(1px); }
.jcard.say { animation: bump .5s ease; }
.jcred { color: var(--ink2); font-size: 12px; margin: 16px 0 0; line-height: 1.5; }

/* ── loading, no-WebGL fallback */
#loading { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #0f1720; transition: opacity .6s; }
#loading.gone { opacity: 0; pointer-events: none; }
.ld__in { width: min(420px, 86vw); text-align: center; }
.ld__in img { width: 100%; border-radius: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.ld__in p { font-weight: 900; font-size: 22px; margin: 14px 0 10px; }
.ld__bar { display: block; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.ld__bar b { display: block; height: 100%; width: 10%; background: var(--amber); transition: width .4s; }
#nogl { position: fixed; inset: 0; z-index: 25; overflow: auto; background: #0f1720; padding: 70px 14px 20px; }
.nogl__in { max-width: 760px; margin: 0 auto; }
.nogl__in img { width: 100%; border-radius: 18px; }
.nogl__in h1 { margin: 12px 0 4px; }
#noglList button { display: inline-block; margin: 4px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .08); font-weight: 800; }
.nojs { position: fixed; inset: 0; display: grid; place-items: center; color: #fff; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

@media (orientation: portrait) { .pin:not(.pin--sec) .pin__lab { display: none; } .pin--sec .pin__lab { font-size: 13px; padding: 5px 9px; } .pin--sec .pin__dot { width: 34px; height: 34px; } }
.nogl__back { display: inline-block; margin-bottom: 12px; color: var(--ink); font-weight: 800; text-decoration: none; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.08); }
body.nogl .card__nav { display: none; } body.nogl #card { z-index: 30; }
/* only the dot takes taps: a label never covers another pin */
.pin { gap: 0; }
.pin__lab { position: absolute; left: calc(100% + 6px); top: 50%; transform: translateY(-50%); pointer-events: none; }
.pin::after { pointer-events: auto; }
.jclose { position: sticky; float: right; top: 4px; right: auto; margin: -6px -6px 0 8px; z-index: 3; background: rgba(30, 42, 58, .95); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
