/* Jumbo web3d — HUD in the approved "tile" language of the web demo (game/src/style.css). */
:root {
  --c-blue: #3fa9e8; --c-green: #7cc243; --c-pink: #ec5a9e; --c-orange: #f39a2b; --c-berry: #b5246f;
  --c-teal: #18b3a8; --c-violet: #7a5bd1; --c-yellow: #f7c832; --c-red: #e23b3b;
  --ink: #1b2340; --cream: #fff8ec; --pill: rgba(27, 26, 52, .78);
  --ease-out: cubic-bezier(.23, 1, .32, 1); --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfe0f6; font-family: "Ubuntu", system-ui, sans-serif; color: var(--ink); user-select: none; -webkit-user-select: none; touch-action: none; }
#stage { position: fixed; inset: 0; }
#gl { display: block; width: 100%; height: 100%; outline: none; touch-action: none; }
#ui { position: absolute; inset: 0; pointer-events: none; }
#ui button, #ui .interactive { pointer-events: auto; }
.title { font-family: "Comfortaa", sans-serif; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; }

/* loading */
#boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; z-index: 50;
  background: linear-gradient(180deg, #5e9ef0 0%, #a9cdf6 45%, #e8f1fd 100%); transition: opacity .4s var(--ease-out); }
#boot.gone { opacity: 0; pointer-events: none; }
#boot img { width: min(300px, 60vw); filter: drop-shadow(0 6px 14px rgba(27, 35, 64, .18)); }
#boot .tag { font: 700 clamp(22px, 4vw, 32px) "Comfortaa", sans-serif; color: var(--c-berry); background: var(--cream); padding: 8px 20px; border-radius: 18px; transform: rotate(-2deg); box-shadow: 0 6px 0 rgba(0, 0, 0, .12); }
#boot .bar { width: min(340px, 70vw); height: 14px; border-radius: 99px; background: rgba(27, 35, 64, .16); overflow: hidden; }
#boot .bar i { display: block; height: 100%; width: 100%; transform-origin: left; transform: scaleX(.04); border-radius: inherit; transition: transform .2s var(--ease-out);
  background: linear-gradient(90deg, var(--c-blue), var(--c-green), var(--c-pink), var(--c-orange), var(--c-teal)); }
#boot p { margin: 0; font-weight: 600; font-size: 15px; color: rgba(27, 35, 64, .72); }

/* chips + progress */
.chips { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 16px; background: rgba(255, 255, 255, .92); font-weight: 700; font-size: 19px; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.chip .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; transform: rotate(-6deg); }
.chip.bump { animation: bump .35s var(--ease-pop); }
@keyframes bump { 40% { transform: scale(1.14); } }
.col { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.prog { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(38vw, 360px); height: 10px; border-radius: 99px; background: rgba(27, 35, 64, .25); }
.prog i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); border-radius: inherit; background: var(--c-teal); }
.prog b { position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.prog u { position: absolute; right: -6px; top: -6px; width: 14px; height: 22px; border-radius: 4px; background: var(--c-yellow); }
@media (max-aspect-ratio: 3/4) { .prog { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); width: 60vw; } }

/* toast + hint */
.toast { position: absolute; left: 50%; top: 13%; transform: translate(-50%, 0) scale(.92); opacity: 0; white-space: nowrap; font: 700 clamp(28px, 5vw, 46px) "Comfortaa", sans-serif;
  color: #ffe08a; -webkit-text-stroke: 7px #1e2a55; paint-order: stroke fill; text-shadow: 0 6px 0 rgba(30, 42, 85, .35); transition: opacity .15s, transform .2s var(--ease-out); }
.toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.hint { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 8%); transform: translateX(-50%); background: var(--pill); color: #fff; padding: 12px 20px; border-radius: 18px; font-weight: 700; font-size: 18px; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.hint.on { opacity: 1; }
.skip { position: absolute; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); background: var(--pill); color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 700; font-size: 15px; }
.introtag { position: absolute; left: 16px; top: max(16px, env(safe-area-inset-top)); font: 700 26px "Comfortaa", sans-serif; color: var(--c-berry); background: var(--cream); padding: 8px 18px; border-radius: 16px; transform: rotate(-2deg); box-shadow: 0 5px 0 rgba(0, 0, 0, .12); }

/* cards */
.dim { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 26, 51, .18); }
.dim.title-screen { background: transparent; justify-items: end; padding-right: max(4vw, 16px); }
@media (max-aspect-ratio: 3/4) { .dim.title-screen { justify-items: center; align-items: end; padding: 0 0 6vh; } }
/* results never cover the destination: right side in landscape, bottom sheet in portrait */
.dim.results { background: linear-gradient(90deg, transparent 55%, rgba(18, 26, 51, .22)); justify-items: end; padding-right: max(4vw, 16px); }
@media (max-aspect-ratio: 3/4) { .dim.results { background: linear-gradient(180deg, transparent 50%, rgba(18, 26, 51, .25)); justify-items: center; align-items: end; padding: 0 0 3vh; } .dim.results .card { padding: 18px 20px 16px; } .dim.results .stats { margin-bottom: 10px; } .dim.results .stats div { padding: 4px 10px; } }
.card { background: var(--cream); border-radius: 26px; padding: 26px 24px 22px; width: min(420px, 92vw); text-align: center; box-shadow: 0 14px 0 rgba(0, 0, 0, .1), 0 20px 50px rgba(18, 26, 51, .25); transform-origin: 50% 60%; animation: pop .32s var(--ease-pop) both; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.card h1 { margin: 0 0 4px; font-size: 38px; color: var(--c-berry); }
.card h2 { margin: 0 0 6px; font-size: 30px; color: var(--c-berry); }
.card .sub { margin: 0 0 16px; color: #5a5f78; font-weight: 600; }
.card .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.card .ctl { margin: 16px 0 0; font-size: 14px; color: #5a5f78; font-weight: 600; line-height: 1.45; }
.tile-btn { --bg: var(--c-orange); appearance: none; border: 0; cursor: pointer; color: #fff; font: 700 21px "Comfortaa", sans-serif; min-height: 58px; padding: 0 24px; border-radius: 18px; background: var(--bg);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .22), inset 0 -4px 0 rgba(0, 0, 0, .12), inset 0 3px 0 rgba(255, 255, 255, .28); transform: rotate(var(--tilt, -2deg)); transition: transform .14s var(--ease-out), filter .16s; }
@media (hover: hover) and (pointer: fine) { .tile-btn:hover { filter: brightness(1.06); } }
.tile-btn:active { transform: rotate(var(--tilt, -2deg)) translateY(4px) scale(.97); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); }
.tile-btn:focus-visible { outline: 4px solid #fff; outline-offset: 3px; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 2px 0 10px; }
.stars svg { width: 56px; height: 56px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .15)); }
.stars .on { animation: pop .45s var(--ease-pop) both; }
.score { font: 700 30px "Comfortaa", sans-serif; margin: 0 0 10px; }
.stats { text-align: left; margin: 0 0 16px; }
.stats div { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 10px; font-weight: 600; color: #5a5f78; }
.stats div:nth-child(odd) { background: rgba(0, 0, 0, .04); }
.stats b { color: var(--ink); }
#fs { position: fixed; right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); width: 42px; height: 42px; border: 0; border-radius: 13px; background: rgba(27, 26, 52, .5); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 5; }
#fs:active { transform: scale(.94); }
#perf { position: fixed; left: 8px; bottom: 8px; font: 12px ui-monospace, monospace; color: #1b2340; background: rgba(255, 255, 255, .7); padding: 2px 6px; border-radius: 6px; display: none; }
@media (prefers-reduced-motion: reduce) { .card, .chip.bump, .stars .on { animation: none; } }

/* command buttons (2026-10-08): right thumb = «Άλμα»/«Τούμπα» (big, lowest) + «Κόλπο» above it; left thumb = «Σκύψε» (hold) with
   «Αλεξίπτωτο» above it (only while it can open). Same tile language as the menu; never over the chips / progress / hint. */
.ctrls { position: absolute; inset: 0; pointer-events: none; }
.cbtn { position: absolute; touch-action: none; z-index: 4; min-height: 70px; padding: 0 16px; font-size: 20px; border-radius: 22px; }
.cbtn.fire { animation: trickFire .28s var(--ease-pop); }
@keyframes trickFire { 35% { transform: rotate(var(--tilt)) scale(.9); } }
.jump-btn { --bg: var(--c-blue); --tilt: -2deg; right: max(14px, env(safe-area-inset-right)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px); min-width: 118px; min-height: 84px; font-size: 23px; }
.jump-btn.flip { --bg: var(--c-violet); }
.jump-btn.off { filter: saturate(.35) brightness(.92); opacity: .72; }
.trick-btn { --bg: var(--c-pink); --tilt: 3deg; right: max(14px, env(safe-area-inset-right)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 156px); min-width: 104px; }
.duck-btn { --bg: var(--c-teal); --tilt: 2deg; left: max(14px, env(safe-area-inset-left)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 58px); min-width: 112px; min-height: 84px; }
.duck-btn.held { transform: rotate(var(--tilt)) translateY(4px) scale(.96); box-shadow: 0 2px 0 rgba(0, 0, 0, .22); filter: brightness(1.08); }
.chute-btn { --bg: var(--c-red); --tilt: -3deg; left: max(14px, env(safe-area-inset-left)); bottom: calc(max(14px, env(safe-area-inset-bottom)) + 156px); min-width: 150px; padding-bottom: 10px; animation: chuteIn .3s var(--ease-pop) both; }
.chute-btn span { display: block; }
.chute-btn i { position: absolute; left: 14px; right: 14px; bottom: 9px; height: 7px; border-radius: 9px; background: #fff3c8; transform-origin: left; transform: scaleX(1); }
.chute-btn.open { --bg: #2f86e0; }
@keyframes chuteIn { from { transform: rotate(var(--tilt)) scale(.6); opacity: 0; } }
@media (max-aspect-ratio: 3/4) {   /* portrait phone: above the bottom progress bar, both thumbs */
  .jump-btn, .duck-btn { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 66px); }   /* above the progress bar and the fullscreen button */
  .trick-btn, .chute-btn { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 164px); }
  .hint { bottom: calc(max(14px, env(safe-area-inset-bottom)) + 248px); width: max-content; max-width: calc(100vw - 32px); white-space: normal; text-align: center; }
}
@media (max-height: 460px) and (min-aspect-ratio: 4/3) {   /* landscape phone */
  .cbtn { min-height: 60px; font-size: 18px; } .jump-btn, .duck-btn { bottom: 66px; min-height: 66px; } .trick-btn, .chute-btn { bottom: 144px; }
  .hint { bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { .cbtn.fire, .chute-btn { animation: none; } }
/* pending air combo chip (dashed until banked) */
.chip.pend { background: rgba(255, 255, 255, .8); outline: 3px dashed var(--c-pink); outline-offset: -3px; font-size: 16px; }
.chip.pend.bank { outline-color: var(--c-green); animation: bankFly .9s var(--ease-out) forwards; }
.chip.pend.lost { outline-color: #8a8fa3; color: #8a8fa3; text-decoration: line-through; animation: lostFade .9s ease-in forwards; }
@keyframes bankFly { 0% { transform: scale(1.18); } 60% { transform: translateY(-46px) scale(1); opacity: 1; } 100% { transform: translateY(-58px) scale(.8); opacity: 0; } }
@keyframes lostFade { 0% { transform: translateX(-6px); } 20% { transform: translateX(6px); } 40% { transform: translateX(0); opacity: 1; } 100% { opacity: 0; } }
/* air ring above the rider: green = another flip fits, amber «Ετοιμάσου!» = prepare to land, blue = parachute energy */
.airring { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; pointer-events: none; display: grid; place-items: center; z-index: 3; will-change: transform; }
.airring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.airring circle { fill: rgba(27, 26, 52, .42); stroke-width: 7; }
.airring .bg { stroke: rgba(255, 255, 255, .35); }
.airring .fg { fill: none; stroke: #7cc243; stroke-linecap: round; stroke-dasharray: 100 100; transition: stroke .15s; }
.airring b { position: relative; color: #fff; font: 700 26px "Comfortaa", sans-serif; line-height: 1; }
.airring span { position: absolute; top: 76px; left: 50%; transform: translateX(-50%); white-space: nowrap; font: 700 19px "Comfortaa", sans-serif; color: #fff; -webkit-text-stroke: 5px #1e2a55; paint-order: stroke fill; }
.airring.ready .fg { stroke: #f39a2b; } .airring.ready span { color: #ffd37a; animation: readyPulse .5s ease-in-out infinite alternate; }
.airring.chute .fg, .airring.para .fg { stroke: #3fa9e8; } .airring.para span { color: #bfe4ff; }
@keyframes readyPulse { to { transform: translateX(-50%) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .airring.ready span { animation: none; } }
.reward { position: absolute; left: 50%; top: calc(13% + 64px); transform: translate(-50%, 8px); opacity: 0; white-space: nowrap; padding: 8px 16px; border-radius: 16px; background: var(--c-yellow); color: var(--ink);
  font: 700 clamp(17px, 3vw, 22px) "Comfortaa", sans-serif; box-shadow: 0 5px 0 rgba(0, 0, 0, .16); transition: opacity .18s, transform .25s var(--ease-pop); }
.reward.on { opacity: 1; transform: translate(-50%, 0); }
@media (max-aspect-ratio: 3/4) { .toast { top: 21%; } .reward { top: calc(21% + 62px); } }   /* portrait: below the right chip column (score / chain / pending) */

/* ending video overlay (ending.js): full-stage, fades in over the arrival frame, skip hint bottom-right */
.ending { position: absolute; inset: 0; z-index: 20; background: #0b1020; opacity: 0; transition: opacity .35s var(--ease-out); display: grid; place-items: center; }
.ending.on { opacity: 1; } .ending.out { opacity: 0; pointer-events: none; }
.ending::before { content: ''; position: absolute; inset: -40px; background: var(--poster) center / cover no-repeat; filter: blur(28px) brightness(.55) saturate(1.15); }   /* landscape: the 9:16 clip sits on a blurred copy of itself, not on black bars */
.ending video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }   /* absolute: a grid item with height:100% grew to the clip's intrinsic height and the overflow cropped it to the roof */
@media (min-aspect-ratio: 1/1) { .ending video { object-fit: contain; } }
.ending-skip { position: absolute; right: 68px; bottom: max(16px, env(safe-area-inset-bottom)); background: var(--pill); color: #fff; padding: 12px 18px; border: 0; border-radius: 14px; font: 700 16px Ubuntu, sans-serif; cursor: pointer; }
.ending-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 22px 34px; border: 0; border-radius: 22px; background: var(--c-orange); color: #fff; font: 700 26px Comfortaa, sans-serif; box-shadow: 0 10px 0 #b8661a, 0 18px 40px rgba(0, 0, 0, .35); cursor: pointer; }
.ending-play:active { transform: translate(-50%, calc(-50% + 4px)); box-shadow: 0 6px 0 #b8661a; }
.challenge { margin: 12px 0 0; padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, .04); text-align: center; }
.challenge .cmp { margin: 0 0 10px; font-weight: 700; color: var(--c-berry); }
.challenge .qr { display: grid; place-items: center; margin: 10px 0 0; }
.challenge .msg { font-size: 13px; color: #5a5f78; margin: 6px 0 0; min-height: 1em; }
.challenge-banner { position: absolute; left: 50%; top: max(70px, calc(env(safe-area-inset-top) + 60px)); transform: translateX(-50%); background: var(--cream); color: var(--ink); padding: 8px 16px; border-radius: 14px; font-weight: 700; box-shadow: 0 5px 0 rgba(0, 0, 0, .12); white-space: nowrap; }
.cmp-title { margin: 0 0 14px; padding: 10px 12px; border-radius: 14px; background: #fff1d6; font-weight: 700; color: var(--c-berry); }
.tile-btn.pick { outline: 4px solid var(--c-yellow); outline-offset: 3px; }
.ch-name { width: 100%; margin: 0 0 10px; padding: 10px 12px; border: 2px solid #e6dccb; border-radius: 12px; font: 600 16px "Ubuntu", sans-serif; background: #fff; color: var(--ink); user-select: text; -webkit-user-select: text; }
.ch-link { margin: 8px 0 0; background: none; border: 0; color: var(--c-blue); font: 700 14px "Ubuntu", sans-serif; cursor: pointer; }
