/* ============================================================
   Lecteur d'invocation — trois habillages d'un même moteur.
   Mobile d'abord : cibles d'au moins 44 px, texte arabe généreux,
   et un mot actif qu'on repère d'un coup d'œil.
   ============================================================ */

.doua-lecteur { --dl-actif: #e8a33f; --dl-ok: #2f9e5f; --dl-ko: #d4526e; }
.dl-chargement { text-align: center; padding: 2rem 1rem; color: var(--texte-doux); }
.dl-scene { background: var(--surface-2); border-radius: var(--rayon); padding: 1.1rem .8rem; }

/* --- Mots, communs aux trois styles --- */
.dl-mot {
  display: flex; flex-direction: column; align-items: center; gap: .15rem;
  padding: .5rem .7rem; min-height: 44px; cursor: pointer; font: inherit;
  background: transparent; border: 2px solid transparent; border-radius: 12px;
  color: var(--texte); transition: background .18s, transform .18s, border-color .18s, opacity .25s;
}
.dl-mot-ar { font-size: 1.9rem; line-height: 1.95; }
.dl-mot-sens { font-size: .74rem; color: var(--texte-doux); line-height: 1.2; }
.dl-mot:hover { border-color: var(--bordure); }
.dl-mot.dl-actif {
  background: var(--dl-actif); color: #16213f; transform: translateY(-4px) scale(1.06);
  box-shadow: 0 8px 22px rgba(232, 163, 63, .4);
}
.dl-mot.dl-actif .dl-mot-sens { color: rgba(22, 33, 63, .75); }
.dl-mot.dl-passe { opacity: .5; }

/* --- Style « fil » : une ligne qui s'illumine --- */
.dl-ligne {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem;
  direction: rtl; unicode-bidi: isolate;
}
.dl-frise { display: flex; gap: 3px; margin-top: .9rem; direction: rtl; }
.dl-frise-seg {
  height: 10px; border-radius: 5px; background: var(--bordure); cursor: pointer;
  transition: background .18s, transform .18s;
}
.dl-frise-seg:hover { background: var(--texte-doux); }
.dl-frise-seg.dl-seg-actif { background: var(--dl-actif); transform: scaleY(1.6); }

/* --- Style « cartes » : chaque mot se retourne --- */
.dl-cartes {
  display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  direction: rtl;
}
.dl-cartes .dl-mot {
  background: var(--surface); border-color: var(--bordure); padding: .9rem .5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.dl-cartes .dl-mot.dl-retourne { background: #1b2a5e; color: #faf6ec; border-color: var(--dl-actif); }
.dl-cartes .dl-mot.dl-retourne .dl-mot-sens { color: #ffe9a3; font-size: .9rem; font-weight: 600; }

/* --- Style « escalier » : révélation cumulative --- */
.dl-palier-info {
  text-align: center; font-weight: 700; color: var(--accent);
  margin-bottom: .8rem; font-size: 1.02rem;
}
.dl-ligne-escalier { min-height: 4.4rem; align-items: center; }
.dl-mot.dl-cache { opacity: .16; filter: blur(3px); pointer-events: none; }

/* --- Traduction, messages, commandes --- */
.dl-traduction {
  text-align: center; font-style: italic; margin: .9rem 0 .3rem;
  color: var(--texte-doux); line-height: 1.6;
}
.dl-message { text-align: center; min-height: 1.7rem; font-weight: 600; margin: .3rem 0 .6rem; }
.dl-commandes { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; }
.dl-reglages {
  display: flex; gap: 1.2rem; flex-wrap: wrap; justify-content: center;
  margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--bordure);
}
.dl-groupe { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.dl-libelle { font-size: .78rem; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .05em; }
.dl-opt {
  padding: .4rem .7rem; min-height: 38px; cursor: pointer; font: inherit; font-size: .85rem;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: 999px; color: var(--texte);
}
.dl-opt.actif { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* --- Récitation de l'enfant --- */
.dl-micro.dl-ecoute { animation: dl-pulse 1.1s infinite; }
@keyframes dl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 82, 110, .55); }
  50%      { box-shadow: 0 0 0 12px rgba(212, 82, 110, 0); }
}
.dl-verdict {
  margin-top: .8rem; padding: .8rem 1rem; border-radius: var(--rayon-petit);
  text-align: center; font-weight: 600; line-height: 1.5;
}
.dl-verdict.ok { background: rgba(47, 158, 95, .14); border: 1px solid var(--dl-ok); }
.dl-verdict.presque { background: rgba(232, 163, 63, .14); border: 1px solid var(--dl-actif); }
.dl-verdict.ko { background: rgba(212, 82, 110, .12); border: 1px solid var(--dl-ko); }
.dl-verdict .dl-score { display: block; font-size: 1.6rem; margin-bottom: .2rem; }

/* --- Sélection de mots (mode « phrase à la carte ») --- */
.dl-mot.dl-choisi {
  border-color: var(--dl-actif); background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--dl-actif), 0 4px 12px rgba(232, 163, 63, .25);
}
.dl-choisir.actif { background: var(--dl-actif); border-color: var(--dl-actif); color: #16213f; font-weight: 700; }

/* --- L'icône Mémorisateur dans les leçons --- */
.btn-memorisateur {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .8rem .35rem .4rem; min-height: 44px; cursor: pointer; font: inherit;
  background: var(--surface-2); border: 2px solid var(--dore, #e8c266); border-radius: 999px;
  color: var(--texte); font-size: .85rem; font-weight: 700;
  transition: transform .18s, box-shadow .18s;
}
.btn-memorisateur:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(232, 163, 63, .3); }
.btn-memorisateur img { width: 34px; height: 34px; object-fit: contain; border-radius: 50%; }

/* --- Le modal du Mémorisateur --- */
body.dm-bloque { overflow: hidden; }
.dm-voile {
  position: fixed; inset: 0; z-index: 9500; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 16, 40, .72); backdrop-filter: blur(4px); padding: .8rem;
  animation: dm-apparait .25s ease both;
}
@keyframes dm-apparait { from { opacity: 0; } to { opacity: 1; } }
.dm-boite {
  width: min(100%, 46rem); max-height: 94vh; overflow: auto;
  background: var(--fond, #faf6ec); color: var(--texte);
  border-radius: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  animation: dm-monte .3s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes dm-monte { from { transform: translateY(26px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.dm-banniere {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: .9rem; padding: .7rem 1rem;
  background: linear-gradient(135deg, #1b2a5e, #2a3f86);
  color: #faf6ec; border-bottom: 3px solid var(--dore, #e8c266);
}
.dm-logo { width: 52px; height: 52px; object-fit: contain; border-radius: 14px; background: #faf6ec; padding: 3px; }
.dm-titres { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dm-titre { font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; }
.dm-sous { font-size: .72rem; color: #ffe9a3; letter-spacing: .08em; text-transform: uppercase; }
.dm-fermer {
  flex: none; padding: .5rem .9rem; min-height: 44px; cursor: pointer; font: inherit; font-weight: 700;
  background: #faf6ec; color: #1b2a5e; border: none; border-radius: 999px; font-size: .85rem;
}
.dm-fermer:hover { background: #ffe9a3; }
.dm-onglets { display: flex; gap: .5rem; padding: .8rem 1rem 0; }
.dm-onglet {
  flex: 1; padding: .6rem; min-height: 44px; cursor: pointer; font: inherit; font-weight: 700;
  background: var(--surface-2); border: 2px solid var(--bordure); border-radius: 14px; color: var(--texte);
}
.dm-onglet.actif { border-color: var(--accent); background: var(--surface); color: var(--accent); }
.dm-corps { padding: .9rem 1rem 1.2rem; }

@media (max-width: 480px) {
  .dl-mot-ar { font-size: 1.6rem; }
  .dl-cartes { grid-template-columns: repeat(auto-fit, minmax(94px, 1fr)); }
  .dm-titre { font-size: 1rem; }
  .dm-fermer { font-size: .78rem; padding: .45rem .7rem; }
  .btn-memorisateur span { display: none; }   /* l'icône suffit sur mobile */
}
