/* Français pas à pas — styles. Gros boutons, pas de texte de navigation. */
:root {
  --fond: #f4f6fb; --carte: #ffffff; --encre: #1f2937; --bord: #d5dbe7;
  --bleu: #1d4ed8; --vert: #15803d; --vert-clair: #dcfce7; --rouge: #b91c1c; --jaune: #f59e0b;
  --ombre: 0 2px 6px rgba(15, 23, 42, .12);
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #0f172a; --carte: #1e293b; --encre: #f1f5f9; --bord: #334155; --vert-clair: #14532d; --ombre: 0 2px 6px rgba(0,0,0,.4); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--encre); font-family: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif; }
body { min-height: 100vh; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
#app { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 12px 16px 24px; }
svg { width: 100%; height: 100%; fill: currentColor; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 4px solid var(--jaune); outline-offset: 3px; }

/* Barre du haut : retour à gauche, écouter à droite (toujours au même endroit) */
.barre { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.rond { width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; padding: 14px;
  background: var(--carte); color: var(--encre); box-shadow: var(--ombre); cursor: pointer; text-decoration: none; }
.rond.haut { background: var(--bleu); color: #fff; width: 76px; height: 76px; padding: 16px; }

/* Grilles */
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.grille.grande { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 700px) { .grille.grande { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
.grille.trois { grid-template-columns: repeat(3, 1fr); }
.grille.quatre { grid-template-columns: repeat(2, 1fr); max-width: 560px; margin: 0 auto; }
.grille.memo { grid-template-columns: repeat(3, 1fr); max-width: 620px; margin: 0 auto; }
@media (min-width: 700px) { .grille.memo { grid-template-columns: repeat(4, 1fr); } .grille.quatre { grid-template-columns: repeat(4, 1fr); max-width: none; } }
.bloque { pointer-events: none; }

/* Tuiles de navigation */
.tuile { position: relative; display: block; background: var(--carte); border: 3px solid transparent; border-radius: 20px;
  padding: 12px; box-shadow: var(--ombre); color: inherit; text-decoration: none; cursor: pointer; }
.tuile.choisie { border-color: var(--bleu); }
.tuile-go { position: absolute; right: 10px; bottom: 10px; width: 58px; height: 58px; border-radius: 50%; background: var(--vert);
  color: #fff; padding: 15px 13px 15px 17px; display: none; box-shadow: var(--ombre); }
.tuile.choisie .tuile-go { display: block; }
.compte { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 4px; background: var(--carte);
  border-radius: 999px; padding: 4px 10px 4px 6px; color: var(--jaune); font-size: 1.1rem; box-shadow: var(--ombre); }
.compte svg { width: 24px; height: 24px; }
.compte b { color: var(--encre); }
.coin { position: absolute; left: 8px; top: 8px; width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--bleu); color: #fff; }
.coin .ok { position: absolute; right: -40px; top: -2px; width: 34px; height: 34px; color: var(--jaune); }

/* Images */
.vignette { display: grid; place-items: center; aspect-ratio: 1; width: 100%; background: #fff; border-radius: 14px; overflow: hidden; }
.vignette img { width: 92%; height: 92%; object-fit: contain; user-select: none; -webkit-user-select: none; }
.vignette.signe-oui { background: var(--vert); color: #fff; padding: 22%; }
.vignette.signe-non { background: var(--rouge); color: #fff; padding: 22%; }
.vignette.mini { width: 54px; height: 54px; border-radius: 8px; border: 1px solid var(--bord); }

/* Cartes d'exercice */
.zone { display: flex; flex-direction: column; gap: 16px; }
.carte { position: relative; display: block; width: 100%; border: 4px solid transparent; background: var(--carte); border-radius: 18px;
  padding: 8px; box-shadow: var(--ombre); cursor: pointer; }
.carte.vu { border-color: var(--bord); }
.carte.bon { border-color: var(--vert); background: var(--vert-clair); }
.carte.pose { opacity: .25; pointer-events: none; }
.carte .mot { display: block; margin-top: 6px; font-size: 1.35rem; font-weight: 700; text-align: center; }
.carte.dos .vignette { visibility: hidden; }
.carte.dos { background: repeating-linear-gradient(45deg, var(--bleu), var(--bleu) 12px, #2563eb 12px, #2563eb 24px); }
.carte.faux { animation: secoue .4s; border-color: var(--rouge); }
@keyframes secoue { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-5px); } }
@media (prefers-reduced-motion: reduce) { .carte.faux { animation: none; } }

/* Points de progression */
.points { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.points i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--bord); }
.points i.plein { background: var(--vert); border-color: var(--vert); }

/* Tri */
.scene { display: flex; justify-content: center; min-height: 200px; }
.carte.seule { width: min(240px, 60vw); }
.boites { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.boite { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 4px dashed var(--bord); background: var(--carte);
  border-radius: 20px; padding: 10px; cursor: pointer; min-height: 200px; }
.boite.faux { animation: secoue .4s; border-color: var(--rouge); }
.boite .tete { width: 110px; }
.dedans { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }

/* Ordre */
.cases { display: flex; justify-content: center; gap: 12px; }
.case { width: 88px; height: 88px; border: 4px dashed var(--bord); border-radius: 16px; display: grid; place-items: center; position: relative; background: var(--carte); }
.case b { position: absolute; top: -14px; left: -10px; background: var(--bleu); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem; }
.case .mini { width: 76px; height: 76px; }

/* Fin d'exercice */
.bravo { width: 180px; height: 180px; margin: 20px auto 0; color: var(--jaune); animation: grandit .6s ease-out; }
@keyframes grandit { from { transform: scale(.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bravo { animation: none; } }
.actions { display: flex; justify-content: center; gap: 24px; }
.gros { width: 96px; height: 96px; border-radius: 50%; border: 0; padding: 22px; background: var(--carte); box-shadow: var(--ombre); cursor: pointer; }
.gros.vert { background: var(--vert); color: #fff; }

/* Crédits (obligatoires pour la licence ARASAAC) */
.credits { max-width: 980px; margin: 0 auto; padding: 8px 16px 16px; font-size: .75rem; opacity: .75; }
