/* ---------- mini-jeu "Éclate les bulles" ---------- */
.bulles-score{ display:flex; justify-content:space-between; align-items:center; gap:10px; margin:0 14px 8px; }
.bs-item{ display:inline-flex; align-items:center; gap:6px; background:#fff; border:3px solid var(--rail-bord); border-radius:999px; padding:3px 12px 3px 6px; box-shadow:0 3px 0 rgba(0,0,0,.06); }
.bs-item img{ width:30px; height:30px; }
.bs-item strong{ font-size:20px; font-weight:800; color:var(--encre); min-width:2ch; text-align:center; }
.bs-label{ font-size:12px; font-weight:700; color:#5b4d7a; }
.bs-item.pop{ animation:hudPop 450ms ease; }
.bs-record.battu{ border-color:var(--attention); background:#FFF6D8; }
.combo{ width:56px; text-align:center; font-size:15px; font-weight:800; color:var(--copain-1); }
.combo.pop{ animation:hudPop 400ms ease; }
.bulles-zone{ position:relative; flex:1 1 auto; overflow:hidden; margin:0 12px; border-radius:28px; background:linear-gradient(180deg, rgba(43,127,176,.06), rgba(43,127,176,.18)); border:3px solid rgba(43,127,176,.25); touch-action:none; }
.bulle{ position:absolute; bottom:-120px; width:96px; height:96px; margin-left:-48px; border:none; padding:0; background:none; cursor:pointer; animation:bulleMonte var(--duree, 8s) linear forwards; }
.bulle-corps{ position:absolute; inset:0; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:54px; line-height:1; color:var(--tc); padding-bottom:8px;
  background:radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 9%, rgba(255,255,255,.55) 10% 22%, rgba(255,255,255,.18) 50%, rgba(255,255,255,.42) 100%);
  border:3px solid rgba(255,255,255,.9); box-shadow:inset 0 0 18px rgba(43,127,176,.35), 0 4px 10px rgba(0,0,0,.08); animation:bulleOndule 2.4s ease-in-out infinite; }
@keyframes bulleMonte{ from{ transform:translateY(0); } to{ transform:translateY(calc(-1 * var(--h, 700px))); } }
@keyframes bulleOndule{ 0%,100%{ transform:translateX(-8px); } 50%{ transform:translateX(8px); } }
.bulle.eclate{ animation-play-state:paused; pointer-events:none; }
.bulle.eclate .bulle-corps{ animation:bulleEclate 300ms ease-out forwards; }
@keyframes bulleEclate{ 0%{ transform:scale(1); opacity:1; } 100%{ transform:scale(1.6); opacity:0; } }
.bulle.rate .bulle-corps{ animation:secoue 300ms ease; }
.bulle.part{ animation-play-state:paused; pointer-events:none; }
.bulle.part .bulle-corps{ animation:bullePart 350ms ease-in forwards; }
@keyframes bullePart{ to{ transform:scale(.2); opacity:0; } }
.eclat{ position:absolute; width:10px; height:10px; border-radius:50%; pointer-events:none; animation:eclatVole 520ms ease-out forwards; }
@keyframes eclatVole{ from{ transform:translate(0,0) scale(1); opacity:1; } to{ transform:translate(var(--dx), var(--dy)) scale(.3); opacity:0; } }
.plus-un{ position:absolute; white-space:nowrap; font-size:24px; font-weight:800; color:var(--reussite); pointer-events:none; animation:plusUn 800ms ease-out forwards; text-shadow:0 2px 0 #fff; }
@keyframes plusUn{ from{ transform:translate(-50%, 0); opacity:1; } to{ transform:translate(-50%, -60px); opacity:0; } }

/* ---------- mini-jeu "Memory" ---------- */
.memory-corps{ flex:1 1 auto; overflow-y:auto; display:flex; flex-direction:column; align-items:center; gap:14px; padding:4px 16px 24px; }
.memory-grille{ width:min(480px, 100%); display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; }
@media (min-width:600px){ .memory-grille{ grid-template-columns:repeat(4, 1fr); } }
.mem-carte{ aspect-ratio:1; border:none; padding:0; background:none; perspective:600px; cursor:pointer; }
.mem-inner{ display:block; position:relative; width:100%; height:100%; transition:transform 380ms ease; transform-style:preserve-3d; }
.mem-carte.ouverte .mem-inner, .mem-carte.trouvee .mem-inner{ transform:rotateY(180deg); }
.mem-dos, .mem-face{ position:absolute; inset:0; border-radius:20px; display:flex; flex-direction:column; align-items:center; justify-content:center; backface-visibility:hidden; -webkit-backface-visibility:hidden; box-shadow:0 6px 0 rgba(0,0,0,.14); }
.mem-dos{ background:var(--accent); border:4px solid #fff; color:rgba(255,255,255,.85); font-size:34px;
  background-image:url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2730%27 height=%2730%27%3E%3Cpath d=%27M15 3 L27 15 L15 27 L3 15 Z%27 fill=%27none%27 stroke=%27%23ffffff%27 stroke-opacity=%27.18%27 stroke-width=%272%27/%3E%3C/svg%3E'); }
.mem-face{ transform:rotateY(180deg); background:#fff; border:4px solid var(--tc); color:var(--tc); gap:2px; }
.mem-face .mem-lettre{ font-size:52px; line-height:1.2; }
.mem-face .mem-emoji{ font-size:40px; line-height:1; }
.mem-face .mem-emoji .img-mot{ width:1em; height:1em; }
.mem-face .mem-mot{ font-size:18px; color:var(--encre); line-height:1.4; }
.mem-carte.trouvee .mem-face{ background:var(--tc); color:#fff; }
.mem-carte.trouvee .mem-face .mem-mot{ color:#fff; }
.mem-carte.trouvee{ animation:saute 400ms ease 380ms; }
.mem-carte.rate{ animation:secoue 300ms ease; }
.memory-info{ font-size:15px; font-weight:700; color:#5b4d7a; }

/* ---------- mini-jeux "Points magiques" et "Assemble le mot" (ADR-023) ---------- */
.jeu-corps{ flex:1 1 auto; overflow-y:auto; display:flex; flex-direction:column; align-items:center; gap:12px; padding:4px 16px 20px; }
/* tuile glissée : clone suivant le doigt (glisseDepose()) */
.glisse-fantome{ position:fixed; z-index:60; pointer-events:none; transform:scale(1.08); filter:drop-shadow(0 8px 10px rgba(0,0,0,.25)); }
.glisse-source{ opacity:.25; }
.pt-scene{ position:relative; width:min(300px, 80vw); aspect-ratio:28/26; background:#fff; border-radius:30px; border:4px solid var(--tc, var(--accent)); box-shadow:0 8px 0 rgba(0,0,0,.12); }
.pt-scene svg{ position:absolute; inset:0; width:100%; height:100%; }
.pt-scene.survole{ box-shadow:0 0 0 6px rgba(184,134,42,.45), 0 8px 0 rgba(0,0,0,.12); }
.pt-scene.secoue{ animation:secoue 300ms ease; }
.pt-scene.reussi{ animation:saute 400ms ease; border-color:var(--reussite); }
.pt-point{ transform-box:fill-box; transform-origin:center; animation:pointPose 420ms cubic-bezier(.3,1.6,.5,1) both; }
@keyframes pointPose{ from{ transform:scale(0) translateY(-30px); } to{ transform:none; } }
.pt-apercu{ opacity:.45; }
.pt-resultat{ min-height:30px; font-size:17px; font-weight:800; color:var(--encre); text-align:center; }
.pt-resultat .ar{ font-size:1.5em; }
.pt-resultat.indice{ color:#5b4d7a; font-weight:700; }
.pt-choix{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }
.pt-motif{ width:96px; height:84px; border-radius:22px; background:#fff; border:4px solid var(--copain-3); box-shadow:0 6px 0 rgba(0,0,0,.12); display:flex; align-items:center; justify-content:center; touch-action:none; cursor:grab; padding:0; }
.pt-motif svg{ width:76px; height:64px; }
.pt-motif.secoue{ animation:secoue 300ms ease; }
.as-image{ font-size:76px; line-height:1; animation:saute 500ms ease; }
.as-image .img-mot{ width:1em; height:1em; }
.as-modele{ font-size:15px; font-weight:700; color:#5b4d7a; text-align:center; }
.as-modele .ar{ font-size:30px; color:var(--neutre); }
.as-zone{ min-width:min(320px, 90vw); min-height:110px; border-radius:26px; background:#fff; border:4px dashed var(--rail-bord); display:flex; flex-direction:row; direction:rtl; align-items:center; justify-content:center; gap:8px; padding:8px 16px; }
.as-zone.survole{ border-color:var(--attention); border-style:solid; }
.as-zone.secoue{ animation:secoue 300ms ease; }
.as-zone.complet{ border-style:solid; border-color:var(--reussite); background:#E8F6EE; animation:saute 400ms ease; }
.as-mot{ font-size:64px; line-height:1.5; color:var(--encre); white-space:nowrap; }
.as-trou{ width:52px; height:64px; border-radius:14px; border:3px dashed var(--rail-bord); flex:0 0 auto; }
.as-trou.prochain{ border-color:var(--attention); animation:playPulse 1.4s ease-in-out infinite; }
.as-tuiles{ display:flex; gap:12px; justify-content:center; flex-wrap:wrap; max-width:440px; }
.as-tuile{ width:82px; height:82px; border-radius:22px; background:#fff; border:4px solid var(--tc, var(--accent)); color:var(--tc, var(--encre)); box-shadow:0 6px 0 rgba(0,0,0,.12); font-size:48px; line-height:1; display:flex; align-items:center; justify-content:center; padding:0 0 8px; touch-action:none; cursor:grab; }
.as-tuile.utilisee{ visibility:hidden; }
.as-tuile.secoue{ animation:secoue 300ms ease; }
.as-tuile.indice{ animation:playPulse 1s ease-in-out infinite; box-shadow:0 0 0 5px rgba(184,134,42,.5), 0 6px 0 rgba(0,0,0,.12); }
@media (max-width:380px){ .as-tuile{ width:70px; height:70px; font-size:42px; } .as-mot{ font-size:54px; } }
@media (prefers-reduced-motion: reduce){
  #ecran-demarrage > *, .continuer-carte::after, .continuer-play, .bulle-corps{ animation:none; }
}

/* Memory mot français <-> mot arabe / tunisien : textes des cartes (taille réduite pour les longs mots via --k) */
.mem-face .mem-fr{ font-size:calc(17px * var(--k, 1)); font-weight:800; color:var(--encre); line-height:1.2; text-align:center; max-width:94%; overflow-wrap:anywhere; }
.mem-face .mem-ar{ font-size:calc(26px * var(--k, 1)); font-weight:800; color:var(--encre); line-height:1.35; text-align:center; max-width:94%; overflow-wrap:anywhere; direction:rtl; }
.mem-carte.trouvee .mem-face .mem-fr, .mem-carte.trouvee .mem-face .mem-ar{ color:#fff; }
.mem-face .mem-emoji{ font-size:34px; }
.mem-face .mem-ar{ font-size:calc(22px * var(--k, 1)); }   /* carte arabe : dessin au-dessus du mot, un peu plus petit pour que les deux tiennent */
.memory-grille .phr-vide{ grid-column:1 / -1; padding:24px; text-align:center; }
