/* Animations des illustrations des apps (_atelier/illustrations.mjs), communes aux trois maquettes.
   Règle : une animation CSS ne se pose jamais sur un élément qui a un attribut transform (elle le remplacerait).
   .ill-actif : l'illustration est apparue à l'écran (illustrations.js) ; les animations d'entrée partent alors.
   .ill-pause : elle est hors de l'écran ; tout s'arrête. Sans JavaScript, l'état final s'affiche directement. */

.ill { display: block; width: 100%; height: auto; }
.ill text { user-select: none; -webkit-user-select: none; }
.ill.ill-pause, .ill.ill-pause * { animation-play-state: paused !important; }

@keyframes ill-tourne { to { transform: rotate(360deg); } }
@keyframes ill-apparait { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ill-scintille { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes ill-brille { 0%, 100% { opacity: 1; } 50% { opacity: .78; } }
@keyframes ill-clignote { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes ill-flotte { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(7deg); } }
@keyframes ill-onde { from { transform: scale(1); opacity: .8; } to { transform: scale(3.4); opacity: 0; } }

.ill-scintille { animation: ill-scintille 3.4s ease-in-out infinite; }
.ill-scintille.s1 { animation-delay: -.9s; animation-duration: 4.1s; }
.ill-scintille.s2 { animation-delay: -1.7s; animation-duration: 2.9s; }
.ill-scintille.s3 { animation-delay: -2.6s; animation-duration: 3.8s; }
.ill-flotte { transform-box: fill-box; transform-origin: center; animation: ill-flotte 5s ease-in-out infinite; }
.ill-flotte.f2 { animation-delay: -1.2s; animation-duration: 6s; }
.ill-flotte.f3 { animation-delay: -2.5s; animation-duration: 4.4s; }
.ill-flotte.f4 { animation-delay: -3.3s; animation-duration: 7s; }

/* WiQ : la boussole cherche la Qibla, s'y arrête, la coche apparaît et le téléphone « vibre » (les ondes). */
.ill-wiq-motif { transform-box: view-box; transform-origin: 240px 240px; animation: ill-tourne 240s linear infinite; }
.ill-wiq-nord { font: 700 22px "Bodoni Moda", Georgia, serif; fill: #f2d27f; }
.ill-wiq-texte { font: 700 15px Manrope, system-ui, sans-serif; fill: #f6e7bd; }
.ill-wiq-halo { transform-box: fill-box; transform-origin: center; opacity: .2; animation: ill-wiq-halo 3s ease-in-out infinite; }
@keyframes ill-wiq-halo { 0%, 100% { transform: scale(1); opacity: .16; } 50% { transform: scale(1.3); opacity: .34; } }
.ill-wiq-aiguille { transform-box: view-box; transform-origin: 240px 240px; transform: rotate(119deg); }
.ill-wiq-ondes circle { transform-box: view-box; transform-origin: 240px 240px; opacity: 0; }
.js .ill-wiq:not(.ill-actif) .ill-wiq-aiguille { transform: rotate(-35deg); }
.js .ill-wiq:not(.ill-actif) .ill-wiq-ok { opacity: 0; }
.ill-actif .ill-wiq-aiguille { animation: ill-wiq-cherche 4.2s cubic-bezier(.3, .1, .3, 1) .2s both, ill-wiq-respire 5s ease-in-out 4.6s infinite; }
@keyframes ill-wiq-cherche {
  0% { transform: rotate(-35deg); } 35% { transform: rotate(152deg); } 52% { transform: rotate(102deg); }
  66% { transform: rotate(127deg); } 78% { transform: rotate(116deg); } 88% { transform: rotate(120.5deg); } 100% { transform: rotate(119deg); }
}
@keyframes ill-wiq-respire { 0%, 100% { transform: rotate(119deg); } 50% { transform: rotate(120.3deg); } }
.ill-actif .ill-wiq-ok { animation: ill-apparait .6s ease-out 4.3s both; }
.ill-actif .ill-wiq-ondes circle { animation: ill-onde 1.8s ease-out 4.3s 2 both; }
.ill-actif .ill-wiq-ondes circle + circle { animation-delay: 4.9s; }

/* Scènes qui se succèdent dans une illustration (JustQuizz, Run Away !) : illustrations.js donne .actif à la scène
   visible, puis .sortie pendant qu'elle s'efface. Sans JavaScript, seule la première scène s'affiche, immobile. */
.js .ill .scene { opacity: 0; transition: opacity .45s ease; }
.js .ill .scene.actif { opacity: 1; }
html:not(.js) .ill .scene ~ .scene { display: none; }

/* JustQuizz : trois modes de jeu à tour de rôle. Dans chaque scène, la carte arrive, puis les réponses, les votes des
   joueurs (--d : leur moment), la bonne réponse ou celle du joueur, les points ou le gage ; le chrono se vide.
   L'état de base est l'état final : c'est celui qu'on voit sans animation. */
.jq-carte, .jq-r, .jq-vote, .jq-points, .jq-gage { transform-box: fill-box; }
.jq-surligne { fill: var(--couleur); fill-opacity: 1; }
.jq-surligne-texte { fill: #2a0d6e; }
.jq-confettis rect { opacity: 0; }
.ill-justquizz :is(.actif, .sortie) .jq-carte { transform-origin: center top; animation: jq-carte .5s cubic-bezier(.2, .9, .3, 1.2) both; }
@keyframes jq-carte { from { opacity: 0; transform: translateY(-16px) scale(.96); } to { opacity: 1; transform: none; } }
.ill-justquizz :is(.actif, .sortie) .jq-r { animation: jq-entre .55s cubic-bezier(.2, .9, .3, 1.3) .35s both; }
.ill-justquizz :is(.actif, .sortie) .jq-r + .jq-r { animation-delay: .5s; }
.ill-justquizz :is(.actif, .sortie) .jq-r + .jq-r + .jq-r { animation-delay: .65s; }
@keyframes jq-entre { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.ill-justquizz :is(.actif, .sortie) .jq-vote { transform-origin: center; animation: jq-pop .45s cubic-bezier(.2, .9, .3, 1.4) var(--d, 0s) both; }
@keyframes jq-pop { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
.ill-justquizz :is(.actif, .sortie) .jq-surligne { animation: jq-surligne .4s ease var(--d, 0s) both; }
@keyframes jq-surligne { from { fill: #ffffff; fill-opacity: .13; } to { fill: var(--couleur); fill-opacity: 1; } }
.ill-justquizz :is(.actif, .sortie) .jq-surligne-texte { animation: jq-texte .4s ease var(--d, 0s) both; }
@keyframes jq-texte { from { fill: #ffffff; } to { fill: #2a0d6e; } }
.ill-justquizz :is(.actif, .sortie) .jq-points { transform-origin: center; animation: jq-points .9s ease var(--d, 0s) both; }
@keyframes jq-points { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 45% { opacity: 1; transform: translateY(-6px) scale(1.2); } 100% { opacity: 1; transform: translateY(-10px) scale(1); } }
.ill-justquizz :is(.actif, .sortie) .jq-confettis rect { animation: jq-confetti 1.6s ease-out var(--d, 0s) both; }
@keyframes jq-confetti {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); } 6% { opacity: 1; }
  60% { opacity: 1; transform: translate(var(--dx), var(--dy)) rotate(200deg); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 30px)) rotate(260deg); }
}
.jq-chrono { transform-box: fill-box; transform-origin: left center; }
.ill-justquizz :is(.actif, .sortie) .jq-chrono { animation: jq-chrono 4.6s linear .6s both; }
@keyframes jq-chrono { from { transform: scaleX(1); } to { transform: scaleX(.06); } }
.ill-justquizz :is(.actif, .sortie) .jq-gage { transform-origin: center bottom; animation: jq-gage .5s cubic-bezier(.2, .9, .3, 1.3) var(--d, 0s) both; }
@keyframes jq-gage { from { opacity: 0; transform: translateY(22px) scale(.9); } to { opacity: 1; transform: none; } }

/* Perla Femina : l'arc du cycle se dessine, le jour du cycle et l'ovulation palpitent, la grosse perle miroite. */
.ill-perle .ill-scintille { animation-name: ill-brille; animation-duration: 4s; }
.ill-perle .ill-pe-ovulation { transform-box: fill-box; transform-origin: center; animation: ill-pe-ovulation 2.6s ease-in-out infinite; }
@keyframes ill-pe-ovulation { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
.ill-pe-jour { transform-box: fill-box; transform-origin: center; animation: ill-pe-jour 2.2s ease-in-out infinite; }
@keyframes ill-pe-jour { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.28); opacity: .4; } }
.ill-pe-reflet { transform-box: view-box; transform-origin: 240px 240px; animation: ill-tourne 14s linear infinite; }
.js .ill-perle:not(.ill-actif) .ill-pe-arc { stroke-dasharray: 0 100; }
.js .ill-perle:not(.ill-actif) .ill-pe-pastille { opacity: 0; }
.ill-actif .ill-pe-arc { animation: ill-pe-arc 2.4s cubic-bezier(.3, .1, .2, 1) .3s both; }
@keyframes ill-pe-arc { from { stroke-dasharray: 0 100; } to { stroke-dasharray: 41 100; } }
.ill-actif .ill-pe-pastille { animation: ill-apparait .7s ease-out 1.8s both; }

/* Astral Lumina : la roue tourne lentement, les aspects se tracent, l'étoile du centre respire. */
.ill-as-roue { transform-box: view-box; transform-origin: 240px 240px; animation: ill-tourne 150s linear infinite; }
.ill-as-signes { font-size: 18px; font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols", "Apple Symbols", "DejaVu Sans", sans-serif; }
.ill-as-aspects > * { stroke-dasharray: 100; animation: ill-as-trace 9s ease-in-out infinite; }
.ill-as-aspects > :nth-child(2) { animation-delay: -3s; }
.ill-as-aspects > :nth-child(3) { animation-delay: -6s; }
@keyframes ill-as-trace { 0% { stroke-dashoffset: 100; opacity: 0; } 12% { opacity: 1; } 45%, 72% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.ill-as-etoile, .ill-as-lueur { transform-box: view-box; transform-origin: 240px 240px; animation: ill-as-pouls 4s ease-in-out infinite; }
@keyframes ill-as-pouls { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }

/* SafetyOwl : ondes autour de l'ancien téléphone, barres du son, alerte « Pleurs détectés ». */
.ill-hw-ondes circle { transform-box: view-box; transform-origin: 125px 250px; opacity: 0; animation: ill-hw-onde 4.5s ease-out infinite; }
.ill-hw-ondes circle:nth-child(2) { animation-delay: 1.5s; }
.ill-hw-ondes circle:nth-child(3) { animation-delay: 3s; }
@keyframes ill-hw-onde { from { transform: scale(.85); opacity: .5; } to { transform: scale(2.3); opacity: 0; } }
.ill-hw-direct { animation: ill-clignote 1.4s ease-in-out infinite; }
.ill-hw-barre { transform-box: fill-box; transform-origin: center bottom; animation: ill-hw-son 1.1s ease-in-out infinite alternate; }
.ill-hw-barre.b1 { animation-delay: -.3s; }
.ill-hw-barre.b2 { animation-delay: -.6s; }
.ill-hw-barre.b3 { animation-delay: -.9s; }
@keyframes ill-hw-son { from { transform: scaleY(.3); } to { transform: scaleY(1); } }
.ill-hw-alerte { transform-box: fill-box; transform-origin: center top; animation: ill-hw-alerte 7s ease infinite; }
@keyframes ill-hw-alerte { 0%, 30% { opacity: 0; transform: translateY(-14px) scale(.96); } 36%, 82% { opacity: 1; transform: none; } 90%, 100% { opacity: 0; transform: translateY(-14px); } }

/* Run Away ! : la zone rétrécit (SMIL), les joueurs bougent (SMIL), les cases passent à l'orange puis au rouge. */
.ill-ra-ping { transform-box: fill-box; transform-origin: center; opacity: .5; animation: ill-ra-ping 2.4s ease-out infinite; }
.ill-ra-chasseur .ill-ra-ping { animation-delay: -1.2s; }
@keyframes ill-ra-ping { from { transform: scale(.5); opacity: .6; } to { transform: scale(2.4); opacity: 0; } }
.ill-ra-case { fill: #ff9f1a; fill-opacity: 0; animation: ill-ra-case 16s linear infinite; }
.ill-ra-case.k1 { animation-delay: -.6s; }
.ill-ra-case.k2 { animation-delay: -1.2s; }
@keyframes ill-ra-case { 0%, 30% { fill: #ff9f1a; fill-opacity: 0; } 34%, 55% { fill: #ff9f1a; fill-opacity: .45; } 58%, 92% { fill: #ff3b3b; fill-opacity: .55; } 97%, 100% { fill: #ff3b3b; fill-opacity: 0; } }
.ill-ra-clignote { animation: ill-clignote 1s ease-in-out infinite; }
.ra-clef { transform-box: fill-box; transform-origin: center; animation: ra-clef 2.2s ease-in-out infinite; }
@keyframes ra-clef { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-4px) rotate(8deg); } }
.ra-monstre .ill-ra-ping { animation-duration: 1.6s; }

/* MyJesus : le halo de la paroisse respire, des cœurs montent, la bulle apparaît. */
.ill-mj-halo { transform-box: view-box; transform-origin: 240px 210px; animation: ill-mj-halo 4s ease-in-out infinite; }
@keyframes ill-mj-halo { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
.ill-mj-coeurs path { transform-box: fill-box; transform-origin: center; opacity: 0; animation: ill-mj-coeur 5s ease-in-out infinite; }
.ill-mj-coeurs .c2 { animation-delay: -1.7s; }
.ill-mj-coeurs .c3 { animation-delay: -3.4s; }
@keyframes ill-mj-coeur { 0% { opacity: 0; transform: translateY(14px) scale(.6); } 30%, 60% { opacity: 1; } 100% { opacity: 0; transform: translateY(-36px) scale(1); } }
.js .ill-myjesus:not(.ill-actif) .ill-mj-bulle { opacity: 0; }
.ill-actif .ill-mj-bulle { animation: ill-apparait .7s ease-out .4s both; }

/* Moins d'animations demandé par le téléphone : tout s'affiche dans son état final, immobile. */
@media (prefers-reduced-motion: reduce) {
  .ill, .ill * { animation: none !important; }
  .jq-confettis, .ill-mj-coeurs, .ill-hw-ondes, .ill-wiq-ondes { display: none; }
}
