/* بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ — Espace pédagogique.
   Couleurs des graphiques : palette validée (CVD, contraste, bande de clarté)
   sur la surface sombre du site. Série = aqua ; seconde série = bleu.
   Les couleurs d'état (bon, attention, critique) sont réservées aux états et
   toujours accompagnées d'un symbole et d'un libellé. */
:root {
    --fond: #071513; --surface: #0c1f1d; --surface-2: #112927; --trait: rgba(212,175,55,.16);
    --texte: #e8ebe8; --texte-2: #a9bdb4; --texte-3: #7d958b; --or: #d4af37;
    --serie-1: #199e70; --serie-2: #3987e5; --grille: rgba(232,235,232,.09);
    --bon: #0ca30c; --attention: #fab219; --serieux: #ec835a; --critique: #d03b3b;
    --seq-1: #123a31; --seq-2: #14574a; --seq-3: #177a62; --seq-4: #1c9f7c; --seq-5: #3fc79c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.55 Inter, system-ui, sans-serif; }
a { color: var(--or); }
.barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px;
    border-bottom: 1px solid var(--trait); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--or); font-weight: 700; }
.marque small { display: block; color: var(--texte-3); font-weight: 400; font-size: .74rem; }
#barreDroite { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--texte-2); white-space: nowrap; }
main { max-width: 1180px; margin: 0 auto; padding: 22px 18px 60px; }
h1 { font-size: 1.45rem; margin: 0 0 4px; color: var(--or); }
h2 { font-size: 1.02rem; margin: 0 0 12px; color: var(--texte); }
.sous { color: var(--texte-2); margin: 0 0 18px; }
.attente, .vide { color: var(--texte-3); text-align: center; padding: 30px 10px; }
.fil { font-size: .84rem; color: var(--texte-3); margin-bottom: 10px; }
.fil a { cursor: pointer; text-decoration: none; }
.carte { background: var(--surface); border: 1px solid var(--trait); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.grille-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 16px; }
.grille-2 > .carte { margin: 0; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pousse { margin-left: auto; }

/* Boutons et champs */
button, .bouton { font: inherit; cursor: pointer; border-radius: 9px; padding: 8px 15px; border: 1px solid rgba(212,175,55,.35);
    background: transparent; color: var(--or); text-decoration: none; display: inline-block; }
button:hover { background: rgba(212,175,55,.09); }
button.plein { background: linear-gradient(135deg, #1a5f3c, #0f3d26); font-weight: 600; }
button.discret { border-color: transparent; color: var(--texte-2); padding: 6px 9px; }
button.danger { color: var(--serieux); border-color: rgba(236,131,90,.4); }
button:disabled { opacity: .5; cursor: default; }
label { display: block; font-size: .82rem; color: var(--texte-2); margin: 12px 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--texte); background: var(--fond); border: 1px solid var(--trait);
    border-radius: 9px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(212,175,55,.5); outline-offset: 1px; }
.formulaire { max-width: 420px; margin: 30px auto; }
.erreur { color: var(--serieux); font-size: .87rem; margin-top: 10px; min-height: 1.2em; }
.info { background: rgba(57,135,229,.09); border-left: 3px solid var(--serie-2); border-radius: 8px; padding: 10px 13px;
    font-size: .87rem; color: var(--texte-2); margin: 12px 0; }
.lien-copie { display: flex; gap: 8px; margin-top: 10px; }
.lien-copie input { font-size: .8rem; }
.etiquette { font-size: .7rem; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--trait); color: var(--texte-2); white-space: nowrap; }

/* Tuiles de chiffres */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tuile { background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 13px 15px; }
.tuile b { display: block; font-size: 1.65rem; font-weight: 700; color: var(--texte); line-height: 1.15; }
.tuile span { color: var(--texte-2); font-size: .8rem; }
.tuile em { display: block; font-style: normal; font-size: .74rem; color: var(--texte-3); margin-top: 2px; }

/* Graphiques */
.graphe svg { width: 100%; height: auto; display: block; overflow: visible; }
.graphe text { fill: var(--texte-3); font: 11px Inter, sans-serif; }
.graphe .axe { stroke: var(--grille); stroke-width: 1; }
.graphe .barre-j { fill: var(--serie-1); }
.graphe .courbe { fill: none; stroke: var(--serie-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graphe .point { fill: var(--serie-1); stroke: var(--surface); stroke-width: 2; }
.graphe .zone { fill: transparent; }
.graphe .zone:hover + .repere, .graphe .repere.actif { opacity: 1; }
.graphe .repere { stroke: var(--texte-3); stroke-width: 1; opacity: 0; pointer-events: none; }
.legende { font-size: .78rem; color: var(--texte-3); margin-top: 8px; }
#bulle { position: fixed; z-index: 50; pointer-events: none; background: #02100e; color: var(--texte); border: 1px solid var(--trait);
    border-radius: 8px; padding: 7px 10px; font-size: .8rem; max-width: 260px; box-shadow: 0 6px 20px rgba(0,0,0,.5); white-space: pre-line; }

/* Barres de compétences */
.comp { display: grid; grid-template-columns: minmax(120px, 190px) 1fr auto; gap: 10px; align-items: center; padding: 7px 0; }
.comp + .comp { border-top: 1px solid var(--grille); }
.comp .nom { font-size: .88rem; }
.comp .piste { height: 10px; background: var(--surface-2); border-radius: 4px; position: relative; }
.comp .rempli { position: absolute; inset: 0 auto 0 0; background: var(--serie-1); border-radius: 0 4px 4px 0; }
.comp .val { font-size: .8rem; color: var(--texte-2); min-width: 92px; text-align: right; }

/* États : symbole + libellé, jamais la couleur seule */
.etat { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; padding: 2px 9px; border-radius: 20px;
    border: 1px solid var(--grille); color: var(--texte-2); white-space: nowrap; }
.etat i { font-style: normal; font-size: .8rem; }
.etat.acquis i { color: var(--bon); } .etat.a_revoir i { color: var(--attention); }
.etat.a_consolider i, .etat.en_cours i { color: var(--serie-2); }

/* Grille élèves × règles */
.defile { overflow-x: auto; }
table { border-collapse: separate; border-spacing: 2px; font-size: .8rem; }
table.liste { width: 100%; border-spacing: 0; }
table.liste th, table.liste td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grille); }
table.liste th { color: var(--texte-3); font-weight: 500; font-size: .76rem; }
.matrice th { font-weight: 500; color: var(--texte-2); }
.matrice th.col { height: 118px; vertical-align: bottom; padding: 0 0 6px; min-width: 38px; }
.matrice th.col span { display: block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; max-height: 112px;
    overflow: hidden; text-overflow: ellipsis; font-size: .74rem; margin: 0 auto; }
.matrice th.lig { text-align: left; padding-right: 12px; white-space: nowrap; }
.matrice th.lig a { cursor: pointer; text-decoration: none; }
.matrice td { width: 38px; height: 30px; text-align: center; border-radius: 4px; font-size: .72rem; color: #f2f6f4; position: relative; }
.matrice td.n0 { background: transparent; outline: 1px dashed var(--grille); outline-offset: -2px; color: var(--texte-3); }
.matrice td.s1 { background: var(--seq-1); } .matrice td.s2 { background: var(--seq-2); } .matrice td.s3 { background: var(--seq-3); }
.matrice td.s4 { background: var(--seq-4); color: #04130f; } .matrice td.s5 { background: var(--seq-5); color: #04130f; }
.matrice td.alerte::after { content: "▲"; position: absolute; top: -1px; right: 1px; font-size: .55rem; color: var(--attention); }
.echelle { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .75rem; color: var(--texte-3); margin-top: 10px; }
.echelle b { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }

/* Synthèse */
.synthese .resume { font-size: 1rem; margin: 0 0 12px; }
.pt { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 7px 0; font-size: .89rem; }
.pt b { color: var(--texte); } .pt span { color: var(--texte-2); }
.conseil { margin-top: 12px; padding: 11px 14px; border-radius: 9px; background: rgba(212,175,55,.07); border-left: 3px solid var(--or); font-size: .9rem; }
.ia { margin-top: 12px; padding: 11px 14px; border-radius: 9px; background: rgba(57,135,229,.08); border-left: 3px solid var(--serie-2); font-size: .9rem; white-space: pre-line; }
.ia small { display: block; color: var(--texte-3); margin-top: 6px; }
.classe-carte { cursor: pointer; transition: border-color .15s; }
.classe-carte:hover { border-color: rgba(212,175,55,.5); }
.ar { font-family: Amiri, serif; }
@media (max-width: 640px) { main { padding: 16px 12px 50px; } .barre { padding: 8px 12px; } .marque small { display: none; }
    #barreDroite { font-size: .78rem; gap: 6px; } #barreDroite a { display: none; } .matrice th.lig { max-width: 110px; overflow: hidden; text-overflow: ellipsis; } .comp { grid-template-columns: 1fr auto; } .comp .piste { grid-column: 1 / -1; order: 3; } }

/* ── Page de connexion et d'inscription ── */
.accueil-connexion { max-width: 460px; margin: 34px auto 0; }
.accueil-connexion .formulaire { max-width: none; margin: 0 0 14px; padding: 26px 26px 24px; position: relative; }
.ornement { height: 26px; margin: -6px 0 12px; background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 26'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='1'%3E%3Cpath d='M0 13h84M136 13h84' opacity='.45'/%3E%3Cpath d='M110 2l4.2 6.8L122 6l-2.8 7.8L126 13l-6.8 4.2L122 20l-7.8-2.8L110 24l-4.2-6.8L98 20l2.8-7.8L94 13l6.8-4.2L98 6l7.8 2.8z'/%3E%3Ccircle cx='110' cy='13' r='2.4' fill='%23d4af37' stroke='none'/%3E%3Ccircle cx='88' cy='13' r='1.4' fill='%23d4af37' stroke='none'/%3E%3Ccircle cx='132' cy='13' r='1.4' fill='%23d4af37' stroke='none'/%3E%3C/g%3E%3C/svg%3E"); }
button.large { width: 100%; margin-top: 4px; padding: 11px 15px; font-size: 1rem; }
.choix-inscription { display: grid; gap: 10px; }
.choix { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 13px 16px;
    background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; text-decoration: none; color: var(--or);
    transition: border-color .15s, transform .15s; }
.choix:hover { border-color: rgba(212,175,55,.55); transform: translateX(2px); }
.choix .pict { font-size: 1.5rem; text-align: center; }
.choix b { display: block; color: var(--texte); font-size: .96rem; }
.choix small { display: block; color: var(--texte-2); font-size: .82rem; margin-top: 2px; }
.note-bas { text-align: center; font-size: .84rem; margin: 16px 0 0; }
.note-bas a { color: var(--texte-2); }
input.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .18em; text-transform: uppercase; font-size: 1.05rem; }

/* Code de classe et demandes */
.code-classe { display: flex; gap: 16px 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.code-classe > div:first-child { flex: 1 1 280px; }
.code-zone { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.code-zone output { font: 700 1.7rem ui-monospace, Menlo, monospace; letter-spacing: .14em; color: var(--or);
    padding: 6px 16px; border: 1px dashed rgba(212,175,55,.45); border-radius: 10px; background: var(--fond); }
.demandes { border-color: rgba(212,175,55,.5); }
.demande { display: flex; gap: 12px 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 11px 0; }
.demande + .demande { border-top: 1px solid var(--grille); }
.demande p { margin: 5px 0 0; color: var(--texte-2); font-size: .86rem; max-width: 640px; }

/* Champ-piège contre les robots : hors écran, jamais montré ni lu. */
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Textes venus d'un formulaire public : jamais de débordement. */
.demande > div:first-child, .demande p, table.liste td, .choix small, .avis, .souvenirs li { overflow-wrap: anywhere; min-width: 0; }
.code-zone .lien-copie { margin-top: 0; width: 100%; max-width: 420px; }
/* Avis de l'agent SAWM et mémoire Basira */
.sawm { border-color: rgba(57,135,229,.35); }
.avis { margin: 12px 0 8px; padding: 13px 15px; border-radius: 10px; background: rgba(57,135,229,.07); border-left: 3px solid var(--serie-2);
    font-size: .92rem; line-height: 1.65; white-space: pre-line; }
.souvenirs { list-style: none; margin: 10px 0 0; padding: 0; max-height: 330px; overflow-y: auto; }
.souvenirs li { display: grid; grid-template-columns: 46px 1fr; gap: 8px; padding: 7px 0; font-size: .85rem; color: var(--texte-2); border-top: 1px solid var(--grille); }
.souvenirs li span { color: var(--texte-3); font-size: .76rem; padding-top: 2px; }

/* ── Graphiques en couleurs ── */
.cle { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: baseline; }
.legende .cle { margin-left: 2px; }
.legende .cle + .cle, .legende { word-spacing: 0; }
.tuile { position: relative; overflow: hidden; padding-top: 16px; }
.tuile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--teinte, var(--serie-1)), transparent 85%); }
.tuile-pict { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center; font-size: 1.05rem;
    border-radius: 10px; background: color-mix(in srgb, var(--teinte, var(--serie-1)) 24%, transparent); }
.tuile-pict:empty { display: none; }
.tuile b { color: #fff; }
.graphe .courbe { stroke: #e9c14d; stroke-width: 2.5; }
.graphe .point { fill: #f4d774; stroke: #0a2b26; }
.graphe .seuil { stroke: #f4d774; stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; }
.graphe .seuil-txt { fill: #e9c14d; font-size: 10px; }
.comp .nom { display: flex; align-items: center; }
.comp .rempli { border-radius: 4px; box-shadow: 0 0 10px rgba(0, 0, 0, .25); }
.comp .piste { height: 12px; border-radius: 6px; overflow: hidden; }
.comp .val b { color: var(--texte); margin-right: 4px; }
.etat.acquis i, .etat.a_revoir i, .etat.a_consolider i, .etat.en_cours i { color: inherit; }

.anneau { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.anneau svg { width: 170px; height: 170px; flex: none; overflow: visible; }
.anneau circle { transition: stroke-width .15s; }
.anneau circle:hover { stroke-width: 22; }
.anneau-nb { fill: #fff; font: 700 22px Inter, sans-serif; }
.anneau-txt { fill: var(--texte-2); font: 11px Inter, sans-serif; }
.anneau-legende { list-style: none; margin: 0; padding: 0; flex: 1 1 170px; display: grid; gap: 7px; font-size: .86rem; }
.anneau-legende li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; color: var(--texte-2); }
.anneau-legende b { color: var(--texte); }

.profils { display: grid; gap: 9px; }
.profil { display: grid; grid-template-columns: minmax(90px, 150px) 1fr; gap: 10px; align-items: center; font-size: .85rem; }
.profil a { cursor: pointer; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pile { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; }
.pile span { display: grid; place-items: center; font-size: .72rem; font-weight: 600; color: #04130f; min-width: 3px; }
.profils .echelle span, .echelle span { white-space: nowrap; margin-right: 6px; }
.matrice td { color: #fff; font-weight: 600; }
.matrice td.s3, .matrice td.s5 { color: #04130f; }
.matrice td.s4 { color: #fff; }

/* ── Cours ── */
h3 { font-size: .95rem; color: var(--or); margin: 20px 0 8px; }
.bascule { display: inline-flex; border: 1px solid var(--trait); border-radius: 22px; padding: 3px; background: rgba(3, 20, 18, .6); }
.bascule button { border: 0; border-radius: 18px; padding: 6px 13px; font-size: .84rem; color: var(--texte-2); }
.bascule button.actif { background: linear-gradient(135deg, #1f8f6a, #0f5f47); color: #f4e4bc; font-weight: 600; }
.methode { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 22px; }
.etape { position: relative; padding: 12px 13px 12px 15px; border-radius: 12px; background: var(--surface); border: 1px solid var(--trait); overflow: hidden; }
.etape::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--teinte); }
.etape span { font-size: 1.25rem; display: block; }
.etape b { display: block; font-size: .9rem; color: var(--texte); margin: 2px 0; }
.etape small { color: var(--texte-2); font-size: .78rem; line-height: 1.4; display: block; }
.tome-titre { font-size: 1.15rem; margin: 26px 0 4px; color: var(--texte); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; text-shadow: 0 2px 10px rgba(0,0,0,.7); }
.tome-titre > span:first-child { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: #06201c; background: var(--or); border-radius: 20px; padding: 3px 11px; font-weight: 700; text-shadow: none; }
.parties { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 12px; }
button.partie { display: grid; grid-template-columns: 42px 1fr auto; gap: 13px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 14px;
    background: linear-gradient(165deg, rgba(11, 66, 57, .95), rgba(6, 34, 30, .97)); border: 1px solid var(--trait); color: var(--texte);
    box-shadow: 0 8px 24px rgba(0,0,0,.32); transition: border-color .15s, transform .15s; }
button.partie:hover:not(:disabled) { border-color: rgba(212, 175, 55, .6); transform: translateY(-2px); background: linear-gradient(165deg, rgba(13, 76, 66, .96), rgba(7, 40, 35, .97)); }
button.partie.fermee { opacity: .62; }
.partie .num { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; color: #06201c;
    background: radial-gradient(circle at 30% 30%, #f4d774, #b8861c); }
.partie .corps { display: grid; gap: 4px; min-width: 0; }
.partie .corps b { font-size: .98rem; }
.partie .corps small { color: var(--texte-2); font-size: .82rem; line-height: 1.4; }
.partie .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .76rem; color: var(--texte-3); margin-top: 2px; }
.partie .pourcent { font-size: 1.35rem; font-weight: 700; color: #fff; }
.partie .pourcent small { font-size: .7rem; color: var(--texte-3); font-weight: 400; }
.jauge { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.jauge i { height: 7px; border-radius: 4px; background: linear-gradient(90deg, var(--teinte) var(--part), rgba(3, 20, 18, .75) var(--part)); }
.frise { display: flex; align-items: flex-end; gap: 5px; height: 74px; margin-top: 12px; padding: 0 2px; border-bottom: 1px solid var(--grille); }
.frise i { flex: 1; min-width: 14px; height: var(--part); border-radius: 5px 5px 0 0; display: flex; align-items: flex-end; justify-content: center; font-style: normal;
    background: linear-gradient(180deg, #f4d774, #b8861c); }
.frise i.termine { background: linear-gradient(180deg, #4fe0ae, #0f7d5c); }
.frise i.non_commence { background: rgba(3, 20, 18, .7); outline: 1px dashed var(--grille); outline-offset: -1px; }
.frise i b { font-size: .68rem; color: #06201c; padding-bottom: 2px; }
.frise i.non_commence b { color: var(--texte-3); }
.cours-accueil { border-color: rgba(212, 175, 55, .5); }

.phases { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 12px; scroll-margin-top: 70px; }
.phases button { display: grid; gap: 2px; justify-items: center; padding: 9px 4px; border-radius: 12px; border: 1px solid var(--trait); color: var(--texte-2);
    background: rgba(7, 42, 37, .92); font-size: .8rem; }
.phases button span { font-size: 1.2rem; }
.phases button b { font-weight: 600; }
.phases button.actif { color: #fff; border-color: var(--teinte); box-shadow: inset 0 -3px 0 var(--teinte), 0 6px 18px rgba(0,0,0,.35);
    background: linear-gradient(180deg, color-mix(in srgb, var(--teinte) 26%, #072a25), rgba(7, 42, 37, .96)); }
.phase-corps { border-top: 3px solid var(--teinte); }
.consigne { margin: 0 0 16px; padding: 11px 14px; border-radius: 10px; background: color-mix(in srgb, var(--teinte) 13%, transparent); border-left: 3px solid var(--teinte); font-size: .93rem; }
.pied { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--grille); }
.voisines { margin-top: 4px; }
.voisines button { max-width: 48%; text-align: left; }
.centre { justify-content: center; }

/* Texte arabe : toujours grand, la lecture voyellée ne supporte pas le petit corps. */
.ar { font-family: Amiri, "Noto Sans Arabic", serif; font-size: 1.75rem; line-height: 1.9; color: #f4e4bc; }
.ar-ligne { font-family: Amiri, "Noto Sans Arabic", serif; font-size: 1.4em; line-height: 1; color: #f4e4bc; padding: 0 2px; }
.translit { font-style: italic; color: var(--texte-3); font-size: .86rem; }
.fr { color: var(--texte); font-size: .95rem; }
.entrees { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.entree { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 13px 14px; border-radius: 12px; background: rgba(3, 20, 18, .5); border: 1px solid var(--grille); }
.entree-texte { min-width: 0; display: grid; gap: 2px; }
.entree .ar { text-align: right; }
.vignette { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 14px; background: #f6efdc; box-shadow: 0 3px 10px rgba(0,0,0,.35), inset 0 0 0 1px rgba(184, 134, 28, .45); }
.vignette img { width: 82%; height: 82%; display: block; }
.vignette.grande { width: 108px; height: 108px; border-radius: 20px; }
.ecoute { padding: 6px 10px; font-size: .84rem; border-radius: 20px; white-space: nowrap; }
.entree .ecoute span { display: none; }
.remarque { margin-top: 6px; font-size: .86rem; color: var(--texte-2); }
.remarque summary { cursor: pointer; color: var(--or); font-size: .82rem; }
.remarque p { margin: 6px 0 0; }
.explication { margin: 0 0 12px; font-size: .97rem; line-height: 1.7; }
.retenir { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.retenir li { padding: 9px 12px 9px 36px; border-radius: 9px; background: rgba(212, 175, 55, .08); position: relative; font-size: .92rem; }
.retenir li::before { content: "★"; position: absolute; left: 12px; color: var(--or); }
.faute { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 11px 13px; border-radius: 10px; background: rgba(3, 20, 18, .5); border: 1px solid var(--grille); margin-bottom: 8px; font-size: .95rem; }
.faute .faux { color: #f0a9a2; } .faute .juste { color: #8fe6b8; }
.faute p { grid-column: 1 / -1; margin: 0; color: var(--texte-2); font-size: .86rem; }

/* Niveaux de répétition */
.niveaux { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.niveaux button { display: grid; gap: 1px; text-align: left; padding: 9px 11px; border-radius: 11px; border: 1px solid var(--grille); background: rgba(3, 20, 18, .5); color: var(--texte-2);
    border-top: 3px solid var(--teinte); }
.niveaux button small { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); }
.niveaux button b { font-size: .9rem; color: var(--texte); }
.niveaux button span { font-size: .78rem; }
.niveaux button.actif { background: color-mix(in srgb, var(--teinte) 22%, #06201c); border-color: var(--teinte); box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.coche { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: .84rem; cursor: pointer; }
.coche input { width: auto; accent-color: var(--or); }
.bravo { margin: 0 0 12px; padding: 10px 13px; border-radius: 10px; background: rgba(47, 191, 113, .14); border-left: 3px solid var(--e-acquis); font-size: .92rem; }
.joueur { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; padding: 26px 18px 20px; border-radius: 16px;
    background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--teinte, var(--c1)) 20%, transparent), transparent 70%), rgba(3, 20, 18, .55);
    border: 1px solid color-mix(in srgb, var(--teinte, var(--c1)) 45%, transparent); }
.joueur .rang { position: absolute; top: 10px; right: 14px; font-size: .76rem; color: var(--texte-3); }
.joueur .ar { font-size: 2.5rem; line-height: 1.8; }
.joueur .ar.voile { color: var(--texte-3); }
.joueur .fr { font-size: 1.05rem; }
.joueur .fr.cible { font-size: 1.2rem; font-weight: 600; margin-bottom: 4px; }
.joueur .legende { margin: 10px 0 2px; }
.joueur .ecoute span { display: inline; }
.auto { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.auto button { display: inline-flex; align-items: center; gap: 7px; padding: 10px 15px; border-radius: 22px; color: #fff; font-weight: 600; font-size: .9rem;
    border: 1px solid var(--teinte); background: color-mix(in srgb, var(--teinte) 24%, #06201c); }
.auto button:hover { background: color-mix(in srgb, var(--teinte) 42%, #06201c); }
.auto button i { font-style: normal; color: var(--teinte); }
.points { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.points button { width: 30px; height: 30px; padding: 0; border-radius: 50%; font-size: .74rem; color: var(--texte-3); border: 1px solid var(--grille); background: rgba(3, 20, 18, .5); }
.points button.facile { background: var(--e-acquis); color: #04130f; border-color: transparent; font-weight: 700; }
.points button.hesitant { background: var(--e-en_cours); color: #04130f; border-color: transparent; }
.points button.pas_encore { background: var(--e-a_revoir); color: #fff; border-color: transparent; }
.points button.ici { outline: 2px solid #f4e4bc; outline-offset: 2px; }
.consigne-tr { margin: 0 0 4px; font-weight: 600; color: var(--or); }
.reponse { display: grid; justify-items: center; gap: 4px; margin-top: 4px; }
.fleche { font-size: 1.4rem; color: var(--or); }
.reponse-ordre, .banque { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 58px; width: 100%; padding: 10px; border-radius: 12px; }
.reponse-ordre { border: 1px dashed rgba(212, 175, 55, .5); background: rgba(3, 20, 18, .55); align-items: center; }
.vide-ordre { color: var(--texte-3); }
button.mot { font-family: Amiri, "Noto Sans Arabic", serif; font-size: 1.5rem; line-height: 1.5; padding: 4px 14px; border-radius: 10px; color: #f4e4bc;
    background: linear-gradient(135deg, #14574a, #0c3a32); border: 1px solid rgba(212, 175, 55, .45); }
.reponse-ordre button.mot { background: linear-gradient(135deg, #7a5a12, #4a370a); }
.verdict { width: 100%; padding: 10px 14px; border-radius: 12px; margin: 4px 0; }
.verdict.bon { background: rgba(47, 191, 113, .16); border: 1px solid var(--e-acquis); }
.verdict.faux { background: rgba(226, 87, 76, .14); border: 1px solid var(--e-a_revoir); }
.verdict .ar { font-size: 1.8rem; }
.fin { margin-top: 22px; padding: 14px 16px; border-radius: 12px; background: rgba(212, 175, 55, .07); border: 1px solid rgba(212, 175, 55, .28); }
.fin h3 { margin-top: 0; }

/* Affichage enfant : tout plus grand, plus d'air, des images larges. */
.enfant .explication { font-size: 1.12rem; line-height: 1.8; }
.enfant .ar { font-size: 2.1rem; }
.enfant .joueur .ar { font-size: 3rem; }
.enfant .fr { font-size: 1.08rem; }
.enfant .entree { grid-template-columns: 1fr; justify-items: center; text-align: center; }
.enfant .entree .ar { text-align: center; }
.enfant .auto button { padding: 13px 18px; font-size: 1rem; }
.enfant .retenir li { font-size: 1.02rem; }

@media (max-width: 640px) {
    .phases button b { font-size: .68rem; } .phases button { padding: 7px 2px; }
    .niveaux { grid-template-columns: repeat(2, 1fr); }
    .joueur .ar { font-size: 2rem; } .enfant .joueur .ar { font-size: 2.4rem; }
    .faute { grid-template-columns: 1fr; }
    button.partie { grid-template-columns: 36px 1fr auto; padding: 12px; } .partie .num { width: 36px; height: 36px; }
    .voisines button { max-width: 100%; }
    #barreDroite > span { display: none; }
}
@media (max-width: 820px) { #barreDroite > span { display: none; } }

/* Grille d'avancement du cours (professeur) */
.matrice td.a1 { background: var(--av-1); } .matrice td.a2 { background: var(--av-2); } .matrice td.a3 { background: var(--av-3); }
.matrice td.a4 { background: var(--av-4); color: #04130f; } .matrice td.a5 { background: var(--av-5); color: #04130f; }

main { padding-bottom: 110px; }
