/* ProfLangue, design « Ton mélange » (choisi par Yannick le 17 octobre 2026) : le verre dépoli du modèle 1 sur fond
   clair, les couleurs du modèle 2, le Sam en pâte à modeler du modèle 4. Courbes reprises d'Emil Kowalski. */
:root {
  --fond: #F7F6F2;
  --encre: #15131F;
  --texte-doux: #5E5B70;
  --gris: #77748A;
  --violet: #6D3BFF;
  --citron: #C6F432;
  --tomate: #FF4D2E;
  --ciel: #49B6FF;
  --verre: rgba(255, 255, 255, .58);
  --verre-bord: rgba(255, 255, 255, .9);
  --verre-flou: blur(24px) saturate(170%);
  --ombre-verre: inset 0 1px 0 #fff, 0 22px 40px -26px rgba(60, 40, 140, .45);
  --rayon-carte: 30px;
  --rayon-bouton: 24px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  --ressort: cubic-bezier(.34, 1.56, .64, 1);
  --tiroir: cubic-bezier(.32, .72, 0, 1);
  --f: "Sora", system-ui, -apple-system, sans-serif;
  --bouche: 0;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  background: var(--fond);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body { margin: 0; color: var(--encre); font: 15px/1.5 var(--f); -webkit-font-smoothing: antialiased; }
button, a, summary, label { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; font-family: var(--f); }
input, select, textarea { font-size: 16px; }

.verre {
  background: var(--verre);
  -webkit-backdrop-filter: var(--verre-flou);
  backdrop-filter: var(--verre-flou);
  border: 1px solid var(--verre-bord);
  box-shadow: var(--ombre-verre);
}

/* ---------- Aurores ---------- */
.aurores { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurores i { position: absolute; border-radius: 50%; filter: blur(56px); opacity: .55; transition: background .8s ease, opacity .8s ease; will-change: transform; }
.aurores .a1 { width: 300px; height: 300px; background: var(--violet); left: -120px; top: -80px; animation: derive1 14s ease-in-out infinite alternate; }
.aurores .a2 { width: 260px; height: 260px; background: var(--citron); right: -110px; top: 250px; opacity: .75; animation: derive2 17s ease-in-out infinite alternate; }
.aurores .a3 { width: 240px; height: 240px; background: var(--tomate); left: 20px; bottom: -80px; opacity: .4; animation: derive3 19s ease-in-out infinite alternate; }
.aurores .a4 { width: 200px; height: 200px; background: var(--ciel); right: -40px; top: -40px; opacity: .45; animation: derive1 16s ease-in-out infinite alternate-reverse; }
@keyframes derive1 { to { transform: translate(110px, 90px) scale(1.15); } }
@keyframes derive2 { to { transform: translate(-140px, -60px) scale(.9); } }
@keyframes derive3 { to { transform: translate(110px, -150px) scale(1.2); } }
/* Sur la leçon, la lumière suit Sam : parle = violet, écoute = ciel, bravo = citron et tomate. */
body:has(#vueCours:not([hidden])):has(.appli[data-state="listen"]) .aurores .a1 { background: var(--ciel); }
body:has(#vueCours:not([hidden])):has(.appli[data-state="win"]) .aurores .a1 { background: var(--citron); }
body:has(#vueCours:not([hidden])):has(.appli[data-state="win"]) .aurores .a2 { background: var(--tomate); opacity: .5; }

/* ---------- Coque ---------- */
.appli { position: relative; z-index: 1; max-width: 480px; min-height: 100dvh; margin: 0 auto; }
.vue {
  padding: max(28px, calc(env(safe-area-inset-top) + 14px)) max(22px, env(safe-area-inset-right)) calc(120px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.entre { opacity: 0; transform: translateY(14px); animation: entre .7s var(--ease) forwards; }
.e1 { animation-delay: .05s; } .e2 { animation-delay: .12s; } .e3 { animation-delay: .19s; } .e4 { animation-delay: .26s; }
.e5 { animation-delay: .33s; } .e6 { animation-delay: .4s; } .e7 { animation-delay: .47s; }
@keyframes entre { to { opacity: 1; transform: none; } }

.grand-titre { margin: 0; font: 800 34px/1.08 var(--f); letter-spacing: -.03em; text-wrap: balance; }
.discret { margin: 0; font-size: 13px; color: var(--texte-doux); }

/* ---------- Les cinq profs (SVG en pâte à modeler, profs.js) ---------- */
.av { position: relative; aspect-ratio: 1; flex: none; }
.av svg { width: 100%; height: 100%; overflow: visible; display: block; }
.av.petit { width: 84px; }
.av.grand { width: 210px; z-index: 2; }
.av .corps { transform-box: view-box; transform-origin: 50% 92%; transition: transform .5s var(--ressort); animation: flotte 3.6s ease-in-out infinite; }
@keyframes flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.av .ombre { transform-box: fill-box; transform-origin: center; animation: ombre 3.6s ease-in-out infinite; }
@keyframes ombre { 50% { transform: scaleX(.88); opacity: .08; } }
.av .oeil { transform-box: fill-box; transform-origin: center; animation: cligne 4.2s infinite; transition: transform .2s; }
@keyframes cligne { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.av .bouche { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(calc(.5 + var(--bouche) * 1.5)); transition: transform 70ms linear; }
.av .antenne { transform-box: view-box; transform-origin: 100px 44px; animation: antenne 2.4s ease-in-out infinite; }
@keyframes antenne { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.av .oreille { transform-box: fill-box; transform-origin: 50% 100%; }
/* États, posés par app.js : talk (sa voix joue), listen (il t'écoute), win (réussite). */
.av[data-state="talk"] .corps { animation: none; transition: transform 80ms linear; transform: scale(calc(1 + var(--bouche) * .06), calc(1 - var(--bouche) * .05)); }
.av[data-state="listen"] .corps { animation: none; transform: rotate(-7deg); }
.av[data-state="listen"] .oreille { animation: frem 1.2s ease-in-out infinite; }
@keyframes frem { 50% { transform: rotate(-10deg); } }
.av[data-state="win"] .corps { animation: saut .9s var(--ressort); }
@keyframes saut { 0% { transform: none; } 20% { transform: scale(1.1, .9); } 45% { transform: translateY(-34px) scale(.93, 1.08); } 75% { transform: scale(1.06, .94); } 100% { transform: none; } }
.av[data-state="win"] .oeil { animation: none; transform: scaleY(.35); }
.av[data-state="win"] .bouche { transform: scale(1.25, 1.8); }
.av[data-state="win"] .led { fill: var(--citron); filter: drop-shadow(0 0 6px var(--citron)); }

/* ---------- Choisis ton prof ---------- */
.vitrine { border-radius: var(--rayon-carte); padding: 10px 14px 16px; display: grid; justify-items: center; gap: 2px; }
.vitrine-av { width: min(150px, 42%); }
.vitrine h2 { margin: 0; font: 800 24px var(--f); letter-spacing: -.02em; }
.vitrine p { margin: 0; text-align: center; font-size: 13px; color: var(--texte-doux); max-width: 34ch; }
.rangee-profs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 8px; }
.rangee-profs button { min-width: 0; aspect-ratio: 1; border-radius: 50%; padding: 4px; cursor: pointer; transition: transform .2s var(--ease), box-shadow .3s; }
.rangee-profs button:active { transform: scale(.95); }
.rangee-profs button[aria-checked="true"] { box-shadow: 0 0 0 3px var(--encre), 0 0 0 6px var(--citron); transform: translateY(-3px); }
.rangee-profs .av { width: 100%; }
.rangee-profs .av .corps { animation: none; }
.sa-voix { border-radius: 24px; padding: 12px; display: grid; gap: 8px; }
.sa-voix-haut { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; padding: 0 4px; }
.grille-voix { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.vx { border: 0; background: rgba(21, 19, 31, .06); border-radius: 14px; padding: 9px 11px; text-align: left; cursor: pointer; color: var(--encre); display: grid; gap: 1px; font-family: var(--f); transition: background .3s, transform .2s var(--ease), opacity .3s; }
.vx:active { transform: scale(.97); }
.vx b { font-size: 15px; }
.vx small { font-size: 11px; color: var(--texte-doux); line-height: 1.25; }
.vx[aria-checked="true"] { background: var(--citron); box-shadow: inset 0 0 0 2px var(--encre); }
.vx:disabled { opacity: .32; cursor: not-allowed; }
.vx:disabled b { text-decoration: line-through; }
.note-voix { margin: 0; font-size: 12px; color: var(--texte-doux); padding: 0 4px; min-height: 1.3em; }
.ecouter { border: 0; background: var(--encre); color: var(--citron); font: 700 13px var(--f); border-radius: 999px; padding: 7px 13px; cursor: pointer; display: flex; gap: 6px; align-items: center; transition: transform .16s var(--ease); }
.ecouter svg { width: 12px; height: 12px; fill: currentColor; }
.ecouter:active { transform: scale(.96); }
.ecouter.joue { background: var(--citron); color: var(--encre); }
.ecouter:focus-visible, .vx:focus-visible, .rangee-profs button:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.changer-prof { width: 100%; margin: 4px 0 8px; }

/* ---------- Accueil ---------- */
.mini-sam { display: flex; align-items: center; gap: 10px; }
.bulle { margin: 0; padding: 12px 16px; border-radius: 22px 22px 22px 6px; font-size: 14px; font-weight: 600; line-height: 1.4; }

.langues { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; width: 220px; }
.langues .curseur { position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); height: calc(100% - 8px); border-radius: 999px; background: var(--citron); box-shadow: 0 6px 16px -8px rgba(110, 140, 0, .8); transition: transform .4s var(--ressort); }
.langues:has(input[value="thai"]:checked) .curseur { transform: translateX(100%); }
.langues label { position: relative; z-index: 1; cursor: pointer; }
.langues input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.langues span { display: grid; place-items: center; height: 40px; border-radius: 999px; font: 700 15px var(--f); transition: transform .16s var(--ease); }
.langues label:active span { transform: scale(.96); }
.langues input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 2px; }

.episode {
  position: relative;
  overflow: hidden;
  border-radius: var(--rayon-carte);
  padding: 22px;
  color: #fff;
  background: linear-gradient(150deg, rgba(109, 59, 255, .94), rgba(80, 30, 220, .86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 24px 40px -22px rgba(109, 59, 255, .9);
  display: grid;
  justify-items: start;
}
.episode::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .22) 45%, transparent 60%);
  transform: translateX(-100%);
  animation: reflet 5s var(--ease) infinite 1.5s;
  pointer-events: none;
}
@keyframes reflet { 0% { transform: translateX(-100%); } 40%, 100% { transform: translateX(100%); } }
.episode > * { margin: 0; }
.episode small { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--citron); }
.numero-episode { margin-top: 10px; font-size: 14px; opacity: .8; }
.episode h2 { margin-top: 2px; font: 800 26px/1.1 var(--f); letter-spacing: -.02em; }
.episode .objectif { margin-top: 10px; font-size: 14px; line-height: 1.45; opacity: .9; }
.reussi { margin-top: 10px; background: var(--citron); color: var(--encre); font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.distribution { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.distribution span { display: flex; align-items: center; gap: 6px; padding: 5px 11px 5px 5px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 13px; font-weight: 700; }
.distribution b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: var(--encre); }

/* Testeur : le temps qui reste aujourd'hui */
.essai { margin: 0; align-self: flex-start; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--citron) 60%, white); color: var(--encre); font-size: 13px; font-weight: 700; line-height: 1.35; }
.semaine { display: flex; align-items: center; gap: 8px; }
.semaine-titre { font-size: 14px; font-weight: 700; margin-right: 6px; }
.semaine-compte { font-size: 14px; font-weight: 800; margin-left: 6px; }
.barres { flex: 1; display: flex; gap: 8px; }
.barres i { flex: 1; height: 10px; border-radius: 99px; background: rgba(21, 19, 31, .08); }
.barres i.faite { background: var(--violet); animation: remplit .6s var(--ressort) both; transform-origin: left; }
@keyframes remplit { from { transform: scaleX(0); } }

.actions-accueil { display: grid; gap: 10px; }
.bouton-noir {
  position: relative;
  overflow: hidden;
  border: 0;
  cursor: pointer;
  color: var(--citron);
  background: var(--encre);
  font: 800 17px var(--f);
  border-radius: 20px;
  min-height: 52px;
  padding: 0 20px;
  box-shadow: 0 18px 36px -18px rgba(21, 19, 31, .8);
  transition: transform .16s var(--ease);
}
.bouton-noir:active { transform: scale(.97); }
.bouton-noir:disabled { opacity: .5; cursor: default; }
.bouton-noir.grand { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 68px; padding: 0 10px 0 24px; border-radius: var(--rayon-bouton); font-size: 18px; text-align: left; }
.bouton-noir.grand::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  left: -80px;
  background: linear-gradient(90deg, transparent, rgba(198, 244, 50, .35), transparent);
  transform: skewX(-20deg);
  animation: eclat 3.2s var(--ease) infinite 1.2s;
}
@keyframes eclat { 0% { left: -80px; } 45%, 100% { left: 120%; } }
.fleche { width: 50px; height: 50px; border-radius: 18px; background: var(--citron); display: grid; place-items: center; animation: pousse 1.6s var(--ease) infinite; flex: none; }
.fleche svg { width: 22px; height: 22px; fill: none; stroke: var(--encre); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes pousse { 0%, 60%, 100% { transform: translateX(0); } 30% { transform: translateX(5px); } }
.bouton-noir.secondaire { background: var(--verre); color: var(--encre); -webkit-backdrop-filter: var(--verre-flou); backdrop-filter: var(--verre-flou); border: 1px solid var(--verre-bord); box-shadow: var(--ombre-verre); }
.bouton-noir.secondaire::after { display: none; }
.bouton-noir.secondaire .fleche { animation: none; background: rgba(21, 19, 31, .06); }

.bouton-doux { border: 0; cursor: pointer; font: 700 15px var(--f); color: var(--encre); min-height: 52px; border-radius: 18px; padding: 0 18px; background: rgba(21, 19, 31, .06); transition: transform .16s var(--ease); }
.bouton-doux:active { transform: scale(.97); }
.bouton-lien { border: 0; background: none; cursor: pointer; font: 700 14px var(--f); color: var(--violet); padding: 8px; }
.bouton-tomate { border: 0; cursor: pointer; font: 700 15px var(--f); color: #fff; background: var(--tomate); height: 46px; border-radius: 16px; padding: 0 18px; flex: none; transition: transform .16s var(--ease); }
.bouton-tomate:active { transform: scale(.97); }
.bouton-tomate:disabled { opacity: .5; }
:is(.bouton-noir, .bouton-doux, .bouton-lien, .bouton-tomate, .barre-bas button):focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

.reglages { font-size: 14px; color: var(--texte-doux); }
.reglages summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.reglages fieldset { border: 0; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.reglages legend { font-weight: 700; margin-bottom: 4px; color: var(--encre); }
.choix { display: flex; gap: 10px; align-items: flex-start; padding: 4px 0; cursor: pointer; }
.choix input { margin-top: 4px; accent-color: var(--violet); }

.carte-verre { border-radius: 24px; padding: 16px; display: grid; gap: 10px; }
.champ { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid rgba(21, 19, 31, .12); background: rgba(255, 255, 255, .8); color: var(--encre); }
.champ:focus { outline: none; border-color: var(--violet); }

.alerte { margin: 0; background: rgba(255, 77, 46, .12); color: #A02410; padding: 12px 14px; border-radius: 18px; font-size: 14px; font-weight: 600; }

/* ---------- Leçon ---------- */
.haut-cours { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.pastille { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.centre { display: flex; justify-content: center; min-height: 32px; }
.pastille-jeu { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--violet); color: #fff; animation: entre .45s var(--ressort) both; }

.scene { position: relative; height: 250px; display: grid; place-items: center; margin-top: -6px; }
.scene > * { grid-area: 1 / 1; }
.halo { width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(109, 59, 255, .35), transparent 65%); }
[data-state="talk"] .halo { transform: scale(calc(1 + var(--bouche) * .14)); transition: transform 80ms linear; }
.anneau { width: 190px; height: 190px; border-radius: 50%; border: 2px solid rgba(73, 182, 255, .8); background: rgba(255, 255, 255, .18); opacity: 0; }
[data-state="listen"] .anneau { animation: anneau 2.1s var(--ease) infinite; }
[data-state="listen"] .anneau.a2 { animation-delay: .7s; }
[data-state="listen"] .anneau.a3 { animation-delay: 1.4s; }
@keyframes anneau { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.55); opacity: 0; } }
.flaque { align-self: end; margin-bottom: 14px; width: 140px; height: 20px; border-radius: 50%; background: rgba(21, 19, 31, .12); }
[data-state="win"] .flaque { animation: flaque .9s var(--ressort); }
@keyframes flaque { 30% { transform: scaleX(.6); opacity: .4; } }
.confettis { width: 0; height: 0; position: relative; z-index: 3; }
.confettis i { position: absolute; left: 0; top: 0; opacity: 0; }
[data-state="win"] .confettis i { animation: confetti 1.2s var(--ressort) forwards; }
@keyframes confetti {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.4); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(1); }
}

.etat-bloc { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: -6px; }
.etat { margin: 0; text-align: center; font: 800 21px/1.2 var(--f); min-height: 1.2em; }
.ondes { display: flex; gap: 5px; align-items: center; height: 28px; }
.ondes i { width: 5px; height: 8px; border-radius: 9px; background: var(--violet); }
[data-state="talk"] .ondes i { animation: barre .5s ease-in-out infinite alternate; }
[data-state="talk"] .ondes i:nth-child(2n) { animation-delay: .15s; }
[data-state="talk"] .ondes i:nth-child(3n) { animation-delay: .3s; }
[data-state="listen"] .ondes i { background: var(--ciel); }
@keyframes barre { to { height: 26px; } }

.etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 5px; border-radius: 18px; }
.etape { padding: 8px 0; text-align: center; border-radius: 14px; font-size: 12px; font-weight: 700; color: var(--gris); transition: background .3s ease, color .3s ease, transform .4s var(--ressort); }
.etape.actif { color: var(--encre); background: var(--citron); transform: translateY(-2px); }

.sous-titre { border-radius: 24px; padding: 16px 18px; min-height: 96px; display: grid; align-content: start; gap: 6px; }
.sous-titre .qui { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--violet); }
.sous-titre.eleve .qui { color: #2C8FD6; }
.sous-titre .replique { font-size: 16px; font-weight: 600; line-height: 1.4; }

.astuce { margin: 0; padding: 12px 14px; border-radius: 18px; font-size: 13px; line-height: 1.45; }

.micro { display: flex; align-items: center; gap: 10px; }
.micro-etiquette { font-size: 12px; font-weight: 600; color: var(--texte-doux); white-space: nowrap; }
.micro-barre { flex: 1; height: 8px; border-radius: 9px; background: rgba(21, 19, 31, .08); overflow: hidden; }
.micro-niveau { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--ciel), var(--violet)); transition: width 80ms linear; }
.micro.en-pause .micro-niveau { background: rgba(21, 19, 31, .18); }

.conversation { display: grid; gap: 8px; }
.conversation:empty { display: none; }
.ligne { margin: 0; padding: 10px 14px; border-radius: 18px; font-size: 14px; max-width: 88%; background: var(--verre); border: 1px solid var(--verre-bord); }
.ligne.sam { border-bottom-left-radius: 6px; justify-self: start; }
.ligne.eleve { border-bottom-right-radius: 6px; justify-self: end; background: rgba(109, 59, 255, .1); }
.ligne:empty { display: none; }

/* ---------- Bilan (feuille de verre qui monte) ---------- */
.voile { position: fixed; inset: 0; z-index: 20; border: 0; padding: 0; background: rgba(21, 19, 31, .3); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.bilan, .feuille {
  position: fixed;
  z-index: 21;
  left: 50%;
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(460px, calc(100% - 20px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-radius: 34px;
  padding: 26px 22px 22px;
  background: rgba(255, 255, 255, .86);
  transform: translate(-50%, 115%);
  transition: transform .5s var(--tiroir);
  display: grid;
  gap: 12px;
}
.bilan-ouvert .voile { opacity: 1; pointer-events: auto; }
.bilan-ouvert .bilan { transform: translate(-50%, 0); }
.fiche-ouverte .voile { opacity: 1; pointer-events: auto; }
.fiche-ouverte .feuille { transform: translate(-50%, 0); }
.poignee { width: 40px; height: 5px; border-radius: 9px; background: rgba(21, 19, 31, .15); margin: -12px auto 4px; }
.bilan-sur { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--violet); }
.bilan h2, .feuille h2 { margin: 0; font: 800 28px/1.1 var(--f); letter-spacing: -.02em; }
.bilan p, .feuille p { margin: 0; font-size: 14px; color: var(--texte-doux); }
.bilan-tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bilan .tuile { min-height: 0; padding: 14px; border-radius: 20px; }
.choix-suite { display: grid; gap: 10px; margin-top: 4px; }

/* ---------- Progrès ---------- */
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tuile { border-radius: 26px; padding: 16px; min-height: 106px; display: flex; flex-direction: column; justify-content: flex-end; }
.tuile b { font: 800 32px/1 var(--f); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tuile span { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--texte-doux); }
.tuile.violette { background: var(--violet); color: #fff; box-shadow: 0 18px 36px -20px var(--violet); }
.tuile.violette span { color: var(--citron); }
.tuile.citron { background: var(--citron); }
.tuile.citron span { color: var(--encre); }
#vueProgres .entre { transform: translateY(16px) scale(.96); animation-timing-function: var(--ressort); }

.anneau-semaine { border-radius: 24px; padding: 16px; display: flex; align-items: center; gap: 16px; }
.anneau-semaine svg { width: 76px; height: 76px; flex: none; }
.anneau-semaine .piste { fill: none; stroke: rgba(21, 19, 31, .08); stroke-width: 9; }
.anneau-semaine .valeur { fill: none; stroke: var(--violet); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 201; stroke-dashoffset: 201; transform: rotate(-90deg); transform-origin: center; transform-box: fill-box; transition: stroke-dashoffset 1.1s var(--ease); }
.anneau-semaine text { font: 800 18px var(--f); fill: var(--encre); }
.anneau-semaine p { margin: 0; }
.anneau-semaine b { display: block; font-size: 17px; font-weight: 800; }
.anneau-semaine span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.4; color: var(--texte-doux); }

.je-sais h2 { margin: 4px 0 8px; font: 800 18px var(--f); }
.je-sais ul { margin: 0; padding: 0; display: grid; gap: 8px; }
.je-sais li { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; font-size: 15px; font-weight: 600; }
.je-sais li.acquis { background: var(--verre); border: 1px solid var(--verre-bord); box-shadow: var(--ombre-verre); }
.je-sais li.a-venir { border: 1.5px dashed rgba(21, 19, 31, .2); color: var(--gris); }
.je-sais .point { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.je-sais .acquis .point { background: var(--citron); }
.je-sais .a-venir .point { border: 1.5px solid rgba(21, 19, 31, .25); }
.je-sais .point svg { width: 14px; height: 14px; fill: none; stroke: var(--encre); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.fiche summary { cursor: pointer; font-weight: 700; color: var(--texte-doux); font-size: 14px; }
.fiche pre { white-space: pre-wrap; font: 12px/1.5 ui-monospace, Menlo, monospace; background: var(--verre); border: 1px solid var(--verre-bord); padding: 14px; border-radius: 18px; overflow-x: auto; }

/* ---------- Barre du bas ---------- */
.barre-bas {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(436px, calc(100% - 44px));
  height: 68px;
  border-radius: 26px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}
.barre-bas button { position: relative; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--gris); font-size: 11px; font-weight: 700; padding: 8px 14px; border-radius: 18px; transition: transform .16s var(--ease), background .25s ease, color .25s ease; }
.barre-bas button:active { transform: scale(.94); }
.barre-bas svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.barre-bas button[aria-current="page"] { color: var(--encre); background: var(--citron); }
.barre-bas button.en-direct::after { content: ""; position: absolute; top: 5px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--tomate); animation: pouls 1.2s ease-in-out infinite; }
@keyframes pouls { 50% { transform: scale(1.5); opacity: .5; } }

@media (hover: hover) and (pointer: fine) {
  .bouton-doux:hover { background: rgba(21, 19, 31, .1); }
  .barre-bas button:not([aria-current="page"]):hover { color: var(--encre); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .entre { opacity: 1; transform: none; }
}


/* L'écran « Choisis ton prof » est une étape à part : pas de barre du bas, le bouton « Apprendre avec… » reste visible. */
body:has(#vueProf:not([hidden])) .barre-bas { display: none; }
#vueProf { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

/* Conseils de fin de leçon : prononciation, petite règle, astuces (bilan et Progrès). */
.conseils { display: grid; gap: 8px; }
.conseil { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: start; padding: 10px 12px; border-radius: 16px; background: rgba(21, 19, 31, .05); font-size: 14px; line-height: 1.4; }
.conseil i { grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 14px; }
.conseil.prononciation i { background: var(--ciel); }
.conseil.regle i { background: var(--citron); }
.conseil.astuce i { background: #FFB3C8; }
.conseil b { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--violet); }
.conseil span { color: var(--encre); }
.mes-conseils h2 { margin: 4px 0 8px; font: 800 18px var(--f); }
.mes-conseils details { border-radius: 20px; padding: 12px 14px; margin-bottom: 8px; }
.mes-conseils summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.mes-conseils .conseils { margin-top: 10px; }

/* ---------- Fiche de leçon (bilan « À retenir », feuille, Progrès « Mes fiches ») ---------- */
.fiche-phrases { margin: 0; padding: 0; display: grid; gap: 8px; }
.fiche-phrases li { list-style: none; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 12px; border-radius: 20px; background: rgba(255, 255, 255, .72); border: 1px solid var(--verre-bord); box-shadow: var(--ombre-verre); }
/* L'illustration posée sur un petit galet de pâte à modeler, d'une couleur de la palette à chaque ligne */
.fiche-image { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; font-size: 27px; line-height: 1; background: radial-gradient(circle at 34% 28%, #fff, #EEE8FF 55%, #D6CBFF); box-shadow: inset 0 -5px 9px rgba(109, 59, 255, .2), inset 0 2px 3px #fff, 0 7px 14px -9px rgba(60, 40, 140, .55); }
.fiche-phrases li:nth-child(3n + 2) .fiche-image { background: radial-gradient(circle at 34% 28%, #fff, #F2FFC9 55%, #D6F27A); box-shadow: inset 0 -5px 9px rgba(120, 150, 0, .22), inset 0 2px 3px #fff, 0 7px 14px -9px rgba(90, 120, 0, .55); }
.fiche-phrases li:nth-child(3n) .fiche-image { background: radial-gradient(circle at 34% 28%, #fff, #E2F4FF 55%, #A9DCFF); box-shadow: inset 0 -5px 9px rgba(26, 120, 194, .22), inset 0 2px 3px #fff, 0 7px 14px -9px rgba(26, 120, 194, .55); }
.fiche-texte { display: grid; gap: 1px; min-width: 0; }
.fiche-cible { font: 800 17px/1.25 var(--f); letter-spacing: -.01em; overflow-wrap: anywhere; }
.fiche-ecriture { font-size: 14px; color: var(--texte-doux); }
.fiche-sens { font-size: 14px; font-weight: 600; color: var(--encre); }
.fiche-note { font-size: 12.5px; line-height: 1.35; color: var(--gris); }
.bilan-fiche { display: grid; gap: 8px; }
.bilan-fiche h3 { margin: 4px 0 0; font: 800 12px var(--f); letter-spacing: .14em; text-transform: uppercase; color: var(--violet); }
.lien-fiche { justify-self: start; margin-top: -6px; }
.mes-fiches h2 { margin: 4px 0 8px; font: 800 18px var(--f); }
.mes-fiches ul { margin: 0; padding: 0; display: grid; gap: 8px; }
.mes-fiches li { list-style: none; }
.mes-fiches button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; font: 600 15px var(--f); color: var(--encre); text-align: left; cursor: pointer; transition: transform .16s var(--ease); }
.mes-fiches button:active { transform: scale(.97); }
.mes-fiches button:focus-visible { outline: 3px solid var(--violet); outline-offset: 2px; }
.mes-fiches b { flex: none; min-width: 40px; height: 28px; padding: 0 8px; border-radius: 999px; display: grid; place-items: center; background: var(--encre); color: var(--citron); font-size: 12px; font-weight: 800; }
.mes-fiches span { flex: 1; min-width: 0; }
.mes-fiches i { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--citron); font-style: normal; font-size: 13px; font-weight: 800; }

/* ---------- Conversation : l'interprète ---------- */
.paire { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.paire-fr { font: 700 15px var(--f); padding: 10px 14px; border-radius: 999px; background: rgba(21, 19, 31, .06); }
.paire-fleche { font-size: 20px; color: var(--violet); font-weight: 800; }
.paire .langues { width: 176px; }
.interprete-bouton.actif { background: var(--tomate); }
.etat-interprete { font-size: 17px; text-align: left; min-height: 1.3em; }
.vide-interprete { margin: 0; }
.echanges { display: grid; gap: 10px; }
.echange { border-radius: 24px; padding: 14px 16px; display: grid; gap: 4px; background: var(--verre); border: 1px solid var(--verre-bord); box-shadow: var(--ombre-verre); animation: entre .45s var(--ressort) both; }
.echange.personne { background: rgba(198, 244, 50, .28); border-color: rgba(198, 244, 50, .6); }
.echange.moi { background: rgba(109, 59, 255, .1); }
.echange.en-cours { opacity: .75; }
.echange-qui { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--violet); }
.echange-original { margin: 0; font-size: 14px; color: var(--texte-doux); }
.echange-original:empty { display: none; }
.echange-traduction { margin: 0; font: 700 21px/1.3 var(--f); color: var(--encre); overflow-wrap: anywhere; }
.echange-traduction:empty { display: none; }
/* Quatre onglets : un peu moins d'espace autour de chacun pour tenir sur un petit téléphone */
.barre-bas button { padding: 8px 10px; }

/* ---------- Note de prononciation (leçon, puis fiche du bilan) ---------- */
.carte-prono { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 22px; animation: entre .45s var(--ressort) both; }
.prono-score { flex: none; min-width: 64px; height: 44px; padding: 0 10px; border-radius: 16px; display: grid; place-items: center; font: 800 18px var(--f); font-variant-numeric: tabular-nums; background: var(--citron); color: var(--encre); }
.carte-prono[data-verdict="presque"] .prono-score { background: #FFCB7A; }
.carte-prono[data-verdict="a-retravailler"] .prono-score { background: var(--tomate); color: #fff; }
.prono-texte { display: grid; gap: 2px; min-width: 0; font-size: 13px; color: var(--texte-doux); }
.prono-texte b { font-size: 14px; color: var(--encre); overflow-wrap: anywhere; }
.prono-texte span { overflow-wrap: anywhere; }
.fiche-score { justify-self: start; margin: 2px 0; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--citron); color: var(--encre); }
.fiche-score[data-verdict="presque"] { background: #FFCB7A; }
.fiche-score[data-verdict="a-retravailler"] { background: var(--tomate); color: #fff; }

/* ---------- Volume de la voix : un curseur (leçon, Réglages, Conversation) ---------- */
.curseur-volume { display: flex; align-items: center; gap: 10px; }
.curseur-volume svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--texte-doux); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.curseur-volume input[type="range"] { flex: 1; min-width: 0; height: 32px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.curseur-volume input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 9px; background: linear-gradient(90deg, var(--violet) var(--rempli, 68%), rgba(21, 19, 31, .1) var(--rempli, 68%)); }
.curseur-volume input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; border: 2px solid var(--violet); box-shadow: 0 4px 10px -4px rgba(60, 40, 140, .6); transition: transform .16s var(--ease); }
.curseur-volume input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
.curseur-volume input[type="range"]::-moz-range-track { height: 8px; border-radius: 9px; background: rgba(21, 19, 31, .1); }
.curseur-volume input[type="range"]::-moz-range-progress { height: 8px; border-radius: 9px; background: var(--violet); }
.curseur-volume input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--violet); }
.curseur-volume input[type="range"]:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; border-radius: 9px; }
.curseur-lecon { width: 100%; }
.volume-interprete { display: flex; align-items: center; gap: 12px; }
.volume-titre { font-size: 13px; font-weight: 700; color: var(--texte-doux); }
.volume-interprete .curseur-volume { flex: 1; max-width: 320px; }

/* ---------- Mon carnet (Progrès) : modèle 4, « carnet illustré » ---------- */
.carnet-eleve { display: grid; gap: 12px; }
.carnet-bandeau { display: flex; gap: 12px; align-items: center; }
.carnet-bandeau h2 { margin: 0; font: 800 22px/1.15 var(--f); letter-spacing: -.02em; }
.carnet-bandeau small { color: var(--texte-doux); font-size: 13px; }
.carnet-page { border-radius: 26px; padding: 16px; background: #FFFDF6; box-shadow: var(--ombre-verre); background-image: repeating-linear-gradient(transparent 0 27px, rgba(73, 182, 255, .16) 27px 28px); }
.carnet-page h3 { margin: 0 0 8px; font: 800 12px var(--f); letter-spacing: .14em; text-transform: uppercase; color: var(--violet); }
.carnet-pastille { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; font-size: 26px; line-height: 1; flex: none; background: radial-gradient(circle at 34% 28%, #fff, #EEE8FF 55%, #D6CBFF); box-shadow: inset 0 -5px 9px rgba(109, 59, 255, .2), inset 0 2px 3px #fff, 0 7px 14px -9px rgba(60, 40, 140, .55); }
.carnet-pastille.couleur-1 { background: radial-gradient(circle at 34% 28%, #fff, #F2FFC9 55%, #D6F27A); }
.carnet-pastille.couleur-2 { background: radial-gradient(circle at 34% 28%, #fff, #E2F4FF 55%, #A9DCFF); }
.carnet-pastille.couleur-3 { background: radial-gradient(circle at 34% 28%, #fff, #FFE4DD 55%, #FFB3A3); }
.carnet-chemin { display: flex; align-items: flex-start; }
.carnet-etape { display: grid; justify-items: center; gap: 4px; width: 64px; flex: none; text-align: center; font-size: 10.5px; font-weight: 800; line-height: 1.2; color: var(--gris); }
.carnet-etape i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: rgba(21, 19, 31, .08); color: var(--gris); }
.carnet-etape.fait i { background: var(--citron); color: var(--encre); }
.carnet-etape.ici { color: var(--encre); }
.carnet-etape.ici i { background: var(--violet); color: #fff; box-shadow: 0 0 0 5px rgba(109, 59, 255, .18); }
.carnet-trait { flex: 1; height: 3px; margin-top: 15px; border-radius: 3px; background: rgba(21, 19, 31, .1); }
.carnet-trait.fait { background: var(--citron); }
.carnet-phrase { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; }
.carnet-phrase + .carnet-phrase { border-top: 1px dashed rgba(21, 19, 31, .1); }
.carnet-phrase .carnet-pastille { width: 44px; height: 44px; font-size: 22px; border-radius: 15px; }
.carnet-phrase b { display: block; font-size: 15px; overflow-wrap: anywhere; }
.carnet-phrase small { display: block; font-size: 12.5px; color: var(--texte-doux); }
.carnet-phrase .carnet-thai { font-size: 14px; color: var(--encre); }
.carnet-autres summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--violet); padding-top: 6px; }
.carnet-duo { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; background: #fff; font-size: 13px; }
.carnet-duo + .carnet-duo { margin-top: 6px; }
.carnet-duo .non { color: var(--tomate); text-decoration: line-through; overflow-wrap: anywhere; }
.carnet-duo .oui { color: #2E7D0B; font-weight: 800; overflow-wrap: anywhere; }
.carnet-duo .carnet-fleche { color: var(--gris); }
.carnet-forces { margin: 0; padding: 0; display: grid; gap: 6px; }
.carnet-forces li { list-style: none; position: relative; padding: 8px 10px 8px 34px; border-radius: 14px; background: rgba(198, 244, 50, .25); font-size: 13px; }
.carnet-forces li::before { content: "✓"; position: absolute; left: 11px; top: 7px; font-weight: 800; color: #4E6B00; }
.carnet-bulle { margin: 0; padding: 12px 14px; border-radius: 18px 18px 18px 6px; background: var(--violet); color: #fff; font-size: 13.5px; line-height: 1.45; }
