/* ===== Pandi — le garage : une carte à côté de l'avatar, avec un paysage vivant ===== */

/* Coin de l'enfant : sa scène (lui, son décor et ses objets) | boutique */
.child-body { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr); }
.scene-card { position: relative; min-height: 0; border-radius: var(--radius); overflow: hidden; background: #2b2368;
  box-shadow: inset 0 0 0 2px var(--line), 0 calc(var(--u) * 2) calc(var(--u) * 6) rgba(5, 3, 30, .3); animation: page-in .6s cubic-bezier(.3, 1.2, .5, 1) both; }
.scene-card .kid-scene, .buy-scene .kid-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-card .gc-hint { position: absolute; bottom: calc(var(--u) * 1.6); right: calc(var(--u) * 2); z-index: 1; font-size: calc(var(--u) * 3); font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none; animation: hint-blink 2.6s ease-in-out infinite; }
.kid-scene .ks-kid { cursor: pointer; }
.kid-scene .ks-stand { animation: stage-in .9s cubic-bezier(.3, 1.4, .5, 1) both; transform-box: fill-box; transform-origin: 50% 100%; }
.garage-card { position: relative; min-height: 0; border-radius: var(--radius); overflow: hidden;
  box-shadow: inset 0 0 0 2px var(--line), 0 calc(var(--u) * 2) calc(var(--u) * 6) rgba(5, 3, 30, .3); animation: page-in .6s cubic-bezier(.3, 1.2, .5, 1) .1s both; }
.garage-card .garage-scene, .buy-scene .garage-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.garage-card .gc-title { position: absolute; top: calc(var(--u) * 2); left: calc(var(--u) * 2); z-index: 1; padding: calc(var(--u) * .8) calc(var(--u) * 2.6); border-radius: 999px;
  background: rgba(255, 255, 255, .78); color: var(--ink); font-weight: 700; font-size: calc(var(--u) * 3.4); box-shadow: 0 calc(var(--u) * .6) calc(var(--u) * 2) rgba(0, 0, 0, .15); pointer-events: none; }
.garage-card .gc-hint { position: absolute; bottom: calc(var(--u) * 1.6); right: calc(var(--u) * 2); z-index: 1; font-size: calc(var(--u) * 3); font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); pointer-events: none; animation: hint-blink 2.6s ease-in-out infinite; }
@media (orientation: portrait) {
  .child-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 36vh minmax(0, 1fr); }
}

/* Essayage en boutique : l'avatar et son garage côte à côte, sans se chevaucher */
.buy-scene { position: relative; width: calc(var(--u) * 84); height: calc(var(--u) * 50); border-radius: calc(var(--u) * 5); overflow: hidden; }
.buy-scene > .bs-avatar { flex: 0 0 38%; border-radius: calc(var(--u) * 5); overflow: hidden; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--kid), #fff 40%), var(--kid)); }
.buy-scene > .bs-avatar .avatar { width: 100%; height: 100%; }
.buy-scene > .bs-garage { position: relative; flex: 1; border-radius: calc(var(--u) * 5); overflow: hidden; }
.buy-scene > .bs-garage .garage-scene { position: absolute; inset: 0; width: 100%; height: 100%; }
@media (orientation: portrait) { .buy-scene { width: calc(var(--u) * 70); height: calc(var(--u) * 40); } }

/* Décor vivant */
.garage-scene .gs-item { cursor: pointer; outline: none; }
.gs-cloud { animation: gs-cloud 40s linear infinite; }
.gs-cloud.c2 { animation-duration: 56s; animation-delay: -22s; }
.gs-cloud.c3 { animation-duration: 48s; animation-delay: -9s; }
@keyframes gs-cloud { from { transform: translateX(-260px); } to { transform: translateX(420px); } }
.gs-birds { animation: gs-birds 17s linear infinite; }
@keyframes gs-birds { 0% { transform: translate(-160px, 0); } 55% { transform: translate(420px, -34px); } 100% { transform: translate(420px, -34px); } }
.gs-rays { transform-box: view-box; transform-origin: 196px 46px; animation: spin 30s linear infinite; }
.gs-moon { animation: halo 4s ease-in-out infinite; }
.gs-grass path { transform-box: fill-box; transform-origin: 50% 100%; animation: sway 2.4s ease-in-out infinite alternate; }
.gs-empty { cursor: pointer; transform-box: fill-box; transform-origin: 50% 100%; animation: sway 3s ease-in-out infinite alternate; }

/* Arrivées */
.gs-arrive { animation: gs-arrive 1.9s cubic-bezier(.2, .9, .3, 1) both; }
.gs-arrive .wheel { animation-duration: .3s; }
@keyframes gs-arrive { 0% { transform: translateX(-360px); } 72% { transform: translateX(14px); } 86% { transform: translateX(-5px); } 100% { transform: translateX(0); } }
.gs-arrive-sky { animation: gs-arrive-sky 2.2s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes gs-arrive-sky { from { transform: translate(300px, -220px) scale(.4); opacity: 0; } }
.gs-pop { transform-box: fill-box; transform-origin: 50% 100%; animation: gs-pop .9s cubic-bezier(.3, 1.6, .5, 1) .3s both; }
@keyframes gs-pop { from { transform: scale(.2); opacity: 0; } }

/* Numéros au toucher */
.gs-act { transform-box: fill-box; transform-origin: 50% 100%; }
.act-drive { transform-box: view-box; animation: act-drive 2.6s cubic-bezier(.5, 0, .5, 1); }
.act-drive .wheel { animation-duration: .22s; }
@keyframes act-drive { 0% { transform: translateX(0); } 8% { transform: translateX(-12px); } 45% { transform: translateX(400px); } 46% { transform: translateX(-440px); } 100% { transform: translateX(0); } }
.act-launch { transform-box: view-box; animation: act-launch 3.4s cubic-bezier(.45, 0, .4, 1); }
.act-launch .flame { scale: 1 1.9; animation-duration: .06s; }
@keyframes act-launch { 0% { transform: translateY(0); } 10% { transform: translate(2px, 3px); } 14% { transform: translate(-2px, 3px); } 18% { transform: translate(2px, 3px); } 50% { transform: translateY(-460px); } 62% { transform: translateY(-460px); } 100% { transform: translateY(0); } }
.act-fly { transform-box: view-box; animation: act-fly 2.6s ease-in-out; }
.act-fly .propeller, .act-fly .rotor { animation-duration: .05s; }
@keyframes act-fly { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(80px, -26px) rotate(-8deg); } 50% { transform: translate(0, -54px); } 75% { transform: translate(-80px, -26px) rotate(8deg); } }
.act-sail { animation: act-sail 2s ease-in-out; }
@keyframes act-sail { 0%, 100% { transform: rotate(0) translateX(0); } 20% { transform: rotate(-7deg) translateX(12px); } 40% { transform: rotate(6deg) translateX(24px); } 60% { transform: rotate(-5deg) translateX(12px); } 80% { transform: rotate(4deg); } }
.act-gallop { animation: act-gallop 2.4s ease-in-out; }
@keyframes act-gallop {
  0% { transform: translate(0, 0); } 10% { transform: translate(20px, -18px); } 20% { transform: translate(40px, 0); } 30% { transform: translate(60px, -18px); } 40% { transform: translate(80px, 0); }
  45% { transform: translate(80px, 0) scaleX(-1); } 55% { transform: translate(60px, -18px) scaleX(-1); } 65% { transform: translate(40px, 0) scaleX(-1); } 75% { transform: translate(20px, -18px) scaleX(-1); } 85% { transform: translate(0, 0) scaleX(-1); }
  92%, 100% { transform: translate(0, 0) scaleX(1); } }
.act-bounce { animation: act-bounce 1.6s cubic-bezier(.3, 0, .6, 1); }
@keyframes act-bounce { 0%, 100% { transform: translateY(0); } 20% { transform: translateY(-80px); } 40% { transform: translateY(0) scale(1.1, .9); } 55% { transform: translateY(-40px); } 70% { transform: translateY(0); } 82% { transform: translateY(-14px); } 92% { transform: translateY(0); } }
.act-ollie { animation: act-ollie .9s cubic-bezier(.3, 1.2, .5, 1); }
@keyframes act-ollie { 0%, 100% { transform: translateY(0) rotate(0); } 35% { transform: translateY(-40px) rotate(-16deg); } 65% { transform: translateY(-34px) rotate(8deg); } }
.act-shine { animation: act-shine 1.4s ease-in-out; }
@keyframes act-shine { 0%, 100% { transform: scale(1); filter: none; } 40% { transform: scale(1.18); filter: drop-shadow(0 0 8px #FFE27A); } }
.act-strum { animation: act-strum 1.2s ease-in-out; }
@keyframes act-strum { 0%, 100% { transform: rotate(0); } 15%, 45%, 75% { transform: rotate(-6deg); } 30%, 60%, 90% { transform: rotate(6deg); } }
.act-swoop { animation: act-swoop 2s ease-in-out; }
@keyframes act-swoop { 0%, 100% { transform: translate(0, 0) rotate(0); } 30% { transform: translate(60px, -40px) rotate(18deg); } 65% { transform: translate(-30px, -60px) rotate(-16deg); } }
.act-dance { animation: act-dance 1.6s ease-in-out; }
@keyframes act-dance { 0%, 100% { transform: rotate(0) translateY(0); } 20% { transform: rotate(-14deg) translateY(-10px); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-14deg) translateY(-10px); } 80% { transform: rotate(14deg); } }
.act-drum { animation: act-drum 1.3s ease-in-out; }
@keyframes act-drum { 0%, 100% { transform: scale(1); } 10%, 50% { transform: scale(1.1, .92); } 30%, 70% { transform: scale(.96, 1.06); } 85% { transform: scale(1.16); } }
.act-beep { animation: act-drum 1.2s ease-in-out; }
.act-wave .flag { animation-duration: .16s; }
.act-boing { animation: act-boing 1.4s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes act-boing { 0%, 100% { transform: scale(1); } 18% { transform: scale(1.1, .82); } 45% { transform: translateY(-26px) scale(.94, 1.1); } 70% { transform: scale(1.05, .94); } }
.act-crackle .flame { scale: 1.7; animation-duration: .08s; }
.act-bird, .act-splash { animation: act-drum 1.2s ease-in-out; }
.act-star { animation: act-shine 1.8s ease-in-out; }

/* Petits effets des numéros */
.gs-shooting { animation: gs-shoot 1.6s ease-out both; }
@keyframes gs-shoot { from { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } to { transform: translate(170px, 74px); opacity: 0; } }
.gs-splash circle { animation: gs-drop 1s ease-out both; }
@keyframes gs-drop { 0% { transform: translate(0, 0); opacity: 1; } 50% { transform: translate(var(--dx), -44px); opacity: 1; } 100% { transform: translate(calc(var(--dx) * 1.6), 6px); opacity: 0; } }
.gs-bird-out { animation: gs-bird-out 2.2s ease-in both; }
@keyframes gs-bird-out { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(160px, -110px); opacity: 0; } }
.gs-hearts path { animation: gs-heart 1.8s ease-in both; }
@keyframes gs-heart { from { transform: translateY(0) scale(.5); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-70px) scale(1.2); opacity: 0; } }

/* Judaïsme : livres qui s'ouvrent, bougies de Chabbat, clochettes du Sefer Torah */
.bk-cover, .bk-page, .bk-letter, .candle-flame, .candle-glow, .rimon, .chabbat-sparkles { transform-box: fill-box; }
.bk-cover, .bk-page { transform-origin: 0 50%; }
.bk-letter { opacity: 0; }
.act-page .bk-cover { animation: bk-open 2.2s ease-in-out; }
.act-page .bk-page.p0 { animation: bk-flip 1.6s ease-in-out .3s; }
.act-page .bk-page.p1 { animation: bk-flip 1.6s ease-in-out .5s; }
.act-page .bk-page.p2 { animation: bk-flip 1.6s ease-in-out .7s; }
@keyframes bk-open { 0%, 100% { transform: scaleX(1); } 22%, 78% { transform: scaleX(-.92); } }
@keyframes bk-flip { 0%, 10% { transform: scaleX(1); } 45%, 70% { transform: scaleX(-.86); } 100% { transform: scaleX(1); } }
.act-page .bk-letter { animation: bk-letter 1.8s ease-out .4s both; }
@keyframes bk-letter { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), -46px) scale(1.3); } }
/* Objets en image 3D : plus de pièces à animer à part (couverture, pages), c'est l'objet entier qui fait son numéro */
.art-item > .art { transform-box: fill-box; transform-origin: 50% 100%; }
.act-page .art-item > .art { animation: art-hop 1.6s ease-in-out .2s; }
@keyframes art-hop { 0%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-7px) rotate(-7deg); } 42% { transform: translateY(0) rotate(0); } 62% { transform: translateY(-4px) rotate(5deg); } 80% { transform: translateY(0) rotate(0); } }
/* Le livre enchanté en image bat des pages comme des ailes */
.art-flap { transform-box: fill-box; transform-origin: 50% 50%; animation: art-flap .7s ease-in-out infinite alternate; }
@keyframes art-flap { from { transform: scaleX(1); } to { transform: scaleX(.84); } }
.candle-flame { transform-origin: 50% 100%; animation: candle .9s ease-in-out infinite alternate; }
@keyframes candle { 0% { transform: scale(1, 1) rotate(-2deg); } 50% { transform: scale(.92, 1.08) rotate(2deg); } 100% { transform: scale(1.04, .95) rotate(-1deg); } }
.candle-glow { transform-origin: 50% 50%; animation: glow-soft 2.2s ease-in-out infinite; }
@keyframes glow-soft { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.15); } }
.act-light .candle-glow { animation: glow-big 2.4s ease-in-out; }
@keyframes glow-big { 0%, 100% { transform: scale(1); } 40%, 70% { transform: scale(2.6); opacity: 1; } }
.act-light .chabbat-sparkles { transform-origin: 50% 50%; animation: act-shine 2.4s ease-in-out; }
.rimon { transform-origin: 50% 100%; animation: rimon 3s ease-in-out infinite; }
@keyframes rimon { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.act-bells .rimon { animation: rimon-ring .22s ease-in-out 8 alternate; }
@keyframes rimon-ring { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
.act-bells { animation: act-shine 2s ease-in-out; }
