:root {
  --fond: #f4f1ff;
  --carte: #ffffff;
  --texte: #1f1b3a;
  --doux: #6b6890;
  --ligne: #e3defa;
  --violet: #6d4aff;
  --violet-clair: #ece6ff;
  --orange: #ff8a3d;
  --jaune: #ffc93c;
  --vert-ok: #1fae6b;
  --rouge-ko: #e5484d;
  --der: #2f6fd6;
  --die: #d64545;
  --das: #2a9d58;
  --der-fond: #e5efff;
  --die-fond: #ffe9e9;
  --das-fond: #e4f6ea;
  --ombre: 0 6px 18px rgba(60, 40, 160, .10);
  --rayon: 20px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #15132a;
    --carte: #221f3d;
    --texte: #f2f0ff;
    --doux: #a9a5cc;
    --ligne: #34305a;
    --violet: #9b84ff;
    --violet-clair: #2e2858;
    --der: #6fa2ff;
    --die: #ff7b7b;
    --das: #5fd18d;
    --der-fond: #1d2c4d;
    --die-fond: #4a2027;
    --das-fond: #183a28;
    --ombre: 0 6px 18px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fond);
  color: var(--texte);
  font-family: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.4;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
}
#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 24px);
}
#confettis { position: fixed; inset: 0; pointer-events: none; width: 100%; height: 100%; z-index: 50; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea { font: inherit; -webkit-user-select: text; user-select: text; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
.doux { color: var(--doux); }
.petit { font-size: 14px; }
.centre { text-align: center; }
.cache { display: none !important; }

/* ---------- barre du haut ---------- */
.barre { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 44px; }
.barre h2 { flex: 1; font-size: 19px; }
.retour {
  width: 44px; height: 44px; border-radius: 14px; background: var(--carte);
  box-shadow: var(--ombre); font-size: 22px; display: grid; place-items: center; flex: none;
}
.progression { flex: 1; height: 12px; background: var(--ligne); border-radius: 99px; overflow: hidden; }
.progression > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--orange)); border-radius: 99px; transition: width .35s; }
.pastille { background: var(--carte); box-shadow: var(--ombre); border-radius: 99px; padding: 6px 12px; font-weight: 700; white-space: nowrap; }

/* ---------- accueil ---------- */
.entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 6px 0 16px; }
.entete .salut { font-size: 15px; color: var(--doux); }
.compteurs { display: flex; gap: 8px; }
.objectif { display: flex; align-items: center; gap: 14px; background: var(--carte); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); margin-bottom: 14px; }
.anneau { --p: 0; width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--orange) calc(var(--p) * 1%), var(--ligne) 0); }
.anneau span { width: 44px; height: 44px; border-radius: 50%; background: var(--carte); display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.choix-unites { width: 100%; text-align: left; background: var(--carte); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre); margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.choix-unites b { display: block; }
.choix-unites .fleche { margin-left: auto; font-size: 22px; color: var(--doux); }
.grille-jeux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.jeu {
  background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre);
  padding: 16px 14px; text-align: left; min-height: 118px; display: flex; flex-direction: column; gap: 4px;
  transition: transform .12s;
}
.jeu:active { transform: scale(.96); }
.jeu .emoji { font-size: 34px; line-height: 1; margin-bottom: 4px; }
.jeu b { font-size: 17px; }
.jeu span { font-size: 13px; color: var(--doux); }
.jeu.large { grid-column: span 2; flex-direction: row; align-items: center; min-height: 0; gap: 14px; }
.jeu.large .emoji { margin: 0; }
.jeu.vedette { background: linear-gradient(135deg, var(--violet), #a35bff 60%, var(--orange)); color: #fff; }
.jeu.vedette span { color: rgba(255,255,255,.85); }
/* icônes des jeux (ICONES_JEUX dans app.js) : carré arrondi de couleur propre à chaque jeu, dessin blanc */
.icone-jeu { --g1: #8b5cf6; --g2: #6d28d9; width: 48px; height: 48px; border-radius: 15px; flex: none; margin-bottom: 8px;
  background: linear-gradient(145deg, var(--g1), var(--g2)); box-shadow: 0 4px 10px color-mix(in srgb, var(--g2) 35%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }
.icone-jeu svg { display: block; width: 100%; height: 100%; }
.jeu.large .icone-jeu { margin: 0; width: 54px; height: 54px; border-radius: 17px; }
.jeu.vedette .icone-jeu { background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 4px 12px rgba(40,10,90,.25); }
.ij-phrases { --g1: #2dd4bf; --g2: #0d9488; }
.ij-histoires { --g1: #fbbf24; --g2: #d97706; }
.ij-asteroides { --g1: #3b3f8f; --g2: #141638; }
.ij-association { --g1: #f472b6; --g2: #be185d; }
.ij-pluie { --g1: #60a5fa; --g2: #2563eb; }
.ij-ballons { --g1: #7dd3fc; --g2: #0ea5e9; }
.ij-croises { --g1: #34d399; --g2: #059669; }
.ij-mystere { --g1: #475569; --g2: #1e293b; }
.ij-ecoute { --g1: #fb923c; --g2: #ea580c; }
.ij-genres { --g1: #e2e8f0; --g2: #cbd5e1; }
.ij-memory { --g1: #e879f9; --g2: #a21caf; }
.ij-chrono { --g1: #a78bfa; --g2: #7c3aed; }
.ij-progres { --g1: #fb923c; --g2: #e11d48; }
.ij-reglages { --g1: #94a3b8; --g2: #475569; }
.lien-bas .icone-jeu { width: 34px; height: 34px; border-radius: 11px; margin: 0; }

/* ---------- unités ---------- */
.unite {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--carte); border-radius: 18px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: var(--ombre); border: 3px solid transparent;
}
.unite.choisie { border-color: var(--violet); }
.unite .num { width: 42px; height: 42px; border-radius: 14px; background: var(--violet-clair); color: var(--violet); display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; }
.unite.choisie .num { background: var(--violet); color: #fff; }
.unite .infos { flex: 1; min-width: 0; }
.unite .infos b { display: block; }
.mini-barre { height: 7px; border-radius: 9px; background: var(--ligne); margin-top: 6px; overflow: hidden; display: flex; }
.mini-barre i { display: block; height: 100%; }
.mini-barre .m { background: var(--vert-ok); }
.mini-barre .e { background: var(--jaune); }
.reglage { background: var(--carte); border-radius: 18px; padding: 14px; box-shadow: var(--ombre); margin: 16px 0 10px; }
.reglage h3 { font-size: 15px; margin-bottom: 10px; }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { padding: 9px 14px; border-radius: 99px; background: var(--fond); border: 2px solid var(--ligne); font-size: 15px; }
.puce.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.ligne-boutons { display: flex; gap: 10px; margin: 12px 0; }
.ligne-boutons > * { flex: 1; }

/* ---------- boutons ---------- */
.btn { display: block; width: 100%; padding: 15px 18px; border-radius: 16px; font-weight: 800; font-size: 17px; background: var(--violet); color: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.18); transition: transform .08s; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn.second { background: var(--carte); color: var(--texte); box-shadow: 0 4px 0 var(--ligne); }
.btn.vert { background: var(--vert-ok); }
.btn.rouge { background: var(--rouge-ko); }
.btn.orange { background: var(--orange); }
.btn[disabled] { opacity: .45; }
.btn + .btn { margin-top: 10px; }

/* ---------- mots et genres ---------- */
.art { font-weight: 800; }
.g-der { color: var(--der); }
.g-die { color: var(--die); }
.g-das { color: var(--das); }
.pluriel { font-size: .72em; color: var(--doux); font-weight: 600; white-space: nowrap; }
.parler { width: 40px; height: 40px; border-radius: 50%; background: var(--violet-clair); font-size: 19px; display: inline-grid; place-items: center; vertical-align: middle; flex: none; }

/* ---------- carte retournable ---------- */
.scene { perspective: 1200px; margin: 8px 0 18px; }
.carte-flip { position: relative; height: 300px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3,.7,.3,1.2); cursor: pointer; }
.carte-flip.retournee { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: var(--carte); border-radius: 26px; box-shadow: var(--ombre);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px; gap: 10px;
}
.face.dos { transform: rotateY(180deg); }
.face .mot { font-size: 30px; font-weight: 800; line-height: 1.2; }
.face .mot.long { font-size: 22px; }
.face .indice { position: absolute; bottom: 14px; font-size: 13px; color: var(--doux); }
.face .exemple { font-size: 15px; color: var(--doux); }
.etiquette { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
.face.g-fond-der { background: var(--der-fond); }
.face.g-fond-die { background: var(--die-fond); }
.face.g-fond-das { background: var(--das-fond); }
.trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trois .btn { padding: 12px 6px; font-size: 15px; margin: 0; }
.trois .btn small { display: block; font-size: 24px; }

/* ---------- question ---------- */
.question { background: var(--carte); border-radius: 26px; box-shadow: var(--ombre); padding: 26px 20px; text-align: center; margin: 8px 0 16px; }
.question .mot { font-size: 27px; font-weight: 800; }
.question .aide { margin-top: 8px; font-size: 14px; color: var(--doux); }
.saisie { width: 100%; padding: 16px; font-size: 22px; border-radius: 16px; border: 3px solid var(--ligne); background: var(--carte); color: var(--texte); text-align: center; outline: none; }
.saisie:focus { border-color: var(--violet); }
.saisie.ok { border-color: var(--vert-ok); }
.saisie.ko { border-color: var(--rouge-ko); }
.umlauts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 14px; }
.umlauts button { min-width: 0; width: clamp(34px, 10.5vw, 42px); height: 42px; border-radius: 12px; background: var(--carte); box-shadow: var(--ombre); font-size: 19px; font-weight: 700; }
.retour-reponse { border-radius: 18px; padding: 14px 16px; margin: 4px 0 14px; display: flex; gap: 12px; align-items: center; }
.retour-reponse.ok { background: color-mix(in srgb, var(--vert-ok) 16%, var(--carte)); }
.retour-reponse.ko { background: color-mix(in srgb, var(--rouge-ko) 14%, var(--carte)); }
.retour-reponse.presque { background: color-mix(in srgb, var(--jaune) 28%, var(--carte)); }
.retour-reponse .gros { font-size: 30px; }
.retour-reponse .txt { flex: 1; }
.retour-reponse .sol { font-size: 20px; font-weight: 800; }
.lien { color: var(--violet); font-weight: 700; padding: 6px 0; font-size: 15px; }

/* ---------- QCM ---------- */
.choix { display: grid; gap: 10px; }
.choix button { background: var(--carte); border-radius: 16px; padding: 15px; font-size: 18px; font-weight: 700; box-shadow: 0 4px 0 var(--ligne); text-align: center; }
.choix button.bon { background: var(--vert-ok); color: #fff; box-shadow: none; }
.choix button.faux { background: var(--rouge-ko); color: #fff; box-shadow: none; }
.chrono { font-size: 34px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; }
.chrono.urgent { color: var(--rouge-ko); animation: pouls .5s infinite alternate; }
@keyframes pouls { to { transform: scale(1.12); } }
.combo { text-align: center; font-weight: 800; color: var(--orange); min-height: 24px; }
/* Chrono : grand cadran de chronomètre (cadranChrono dans app.js) ; --c = couleur du temps qui reste */
.ch-cadran { --c: rgb(124, 92, 255); position: relative; width: clamp(118px, 21vh, 178px); aspect-ratio: 140 / 152; margin: -4px auto 2px; }
.ch-cadran svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ch-remontoir { fill: var(--doux); opacity: .7; }
.ch-fond { fill: var(--carte); stroke: var(--ligne); stroke-width: 1; filter: drop-shadow(0 6px 14px rgba(60, 40, 160, .16)); transition: fill .5s; }
.ch-piste { fill: none; stroke: var(--ligne); stroke-width: 9; }
.ch-arc { fill: none; stroke: var(--c); stroke-width: 9; stroke-linecap: round; filter: drop-shadow(0 0 4px var(--c)); }
.ch-tete { fill: #fff; stroke: var(--c); stroke-width: 2.2; filter: drop-shadow(0 0 5px var(--c)); }
.ch-grad { stroke: var(--texte); stroke-width: 1.1; stroke-linecap: round; opacity: .5; transition: opacity .35s, stroke .35s; }
.ch-grad.forte { stroke-width: 2.2; opacity: .75; }
.ch-grad.passee { opacity: .08; }
.ch-centre { position: absolute; left: 0; right: 0; top: 7.9%; height: 92.1%; display: grid; place-content: center; text-align: center; pointer-events: none; }
.ch-centre b { font-size: clamp(36px, 7.2vh, 56px); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; color: var(--c); transition: color .3s; }
.ch-centre small { font-size: 11px; font-weight: 700; color: var(--doux); letter-spacing: .04em; margin-top: 2px; }
.ch-cadran.urgent .ch-fond { fill: color-mix(in srgb, var(--rouge-ko) 13%, var(--carte)); }
.ch-cadran.urgent .ch-grad.forte:not(.passee) { stroke: var(--c); }
.ch-cadran.bat svg { animation: chBat .5s cubic-bezier(.3, 1.6, .5, 1); }
.ch-cadran.bat .ch-centre b { animation: chChiffre .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes chBat { 0% { transform: scale(1); } 22% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes chChiffre { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
.ch-cadran.fini svg { animation: chSonne .12s linear 8; }
.ch-cadran.fini .ch-centre b { font-size: clamp(28px, 5vh, 40px); }
.ch-cadran.fini .ch-centre small { color: var(--rouge-ko); font-size: 12px; }
@keyframes chSonne { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.ch-alerte { position: fixed; inset: 0; pointer-events: none; z-index: 5; box-shadow: inset 0 0 70px 12px rgba(255, 45, 70, .5); opacity: 0; transition: opacity .6s; }
.ch-alerte.on { animation: chAlerte 1s ease-in-out infinite; }
@keyframes chAlerte { 0%, 100% { opacity: .3; } 50% { opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .ch-cadran.bat svg, .ch-cadran.bat .ch-centre b, .ch-cadran.fini svg, .ch-alerte.on { animation: none; } .ch-alerte.on { opacity: .5; } }

/* ---------- der die das ---------- */
.genres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.genres button { padding: 22px 0; border-radius: 20px; font-size: 24px; font-weight: 900; color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.genres button:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.genres .b-der { background: var(--der); }
.genres .b-die { background: var(--die); }
.genres .b-das { background: var(--das); }
.secoue { animation: secoue .4s; }
@keyframes secoue { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.saute { animation: saute .4s; }
@keyframes saute { 50% { transform: scale(1.08); } }

/* ---------- memory ---------- */
.memory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tuile { aspect-ratio: 3 / 3.3; perspective: 800px; }
.tuile .in { position: relative; width: 100%; height: 100%; transition: transform .4s; transform-style: preserve-3d; }
.tuile.ouverte .in, .tuile.trouvee .in { transform: rotateY(180deg); }
.tuile .f, .tuile .d { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; place-items: center; padding: 6px; text-align: center; font-weight: 700; font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.tuile .d.long { font-size: 12px; }
.tuile .f { background: linear-gradient(135deg, var(--violet), #a35bff); color: #fff; font-size: 30px; box-shadow: var(--ombre); }
.tuile .d { background: var(--carte); transform: rotateY(180deg); box-shadow: var(--ombre); }
.tuile.trouvee .d { background: color-mix(in srgb, var(--vert-ok) 20%, var(--carte)); }
.tuile .d.fr { font-style: italic; }

/* ---------- phrases ---------- */
.zone-phrase { min-height: 96px; background: var(--carte); border-radius: 20px; box-shadow: var(--ombre); padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; margin-bottom: 14px; border: 3px dashed var(--ligne); }
.zone-phrase.ok { border-color: var(--vert-ok); border-style: solid; }
.zone-phrase.ko { border-color: var(--rouge-ko); border-style: solid; }
.reserve { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; min-height: 50px; }
.tuile-mot { padding: 10px 14px; border-radius: 14px; background: var(--carte); box-shadow: 0 3px 0 var(--ligne); font-weight: 700; font-size: 18px; }
.zone-phrase .tuile-mot { background: var(--violet-clair); box-shadow: none; }

/* ---------- histoires ---------- */
.histoire-item { width: 100%; text-align: left; display: flex; gap: 14px; align-items: center; background: var(--carte); border-radius: 18px; padding: 14px; margin-bottom: 10px; box-shadow: var(--ombre); }
.histoire-item .num { font-size: 30px; }
.histoire-item.hors { opacity: .55; }
.recit { background: var(--carte); border-radius: 22px; box-shadow: var(--ombre); padding: 20px 18px; font-size: 18px; line-height: 1.75; -webkit-user-select: text; user-select: text; }
.recit p { margin: 0 0 14px; }
.recit p:last-child { margin: 0; }
.motde { display: inline; padding: 2px 6px; border-radius: 8px; font-weight: 800; cursor: pointer; background: var(--violet-clair); color: var(--violet); white-space: nowrap; }
.motde.g-der { background: var(--der-fond); color: var(--der); }
.motde.g-die { background: var(--die-fond); color: var(--die); }
.motde.g-das { background: var(--das-fond); color: var(--das); }
.trou { display: inline-block; min-width: 90px; padding: 0 8px; border-radius: 8px; border: 2px dashed var(--violet); color: var(--violet); font-weight: 800; text-align: center; cursor: pointer; line-height: 1.5; }
.trou small { font-weight: 600; font-style: italic; color: var(--doux); }
.trou.rempli { border-style: solid; }
.trou.bon { border-color: var(--vert-ok); background: color-mix(in srgb, var(--vert-ok) 15%, transparent); color: var(--vert-ok); }
.trou.faux { border-color: var(--rouge-ko); background: color-mix(in srgb, var(--rouge-ko) 12%, transparent); color: var(--rouge-ko); }
.bulle { position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 16px); max-width: 528px; margin: 0 auto; background: var(--texte); color: var(--fond); border-radius: 20px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.3); animation: monte .2s; }
.bulle .txt { flex: 1; }
.bulle .parler { background: rgba(255,255,255,.18); }
.bulle { overflow: hidden; }
.bulle.part { animation: bulleSort .25s ease-in forwards; }
@keyframes bulleSort { to { opacity: 0; transform: translateY(12px); } }
.bulle.compte::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--violet); opacity: .7; transform-origin: left; animation: bulleCompte var(--duree, 5s) linear forwards; }
@keyframes bulleCompte { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes monte { from { transform: translateY(30px); opacity: 0; } }
.feuille { position: fixed; inset: 0; background: rgba(10, 8, 30, .45); z-index: 30; display: flex; align-items: flex-end; animation: fondu .15s; }
@keyframes fondu { from { opacity: 0; } }
.feuille > div { width: 100%; max-width: 560px; margin: 0 auto; background: var(--fond); border-radius: 26px 26px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); animation: monte .2s; }
.feuille h3 { margin-bottom: 4px; }

/* ---------- résultats & progrès ---------- */
.resultat { text-align: center; padding-top: 30px; }
.resultat .etoiles { font-size: 56px; letter-spacing: 6px; margin: 10px 0; }
.resultat .gros-score { font-size: 46px; font-weight: 900; }
.liste-mots { background: var(--carte); border-radius: 18px; box-shadow: var(--ombre); padding: 6px 14px; margin: 14px 0; text-align: left; }
.liste-mots div { padding: 9px 0; border-bottom: 1px solid var(--ligne); display: flex; justify-content: space-between; gap: 12px; }
.liste-mots div:last-child { border-bottom: 0; }
.liste-mots .fr { color: var(--doux); text-align: right; }
.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge { background: var(--carte); border-radius: 16px; padding: 10px 4px; text-align: center; box-shadow: var(--ombre); font-size: 11px; color: var(--doux); }
.badge i { display: block; font-style: normal; font-size: 30px; filter: grayscale(1); opacity: .35; }
.badge.gagne i { filter: none; opacity: 1; }
.badge.gagne { color: var(--texte); font-weight: 700; }
.section-titre { margin: 22px 0 10px; font-size: 18px; }
.toast { position: fixed; top: calc(env(safe-area-inset-top) + 14px); left: 50%; transform: translateX(-50%); background: var(--texte); color: var(--fond); padding: 10px 18px; border-radius: 99px; font-weight: 700; z-index: 60; animation: monte .25s; white-space: nowrap; }
.legende { display: flex; gap: 14px; font-size: 13px; color: var(--doux); margin-top: 6px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.champ { width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--ligne); background: var(--carte); color: var(--texte); font-size: 17px; }
textarea.champ { min-height: 90px; font-size: 13px; font-family: ui-monospace, monospace; }
.interrupteur { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.interrupteur:last-child { border-bottom: 0; }
.interrupteur input { width: 22px; height: 22px; accent-color: var(--violet); }
.barre .chrono { flex: 1; text-align: left; }

/* ---------- avatars et profil ---------- */
.avatar svg { display: block; width: 100%; height: 100%; }
.avatar { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex: none; }
.profil { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--carte); box-shadow: var(--ombre); border-radius: var(--rayon); padding: 12px; margin: 6px 0 14px; }
.profil-avatar { position: relative; }
.profil-avatar .avatar { width: 74px; height: 74px; }
.cadeau-pastille { position: absolute; right: -6px; bottom: -4px; background: var(--orange); color: #fff; font-size: 12px; font-weight: 800; border-radius: 99px; padding: 2px 7px; animation: sautille 1.2s infinite; }
@keyframes sautille { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.profil-infos { flex: 1; min-width: 0; }
.profil-infos .salut { font-size: 14px; color: var(--doux); }
.progression.mini { height: 8px; margin: 4px 0 2px; }
.profil .compteurs { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.profil .pastille { box-shadow: none; background: var(--violet-clair); font-size: 14px; padding: 4px 10px; }

.bande { display: flex; justify-content: center; gap: 6px; margin: 14px 0; flex-wrap: wrap; }
.bande-perso { display: flex; flex-direction: column; align-items: center; font-size: 12px; font-weight: 700; color: var(--doux); }
.bande-perso .avatar { width: 58px; height: 58px; }
.presents { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 8px; padding-bottom: 4px; }
.presents .avatar { width: 46px; height: 46px; }
.la-bande { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 10px 14px; margin: 10px 0 14px; }
.la-bande summary { font-weight: 800; cursor: pointer; }
.fiche-perso { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--ligne); }
.fiche-perso:first-of-type { margin-top: 8px; }
.fiche-perso .avatar { width: 54px; height: 54px; }

/* ---------- éditeur « Mon perso » ---------- */
.perso-haut { display: flex; gap: 14px; align-items: center; margin: 4px 0 12px; }
.avatar.grand { width: 150px; height: 150px; box-shadow: var(--ombre); }
.avatar.en-essai { outline: 3px dashed var(--orange); outline-offset: 3px; }
.perso-infos { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.petit-btn { padding: 10px 12px; font-size: 15px; }
.perso-infos .btn + .btn { margin-top: 0; }
.essai-panneau { background: var(--carte); border: 2px dashed var(--orange); border-radius: 16px; padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.essai-panneau p { margin: 0; }
.onglets { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.onglets::-webkit-scrollbar { display: none; }
.onglet { flex: none; background: var(--carte); border-radius: 99px; padding: 8px 12px; font-weight: 700; font-size: 14px; box-shadow: 0 2px 0 var(--ligne); }
.onglet.on { background: var(--violet); color: #fff; box-shadow: none; }
.tuiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 10px; }
.tuiles.couleurs { grid-template-columns: repeat(5, 1fr); }
.tuile-av { position: relative; background: var(--carte); border-radius: 16px; padding: 6px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 var(--ligne); border: 2px solid transparent; }
.tuile-av .avatar { width: 100%; height: 100%; border-radius: 12px; }
.tuile-av.porte { border-color: var(--violet); background: var(--violet-clair); }
.tuile-av.essai { border-color: var(--orange); border-style: dashed; }
.tuile-av.verrou .avatar { filter: grayscale(.85) opacity(.45); }
.tuile-av.verrou .pastille-couleur { opacity: .5; }
.tuile-av.cher .avatar, .tuile-av.cher .pastille-couleur { opacity: .7; }
.tuile-av.r2 { box-shadow: 0 3px 0 #7cc4ff; }
.tuile-av.r3 { box-shadow: 0 3px 0 #b48cff; }
.tuile-av.r4 { box-shadow: 0 3px 0 #ffb938; }
.etiquette-av { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); background: var(--texte); color: var(--carte); font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 6px; white-space: nowrap; }
.tuile-av.achetable .etiquette-av { background: var(--orange); color: #fff; }
.pastille-couleur { width: 74%; height: auto; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.rarete { font-size: 12px; font-weight: 800; border-radius: 99px; padding: 2px 8px; background: var(--ligne); }
.rarete.r1 { background: #e3e9f2; color: #44526a; }
.rarete.r2 { background: #d9eeff; color: #1f5f9a; }
.rarete.r3 { background: #ecdfff; color: #5b2fb3; }
.rarete.r4 { background: #ffefc9; color: #8a5a00; }
.legende-tuiles { text-align: center; }
.cadeaux { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.cadeaux .tuile-av { flex-direction: column; aspect-ratio: auto; gap: 6px; padding: 10px 6px; }
.cadeaux .avatar, .cadeaux .pastille-couleur { width: 72px; height: 72px; }
.nom-cadeau { font-size: 13px; font-weight: 700; text-align: center; }

/* ---------- compte ---------- */
.carte-formulaire { display: flex; flex-direction: column; gap: 10px; }
.carte-formulaire .btn { margin-top: 6px; }
.message-erreur { color: var(--rouge-ko); font-weight: 700; margin: 0; min-height: 0; font-size: 15px; }
.message-erreur:empty { display: none; }
.carte-formulaire .lien, .resultat .lien, .essai-panneau .lien { display: block; margin: 10px auto 0; background: none; }
.interrupteur input.champ { width: 100%; height: auto; appearance: auto; -webkit-appearance: none; border-radius: 14px; padding: 8px 12px; }

/* ---------- pages du cahier ---------- */
.voir-page { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 20px; padding: 6px 7px 4px; margin-right: 4px; border-radius: 12px; background: var(--violet-clair); line-height: 1; }
.voir-page small { font-size: 10px; font-weight: 700; color: var(--doux); }
.visionneuse { position: fixed; inset: 0; z-index: 40; background: var(--fond); display: flex; flex-direction: column; animation: fondu .15s; }
.visionneuse-barre { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; background: var(--carte); box-shadow: var(--ombre); }
.visionneuse-barre b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.rond { width: 40px; height: 40px; border-radius: 50%; background: var(--violet-clair); font-size: 20px; font-weight: 800; flex: none; }
.rond[disabled] { opacity: .35; }
.visionneuse-contenu { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px); }
.pages { width: 100%; max-width: none; margin: 0 auto; }
.pages img { display: block; width: 100%; height: auto; margin-bottom: 10px; border-radius: 8px; box-shadow: var(--ombre); background: #fff; }
.logo { width: 76px; height: 76px; border-radius: 18px; box-shadow: var(--ombre); }
.nom-app { font-weight: 900; font-size: 15px; letter-spacing: .5px; color: var(--violet); margin-top: 6px; }
.resultat .nom-app + h1 { margin-top: 4px; }

/* badge « Powered by Netlify » ajouté par l'hébergeur : il masquait le bas de l'écran */
#nl-badge-frame, iframe[id^="nl-badge"] { display: none !important; }

/* ---------- histoires : niveaux 1 et 2 ---------- */
.histoire-item .histoire-infos { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; text-align: left; }
.niveaux { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.niveau { background: var(--violet-clair); border-radius: 99px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.niveau.de { background: color-mix(in srgb, var(--jaune) 35%, var(--carte)); }
.para-de { margin-bottom: 14px; }
.para-de p { margin: 0 0 6px; }
.para-actions { display: flex; gap: 8px; }
.mini { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--violet-clair); color: var(--texte); }
.trad { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--violet); background: var(--violet-clair); border-radius: 0 10px 10px 0; font-size: 15px; color: var(--doux); font-style: italic; }
.trad.cache { display: none; }
/* mots connus (unités précédentes) et saison 2 */
.motde.connu { background: none; color: inherit; font-weight: inherit; border-bottom: 2px dotted var(--doux); border-radius: 0; padding: 0; }
.trou.trou-revision { border-style: dashed; }
.histoire-item.revision { opacity: .85; }
.num-unite { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--violet-clair); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; line-height: 1; color: var(--violet); }
.num-unite small { font-size: 9px; font-weight: 700; color: var(--doux); margin-bottom: 2px; }
/* ---------- choix de la langue ---------- */
/* année scolaire (7P / 9e) : bien visible en haut de l'accueil */
.annees { display: flex; gap: 8px; margin: 0 0 10px; }
.annee { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px; border-radius: 14px; background: var(--carte); box-shadow: 0 3px 0 var(--ligne); color: var(--doux); }
.annee b { font-size: 20px; line-height: 1.1; color: var(--texte); }
.annee span { font-size: 12px; font-weight: 700; }
.annee.on { color: #fff; box-shadow: none; background: var(--violet); }
.annee.on b { color: #fff; }
.annee.a7.on { background: linear-gradient(135deg, #ff9f1c, #f3722c); }
.annee.a9.on { background: linear-gradient(135deg, #4361ee, #3a0ca3); }
.annees.grandes { flex-direction: column; gap: 12px; width: 100%; max-width: 320px; margin: 10px auto 0; }
.annees.grandes .annee { padding: 16px; color: #fff; box-shadow: none; }
.annees.grandes .annee b { font-size: 30px; color: #fff; }
.annees.grandes .annee span { font-size: 15px; }
.annees.grandes .annee.a7 { background: linear-gradient(135deg, #ff9f1c, #f3722c); }
.annees.grandes .annee.a9 { background: linear-gradient(135deg, #4361ee, #3a0ca3); }
.annees.grandes .annee.actuelle { outline: 4px solid var(--texte); outline-offset: 3px; }
.annees.grandes .annee.actuelle b::after { content: " ✓"; }
.annee-pastille { color: #fff; cursor: pointer; }
.annee-pastille.a7 { background: linear-gradient(135deg, #ff9f1c, #f3722c); }
.annee-pastille.a9 { background: linear-gradient(135deg, #4361ee, #3a0ca3); }
.langues { display: flex; gap: 8px; margin: 0 0 12px; }
.langue { flex: 1; padding: 10px; border-radius: 14px; background: var(--carte); font-weight: 800; box-shadow: 0 3px 0 var(--ligne); }
.langue.on { background: var(--violet); color: #fff; box-shadow: none; }
.gros-haut-parleur { font-size: 46px; width: 96px; height: 96px; border-radius: 50%; background: var(--violet-clair); margin: 8px auto; display: block; }
.liste-unite > div { cursor: pointer; }

/* ---------- avatar de l'élève : cadre, motif, sticker, titre ---------- */
.perso { position: relative; flex: none; border-radius: 50%; width: 64px; height: 64px; font-size: 64px; }
.perso > .avatar { width: 100%; height: 100%; border-radius: 50%; }
.perso.avec-cadre { padding: .055em; }
.perso .sticker { position: absolute; right: -.04em; bottom: -.02em; font-size: .3em; line-height: 1; filter: drop-shadow(0 .03em .05em rgba(0,0,0,.3)); }
.perso.grand { width: 150px; height: 150px; font-size: 150px; box-shadow: var(--ombre); }
.perso.grand.en-essai { outline: 3px dashed var(--orange); outline-offset: 3px; }
.perso.moyen { width: 74px; height: 74px; font-size: 74px; }
.tuile-av .perso.tuile { width: 100%; height: 100%; font-size: 60px; }
.cadeaux .perso.cadeau { width: 72px; height: 72px; font-size: 72px; }
.titre-perso { display: inline-block; font-size: 12px; font-weight: 800; color: var(--violet); background: var(--violet-clair); border-radius: 99px; padding: 2px 8px; margin: 2px 0; }
.tuiles.textes { grid-template-columns: repeat(2, 1fr); }
.tuiles.textes .tuile-av { aspect-ratio: auto; min-height: 56px; padding: 10px 8px; }
.titre-tuile { font-size: 13px; font-weight: 800; text-align: center; line-height: 1.2; }
.tuile-av.verrou .titre-tuile, .tuile-av.verrou .sticker-tuile { opacity: .45; }
.sticker-tuile { font-size: 34px; line-height: 1; }
.profil-avatar .perso > .avatar, .tuile-av .perso > .avatar, .cadeaux .perso > .avatar { width: 100%; height: 100%; border-radius: 50%; }
.profil .titre-perso { display: table; }
/* ---------- lecture d'une histoire ---------- */
.barre-lecture { position: sticky; top: calc(env(safe-area-inset-top) + 6px); z-index: 5; display: flex; gap: 8px; margin: 4px 0 10px; }
.barre-lecture .btn { margin: 0; }
.barre-lecture .lire-histoire { flex: 1; }
.barre-lecture .lire-stop { flex: none; width: 64px; }
.para-de { border-radius: 12px; transition: background .3s; padding: 4px 6px; margin-left: -6px; margin-right: -6px; }
.para-de.en-lecture { background: color-mix(in srgb, var(--jaune) 28%, transparent); }
.exemple .parler { width: 30px; height: 30px; font-size: 15px; vertical-align: middle; }

/* ---------- Écris et joue : jeu des bijoux ---------- */
.etat-bijoux { flex: 1; text-align: center; font-weight: 700; font-size: 17px; }
.etat-bijoux b { color: var(--violet); font-size: 20px; }
.bijoux { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1; margin: 4px auto 10px; border-radius: 22px; overflow: hidden;
  background: linear-gradient(160deg, #2c2266, #140f33); box-shadow: var(--ombre), inset 0 0 0 2px rgba(255, 255, 255, .07);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.bijoux::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: conic-gradient(rgba(255, 255, 255, .05) 25%, transparent 0 50%, rgba(255, 255, 255, .05) 0 75%, transparent 0) 0 0 / 25% 25%; }
.bijou { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; display: grid; place-items: center;
  transition: transform .26s cubic-bezier(.35, .1, .45, 1.15); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); will-change: transform; }
.bijou i { position: relative; display: block; width: 78%; height: 78%; transition: transform .18s; }
.bijou i::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .75) 0 10%, transparent 11%); }
.bijou.t0 i { border-radius: 50%; background: radial-gradient(circle at 38% 32%, #ffd3da, #ff3b62 45%, #a50f37); }
.bijou.t1 i { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: linear-gradient(135deg, #ffe3c0, #ff8a3d 50%, #c94e12); }
.bijou.t2 i { clip-path: polygon(62% 0, 12% 57%, 44% 57%, 32% 100%, 90% 38%, 57% 38%, 76% 0); background: linear-gradient(160deg, #fff8c8, #ffd23c 50%, #e39a00); }
.bijou.t3 i { clip-path: polygon(25% 6%, 75% 6%, 100% 50%, 75% 94%, 25% 94%, 0 50%); background: linear-gradient(150deg, #cbffe3, #22d47d 50%, #0b8548); }
.bijou.t4 i { clip-path: polygon(50% 5%, 98% 90%, 2% 90%); background: linear-gradient(170deg, #d6eeff, #3aa7ff 50%, #145bc4); }
.bijou.t5 i { width: 70%; height: 70%; border-radius: 28%; background: linear-gradient(140deg, #eedcff, #a65cff 50%, #6020c4); }
.bijou.s-h i::after, .bijou.s-v i::after, .bijou.s-x i::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.bijou.s-h i::after { background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .7) 0 3px, transparent 3px 8px); }
.bijou.s-v i::after { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .7) 0 3px, transparent 3px 8px); }
.bijou.s-x i::after { background: linear-gradient(90deg, transparent 42%, rgba(255, 255, 255, .85) 42% 58%, transparent 58%), linear-gradient(0deg, transparent 42%, rgba(255, 255, 255, .85) 42% 58%, transparent 58%); }
.bijou.s-h, .bijou.s-v, .bijou.s-x { animation: brille 1.4s ease-in-out infinite; }
.bijou.s-b i { width: 80%; height: 80%; border-radius: 50%; clip-path: none; animation: tourne 3s linear infinite;
  background: radial-gradient(circle, #fff 0 14%, transparent 16%), conic-gradient(#ff3b62, #ffd23c, #22d47d, #3aa7ff, #a65cff, #ff3b62); }
.bijou.choisi i { transform: scale(1.18); }
.bijou.choisi::after { content: ""; position: absolute; inset: 4%; border-radius: 28%; border: 2px solid rgba(255, 255, 255, .85); }
.bijou.pop i { animation: eclat .23s ease-out forwards; }
.gain-bijoux { position: absolute; left: 50%; top: 42%; z-index: 3; pointer-events: none; text-align: center; color: #fff;
  font-weight: 900; font-size: 30px; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); animation: monte .9s ease-out forwards; }
.gain-bijoux small { display: block; font-size: 22px; color: #ffd23c; }
.legende-bijoux { font-size: 12.5px; }
@keyframes eclat { to { transform: scale(1.5); opacity: 0; } }
@keyframes brille { 50% { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9)); } }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes monte { from { transform: translate(-50%, -30%) scale(.8); opacity: 0; } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } to { transform: translate(-50%, -110%); opacity: 0; } }

/* ---------- bas de l'accueil : progrès et réglages (plus discrets que les jeux) ---------- */
.liens-bas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 18px; padding-top: 16px; border-top: 1px solid var(--ligne); }
.lien-bas { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px 10px; border-radius: 16px;
  background: transparent; border: 1.5px solid var(--ligne); color: var(--texte); transition: transform .12s, background .12s; }
.lien-bas:active { transform: scale(.97); background: var(--violet-clair); }
.lien-bas .emoji { font-size: 24px; line-height: 1; }
.lien-bas b { font-size: 17px; white-space: nowrap; }
.lien-bas.seul { width: 100%; margin: 18px 0 8px; }

/* ---------- liste allemande d'une unité (indications du cahier) ---------- */
.liste-de { padding: 12px 14px calc(env(safe-area-inset-bottom) + 16px); }
.but-unite { margin: 2px 0 10px; font-weight: 600; color: var(--violet); }
.legende-voc { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12.5px; margin-bottom: 14px; }
.puce-gris, .puce-bleu { padding: 2px 8px; border-radius: 99px; }
.puce-gris { background: color-mix(in srgb, var(--doux) 18%, transparent); }
.puce-bleu { background: color-mix(in srgb, var(--der) 20%, transparent); }
.rubrique-voc { margin-bottom: 18px; }
.rubrique-voc h3 { display: flex; justify-content: space-between; gap: 10px; font-size: 17px; color: var(--violet); border-bottom: 2px solid var(--violet-clair); padding-bottom: 6px; margin: 0 0 8px; }
.rubrique-voc h3 .doux { font-weight: 500; font-size: 14px; text-align: right; }
.bloc-voc { background: var(--carte); border-radius: 16px; box-shadow: var(--ombre); padding: 4px 12px; margin-bottom: 10px; }
.bloc-voc.connu { background: color-mix(in srgb, var(--doux) 12%, var(--carte)); box-shadow: none; }
.bloc-voc.plus { background: color-mix(in srgb, var(--der) 12%, var(--carte)); box-shadow: none; border-left: 4px solid var(--der); }
.titre-bloc { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); padding: 8px 0 2px; }
.ligne-voc { padding: 9px 0; border-bottom: 1px solid var(--ligne); cursor: pointer; }
.ligne-voc:last-child { border-bottom: 0; }
.ligne-voc:active { opacity: .6; }
.ligne-voc.info { cursor: default; font-size: 14px; }
.ligne-voc-haut { display: flex; justify-content: space-between; gap: 12px; }
.ligne-voc-haut > span:first-child { flex: 1.1; }
.ligne-voc-haut .fr { flex: 1; color: var(--doux); text-align: right; }
.ligne-voc-ex { margin-top: 5px; padding-left: 10px; border-left: 2px solid var(--ligne); font-size: 13.5px; display: flex; flex-direction: column; }
.ligne-voc .pluriel { white-space: normal; }
.ligne-voc-haut > span { min-width: 0; overflow-wrap: anywhere; }
/* motifs du t-shirt : on zoome sur le torse pour bien voir le dessin */
.tuile-av .avatar.zoom-torse { overflow: hidden; }
.tuile-av .avatar.zoom-torse svg { width: 100%; height: 100%; transform: scale(1.6); transform-origin: 50% 100%; }
.tuile-av.verrou .avatar.zoom-torse { filter: grayscale(.6) opacity(.6); }
.tuile-pose { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; }
.tuile-pose .perso { width: 66%; }
.tuile-pose small { font-size: 11px; font-weight: 700; color: var(--doux); }

/* ---------- histoires à trous, scène par scène ---------- */
.scene-num { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); margin: 4px 0 8px; }
.recit-scene { margin-bottom: 12px; }
.trou.actif { background: var(--violet-clair); animation: pouls .7s ease-in-out infinite alternate; }
.trad-scene { margin: 0 0 12px; font-size: 14px; color: var(--doux); }
.trad-scene summary { cursor: pointer; font-weight: 700; }
.trad-scene p { margin: 6px 0 0; }
.defi { background: var(--carte); border-radius: 22px; box-shadow: var(--ombre); padding: 16px; margin-bottom: 12px; animation: fondu .2s; }
.defi:empty { display: none; }
.defi .choix { margin-top: 10px; }
.defi-tete { text-align: center; margin-bottom: 6px; }
.defi-indice { text-align: center; font-style: italic; color: var(--doux); margin-bottom: 6px; }
.defi-mot { text-align: center; font-size: 24px; font-weight: 800; margin: 4px 0; }
.cases-lettres { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 12px 0; }
.case-lettre { width: 34px; height: 42px; border-radius: 10px; border: 2px dashed var(--ligne); display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.case-lettre.pleine { border: 2px solid var(--violet); background: var(--violet-clair); cursor: pointer; }
.tuiles-lettres { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.tuile-lettre { width: 42px; height: 46px; border-radius: 12px; background: var(--violet); color: #fff; font-size: 22px; font-weight: 800; box-shadow: 0 4px 0 color-mix(in srgb, var(--violet) 60%, #000); }
.tuile-lettre:disabled { opacity: .2; box-shadow: none; }
.gros-haut-parleur { display: block; margin: 8px auto; width: 74px; height: 74px; border-radius: 50%; background: var(--violet); color: #fff; font-size: 34px; box-shadow: var(--ombre); }
.suite-scene { display: grid; gap: 8px; }
.saute { animation: saute .4s; }

/* ---------- Association éclair ---------- */
.match { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tuile-match { min-height: 84px; border-radius: 16px; background: var(--carte); box-shadow: 0 4px 0 var(--ligne); padding: 8px 6px; font-size: 15px; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; transition: transform .15s, opacity .3s; }
.tuile-match.de { background: var(--violet-clair); }
.tuile-match.choisie { outline: 3px solid var(--violet); transform: scale(1.04); }
.tuile-match.rate { background: color-mix(in srgb, var(--rouge-ko) 25%, var(--carte)); }
.tuile-match.partie { opacity: 0; transform: scale(.6); pointer-events: none; }

/* ---------- Astéroïdes ---------- */
.pastilles { display: flex; gap: 6px; }
.ast-scene { position: relative; height: min(66vh, 600px); min-height: 380px; border-radius: 24px; overflow: hidden; touch-action: none; background: #070418;
  box-shadow: 0 12px 34px rgba(20, 10, 70, .45), inset 0 0 0 1px rgba(160,140,255,.25); }
.ast-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ast-carte { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 2; text-align: center; padding: 10px 14px 12px; border-radius: 18px; pointer-events: none;
  background: linear-gradient(180deg, rgba(40,28,110,.72), rgba(20,14,60,.62)); border: 1px solid rgba(170,150,255,.35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.ast-carte .etiquette { color: #b7a8ff; }
.ast-carte.on { animation: carteArrive .45s cubic-bezier(.2,.9,.3,1.2); }
@keyframes carteArrive { from { transform: translateY(-14px) scale(.96); opacity: 0; } }
.ast-mot { font-size: 23px; font-weight: 900; text-shadow: 0 0 14px rgba(150,120,255,.6); }
.ast-mot .art { text-shadow: none; }
.ast-combo { position: absolute; right: 14px; top: 96px; z-index: 2; font-weight: 900; color: #ffd34d; text-shadow: 0 0 10px rgba(255,160,40,.8); pointer-events: none; }
.ast-banniere { position: absolute; left: 50%; top: 45%; z-index: 3; transform: translate(-50%, -50%); font-size: 30px; font-weight: 900; color: #fff; opacity: 0; pointer-events: none; white-space: nowrap;
  text-shadow: 0 0 18px rgba(126,249,255,.9), 0 2px 4px rgba(0,0,0,.6); letter-spacing: .04em; }
.ast-banniere.on { animation: badgeNiveau 1.8s ease forwards; }

/* ---------- Ballons (pendu) ---------- */
.question.petite { padding: 14px; margin-bottom: 8px; }
.question.petite .mot { font-size: 22px; }
.bl-scene { position: relative; height: clamp(190px, 36vh, 290px); border-radius: 24px; overflow: hidden; margin-bottom: 12px; isolation: isolate;
  --horizon: 34%;   /* hauteur de la mer du large */
  background: linear-gradient(180deg, #3f8fe0 0%, #7dbcf3 38%, #bfe0fa 58%, #f3e9dc 65.5%, #f3e9dc 66%); box-shadow: 0 10px 28px rgba(30,60,140,.22), inset 0 0 0 1px rgba(255,255,255,.2); }
@media (prefers-color-scheme: dark) { .bl-scene { background: linear-gradient(180deg, #2f6cc4 0%, #5f9ee6 40%, #a9cdf2 58%, #e8d6c4 65.5%, #e8d6c4 66%); } }
/* décor (DECOR_BALLONS dans app.js) : soleil et son halo, La Réunion au fond, mer du large avec rides et reflets, voilier */
.bl-halo { position: absolute; right: -10%; bottom: calc(var(--horizon) - 30%); width: 70%; height: 80%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,236,190,.55), rgba(255,236,190,0)); }
.bl-soleil { position: absolute; right: 4%; top: 2%; width: clamp(64px, 26%, 96px); aspect-ratio: 1; pointer-events: none; }
.bl-soleil svg { display: block; width: 100%; height: 100%; }
/* La Réunion au loin (DECOR_BALLONS.reunion) : à gauche, à l'écart de la grappe de ballons */
.bl-reunion { position: absolute; left: 1%; bottom: calc(var(--horizon) - 1px); width: 46%; aspect-ratio: 300 / 96; pointer-events: none; }
.bl-reunion svg { display: block; width: 100%; height: 100%; overflow: visible; }   /* le panache dépasse au-dessus */
/* éruption du Piton de la Fournaise : lueur et fontaine qui vacillent, lave qui descend, bouffées de fumée */
.re-lueur, .re-fontaine { transform-box: fill-box; transform-origin: 50% 100%; animation: reLueur 1.1s ease-in-out infinite alternate; }
@keyframes reLueur { from { opacity: .75; transform: scale(.85); } to { opacity: 1; transform: scale(1.12); } }
.re-lave { animation: reLave 1.6s ease-in-out infinite alternate; }
@keyframes reLave { from { opacity: .7; } to { opacity: 1; } }
.re-lave-coule { animation: reCoule 2.4s linear infinite; }
@keyframes reCoule { to { stroke-dashoffset: -14; } }
.re-bouffee { transform-box: fill-box; transform-origin: center; animation: reBouffee 6.4s ease-out infinite; opacity: 0; }
@keyframes reBouffee { 0% { transform: translate(0, 0) scale(.5); opacity: .85; } 100% { transform: translate(-16px, -54px) scale(3.2); opacity: 0; } }
.re-vapeur { transform-box: fill-box; transform-origin: 50% 100%; animation: reVapeur 4s ease-in-out infinite alternate; }
@keyframes reVapeur { to { transform: translateY(-3px) scale(1.15); opacity: .7; } }
.re-nuages { animation: reNuages 26s ease-in-out infinite; }
@keyframes reNuages { 50% { transform: translateX(9px); } }
.bl-large { position: absolute; left: 0; right: 0; bottom: 0; height: var(--horizon); pointer-events: none;
  background: linear-gradient(180deg, #a9d3f0 0%, #5ea8e0 9%, #3a8ad0 35%, #2068b3 75%, #18579c 100%); }
.bl-large::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1.5px; background: rgba(255,255,255,.75); }
.bl-large > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bl-scintilles { position: absolute; right: -6%; top: 0; bottom: 0; width: 44%; }
.bl-scintilles i { position: absolute; height: 1.6px; border-radius: 2px; margin-left: -10px; background: linear-gradient(90deg, transparent, #fffbe8 30%, #fff 50%, #fffbe8 70%, transparent); filter: drop-shadow(0 0 2px #fff6c2); animation: scintilleMer 2.4s ease-in-out infinite; }
@keyframes scintilleMer { 0%, 100% { opacity: .1; transform: scaleX(.4); } 50% { opacity: .95; transform: scaleX(1); } }
.bl-voilier { position: absolute; bottom: calc(var(--horizon) - 6%); left: 0; height: 12%; aspect-ratio: 40 / 44; pointer-events: none; animation: voilier 70s linear infinite; animation-delay: -24s; }
.bl-voilier svg { display: block; width: 100%; height: 100%; animation: tangage 3.2s ease-in-out infinite; transform-origin: 50% 85%; }
@keyframes voilier { from { transform: translateX(-60px); } to { transform: translateX(110vw); } }
@keyframes tangage { 50% { transform: rotate(-3deg) translateY(1px); } }
.bl-scene .pl-oiseau { z-index: 1; }
/* paille-en-queue (DECOR_BALLONS.pailleEnQueue) : traversent le ciel, ailes par séries de battements puis vol plané */
.bl-pq { position: absolute; left: -12%; width: calc(36px * var(--k)); z-index: 1; pointer-events: none; animation: pqVol var(--d) linear infinite; animation-delay: var(--dl); }
.bl-pq.pq-retour { animation-name: pqVolRetour; }
.bl-pq svg { display: block; width: 100%; overflow: visible; filter: drop-shadow(0 1px 1px rgba(30,60,110,.18)); }
.bl-pq.pq-retour svg { transform: scaleX(-1); }
@keyframes pqVol { 0% { left: -12%; transform: translateY(0) rotate(0); } 22% { transform: translateY(-9px) rotate(-4deg); } 48% { transform: translateY(4px) rotate(3deg); } 74% { transform: translateY(-6px) rotate(-3deg); } 100% { left: 108%; transform: translateY(0) rotate(0); } }
@keyframes pqVolRetour { 0% { left: 108%; transform: translateY(0) rotate(0); } 26% { transform: translateY(6px) rotate(-3deg); } 52% { transform: translateY(-7px) rotate(4deg); } 78% { transform: translateY(3px) rotate(-2deg); } 100% { left: -12%; transform: translateY(0) rotate(0); } }
.pq-ailes { transform-box: view-box; transform-origin: 30px 14px; animation: pqBat 3.2s ease-in-out infinite; animation-delay: var(--dl); }
@keyframes pqBat { 0%, 9%, 18%, 27% { transform: scaleY(1); } 4.5%, 13.5%, 22.5% { transform: scaleY(-.6); } 36%, 100% { transform: scaleY(.7); } }
.pq-queue { transform-box: view-box; transform-origin: 21px 15px; animation: pqQueue 1.4s ease-in-out infinite alternate; }
@keyframes pqQueue { from { transform: rotate(-5deg); } to { transform: rotate(6deg); } }
.bl-grappe { position: absolute; left: 0; right: 0; top: 14px; height: 190px; transform-origin: 50% 0; scale: var(--k, 1); transform: translateY(var(--chute, 0)); transition: transform .9s cubic-bezier(.3,1.4,.5,1); animation: flotte 4s ease-in-out infinite; z-index: 2; }
@keyframes flotte { 50% { translate: 0 -6px; } }
.bl-ficelles { position: absolute; left: 50%; top: 0; width: 200px; height: 150px; margin-left: -100px; z-index: -1; overflow: visible; }
.bl-ficelles path { fill: none; stroke: rgba(70,70,90,.7); stroke-width: 1.2; transition: opacity .3s; }
.bl-ficelles path.lache { opacity: 0; }
.bl-ballon { position: absolute; width: 46px; margin-left: -23px; transform-origin: 50% 88%; animation: balancier 3s ease-in-out infinite; animation-delay: calc(var(--ph) * -1);
  filter: drop-shadow(0 6px 6px rgba(20,40,90,.25)); }
.bl-ballon svg { display: block; width: 100%; }
@keyframes balancier { 0%, 100% { transform: rotate(var(--rot)); } 50% { transform: rotate(calc(var(--rot) * -1)); } }
.bl-ballon.eclate { animation: eclateBallon .22s ease-out forwards; }
@keyframes eclateBallon { 40% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
.bl-eclat { position: absolute; z-index: 4; width: 9px; height: 5px; border-radius: 2px; pointer-events: none; animation: eclat2 .75s cubic-bezier(.2,.7,.4,1) forwards; }
@keyframes eclat2 { to { transform: translate(var(--dx), calc(var(--dy) + 30px)) rotate(var(--r)); opacity: 0; } }
.bl-pop { position: absolute; z-index: 5; transform: translate(-50%, -50%); font-size: 22px; font-weight: 900; color: #fff; -webkit-text-stroke: 1.5px #c2185b; text-shadow: 0 3px 0 #c2185b;
  pointer-events: none; animation: pop .8s ease-out forwards; font-style: italic; }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(.4) rotate(-12deg); } 25% { transform: translate(-50%, -60%) scale(1.15) rotate(-6deg); } 100% { transform: translate(-50%, -110%) scale(1) rotate(-6deg); opacity: 0; } }
.bl-perso { position: absolute; left: 50%; top: 118px; width: 70px; margin-left: -35px; }
.bl-perso .perso { width: 70px; box-shadow: 0 6px 14px rgba(20,40,90,.3); }
.bl-grappe.plouf { transform: translateY(150px); transition: transform .8s cubic-bezier(.6,0,1,.6); animation: none; }
.bl-grappe.envol { transform: translateY(-260px); transition: transform 1.8s cubic-bezier(.4,0,.6,1); }
.bl-mer { position: absolute; left: 0; right: 0; bottom: 0; height: calc(clamp(50px, 21%, 76px) + 44px);   /* + place de l'aileron (MARGE dans animerMer) */ z-index: 3; overflow: hidden; pointer-events: none; }
.bl-mer canvas { display: block; width: 100%; height: 100%; }
/* le requin est dessiné dans la mer du premier plan (animerMer : nager, dessinerRequin, attaquer) */
/* perdu : pas de montée de l'eau ; la tache rouge est dessinée dans la mer (animerMer, saigner) */
.bl-plouf { position: absolute; left: 50%; bottom: 30px; z-index: 4; width: 90px; height: 50px; margin-left: -45px; border-radius: 50% 50% 0 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,255,255,.95), rgba(180,225,255,.7) 50%, transparent 70%); animation: plouf .9s ease-out forwards; }
@keyframes plouf { 0% { transform: scale(.2, .2); opacity: 1; } 40% { transform: scale(1.2, 1.4); } 100% { transform: scale(1.6, .6); opacity: 0; } }
.mot-pendu { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 5px; margin: 6px 0 12px; font-size: 24px; font-weight: 800; }
.lettre-pendu { width: 26px; border-bottom: 3px solid var(--texte); text-align: center; min-height: 32px; }
.lettre-pendu.vue { color: var(--violet); }
.mot-pendu .espace { width: 14px; }
.clavier { display: grid; gap: 6px; margin-bottom: 10px; touch-action: manipulation; }
.clavier-ligne { display: flex; gap: 4px; justify-content: center; }
/* toutes les touches ont la même largeur, comme sur un vrai clavier (--n = touches de la 1re ligne) */
.clavier button { flex: 0 1 calc((100% - (var(--n, 11) - 1) * 4px) / var(--n, 11)); max-width: 40px; min-width: 0; padding: 0; height: clamp(40px, 6.4vh, 50px); border-radius: 9px; background: var(--carte); box-shadow: 0 3px 0 var(--ligne); font-size: 18px; font-weight: 800; }
.clavier button.bon { background: var(--vert-ok); color: #fff; box-shadow: none; }
.clavier button.faux { background: var(--rouge-ko); color: #fff; opacity: .5; box-shadow: none; }

/* ---------- Pluie de mots (décor : ciel, soleil, nuages, collines, orage) ---------- */
.pl-scene { position: relative; height: clamp(220px, 42vh, 340px); transition: height .25s; border-radius: 24px; overflow: hidden; margin-bottom: 8px; isolation: isolate;
  box-shadow: 0 10px 30px rgba(30, 20, 90, .25), inset 0 0 0 1px rgba(255,255,255,.15); --lum: 1; }
.pl-ciel { position: absolute; inset: 0; transition: opacity 2.5s ease; }
.pl-matin { background: linear-gradient(180deg, #7fb6f0 0%, #b9d9f5 45%, #ffd9b0 85%, #ffc49a 100%); }
.pl-midi { background: linear-gradient(180deg, #2f86e6 0%, #6fb4f5 50%, #bfe3ff 100%); opacity: 0; }
.pl-soir { background: linear-gradient(180deg, #2a1d5c 0%, #7a3f8f 38%, #e8705a 72%, #ffb36b 100%); opacity: 0; }
.pl-nuit { background: linear-gradient(180deg, #050a1f 0%, #101a42 55%, #22336b 100%); opacity: 0; }
.pl-etoiles { position: absolute; inset: 0; opacity: 0; transition: opacity 2.5s; }
.phase-nuit .pl-etoiles, .phase-soir .pl-etoiles { opacity: .55; }
.phase-nuit .pl-etoiles { opacity: 1; }
.pl-etoiles i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; transform: scale(var(--t)); animation: scintille 3.4s ease-in-out infinite; box-shadow: 0 0 4px #fff; }
@keyframes scintille { 50% { opacity: .25; } }
.pl-astre { position: absolute; width: 104px; height: 104px; margin: -52px 0 0 -52px; left: 20%; top: 46%; transition: left 3s ease, top 3s ease, opacity 1.5s, filter 1.5s; }
.pl-astre svg { width: 100%; height: 100%; display: block; }
.pl-rayons { animation: tourne 40s linear infinite; transform-origin: 0 0; }
.phase-midi .pl-astre { left: 68%; top: 22%; }
.phase-soir .pl-astre { left: 80%; top: 52%; filter: hue-rotate(-18deg) saturate(1.4); }
.phase-nuit .pl-astre { left: 92%; top: 120%; opacity: 0; }
.meteo-2 .pl-astre { opacity: .75; } .meteo-1 .pl-astre, .meteo-0 .pl-astre { opacity: .15; }
.pl-lune { position: absolute; width: 34px; height: 34px; border-radius: 50%; left: 78%; top: -20%; box-shadow: 9px -5px 0 0 #f6f1cf; filter: drop-shadow(0 0 10px rgba(246,241,207,.7)); transition: top 3s ease, opacity 2s; opacity: 0; }
.phase-nuit .pl-lune { top: 16%; opacity: 1; }
.meteo-1 .pl-lune, .meteo-0 .pl-lune { opacity: .2; }
.pl-nuage { position: absolute; left: 0; animation: deriveNuage var(--d) linear infinite; animation-delay: var(--dl); }
.pl-nuage svg { width: 100%; display: block; overflow: visible; }
@keyframes deriveNuage { from { transform: translateX(-110%); } to { transform: translateX(330%); } }
.pl-nuage.clair .pl-n-corps { fill: #fff; } .pl-nuage.clair .pl-n-ombre { fill: #b8c7e0; opacity: .5; } .pl-nuage.clair .pl-n-reflet { fill: #fff; }
.pl-nuage.clair { filter: drop-shadow(0 6px 10px rgba(60,80,140,.18)); transition: opacity 2s, filter 2s; }
.pl-nuage.loin { opacity: .7; }
.phase-soir .pl-nuage.clair .pl-n-corps { fill: #ffd6c4; } .phase-soir .pl-nuage.clair .pl-n-ombre { fill: #b05a7a; }
.phase-nuit .pl-nuage.clair { opacity: .25; }
.meteo-1 .pl-nuages, .meteo-0 .pl-nuages { opacity: .3; }
.pl-nuages { position: absolute; inset: 0; transition: opacity 2s; }
.pl-orage { position: absolute; inset: 0 0 auto 0; height: 70%; transform: translateY(-115%); transition: transform 2.2s cubic-bezier(.3,.7,.3,1); }
.meteo-2 .pl-orage { transform: translateY(-45%); } .meteo-1 .pl-orage { transform: translateY(-12%); } .meteo-0 .pl-orage { transform: translateY(0); }
.pl-nuage.sombre { animation: balanceNuage var(--d) ease-in-out infinite alternate; animation-delay: var(--dl); filter: drop-shadow(0 10px 14px rgba(0,0,0,.35)); }
@keyframes balanceNuage { from { transform: translateX(-8%); } to { transform: translateX(8%); } }
.pl-nuage.sombre .pl-n-corps { fill: #4a5168; } .pl-nuage.sombre .pl-n-ombre { fill: #262a3a; opacity: .8; } .pl-nuage.sombre .pl-n-reflet { fill: #6c7590; }
.pl-nuage.sombre.bas .pl-n-corps { fill: #3a4054; }
.pl-voile { position: absolute; inset: 0; background: linear-gradient(180deg, #1a1f33, #2c3550); opacity: 0; transition: opacity 2s; pointer-events: none; }
.meteo-2 .pl-voile { opacity: .18; } .meteo-1 .pl-voile { opacity: .42; } .meteo-0 .pl-voile { opacity: .62; }
.pl-arc { position: absolute; left: 50%; top: 78%; width: 130%; aspect-ratio: 1; transform: translate(-50%, 0) scale(.9); border-radius: 50%; opacity: 0; pointer-events: none;
  background: radial-gradient(circle, transparent 54%, rgba(155,80,255,.0) 54%, rgba(155,80,255,.35) 56%, rgba(60,130,255,.35) 58%, rgba(40,200,120,.35) 60%, rgba(255,230,70,.38) 62%, rgba(255,150,40,.35) 64%, rgba(255,60,60,.32) 66%, transparent 68%); }
.pl-arc.on { animation: arcEnCiel 3.2s ease forwards; }
@keyframes arcEnCiel { 20%, 70% { opacity: 1; transform: translate(-50%, 0) scale(1); } to { opacity: 0; transform: translate(-50%, 0) scale(1.02); } }
/* paysage : dessin 3:1 qui garde ses proportions (voir paysage dans app.js). Scène large : tout le panorama ;
   scène étroite et haute (téléphone) : le paysage prend au moins la moitié de la hauteur et on en voit le centre. */
.pl-scene { container-type: size; }
.pl-sol, .pl-lumieres { position: absolute; left: 0; width: 100%; bottom: 0; height: min(58cqh, max(33.34cqw, 50cqh)); pointer-events: none; }
.pl-sol { filter: brightness(var(--lum)) saturate(calc(.4 + var(--lum) * .6)); transition: filter 2s; }
.pl-sol svg, .pl-lumieres svg { width: 100%; height: 100%; display: block; }
.pl-sol path, .pl-sol g { transition: fill 2.5s; }
.phase-soir .pl-loin { fill: url(#plLoinSoir); } .phase-soir .pl-pres { fill: url(#plPresSoir); }
.phase-nuit .pl-sol { filter: brightness(calc(var(--lum) * 1.15)) saturate(1.15); }
.phase-nuit .pl-loin { fill: url(#plLoinNuit); } .phase-nuit .pl-pres { fill: url(#plPresNuit); } .phase-nuit .pl-neige { fill: #e4ecff; }
.phase-soir .pl-neige { fill: #ffd9cf; } .phase-matin .pl-neige { fill: #fff6ec; }
.pl-jet { transform-box: fill-box; transform-origin: 50% 100%; animation: jetDeau 2.6s ease-in-out infinite alternate; }
@keyframes jetDeau { from { transform: scaleY(.94); } to { transform: scaleY(1.03); } }
.pl-lumieres { opacity: 0; transition: opacity 2.5s; filter: drop-shadow(0 0 2px rgba(255,210,110,.9)); }
.phase-soir .pl-lumieres { opacity: .55; } .phase-nuit .pl-lumieres { opacity: 1; } .meteo-0 .pl-lumieres { opacity: .8; }
.pl-oiseaux { position: absolute; inset: 0; transition: opacity 2s; pointer-events: none; }
.phase-soir .pl-oiseaux, .phase-nuit .pl-oiseaux, .meteo-1 .pl-oiseaux, .meteo-0 .pl-oiseaux { opacity: 0; }
.pl-oiseau { position: absolute; left: 0; width: calc(22px * var(--k)); animation: volOiseau var(--d) linear infinite; animation-delay: var(--dl); }
.pl-oiseau svg { display: block; width: 100%; stroke: #3b4a6b; animation: battre .5s ease-in-out infinite alternate; transform-origin: 50% 60%; }
@keyframes volOiseau { from { transform: translate(-30px, 0); } 50% { transform: translate(50vw, -14px); } to { transform: translate(110vw, 6px); } }
@keyframes battre { to { transform: scaleY(.35); } }
.pl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.pl-flash { position: absolute; inset: 0; background: #eef4ff; opacity: 0; pointer-events: none; z-index: 4; mix-blend-mode: screen; }
.pl-flash.on { animation: flashEclair .45s ease-out; } .pl-flash.on.fort { animation: flashEclairFort .9s ease-out; }
@keyframes flashEclair { 0% { opacity: .55; } 15% { opacity: .1; } 25% { opacity: .4; } 100% { opacity: 0; } }
@keyframes flashEclairFort { 0% { opacity: .95; } 12% { opacity: .2; } 22% { opacity: .85; } 40% { opacity: .3; } 100% { opacity: 0; } }
.pl-badge { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 5; pointer-events: none; opacity: 0;
  font-size: 26px; font-weight: 900; color: #fff; text-shadow: 0 2px 12px rgba(40,20,120,.6), 0 0 2px rgba(0,0,0,.4); white-space: nowrap; }
.pl-badge.on { animation: badgeNiveau 1.8s ease forwards; }
@keyframes badgeNiveau { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 20%, 70% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1.05); } }
/* le mot dans sa goutte d'eau */
.pl-goutte { position: absolute; top: -80px; z-index: 2; max-width: 62%; will-change: top; }
.pl-bulle { position: relative; padding: 11px 16px 10px; border-radius: 22px 22px 22px 22px; text-align: center; font-weight: 800; font-size: 17px; color: #10234a; line-height: 1.2;
  background: radial-gradient(120% 140% at 30% 20%, rgba(255,255,255,.95), rgba(214,236,255,.85) 45%, rgba(150,200,255,.75));
  border: 1.5px solid rgba(255,255,255,.9); box-shadow: 0 8px 18px rgba(20,60,140,.28), inset 0 -6px 12px rgba(70,140,230,.35), inset 0 4px 6px rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: balance 2.4s ease-in-out infinite; transform-origin: 50% -20px; }
.pl-bulle::before { content: ""; position: absolute; left: 50%; top: -11px; width: 18px; height: 18px; margin-left: -9px; border-radius: 0 50% 50% 50%; transform: rotate(45deg);
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(200,228,255,.9)); border-left: 1.5px solid rgba(255,255,255,.9); border-top: 1.5px solid rgba(255,255,255,.9); }
.pl-bulle::after { content: ""; position: absolute; left: 14%; top: 18%; width: 22%; height: 22%; border-radius: 50%; background: rgba(255,255,255,.85); filter: blur(1px); }
.pl-bulle span { position: relative; z-index: 1; }
.pl-bulle b { display: block; color: #0f7a46; font-size: 18px; position: relative; z-index: 1; }
.pl-bulle.rate { animation: secoue .4s; box-shadow: 0 0 0 3px rgba(229,72,77,.7), 0 8px 18px rgba(20,60,140,.28); }
@keyframes balance { 50% { transform: rotate(2.5deg); } 0%, 100% { transform: rotate(-2.5deg); } }
.pl-goutte.pl-danger .pl-bulle { box-shadow: 0 0 0 3px rgba(255,140,60,.75), 0 0 22px rgba(255,120,60,.55), inset 0 -6px 12px rgba(70,140,230,.35); }
.pl-goutte.pl-ecrase .pl-bulle { animation: ecrase .35s ease-out forwards; }
@keyframes ecrase { 50% { transform: scale(1.25, .55) translateY(12px); } 100% { transform: scale(1, 1); } }
.pl-goutte.pl-pose { z-index: 6; }
.pl-goutte.pl-pose .pl-bulle { animation: none; background: rgba(255,255,255,.95); }
.pl-goutte.pl-fond { transition: opacity .35s, transform .35s; opacity: 0; transform: translateY(10px) scale(.9); }
.pl-plus { position: absolute; z-index: 5; transform: translate(-50%, -50%); font-size: 24px; font-weight: 900; color: #fff6c2; text-shadow: 0 2px 8px rgba(120,60,0,.6); pointer-events: none; animation: plusUn .9s ease-out forwards; }
@keyframes plusUn { to { transform: translate(-50%, -160%) scale(1.3); opacity: 0; } }
.pl-onde { position: absolute; z-index: 2; width: 60px; height: 14px; margin: -7px 0 0 -30px; border-radius: 50%; border: 2px solid rgba(220,240,255,.9); pointer-events: none; animation: onde 1.2s ease-out forwards; }
@keyframes onde { to { transform: scale(3.2); opacity: 0; } }
.pl-aide { text-align: center; font-size: 14px; color: var(--doux); min-height: 20px; margin-bottom: 6px; }
.pl-ligne { display: flex; gap: 8px; align-items: stretch; }
.pl-ligne .saisie { flex: 1; margin: 0; }
.pl-valider { flex: none; width: 58px; border-radius: 16px; background: var(--violet); color: #fff; font-size: 24px; font-weight: 900; box-shadow: 0 4px 0 color-mix(in srgb, var(--violet) 60%, #000); }
.pl-scene.secoue { animation: secoue .45s; }
.match-cadre { position: relative; }
.match.cachee .tuile-match { color: transparent; filter: blur(6px); pointer-events: none; }
.match.cachee .tuile-match * { visibility: hidden; }
.decompte { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; font-weight: 900; color: var(--violet); text-shadow: 0 6px 24px rgba(109,74,255,.35); animation: saute .8s infinite; pointer-events: none; }

/* ---------- Memory (3 niveaux, aperçu, combos, collection) ---------- */
.mx-hud { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; min-height: 34px; }
.mx-niveau { font-size: 15px; } .mx-niveau .mx-paires { color: var(--doux); font-size: 13px; }
.mx-combo { flex: 1; text-align: center; font-weight: 900; color: var(--orange); }
.mx-combo.pop { animation: saute .35s; }
.mx-oeil { padding: 7px 11px; border-radius: 99px; background: var(--violet-clair); color: var(--violet); font-weight: 800; font-size: 13px; white-space: nowrap; }
.mx-oeil.utilise { opacity: .4; }
.mx-cadre { position: relative; padding: 10px; border-radius: 24px; background: radial-gradient(120% 90% at 50% 0%, #3a2c8f, #1b1550 70%); box-shadow: 0 12px 30px rgba(30,20,90,.3), inset 0 0 0 1px rgba(255,255,255,.08); }
.mx-plateau { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; perspective: 1000px; }
.mx-carte { height: var(--h, 100px); padding: 0; background: none; border-radius: 16px; }
.mx-carte.donne { animation: donne .5s cubic-bezier(.2,.9,.3,1.2) backwards; animation-delay: calc(var(--i) * 45ms); }
@keyframes donne { from { transform: translateY(-40px) scale(.4) rotate(-12deg); opacity: 0; } }
.mx-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.35,1.4,.5,1); }
.mx-carte.ouverte .mx-in, .mx-carte.trouvee .mx-in { transform: rotateY(180deg); }
.mx-carte:not(.ouverte):not(.trouvee):active .mx-in { transform: scale(.95); }
.mx-dos, .mx-face { position: absolute; inset: 0; border-radius: 16px; -webkit-backface-visibility: hidden; backface-visibility: hidden; display: grid; place-items: center; overflow: hidden; }
.mx-dos { box-shadow: 0 4px 0 rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.25); }
.mx-dos.de { background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.4), transparent 38%), repeating-linear-gradient(45deg, rgba(255,255,255,.09) 0 7px, transparent 7px 14px), linear-gradient(145deg, #8a6bff, #4a2bd0); }
.mx-dos.fr { background: radial-gradient(circle at 30% 22%, rgba(255,255,255,.45), transparent 38%), repeating-linear-gradient(-45deg, rgba(255,255,255,.12) 0 7px, transparent 7px 14px), linear-gradient(145deg, #ffbe5c, #ff5f6d); }
.mx-dos::after { content: ""; position: absolute; inset: 5px; border-radius: 12px; border: 2px solid rgba(255,255,255,.35); }
.mx-dos::before { content: ""; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%); animation: reflet 4.5s ease-in-out infinite; animation-delay: calc(var(--i, 0) * .12s); }
@keyframes reflet { 0%, 70% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.mx-dos span { position: relative; font-size: clamp(22px, calc(var(--h, 100px) * .3), 34px); filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.mx-face { transform: rotateY(180deg); box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 8px 16px rgba(0,0,0,.2); }
.mx-face.de { background: #fffdf8; color: #1f1b3a; padding: 14px 5px 6px; }
.mx-face.de .mx-bande { position: absolute; left: 0; right: 0; top: 0; height: 9px; background: var(--doux); }
.mx-face.de.g-der .mx-bande { background: #2f6fd6; } .mx-face.de.g-die .mx-bande { background: #d64545; } .mx-face.de.g-das .mx-bande { background: #2a9d58; }
.mx-mot { font-weight: 800; font-size: clamp(12px, calc(var(--h, 100px) * .15), 16px); line-height: 1.15; text-align: center; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; max-width: 100%; }
.mx-face.fr { background: radial-gradient(circle at 50% 35%, #fff, var(--pastel) 75%); color: #1f1b3a; padding: 5px; }
.mx-emoji { font-size: clamp(28px, calc(var(--h, 100px) * .45), 54px); line-height: 1; filter: drop-shadow(0 4px 5px rgba(0,0,0,.18)); }
.mx-trad { font-weight: 800; font-size: clamp(11px, calc(var(--h, 100px) * .13), 15px); line-height: 1.15; text-align: center; overflow-wrap: break-word; -webkit-hyphens: auto; hyphens: auto; }
.mx-carte.brille .mx-face { animation: mxBrille .6s ease; }
@keyframes mxBrille { 40% { box-shadow: 0 0 0 4px #3ee08a, 0 0 28px #3ee08a; transform: rotateY(180deg) scale(1.1); } }
.mx-carte.rate .mx-face { animation: secoue .4s; box-shadow: 0 0 0 3px #ff5a5a, 0 8px 16px rgba(0,0,0,.2); }
.mx-carte.partie { visibility: hidden; }
.mx-vol { position: fixed; z-index: 60; margin: 0; pointer-events: none; transition: transform .7s cubic-bezier(.5,0,.2,1), opacity .7s ease-in; }
.mx-plus { position: absolute; z-index: 5; transform: translate(-50%, -50%); font-size: 22px; font-weight: 900; color: #fff3a8; text-shadow: 0 2px 8px rgba(0,0,0,.5); pointer-events: none; animation: plusUn 1s ease-out forwards; }
.mx-banniere { position: absolute; inset: 0; z-index: 6; display: grid; place-content: center; text-align: center; gap: 4px; pointer-events: none; opacity: 0; color: #fff; }
.mx-banniere b { font-size: 34px; font-weight: 900; text-shadow: 0 3px 16px rgba(0,0,0,.6); }
.mx-banniere span { font-size: 16px; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.mx-banniere.on { animation: mxBanniere 1.9s ease forwards; }
@keyframes mxBanniere { 0% { opacity: 0; transform: scale(.7); } 15%, 70% { opacity: 1; transform: scale(1); background: rgba(10,6,40,.55); } 100% { opacity: 0; transform: scale(1.05); } }
.mx-chrono { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); z-index: 4; padding: 5px 14px; border-radius: 99px; color: #fff; font-weight: 900; font-size: 14px; overflow: hidden;
  background: #ff8a3d; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.mx-chrono::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.25); transform-origin: left; animation: mxChrono var(--d) linear forwards; }
.mx-chrono span { position: relative; }
@keyframes mxChrono { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.mx-coll-titre { margin: 18px 2px 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--doux); }
.mx-collection, .mx-recap { display: flex; flex-wrap: wrap; gap: 6px; min-height: 36px; }
.mx-recap { justify-content: center; margin: 8px 0; }
.mx-puce { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; background: var(--carte); box-shadow: 0 2px 0 var(--ligne); font-size: 14px; cursor: pointer; }
.mx-puce span { font-size: 18px; }
.mx-puce.nouvelle { animation: mxPuce .8s cubic-bezier(.2,.9,.3,1.4); }
@keyframes mxPuce { 0% { transform: scale(0); } 60% { transform: scale(1.2); background: #c9f2d9; } }

/* petits téléphones : touches du clavier des ballons un peu plus serrées, scène un peu plus basse */
@media (max-width: 380px) {
  .clavier button { font-size: 16px; border-radius: 8px; }
}
@media (max-height: 700px) {
  .bl-scene { height: clamp(165px, 31vh, 290px); }
  .question.petite { padding: 10px 12px; margin-bottom: 6px; }
  .mot-pendu { margin: 4px 0 8px; font-size: 22px; }
}

/* ---------- clavier des jeux d'écriture ---------- */
.clav { display: grid; gap: 6px; margin: 8px 0 10px; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.clav-ligne { display: flex; gap: 4px; justify-content: center; }
.clav-t { flex: 0 1 calc((100% - (var(--n, 11) - 1) * 4px) / var(--n, 11)); min-width: 0; max-width: 40px; height: clamp(40px, 6.4vh, 50px); padding: 0; border-radius: 9px; background: var(--carte); box-shadow: 0 3px 0 var(--ligne);
  font-size: clamp(14px, 4.3vw, 18px); font-weight: 800; color: var(--texte); transition: background .25s, transform .08s; }
.clav-t:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ligne); }
.clav-t.large { flex: 1.6 1 0; max-width: 62px; font-size: 14px; background: var(--violet-clair); }
.clav-t.bon { background: #2fae63; color: #fff; box-shadow: 0 3px 0 #1d7a43; }
.clav-t.present { background: #e7b400; color: #fff; box-shadow: 0 3px 0 #a07c00; }
.clav-t.absent { background: color-mix(in srgb, var(--doux) 45%, var(--fond)); color: color-mix(in srgb, var(--texte) 55%, transparent); box-shadow: none; }

/* ---------- Mots croisés ---------- */
.cr-cadre { display: flex; justify-content: center; margin: 4px 0 10px; }
.cr-grille { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 3px; width: min(100%, calc(var(--cols) * 40px), calc((100vh - 320px) * var(--cols) / var(--rows))); width: min(100%, calc(var(--cols) * 40px), calc((100svh - 320px) * var(--cols) / var(--rows))); padding: 8px; border-radius: 18px;
  background: linear-gradient(135deg, #2b2370, #1a1450); box-shadow: 0 10px 26px rgba(30,20,90,.3); }
.cr-vide { aspect-ratio: 1; }
.cr-case { position: relative; aspect-ratio: 1; padding: 0; border-radius: 6px; background: #fdfcff; color: #1f1b3a; font-weight: 900; font-size: clamp(13px, 4.6vw, 20px);
  display: grid; place-items: center; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); transition: background .2s; }
.cr-case small { position: absolute; left: 2px; top: 0; font-size: 9px; font-weight: 800; color: #6d4aff; line-height: 1.1; }
.cr-case.dans-mot { background: #e6ddff; }
.cr-case.curseur { background: #ffd34d; box-shadow: inset 0 0 0 2px #e09a00; }
.cr-case.bonne { background: #c9f2d9; color: #12703c; }
.cr-case.fausse { background: #ffd6d6; color: #c0262c; }
.cr-indice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: center; text-align: center; min-height: 46px; padding: 8px 12px; border-radius: 16px;
  background: var(--carte); box-shadow: var(--ombre); font-weight: 700; font-size: 16px; }
.cr-num { background: var(--violet); color: #fff; border-radius: 99px; padding: 1px 9px; font-size: 13px; font-weight: 900; }
.cr-img { font-size: 24px; line-height: 1; }
.cr-actions { display: flex; gap: 8px; }
.cr-actions .btn { flex: 1; margin: 0; padding: 10px; font-size: 15px; }
.cr-listes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.cr-def { display: block; width: 100%; text-align: left; padding: 6px 8px; border-radius: 10px; background: none; font-size: 13px; line-height: 1.25; color: var(--texte); }
.cr-def.actif { background: var(--violet-clair); }
.cr-def.juste { color: var(--vert-ok); text-decoration: line-through; }

/* ---------- Mot mystère ---------- */
.my-indice .mot { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.my-img { font-size: 30px; }
.my-grille { display: grid; gap: 6px; justify-content: center; margin: 6px 0 4px; }
.my-ligne { display: grid; grid-template-columns: repeat(var(--n), min(46px, calc((100vw - 48px - (var(--n) - 1) * 6px) / var(--n)))); gap: 6px; }
.my-case { aspect-ratio: 1; border-radius: 10px; border: 2px solid var(--ligne); display: grid; place-items: center; font-size: clamp(16px, 5.5vw, 24px); font-weight: 900;
  background: var(--carte); transition: border-color .15s; }
@media (max-height: 700px) { .my-ligne { grid-template-columns: repeat(var(--n), min(38px, calc((100vw - 48px - (var(--n) - 1) * 6px) / var(--n)))); } .my-grille { gap: 4px; } }
.my-case.pleine { border-color: color-mix(in srgb, var(--texte) 45%, transparent); animation: saute .15s; }
.my-case.retourne { animation: retourne .5s ease; border-color: transparent; color: #fff; }
.my-case.bon { background: #2fae63; } .my-case.present { background: #e7b400; } .my-case.absent { background: color-mix(in srgb, var(--doux) 55%, var(--fond)); }
@keyframes retourne { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.my-ligne.gagne .my-case { animation: sautVictoire .6s ease; }
.my-ligne.gagne .my-case:nth-child(2) { animation-delay: .08s; } .my-ligne.gagne .my-case:nth-child(3) { animation-delay: .16s; } .my-ligne.gagne .my-case:nth-child(4) { animation-delay: .24s; }
.my-ligne.gagne .my-case:nth-child(5) { animation-delay: .32s; } .my-ligne.gagne .my-case:nth-child(6) { animation-delay: .4s; } .my-ligne.gagne .my-case:nth-child(7) { animation-delay: .48s; }
@keyframes sautVictoire { 40% { transform: translateY(-12px); } 70% { transform: translateY(2px); } }
.my-legende { margin-top: 2px; }
.my-ligne.secoue { animation: secoue .4s; }

/* ---------- Phrases : glisser-déposer ---------- */
.zone-phrase .tuile-mot, .reserve .tuile-mot { touch-action: none; -webkit-user-select: none; user-select: none; cursor: grab; }
.tuile-mot.prise { display: none; }
.tuile-mot.fantome { display: inline-block; min-height: 44px; background: transparent !important; border: 2px dashed var(--violet); box-shadow: none; animation: pouls .6s ease-in-out infinite alternate; }
.tuile-mot.volant { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; background: var(--violet); color: #fff; box-shadow: 0 12px 26px rgba(60,40,160,.35); }
.interrupteur input[type=checkbox] { flex: none; }
.interrupteur > div { flex: 1; padding-right: 10px; }

/* ---------- iPad et grands écrans : colonne plus large, textes et touches plus grands ---------- */
@media (min-width: 700px) {
  body { font-size: 19px; }
  #app { max-width: 760px; padding-left: 28px; padding-right: 28px; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .grille-jeux { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .jeu.large { grid-column: span 3; }
  .bulle, .feuille > div { max-width: 704px; }
  .clav-ligne, .clavier-ligne { gap: 6px; }
  .clav-t, .clavier button { max-width: 58px; height: clamp(44px, 6vh, 58px); font-size: 22px; border-radius: 11px; }
  .clav-t.large { max-width: 92px; font-size: 17px; }
  .bijoux { max-width: 520px; }
  .bl-scene { height: clamp(240px, 34vh, 340px); }
  .pl-scene { height: clamp(260px, 42vh, 460px); }
  .cr-grille { width: min(100%, calc(var(--cols) * 56px), calc((100svh - 420px) * var(--cols) / var(--rows))); }
  .cr-case { font-size: clamp(16px, 2.6vw, 26px); }
  .cr-case small { font-size: 11px; }
  .mot-pendu { font-size: 34px; gap: 8px; }
  .ast-scene { height: min(70vh, 860px); }
  .lettre-pendu { width: 36px; min-height: 44px; }
}

/* ---------- Boss de la semaine ---------- */
.boss-carte, .boss-mini, .bs-boss {
  --b1: hsl(var(--h) 72% 60%); --b2: hsl(var(--h) 62% 26%); --b3: hsl(var(--h) 90% 85%);
  --oeil: hsl(calc(var(--h) + 150) 95% 55%); --oeil2: hsl(calc(var(--h) + 150) 80% 22%);
}
.jeu.boss-carte { background: radial-gradient(circle at 12% 50%, hsl(var(--h) 90% 60% / .45), transparent 42%), linear-gradient(135deg, hsl(calc(var(--h) + 10) 55% 12%), hsl(var(--h) 50% 24%) 60%, hsl(calc(var(--h) - 40) 60% 30%)); color: #fff; padding-top: 10px; padding-bottom: 10px; }
.jeu.boss-carte span { color: rgba(255,255,255,.82); }
.boss-mini { flex: none; width: 62px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.boss-mini .bs-oeil-ferme, .boss-mini .bs-bouche .ouverte, .boss-mini .bs-armure { display: none; }
.boss-mini .bs-flotte { animation: bsFlotte 3.2s ease-in-out infinite; }
.boss-mini.vaincu, .boss-carte.vaincu .boss-mini { filter: grayscale(.4) drop-shadow(0 4px 8px rgba(0,0,0,.4)); }
.boss-mini.vaincu .bs-oeil-ouvert, .boss-carte.vaincu .boss-mini .bs-oeil-ouvert { display: none; }
.boss-mini.vaincu .bs-oeil-ferme, .boss-carte.vaincu .boss-mini .bs-oeil-ferme { display: inline; }

.bs-scene { position: relative; height: clamp(250px, 46vh, 380px); border-radius: 24px; overflow: hidden; margin-bottom: 10px; isolation: isolate; container-type: size; transition: height .25s; box-shadow: 0 10px 30px rgba(20,0,40,.3); }
.bs-scene.secoue { animation: bsSecoue .45s; }
@keyframes bsSecoue { 15% { transform: translate(var(--sec), calc(var(--sec) * -.6)); } 35% { transform: translate(calc(var(--sec) * -1), var(--sec)); } 55% { transform: translate(calc(var(--sec) * .7), calc(var(--sec) * .4)); } 75% { transform: translate(calc(var(--sec) * -.4), calc(var(--sec) * -.3)); } }
.bs-ciel { position: absolute; inset: 0; background:
  radial-gradient(circle at 62% 46%, hsl(var(--h) 95% 62% / .38), transparent 42%),
  linear-gradient(180deg, hsl(calc(var(--h) + 20) 60% 7%), hsl(var(--h) 48% 17%) 58%, hsl(calc(var(--h) - 35) 52% 24%)); }
.bs-ciel::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 62% 50%, rgba(255,60,30,.5), rgba(120,0,20,.35) 55%, rgba(60,0,10,.5)); opacity: 0; transition: opacity 1s; }
.bs-scene.rage .bs-ciel::after { opacity: 1; animation: bsPulse 1.2s ease-in-out infinite; }
@keyframes bsPulse { 50% { opacity: .7; } }
.bs-etoiles i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: .7; animation: bsScintille 3.4s ease-in-out infinite; transform: scale(var(--t)); }
@keyframes bsScintille { 50% { opacity: .15; } }
.bs-lune { position: absolute; right: 8%; top: 9%; width: 13cqw; max-width: 64px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 38% 36%, #fffbe8, #f3e3b8 55%, #cdb889); box-shadow: 0 0 30px 8px rgba(255,240,200,.25); opacity: .85; }
.bs-scene.rage .bs-lune { background: radial-gradient(circle at 38% 36%, #ffd9c8, #ff7a5a 55%, #b0302a); box-shadow: 0 0 34px 10px rgba(255,80,40,.35); }
.bs-decor { position: absolute; left: 0; right: 0; bottom: 0; height: 58%; }
.bs-decor svg { width: 100%; height: 100%; display: block; }
.bd-loin { fill: hsl(var(--h) 35% 15%); }
.bd-pres { fill: hsl(var(--h) 32% 10%); }
.bd-pilier { fill: hsl(var(--h) 25% 7%); }
.bd-sol { fill: hsl(var(--h) 30% 5%); }
.bd-lave { fill: none; stroke: #ff8a3d; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px #ff5a1a); opacity: .55; animation: bsLave 2.6s ease-in-out infinite; }
.bs-scene.rage .bd-lave { opacity: 1; stroke: #ff5a2a; }
@keyframes bsLave { 50% { opacity: .25; } }
.bs-cercle { position: absolute; left: 62%; bottom: 9%; width: min(44cqw, 300px); aspect-ratio: 1; transform: translate(-50%, 50%) rotateX(76deg); border-radius: 50%; border: 2px dashed hsl(var(--h) 95% 70% / .65); box-shadow: 0 0 24px hsl(var(--h) 95% 60% / .5), inset 0 0 24px hsl(var(--h) 95% 60% / .4); animation: bsTourne 14s linear infinite; }
@keyframes bsTourne { to { transform: translate(-50%, 50%) rotateX(76deg) rotate(360deg); } }
.bs-scene.rage .bs-cercle { border-color: rgba(255,90,40,.8); box-shadow: 0 0 24px rgba(255,60,30,.6), inset 0 0 24px rgba(255,60,30,.5); animation-duration: 5s; }
.bs-ombre { position: absolute; left: 62%; bottom: 7%; width: 30cqw; height: 5cqh; margin-left: -15cqw; border-radius: 50%; background: radial-gradient(rgba(0,0,0,.6), transparent 70%); animation: bsOmbre 3.2s ease-in-out infinite; }
@keyframes bsOmbre { 50% { transform: scale(.85); opacity: .7; } }
.bs-boss { --t: min(46cqw, 62cqh); position: absolute; z-index: 4; left: 62%; top: 47%; width: var(--t); margin: calc(var(--t) * -.55) 0 0 calc(var(--t) * -.5); filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); transition: opacity .4s; }
.bs-svg { display: block; width: 100%; overflow: visible; }
.bs-flotte { transform-box: fill-box; transform-origin: 50% 100%; }
.bs-scene.eveille .bs-flotte { animation: bsFlotte 3.2s ease-in-out infinite; }
.bs-scene:not(.eveille) .bs-flotte { animation: bsRespire 4s ease-in-out infinite; }
@keyframes bsFlotte { 50% { transform: translateY(-4%); } }
@keyframes bsRespire { 50% { transform: scale(1.025, .98); } }
.bs-aile { transform-box: fill-box; }
.bs-aile.g { transform-origin: 100% 30%; } .bs-aile.d { transform-origin: 0 30%; }
.bs-scene.eveille .bs-aile.g { animation: bsAileG .9s ease-in-out infinite; }
.bs-scene.eveille .bs-aile.d { animation: bsAileD .9s ease-in-out infinite; }
@keyframes bsAileG { 50% { transform: rotate(14deg) scaleY(.85); } }
@keyframes bsAileD { 50% { transform: rotate(-14deg) scaleY(.85); } }
.bs-scene.rage .bs-aile.g, .bs-scene.rage .bs-aile.d { animation-duration: .45s; }
.bs-oeil-ferme { display: none; }
.bs-scene:not(.eveille) .bs-oeil-ouvert, .bs-boss.vaincu .bs-oeil-ouvert { display: none; }
.bs-scene:not(.eveille) .bs-oeil-ferme, .bs-boss.vaincu .bs-oeil-ferme { display: inline; }
.bs-scene:not(.eveille) .bs-sourcil { transform: translateY(3px); opacity: .5; }
.bs-pupille { transition: transform .25s; }
.bs-bouche .ouverte { opacity: 0; transition: opacity .12s; }
.bs-boss.attaque .bs-bouche .ouverte, .bs-boss.rugit .bs-bouche .ouverte, .bs-boss.rit .bs-bouche .ouverte { opacity: 1; }
.bs-boss.attaque .bs-bouche .ferme, .bs-boss.rugit .bs-bouche .ferme, .bs-boss.rit .bs-bouche .ferme { opacity: 0; }
.bs-gorge { animation: bsGorge .3s ease-in-out infinite alternate; }
@keyframes bsGorge { to { opacity: .5; } }
.bs-gemme { opacity: 0; transition: opacity .6s; }
.bs-scene.rage .bs-gemme { opacity: 1; animation: bsGemme .8s ease-in-out infinite; filter: drop-shadow(0 0 6px #ffcf4d); }
@keyframes bsGemme { 50% { filter: drop-shadow(0 0 14px #ff7a2a); } }
.bs-fissures path { opacity: 0; transition: opacity .3s; }
.bs-fissures path.on { opacity: 1; }
.bs-armure { transform-box: view-box; transition: transform 1s cubic-bezier(.5,0,.8,.4), opacity 1s; }
.bs-boss.armure-brisee .bs-armure { transform: translateY(60%) rotate(14deg); opacity: 0; }
.bs-scene.rage .bs-boss { --b1: hsl(4 85% 56%); --b2: hsl(350 72% 22%); --b3: hsl(28 100% 78%); --oeil: #ff3b1f; --oeil2: #5a0000; }
.bs-scene.rage .bs-boss { filter: drop-shadow(0 0 14px rgba(255,60,30,.65)) drop-shadow(0 6px 14px rgba(0,0,0,.45)); }
.bs-boss.touche .bs-svg { animation: bsTouche .35s; }
@keyframes bsTouche { 0% { filter: brightness(3) saturate(0); transform: translateX(5%) rotate(4deg); } 40% { filter: brightness(1.6); transform: translateX(-2%) rotate(-2deg); } }
.bs-boss.attaque .bs-svg { animation: bsAttaque 1s; }
@keyframes bsAttaque { 25% { transform: translate(4%, -4%) scale(.95); } 45% { transform: translate(-14%, 5%) scale(1.12); } 70% { transform: translate(-6%, 2%) scale(1.04); } }
.bs-boss.rugit .bs-svg { animation: bsRugit 1.2s; }
@keyframes bsRugit { 10%, 30%, 50%, 70% { transform: scale(1.1) translateX(-2%); } 20%, 40%, 60%, 80% { transform: scale(1.1) translateX(2%); } }
.bs-boss.rit .bs-svg { animation: bsRit .35s ease-in-out infinite alternate; }
@keyframes bsRit { to { transform: translateY(-5%) rotate(-3deg); } }
.bs-boss.vaincu { animation: bsVaincu 1.3s ease-in forwards; }
@keyframes bsVaincu { 0% { filter: brightness(1); } 30% { transform: scale(1.15); filter: brightness(3) saturate(0); } 100% { transform: scale(.2) rotate(30deg); opacity: 0; filter: brightness(5) blur(6px); } }
.bs-aura { position: absolute; z-index: 3; left: 62%; top: 47%; width: 70cqw; height: 70cqw; max-width: 460px; max-height: 460px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(rgba(255,90,40,.75), rgba(255,40,20,.25) 40%, transparent 68%); opacity: 0; pointer-events: none; }
.bs-aura.off { display: none; }
.bs-zzz { position: absolute; z-index: 5; left: 74%; top: 18%; color: #e9e2ff; font-weight: 900; pointer-events: none; }
.bs-zzz i { position: absolute; font-style: normal; font-size: 18px; opacity: 0; animation: bsZzz 3s ease-out infinite; }
.bs-zzz i:nth-child(2) { animation-delay: 1s; font-size: 22px; } .bs-zzz i:nth-child(3) { animation-delay: 2s; font-size: 28px; }
@keyframes bsZzz { 20% { opacity: .9; } 100% { transform: translate(28px, -46px) rotate(12deg); opacity: 0; } }
.bs-scene.eveille .bs-zzz { display: none; }
.bs-cristal { position: absolute; left: 0; top: 0; z-index: 3; width: clamp(18px, 6.5cqw, 34px); color: var(--c); filter: drop-shadow(0 0 5px var(--c)); pointer-events: none; will-change: transform; }
.bs-cristal svg { display: block; width: 100%; animation: bsCristal 2.4s ease-in-out infinite; }
@keyframes bsCristal { 50% { transform: rotate(8deg); } }
.bs-cristal .fissure { opacity: 0; }
.bs-cristal.fele .fissure { opacity: 1; }
.bs-cristal.fele { filter: drop-shadow(0 0 3px var(--c)) brightness(.85); }
.bs-cristal.actif { filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 14px var(--c)); }
.bs-cristal.actif svg { animation: bsActif .6s ease-in-out infinite alternate; }
@keyframes bsActif { to { transform: translateY(-8%) rotate(-6deg); } }
.bs-cristal.brise { transition: opacity .3s; opacity: 0 !important; }
.bs-socle { position: absolute; z-index: 4; left: 4%; bottom: 4%; width: min(19cqw, 25cqh); height: 4cqh; border-radius: 50%; background: radial-gradient(hsl(var(--h) 90% 70% / .55), transparent 70%); }
.bs-joueur { position: absolute; z-index: 5; left: 4%; bottom: 6%; width: min(19cqw, 25cqh); display: flex; justify-content: center; }
.bs-joueur .perso { width: min(16cqw, 22cqh); height: min(16cqw, 22cqh); font-size: min(16cqw, 22cqh); box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 18px hsl(var(--h) 90% 70% / .7); animation: bsJoueur 2.6s ease-in-out infinite; }
@keyframes bsJoueur { 50% { transform: translateY(-5%); } }
.bs-joueur.blesse .perso { animation: bsBlesse .5s; }
@keyframes bsBlesse { 0% { filter: brightness(2) sepia(1) hue-rotate(-40deg) saturate(5); transform: translateX(-10%) rotate(-8deg); } 50% { transform: translateX(6%) rotate(5deg); } }
.bs-joueur.ko .perso { animation: none; filter: grayscale(1) brightness(.7); transform: rotate(-16deg) translateY(10%); transition: all .6s; }
.bs-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 7; pointer-events: none; }
.bs-pv { position: absolute; z-index: 8; left: 50%; top: 10px; width: min(78%, 360px); transform: translateX(-50%); text-align: center; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.bs-pv-jauge { position: relative; height: 10px; margin-top: 3px; border-radius: 6px; background: rgba(0,0,0,.55); box-shadow: 0 0 0 2px rgba(255,255,255,.25); overflow: hidden; }
.bs-pv-jauge i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.bs-pv-retard { background: #fff6d0; transition: width .6s .35s; }
.bs-pv-plein { background: linear-gradient(90deg, #ff3b5c, #ff8a3d 70%, #ffd34d); transition: width .2s; box-shadow: inset 0 2px 0 rgba(255,255,255,.35); }
.bs-banniere { position: absolute; z-index: 9; left: 0; right: 0; top: 40%; transform: translateY(-50%); padding: 12px 10px; text-align: center; color: #fff; background: linear-gradient(90deg, transparent, rgba(10,0,25,.78) 18%, rgba(10,0,25,.78) 82%, transparent); opacity: 0; pointer-events: none; }
.bs-banniere b { display: block; font-size: clamp(22px, 7cqw, 34px); font-weight: 900; letter-spacing: .02em; background: linear-gradient(180deg, #fff, #ffd34d); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 6px rgba(255,140,40,.6)); }
.bs-banniere span { display: block; font-size: 14px; opacity: .9; margin-top: 2px; }
.bs-banniere.on { animation: bsBanniere 2.3s ease forwards; }
@keyframes bsBanniere { 0% { opacity: 0; transform: translateY(-50%) scaleX(.4); } 12% { opacity: 1; transform: translateY(-50%) scaleX(1.04); } 20%, 80% { opacity: 1; transform: translateY(-50%) scaleX(1); } 100% { opacity: 0; transform: translateY(-60%); } }
.bs-flash { position: absolute; inset: 0; z-index: 10; pointer-events: none; opacity: 0; }
.bs-flash.on { animation: bsFlash .5s ease-out; }
.bs-flash.blanc { background: #fff; } .bs-flash.rouge { background: radial-gradient(transparent 30%, rgba(255,30,30,.75)); } .bs-flash.violet { background: radial-gradient(circle at 62% 47%, rgba(255,255,255,.9), hsl(var(--h) 90% 60% / .6)); }
@keyframes bsFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
.bs-degat { position: absolute; z-index: 9; transform: translate(-50%, -50%); font-size: 24px; font-weight: 900; color: #fff6c2; text-shadow: 0 2px 0 #b3123a, 0 0 10px rgba(255,120,40,.9); pointer-events: none; animation: bsDegat 1s ease-out forwards; white-space: nowrap; }
.bs-degat.crit { font-size: 28px; color: #fff; text-shadow: 0 2px 0 #8a1bd6, 0 0 14px #ff9cf0; }
.bs-degat.perte { font-size: 22px; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
@keyframes bsDegat { 0% { transform: translate(-50%, -50%) scale(.4); } 20% { transform: translate(-50%, -90%) scale(1.25); } 100% { transform: translate(-50%, -190%) scale(1); opacity: 0; } }
.bs-trophee { position: absolute; z-index: 9; left: 62%; top: 46%; transform: translate(-50%, -50%); font-size: min(26cqw, 38cqh); animation: bsTrophee .9s cubic-bezier(.2,1.6,.4,1) both; }
.bs-trophee span { position: relative; display: block; filter: drop-shadow(0 6px 14px rgba(0,0,0,.5)); animation: bsJoueur 2s ease-in-out infinite; }
.bs-rayons { position: absolute; left: 50%; top: 50%; width: 2.6em; height: 2.6em; margin: -1.3em 0 0 -1.3em; border-radius: 50%; background: repeating-conic-gradient(rgba(255,230,140,.55) 0 10deg, transparent 10deg 24deg); -webkit-mask: radial-gradient(#000 20%, transparent 70%); mask: radial-gradient(#000 20%, transparent 70%); animation: bsTourneR 8s linear infinite; }
@keyframes bsTourneR { to { transform: rotate(360deg); } }
@keyframes bsTrophee { from { transform: translate(-50%, 40%) scale(0); opacity: 0; } }

.bs-panneau { background: var(--carte); border-radius: 22px; padding: 12px 14px 8px; box-shadow: var(--ombre); }
.bs-question { text-align: center; margin-bottom: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bs-consigne { font-size: 13px; color: var(--doux); font-weight: 600; }
.bs-mot { font-size: clamp(22px, 6vw, 28px); font-weight: 800; line-height: 1.2; }
button.bs-mot { background: none; padding: 2px 8px; border-radius: 12px; color: inherit; }
button.bs-mot:active { background: var(--violet-clair); }
.bs-hp { font-size: .7em; }
.bs-reponse { margin-top: 4px; padding: 4px 12px; border-radius: 12px; background: color-mix(in srgb, var(--vert-ok) 14%, transparent); color: var(--vert-ok); font-size: 20px; font-weight: 800; }
.bs-charge { height: 8px; border-radius: 6px; background: var(--ligne); overflow: hidden; margin: 0 4px 10px; display: none; }
.bs-charge.on { display: block; }
.bs-charge i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #ffd34d, #ff8a3d 60%, #ff3b5c); }
.bs-charge.danger i { animation: bsDanger .3s ease-in-out infinite alternate; }
@keyframes bsDanger { to { filter: brightness(1.5); } }
.bs-choix { grid-template-columns: 1fr 1fr; }
.bs-choix button { font-size: 16px; padding: 13px 8px; }
.bs-intro { margin: 0 0 8px; text-align: center; font-size: 15px; }
.bs-etapes { margin: 0 0 12px; padding-left: 22px; font-size: 14px; color: var(--doux); }
.bs-etapes b { color: var(--texte); }
.btn.bs-go { background: linear-gradient(135deg, hsl(268 70% 45%), #d63a6a); }
.bs-fin { display: flex; flex-direction: column; align-items: center; }
.bs-fin .boss-mini { width: 90px; }
@media (min-width: 700px) {
  .bs-scene { height: clamp(300px, 48vh, 500px); }
  .bs-choix button { font-size: 18px; }
}

/* ---------- Boîtes visibles (répétition espacée) ---------- */
.montee { position: fixed; z-index: 61; top: calc(env(safe-area-inset-top) + 62px); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 8px 16px; border-radius: 99px; background: var(--carte); color: var(--texte); font-weight: 700; font-size: 15px; box-shadow: 0 6px 20px rgba(60,40,160,.25), 0 0 0 2px var(--das); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: montee 1.9s ease both; }
.montee.or { background: linear-gradient(135deg, #fff3c4, #ffd34d); color: #5a3d00; box-shadow: 0 6px 24px rgba(255,180,0,.45), 0 0 0 2px #e0a800; animation-duration: 2.6s; }
.montee.or .art { filter: saturate(.8); }
@keyframes montee { 0% { opacity: 0; transform: translate(-50%, 14px) scale(.9); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.04); } 20%, 82% { transform: translate(-50%, 0) scale(1); opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -12px); } }
.montees { display: block; width: 100%; border: 0; font: inherit; color: inherit; text-align: center; cursor: pointer;
  background: var(--carte); border-radius: 18px; box-shadow: var(--ombre); padding: 12px 14px; margin: 14px 0 4px; transition: transform .12s; }
.montees:active { transform: scale(.97); }
.montees-lien { margin-top: 10px; font-size: 14px; font-weight: 800; color: var(--violet); }
.montees-mots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.puce-boite { padding: 4px 10px; border-radius: 99px; background: var(--violet-clair); font-size: 15px; font-weight: 600; }
.puce-boite.b5 { background: linear-gradient(135deg, #fff3c4, #ffd34d); color: #5a3d00; }
.boites { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.boite { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 2px 8px; border-radius: 16px; background: var(--carte); box-shadow: var(--ombre); color: var(--texte); border: 2px solid transparent; }
.boite.on { border-color: var(--violet); }
.boite-emoji { font-size: 26px; line-height: 1.1; }
.boite b { font-size: 20px; }
.boite-nom { font-size: 11px; color: var(--doux); line-height: 1.15; text-align: center; }
.boite.b5 { background: linear-gradient(160deg, #fff6d6, #ffe08a); color: #5a3d00; }
.boite.b5 .boite-nom { color: #7a5a10; }
.boites-aide { margin: 10px 2px; }
.collection { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.carte-or { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 14px; text-align: left; background: linear-gradient(150deg, #fff8dc, #ffe39a); color: #4a3200; box-shadow: 0 3px 0 #e0b84a, 0 6px 14px rgba(200,150,0,.25); }
.carte-or span { font-size: 13px; color: #7a5a10; }
.carte-or .art { filter: saturate(.85); }
@media (prefers-color-scheme: dark) { .montee:not(.or) { box-shadow: 0 6px 20px rgba(0,0,0,.5), 0 0 0 2px var(--das); } }
@media (min-width: 700px) { .boite-nom { font-size: 13px; } .boite-emoji { font-size: 30px; } }

/* Boss : déplacements et langue */
.bs-groupe { position: absolute; inset: 0; z-index: 4; pointer-events: none; will-change: transform; }
.bs-groupe.sol { z-index: 1; }
.bs-joueur, .bs-socle { will-change: transform; }
.bs-socle { transform-origin: 50% 50%; }
.bs-blep { display: none; }
.bs-scene:not(.eveille) .bs-blep, .boss-mini .bs-blep { display: inline; }
.bs-langue, .bs-luette { transform-box: fill-box; transform-origin: 50% 0; }
.bs-boss.attaque .bs-langue, .bs-boss.rugit .bs-langue { animation: bsLangue .22s ease-in-out infinite alternate; }
@keyframes bsLangue { from { transform: rotate(-7deg) translateY(-2%); } to { transform: rotate(7deg) translateY(5%); } }
.bs-boss.rit .bs-langue { animation: bsLangueRit .3s ease-in-out infinite alternate; }
@keyframes bsLangueRit { from { transform: translateY(-4%) scale(1.04, 1.08) rotate(-9deg); } to { transform: translateY(4%) scale(1.06, .96) rotate(9deg); } }
.bs-boss.attaque .bs-luette, .bs-boss.rugit .bs-luette, .bs-boss.rit .bs-luette { animation: bsLuette .18s ease-in-out infinite alternate; }
@keyframes bsLuette { to { transform: rotate(14deg); } }
.bs-bave path { transform-box: fill-box; transform-origin: 50% 0; animation: bsBave 1.1s ease-in-out infinite alternate; }
.bs-bave path + path { animation-delay: -.5s; }
@keyframes bsBave { from { transform: scaleY(.85); } to { transform: scaleY(1.12); } }
.bs-goutte { animation: bsGoutte 1.6s ease-in infinite; }
@keyframes bsGoutte { 0%, 40% { transform: translateY(0); opacity: .55; } 100% { transform: translateY(18px); opacity: 0; } }
.bs-dents path { stroke: #bfa97f; stroke-width: .7; stroke-linejoin: round; }
.bs-dents path.reflet { fill: none; stroke: #fff; stroke-width: 1.1; stroke-linecap: round; opacity: .9; }
.bs-griffes path { fill: url(#bsGriffe); stroke: #5a4628; stroke-width: .55; stroke-linejoin: round; }
.bs-griffes path.reflet { fill: none; stroke: #fff; stroke-width: .9; stroke-linecap: round; opacity: .75; }
.bs-musique { border: 0; font: inherit; font-size: 19px; line-height: 1; cursor: pointer; color: var(--violet, #7c4dff); min-width: 44px; }
.bs-musique.off { color: inherit; opacity: .45; text-decoration: line-through; }
.reglage.reglage-haut { margin: 4px 0 12px; }
/* jeu des ballons : un vrai espace entre l'article et le mot (l'espace en fin de texte disparaît dans une ligne flex) */
.mot-pendu .art { margin-right: .55em; padding-bottom: 4px; }

/* ---------- Écris et joue : tuile de l'accueil avec deux icônes à toucher (diamant / pièce de briques) ---------- */
.jeu-ej { padding-top: 12px; }
.jeu-ej:active { transform: none; }
.ej-icones { display: flex; gap: 10px; margin-bottom: 8px; }
/* deux boutons au format des icônes des jeux (48 px, carré arrondi en dégradé) : on touche le jeu voulu */
.ej-icone { width: 48px; height: 48px; flex: none; border: 0; border-radius: 15px; padding: 0; cursor: pointer; font: inherit; color: #fff;
  display: grid; place-items: center; box-shadow: 0 4px 10px color-mix(in srgb, var(--g2) 35%, transparent), inset 0 1px 0 rgba(255,255,255,.35);
  background: linear-gradient(145deg, var(--g1), var(--g2)); }
.ej-icone.bij { --g1: #818cf8; --g2: #4338ca; }
.ej-icone.bri { --g1: #fb7185; --g2: #be123c; }
.ej-icone small { font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, .85) !important; line-height: 1; }
.ej-icone:active { transform: scale(.9); }
.jeu .ej-diamant { display: block; width: 32px; height: 32px; color: inherit; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.jeu .ej-diamant svg { display: block; width: 100%; height: 100%; }
.ej-piece { display: grid; grid-template-columns: repeat(3, 10px); grid-template-rows: repeat(2, 10px); gap: 2px; }
.ej-piece .bloc-brique { position: relative; inset: auto; border-radius: 3px; }
.ej-piece .bloc-brique::after { display: none; }

/* ---------- Briques : grille 8 × 8, pièces à glisser ---------- */
.briques { position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; padding: 6px;
  width: 100%; max-width: 440px; aspect-ratio: 1; margin: 4px auto 12px; border-radius: 22px;
  background: linear-gradient(160deg, #1d3a66, #0e1c38); box-shadow: var(--ombre), inset 0 0 0 2px rgba(255, 255, 255, .07);
  touch-action: none; user-select: none; -webkit-user-select: none; }
.brique-case { position: relative; border-radius: 22%; background: rgba(255, 255, 255, .06); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); }
.brique-case.apercu { background: rgba(255, 255, 255, .28); background: color-mix(in srgb, var(--c) 45%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 80%, #fff); }
.brique-case.va-partir .bloc-brique, .brique-case.va-partir.apercu { filter: brightness(1.35) saturate(1.2); animation: briqueBrille .5s ease-in-out infinite alternate; }
@keyframes briqueBrille { to { filter: brightness(1.7) saturate(1.3); } }
.bloc-brique { position: absolute; inset: 0; border-radius: 22%; display: block; background: var(--c);
  background: linear-gradient(155deg, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 70%, #000) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(0, 0, 0, .22), 0 2px 3px rgba(0, 0, 0, .3); }
.bloc-brique::after { content: ""; position: absolute; left: 18%; top: 14%; width: 34%; height: 22%; border-radius: 50%; background: rgba(255, 255, 255, .45); filter: blur(.5px); }
.bloc-brique.pose { animation: briquePose .22s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes briquePose { from { transform: scale(.6); } }
.bloc-brique.part { animation: briquePart .32s ease-in forwards; }
@keyframes briquePart { 40% { transform: scale(1.15); filter: brightness(2); } to { transform: scale(0) rotate(25deg); opacity: 0; } }
.pieces-briques { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 440px; margin: 0 auto 12px; min-height: 120px; }
.slot-brique { display: grid; place-items: center; min-height: 120px; border-radius: 18px; background: var(--carte); box-shadow: var(--ombre); touch-action: none; cursor: grab; }
.piece-brique { --t: 22px; display: grid; grid-template-columns: repeat(var(--w), var(--t)); grid-template-rows: repeat(var(--h), var(--t)); gap: 2px; }
.piece-brique .bloc-brique { position: relative; inset: auto; width: 100%; height: 100%; }
.piece-brique.posee { visibility: hidden; }
.piece-brique.bloquee { opacity: .35; filter: grayscale(.6); }
.piece-brique.prise { opacity: .2; }
.piece-brique.volante { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; gap: 3px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .35)); }
@media (max-width: 360px) { .piece-brique { --t: 17px; } .slot-brique, .pieces-briques { min-height: 100px; } }
@media (min-width: 700px) { .briques { max-width: 520px; } .pieces-briques { max-width: 520px; } .piece-brique { --t: 26px; } .slot-brique { min-height: 150px; } }
