/* Exercices dynamiques (planches validées par Loïc le 16 novembre 2026).
   Six gestes communs : apparaître, compter en direct, boum de réussite, erreur douce, Tomo qui saute, série de 3,
   et des paillettes partout (bulles validées par Loïc le 16/11 au soir).
   Seules scale, translate, rotate et opacity sont animées (contrôle : tests/exercices-dynamiques-20261116.test.mjs).
   Ressort : linear() (Modern Web Guidance « physics-based-easing »), repli cubic-bezier. */
:root{--mtd-spring:cubic-bezier(.34,1.56,.64,1);--mtd-ink:#24384a}
@supports (transition-timing-function:linear(0,1)){:root{--mtd-spring:linear(0,.016 .5%,.06 1%,.226 2%,1.116 5.4%,1.375 6.6%,1.527 7.7%,1.565 8.2%,1.585 8.8%,1.581 9.3%,1.559 9.8%,1.458 10.9%,.937 14.3%,.784 15.5%,.693 16.6%,.67 17.1%,.657 17.7%,.671 18.7%,.729 19.8%,1.042 23.3%,1.13 24.5%,1.182 25.6%,1.201 26.7%,1.192 27.7%,1.156 28.8%,.977 32.2%,.925 33.4%,.894 34.5%,.882 35.6%,.887 36.6%,.907 37.7%,1.045 42.4%,1.069 44.5%,1.059 46.3%,.979 50.9%,.96 53.4%,.966 55.3%,1.013 59.9%,1.024 62.3%,.986 71.2%,1.008 79.9%,.995 88.9%,1)}}

/* ---------- La scène des dessins ---------- */
.mtd-stage{position:relative;margin:0 0 22px;padding:10px;border-radius:24px;background:radial-gradient(80% 70% at 50% 35%,#fffdf8,#f3eefb 70%);border:1px solid #e6e0f2;box-shadow:inset 0 1px 0 #fff}
[data-veilleuse=on] .mtd-stage{background:radial-gradient(80% 70% at 50% 35%,rgb(255 255 255/.16),rgb(255 255 255/.03) 70%);border-color:rgb(255 255 255/.18);box-shadow:none}
.mtd-figure{display:block;width:100%;max-width:660px;height:auto;margin:0 auto;overflow:visible;font-family:"Nunito Sans",Nunito,system-ui,sans-serif}
.mtd-figure text{font-weight:900;fill:var(--mtd-ink)}
.mtd-figure .mtd-plus{font-size:28px}
.mtd-figure .mtd-clock-n{font-size:15px;fill:#3d3a6b}.mtd-figure .mtd-clock-n.big{font-size:20px}
.mtd-floor{fill:#24384a;opacity:.12}[data-veilleuse=on] .mtd-floor{fill:#0b1035;opacity:.28}
.mtd-string{fill:none;stroke:#a9a3c9;stroke-width:2}[data-veilleuse=on] .mtd-string{stroke:#e8e6ff;opacity:.8}
.mtd-count-bg{fill:#fff;stroke:#c9c2e6;stroke-width:2}.mtd-count text{font-size:16px}
.mtd-tap{cursor:pointer}
.mtd-chips{display:flex;flex-wrap:wrap;gap:10px;margin:2px 4px 6px}
.mtd-chips span{font-weight:800;font-size:15px;padding:7px 12px;border-radius:999px;color:var(--mtd-ink);background:#fff;box-shadow:0 2px 0 #d8d2ea}
[data-veilleuse=on] .mtd-chips span{color:var(--mtd-ink);background:linear-gradient(160deg,#fff,#e9e6ff);box-shadow:0 3px 0 rgb(18 24 70/.4)}

/* ---------- Geste 1 : apparaître avec un rebond ---------- */
.mtd-figure :is(.mtd-pop,.mtd-float,.mtd-count,.mtd-slice,.mtd-ring){transform-box:fill-box;transform-origin:center}
@keyframes mtd-pop{from{scale:.15}to{scale:1}}
@keyframes mtd-fade{from{opacity:0}to{opacity:1}}
.mtd-pop{animation:mtd-pop .7s var(--mtd-spring) both,mtd-fade .2s linear both;animation-delay:calc(var(--i,0)*80ms)}
@keyframes mtd-float{50%{translate:0 -6px}}
.mtd-float{animation:mtd-float 3.2s ease-in-out infinite;animation-delay:calc(var(--i,0)*-.45s)}

/* ---------- Geste 2 : compter en direct ---------- */
.mtd-count{animation:mtd-pop .55s var(--mtd-spring) both}
.mtd-tap[data-counted] .mtd-pop{filter:brightness(1.06)}

/* ---------- Geste 3 : boum de réussite ---------- */
.mtd-boom{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none;z-index:2}
.mtd-boom i{position:absolute;left:-9px;top:-9px;width:18px;height:18px;border-radius:50%}
.mtd-boom .mtd-spark{background:var(--c);clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);animation:mtd-spark .9s cubic-bezier(.2,.8,.3,1) both}
.mtd-boom .mtd-spark.dot{clip-path:none;width:12px;height:12px;left:-6px;top:-6px}
@keyframes mtd-spark{from{translate:0 0;scale:.2;opacity:1}75%{opacity:1}to{translate:var(--dx) var(--dy);scale:1;opacity:0}}
.mtd-boom-ring{left:-40px!important;top:-40px!important;width:80px!important;height:80px!important;border:3px solid #fff;animation:mtd-ring .7s ease-out both}
@keyframes mtd-ring{from{scale:.1;opacity:.9}to{scale:1.4;opacity:0}}
.answer-options button,.order-built,.answer-input{position:relative}
@keyframes mtd-jump{0%,100%{translate:0 0}30%{translate:0 -12px;scale:1.03 .97}55%{translate:0 0;scale:1.06 .94}75%{scale:.98 1.02}}
.mtd-slice.on.hop{animation:mtd-jump .8s var(--mtd-spring) both;animation-delay:calc(var(--i,0)*90ms)}
@keyframes mtd-ringing{0%,100%{rotate:0deg}20%{rotate:-6deg}40%{rotate:6deg}60%{rotate:-4deg}80%{rotate:3deg}}
.mtd-ring.ringing{transform-origin:50% 60%;animation:mtd-ringing .6s ease-in-out 2}
.exercise-card .answer-options button.answer-correct{animation:mtd-jump .8s var(--mtd-spring)}

/* Phrase à trous : la case qui attend le mot, puis le mot qui saute dedans */
.mtd-gap-lead{display:block;font-size:.8em;opacity:.85;margin-bottom:6px}
.mtd-gap-sentence{display:block;font-size:1.25em;line-height:1.7}
.mtd-slot-word{position:relative;display:inline-block;min-width:4.2em;margin:0 .25em;padding:0 .45em;border-radius:14px;border:2.5px dashed #b9a3ec;background:#f5f1ff;text-align:center;vertical-align:baseline;line-height:1.5}
[data-veilleuse=on] .mtd-slot-word{border-color:rgb(255 255 255/.65);background:rgb(255 255 255/.08)}
.mtd-slot-word.filled{border-style:solid;border-color:#9fd6b9;color:#173a2f;background:radial-gradient(120% 90% at 30% 15%,#fff 0 8%,#d9f6e7 22%,#9fd6b9 70%);animation:mtd-pop .7s var(--mtd-spring) both}

/* ---------- Geste 4 : erreur douce (jamais de rouge) ---------- */
@keyframes mtd-soft{0%,100%{translate:0}25%{translate:-6px;rotate:-2deg}50%{translate:5px;rotate:1deg}75%{translate:-3px}}
.exercise-card .answer-options button.mtd-soft{animation:mtd-soft .5s ease-in-out;outline:3px solid #f4a983;outline-offset:2px}

/* ---------- Réponses en relief : la tuile s'enfonce, la tuile choisie se soulève ---------- */
.exercise-card .answer-options button{transition:translate .45s var(--mtd-spring),scale .45s var(--mtd-spring)}
.exercise-card .answer-options button:active:not(:disabled){translate:0 3px;scale:.98}
.exercise-card .answer-options button.chosen{translate:0 -4px}

/* Mots dans l'ordre : une place par mot, étiquettes lisibles en veilleuse */
.mtd-ghost{display:inline-block;min-width:64px;height:44px;border-radius:12px;border:2px dashed #cfd8c6}
.order-built button{animation:mtd-pop .5s var(--mtd-spring) both}
[data-veilleuse=on] .mtd-ghost{border-color:rgb(255 255 255/.3)}
[data-veilleuse=on] .exercise-card .order-built{background:rgb(20 24 70/.35);border-color:rgb(255 255 255/.3)}
[data-veilleuse=on] .exercise-card .order-placeholder{color:#dfe2f7}
[data-veilleuse=on] .exercise-card :is(.order-bank,.order-built) button{color:#fff;background:linear-gradient(170deg,rgb(255 255 255/.28),rgb(255 255 255/.10));border:1.5px solid rgb(255 255 255/.55);box-shadow:inset 0 2px 0 rgb(255 255 255/.5),0 4px 0 rgb(18 24 70/.45)}
[data-veilleuse=on] .exercise-card .order-built.order-done{color:#fff}

/* Réponse tapée : l'ardoise */
.exercise-card .answer-input input{transition:scale .4s var(--mtd-spring)}
.exercise-card .answer-input input:focus{scale:1.02}

/* ---------- Geste 5 : Tomo saute sur « Question suivante » (un seul Tomo) ---------- */
.mtd-next{position:relative;display:inline-flex;align-items:flex-end;margin-top:78px}
.mtd-perch{position:absolute;right:4px;bottom:calc(100% - 10px);width:86px;height:96px;pointer-events:none}
.mtd-perch #tomo-inline-view{width:86px;height:96px;flex-basis:auto}
.mtd-perch #tomo-inline-view>.tomo-mini{inset:0;width:86px;height:86px}
@keyframes mtd-hop{0%{translate:-120px 70px;scale:.6;opacity:0}20%{opacity:1}55%{translate:0 -36px;scale:1}78%{translate:0 0;scale:1.12 .88}100%{translate:0 0;scale:1}}
.mtd-perch{animation:mtd-hop 1s var(--mtd-spring) both .15s}

/* ---------- Geste 6 : série de 3, la frise devient étoiles ---------- */
.mission-trail li.complete .trail-stone{animation:mtd-pop .6s var(--mtd-spring) both;background:radial-gradient(circle at 35% 28%,#fff 0 14%,#ffe7a0 28%,#f0cf6a 65%,#c99a2a)!important;border-color:#ffe9a8!important;color:#5b4a14!important}

/* Mouvement réduit : tout s'affiche directement, sans ressort ni particules */
@media (prefers-reduced-motion:reduce){
 .mtd-pop,.mtd-float,.mtd-count,.mtd-slice,.mtd-ring,.mtd-slot-word,.mtd-perch,.order-built button,.mission-trail li.complete .trail-stone,.exercise-card .answer-options button{animation:none!important;transition:none!important}
 .mtd-boom{display:none}
}

/* ---------- Parcours des autres langues (national-preview.html) ---------- */
.national-figure :is(.mtd-pop,.mtd-grow){transform-box:fill-box;transform-origin:center}
.national-figure .mtd-grow{transform-origin:bottom;animation:mtd-grow .8s var(--mtd-spring) both;animation-delay:calc(var(--i,0)*150ms)}
@keyframes mtd-grow{from{scale:1 0}to{scale:1 1}}
.national-figure .mtd-pop{animation-delay:calc(var(--i,0)*60ms)}
/* Veilleuse : axes, graduations et textes des figures restent lisibles (la droite des nombres disparaissait) */
[data-veilleuse=on] .national-figure :is(.figure-axis,.grid-line){stroke:#dfe2f7}
[data-veilleuse=on] .national-figure text{fill:#eef0fb}
[data-veilleuse=on] .national-figure .figure-ray{stroke:#eef0fb}
.session [data-result="correct"]{position:relative;animation:mtd-jump .8s var(--mtd-spring)}
.session [data-result="wrong"].mtd-soft{animation:mtd-soft .5s ease-in-out}
.session .preview-control{transition:translate .45s var(--mtd-spring),scale .45s var(--mtd-spring)}
.session .preview-control[aria-pressed="true"]{translate:0 -4px}
/* Lectures de kanji : le kanji en grand sur une tuile en relief */
.mtd-kanji{display:grid;place-items:center;width:150px;height:150px;margin:8px auto 18px;border-radius:30px;font:700 104px/1 "Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans CJK JP","Noto Sans JP",Meiryo,sans-serif;color:#2f2b52;background:radial-gradient(circle at 40% 35%,#fff,#f4f1ff 80%,#d9d3f2);box-shadow:inset 0 2px 0 #fff,0 8px 0 #cfc6e6,0 18px 26px -14px #24384a80;animation:mtd-pop .7s var(--mtd-spring) both}
@media (prefers-reduced-motion:reduce){.national-figure :is(.mtd-pop,.mtd-grow),.mtd-kanji,.session [data-result],.session .preview-control{animation:none!important;transition:none!important}}

/* ---------- Paillettes (16/11/2026, après la vidéo des bulles validée par Loïc) ----------
   Le même niveau de détail partout : étincelles au toucher, éclatement en cascade, pluie de paillettes. */
.mtd-fx{position:fixed;inset:0;pointer-events:none;z-index:60;overflow:hidden}
.mtd-g{position:fixed;display:block;background:var(--c);translate:-50% -50%;opacity:0;animation:mtd-g var(--t,.9s) cubic-bezier(.2,.75,.3,1) forwards;will-change:translate,opacity}
.mtd-g.star{clip-path:polygon(50% 0,60% 40%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%)}
.mtd-g.diamond{clip-path:polygon(50% 0,100% 50%,50% 100%,0 50%)}
.mtd-g.dot{border-radius:50%;scale:.7}
@keyframes mtd-g{0%{translate:-50% -50%;scale:.2;opacity:1}55%{translate:calc(var(--dx) - 50%) calc(var(--dy) - 50%);scale:1;opacity:1}100%{translate:calc(var(--dx) - 50%) calc(var(--dy) + var(--fall) - 50%);rotate:var(--r);scale:.5;opacity:0}}
/* Bulles à paillettes : elles flottent, l'étoile du centre scintille, la bulle touchée rebondit */
.mtd-figure :is(.mtd-bubble,.mtd-twinkle){transform-box:fill-box;transform-origin:center}
@keyframes mtd-twinkle{50%{scale:.55;rotate:45deg}}
.mtd-twinkle{animation:mtd-twinkle 1.6s ease-in-out infinite;animation-delay:calc(var(--i,0)*-.23s)}
@keyframes mtd-tap{40%{scale:1.28}}
.mtd-tapped .mtd-bubble{animation:mtd-tap .45s var(--mtd-spring)}
@keyframes mtd-burst{40%{scale:1.35;opacity:1}100%{scale:.1;opacity:0}}
.mtd-burst .mtd-bubble{animation:mtd-burst .42s ease-in forwards}
.mtd-back .mtd-bubble{animation:mtd-pop .6s var(--mtd-spring) both,mtd-fade .2s linear both}
.mtd-counting .mtd-count-bg{fill:#fffdf8;stroke:#e8dff7}
/* Vague de réussite : chaque élément saute à son tour */
.mtd-figure :is(.mtd-tap,.mtd-arm,.mtd-hands){transform-box:fill-box;transform-origin:center}
.mtd-wave{animation:mtd-jump .7s var(--mtd-spring) both!important}
.order-built button.mtd-wave{animation:mtd-jump .7s var(--mtd-spring) both}
.mtd-figure .mtd-hands{transform-box:view-box}
@keyframes mtd-spin{from{rotate:-360deg}to{rotate:0deg}}
.mtd-hands.spin{animation:mtd-spin 1.1s var(--mtd-spring) both}
@keyframes mtd-kanji-spin{0%{scale:1;rotate:0deg}35%{scale:1.15;rotate:-8deg}70%{scale:.96;rotate:4deg}100%{scale:1;rotate:0deg}}
.mtd-kanji.mtd-spin{animation:mtd-kanji-spin .9s var(--mtd-spring) both}
@media (prefers-reduced-motion:reduce){
 .mtd-fx,.mtd-g{display:none}
 .mtd-twinkle,.mtd-tapped .mtd-bubble,.mtd-burst .mtd-bubble,.mtd-back .mtd-bubble,.mtd-wave,.order-built button.mtd-wave,.mtd-hands.spin,.mtd-kanji.mtd-spin{animation:none!important}
}

/* Modèles 1 choisis par Loïc le 16/11/2026 : réveil glossy, éventail arc-en-ciel, tubes de billes */
.mtd-figure .mtd-tap{transform-box:fill-box;transform-origin:50% 100%}
/* Ces pièces tournent autour d'un point du dessin (centre du cadran, sommet de l'angle) : origine dans le repère du dessin. */
.mtd-figure :is(.mtd-arm.mtd-open,.mtd-hands,.mtd-hand,.mtd-sec,.mtd-bell,.mtd-fan){transform-box:view-box}
.mtd-figure.mtd-zoom{max-width:420px}
.mtd-still :is(.mtd-pop,.mtd-marble,.mtd-hand,.mtd-bell,.mtd-open,.mtd-fan,.mtd-cut,.mtd-tool,.mtd-berry,.mtd-lift){animation:none}
.mtd-marble{transform-box:fill-box;transform-origin:50% 100%;animation:mtd-drop .62s cubic-bezier(.3,0,.6,1) both;animation-delay:calc(var(--d,0)*1ms)}
@keyframes mtd-drop{0%{translate:0 -230px;opacity:0}10%{opacity:1}70%{translate:0 0;scale:1}82%{scale:1.14 .84}100%{translate:0 0;scale:1}}
.mtd-tube{transform-box:fill-box;transform-origin:50% 100%}
.mtd-tapped .mtd-tube{animation:mtd-jump .6s var(--mtd-spring)}
.mtd-figure .mtd-clock-n.big{font-size:17px;fill:#5b4a14}
.mtd-hand{rotate:var(--to);animation:mtd-sweep 2.3s cubic-bezier(.45,0,.2,1) .35s both}
@keyframes mtd-sweep{from{rotate:calc(var(--to) + var(--turn))}to{rotate:var(--to)}}
.mtd-sec{animation:mtd-orbit 8s linear infinite}
@keyframes mtd-orbit{to{rotate:360deg}}
.mtd-bell{animation:mtd-bell .95s ease-in-out 2.6s both}
.mtd-ring.ringing .mtd-bell{animation:mtd-bell-again .95s ease-in-out both}
@keyframes mtd-bell{0%,100%{rotate:0deg}12%{rotate:calc(var(--s)*-16deg)}28%{rotate:calc(var(--s)*13deg)}44%{rotate:calc(var(--s)*-9deg)}60%{rotate:calc(var(--s)*6deg)}78%{rotate:calc(var(--s)*-3deg)}}
@keyframes mtd-bell-again{0%,100%{rotate:0deg}12%{rotate:calc(var(--s)*-16deg)}28%{rotate:calc(var(--s)*13deg)}44%{rotate:calc(var(--s)*-9deg)}60%{rotate:calc(var(--s)*6deg)}78%{rotate:calc(var(--s)*-3deg)}}
.mtd-open{rotate:var(--to);animation:mtd-open 1.2s cubic-bezier(.33,1,.68,1) .3s both}
@keyframes mtd-open{from{rotate:0deg}to{rotate:var(--to)}}
.mtd-fan{transform-box:view-box;transform-origin:330px 206px;animation:mtd-fan .4s var(--mtd-spring) both;animation-delay:calc(var(--d,0)*1ms)}
@keyframes mtd-fan{from{scale:.55;opacity:0}to{scale:1;opacity:1}}
.mtd-figure .mtd-deg{font-size:26px}
.mtd-reveal{transform-box:fill-box;transform-origin:center;opacity:0}
.mtd-solved .mtd-reveal{animation:mtd-reveal .6s var(--mtd-spring) both}
@keyframes mtd-reveal{from{opacity:0;scale:.3}to{opacity:1;scale:1}}
[data-veilleuse=on] .mtd-figure .mtd-deg{fill:#eef0fb}
@media (prefers-reduced-motion:reduce){
 .mtd-marble,.mtd-tube,.mtd-hand,.mtd-sec,.mtd-bell,.mtd-open,.mtd-fan,.mtd-reveal{animation:none!important}
 .mtd-solved .mtd-reveal{opacity:1}
}

/* Les six autres styles au même niveau (planche validée par Loïc le 16/11/2026) */
/* Tarte : traits de découpe, pelle à tarte, parts qui sortent, fraises */
.mtd-cut{transform-box:view-box;transform-origin:330px 104px;animation:mtd-cut .36s ease-out both;animation-delay:calc(var(--d,0)*1ms)}
@keyframes mtd-cut{from{scale:0}to{scale:1}}
.mtd-tool{opacity:0;animation:mtd-tool var(--t,.4s) linear both;animation-delay:calc(var(--d,0)*1ms)}
@keyframes mtd-tool{0%{translate:0 0;opacity:0}15%{opacity:1}85%{opacity:1}100%{translate:var(--len) 0;opacity:0}}
.mtd-lift.on{translate:var(--dx) var(--dy);animation:mtd-lift .7s var(--mtd-spring) both;animation-delay:calc(var(--d,0)*1ms)}
@keyframes mtd-lift{from{translate:0 0}to{translate:var(--dx) var(--dy)}}
.mtd-berry{transform-box:fill-box;transform-origin:50% 100%;animation:mtd-berry .7s var(--mtd-spring) both;animation-delay:calc(var(--d,0)*1ms)}
@keyframes mtd-berry{from{translate:0 -60px;opacity:0;scale:.6}to{translate:0 0;opacity:1;scale:1}}
.mtd-figure .mtd-frac{font-size:46px}
[data-veilleuse=on] .mtd-figure .mtd-frac{fill:#eef0fb}
/* Vrai ou faux : soleil et nuage dans les boutons */
.mtd-vf{display:block;width:62px;height:62px;margin:0 auto 4px;overflow:visible}
.mtd-rays{transform-box:view-box;transform-origin:60px 60px;animation:mtd-orbit 16s linear infinite}
.answer-correct .mtd-rays{animation:mtd-sunburst 1.2s var(--mtd-spring) both}
@keyframes mtd-sunburst{0%{rotate:0deg;scale:1}40%{scale:1.3}100%{rotate:180deg;scale:1}}
.mtd-cloud-body{animation:mtd-drift 3.2s ease-in-out infinite alternate}
.answer-correct .mtd-cloud-body{transform-box:fill-box;transform-origin:50% 100%;animation:mtd-jump .8s var(--mtd-spring) 2}
@keyframes mtd-drift{from{translate:-3px 0}to{translate:3px 0}}
.mtd-drops ellipse{opacity:0}
.mtd-soft .mtd-drops ellipse{animation:mtd-rain .8s linear 2 both;animation-delay:calc(var(--i,0)*120ms)}
@keyframes mtd-rain{0%{translate:0 -6px;opacity:0}30%{opacity:.9}100%{translate:0 22px;opacity:0}}
/* Choix : médaille dorée qui se retourne sur la bonne réponse */
.mtd-medal{position:absolute;top:-26px;right:-14px;width:46px;height:56px;pointer-events:none;z-index:2;animation:mtd-medal 1s var(--mtd-spring) both}
.mtd-medal-ribbon{position:absolute;left:11px;top:0;width:24px;height:22px;background:linear-gradient(90deg,#8fd0ae 0 50%,#b9a3ec 50%);clip-path:polygon(0 0,100% 0,82% 100%,50% 70%,18% 100%)}
.mtd-medal-disc{position:absolute;left:3px;bottom:0;width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-size:20px;color:#8a6a12;background:radial-gradient(circle at 35% 28%,#fff 0 12%,#ffe7a0 30%,#f0cf6a 70%,#d9a93a);box-shadow:inset 0 2px 0 #fff,0 4px 0 #c99a2a,0 10px 16px -8px #24384a88}
@keyframes mtd-medal{0%{scale:0;rotate:-30deg}35%{scale:1.2 1.2;rotate:8deg}50%{scale:.1 1.15}65%{scale:1 1;rotate:-4deg}80%{scale:.2 1}100%{scale:1;rotate:0deg}}
/* Mots dans l'ordre : wagons et petit train */
.order-built button,.mtd-wagon{border-radius:14px 14px 10px 10px!important}
.order-built button:nth-child(3n+1),.mtd-wagon:nth-of-type(3n+1){background:radial-gradient(120% 90% at 30% 15%,#fff 0 10%,#d9f6e7 30%,#a7dcc0)!important}
.order-built button:nth-child(3n+2),.mtd-wagon:nth-of-type(3n+2){background:radial-gradient(120% 90% at 30% 15%,#fff 0 10%,#dcebf8 30%,#a9cdec)!important}
.order-built button:nth-child(3n),.mtd-wagon:nth-of-type(3n){background:radial-gradient(120% 90% at 30% 15%,#fff 0 10%,#fde3d3 30%,#f5bc9b)!important}
.order-built button::after,.mtd-wagon::after{content:"";position:absolute;left:12%;right:12%;bottom:-7px;height:12px;background:radial-gradient(circle at 6px 6px,#6b6597 0 5px,#fff 5.5px 6.5px,transparent 7px) left/12px 12px no-repeat,radial-gradient(circle at 6px 6px,#6b6597 0 5px,#fff 5.5px 6.5px,transparent 7px) right/12px 12px no-repeat}
.mtd-train{position:relative;display:inline-flex;flex-wrap:wrap;align-items:flex-end;gap:8px 10px;padding:6px 4px 12px;background:linear-gradient(#0000 calc(100% - 9px),#d9b48a calc(100% - 9px) calc(100% - 4px),#0000 0)}
.mtd-wagon{position:relative;display:inline-block;padding:8px 14px;color:#173a2f;font-weight:800;box-shadow:inset 0 2px 0 #fff,0 3px 0 rgb(36 56 74/.18);animation:mtd-pop .6s var(--mtd-spring) both;animation-delay:calc(var(--i,0)*90ms)}
.mtd-loco{display:inline-block;width:52px;height:46px;animation:mtd-pop .6s var(--mtd-spring) both}
.mtd-loco svg{display:block;width:100%;height:100%}
.mtd-train.mtd-go{animation:mtd-chug 1.4s ease-in-out both}
@keyframes mtd-chug{0%,100%{translate:0 0}35%{translate:18px 0}45%{translate:16px -2px}55%{translate:18px 0}}
/* Phrase à trous : le mot qui vole */
.mtd-fly{position:fixed;width:0;height:0;animation:mtd-fly-x .58s cubic-bezier(.45,0,.55,1) both}
.mtd-fly-y{position:absolute;translate:-50% -50%;display:block;padding:6px 14px;border-radius:14px;font:800 22px/1.2 "Nunito Sans",system-ui,sans-serif;color:#173a2f;white-space:nowrap;background:radial-gradient(120% 90% at 30% 15%,#fff 0 8%,#d9f6e7 22%,#9fd6b9 70%);box-shadow:0 8px 18px -8px #24384a88;animation:mtd-fly-y .58s cubic-bezier(.3,0,.7,1) both}
@keyframes mtd-fly-x{from{translate:0 0}to{translate:var(--dx) 0}}
@keyframes mtd-fly-y{0%{translate:-50% -50%;rotate:0deg;scale:1}45%{translate:-50% calc(-50% - 90px);rotate:-10deg;scale:1.15}100%{translate:-50% calc(-50% + var(--dy));rotate:0deg;scale:1}}
.mtd-slot-word.mtd-await{opacity:0}
/* Réponse à taper : tuiles dorées */
.answer-input.mtd-tiled input{color:transparent!important}
.mtd-tiles{position:absolute;left:14px;top:50%;translate:0 -50%;display:flex;gap:6px;pointer-events:none}
.mtd-tiles i{display:grid;place-items:center;width:38px;height:48px;border-radius:12px;font:900 28px/1 "Nunito Sans",system-ui,sans-serif;font-style:normal;color:#5b4a14;background:radial-gradient(circle at 35% 28%,#fff 0 12%,#ffe7a0 30%,#f0cf6a 70%,#d9a93a);box-shadow:inset 0 2px 0 #fff,0 4px 0 #c99a2a;animation:mtd-tile .8s var(--mtd-spring) both;animation-delay:calc(var(--i,0)*110ms)}
.mtd-tiles i.blank{visibility:hidden}
@keyframes mtd-tile{0%{translate:0 -40px;scale:1;opacity:0}30%{translate:0 0;opacity:1}55%{scale:.1 1}75%{scale:1.1 1}100%{scale:1}}
@media (prefers-reduced-motion:reduce){
 .mtd-cut,.mtd-tool,.mtd-lift.on,.mtd-berry,.mtd-rays,.mtd-cloud-body,.mtd-drops ellipse,.mtd-medal,.mtd-wagon,.mtd-loco,.mtd-train.mtd-go,.mtd-fly,.mtd-fly-y,.mtd-tiles i{animation:none!important}
 .mtd-tool,.mtd-fly{display:none}
}
/* Veilleuse : texte encre sur les wagons et le mot posé (fond pastel clair) */
[data-veilleuse=on] .exercise-card .order-built button,[data-veilleuse=on] .mtd-wagon,[data-veilleuse=on] .mtd-slot-word.filled{color:#173a2f!important}
