:root {
  --fond: #f5f1e8;
  --carte: #fffdf9;
  --texte: #1f2a33;
  --texte-doux: #4c5863;
  --bord: #d9d2c3;
  --bord-fort: #7d8894;
  --principal: #0d5c6e;
  --principal-fonce: #083f4c;
  --principal-clair: #dfeef0;
  --prune: #6d3b73;
  --prune-clair: #f1e6f2;
  --corail: #a8431f;
  --corail-clair: #fbe8df;
  --sapin: #1e6448;
  --sapin-clair: #dff0e7;
  --vert: #17603a;
  --vert-clair: #e2f3e9;
  --orange: #7f4400;
  --orange-clair: #fbefdc;
  --creme-fonce: #ebe5d8;
  --rouge: #9b1c1c;
  --rouge-clair: #fbe9e7;
  --ombre: 0 1px 2px rgba(31, 42, 51, .08), 0 6px 18px rgba(31, 42, 51, .07);
  --rayon: 18px;
  --echelle: 1;
  font-size: calc(18px * var(--echelle));
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

button, input { font: inherit; color: inherit; }

button {
  min-height: 48px;
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:active:not(:disabled) { transform: scale(.985); }

:focus-visible { outline: 3px solid var(--principal); outline-offset: 2px; }

h1, .score-texte { font-family: Georgia, "Noto Serif", "Times New Roman", serif; }
.score-texte, .chiffre strong { font-variant-numeric: lining-nums; }
h1 { margin: 0 0 12px; font-size: 1.5rem; line-height: 1.25; font-weight: 700; }
h2 { margin: 24px 0 8px; font-size: 1.15rem; }
p { margin: 0 0 12px; }
.doux { color: var(--texte-doux); }
.pile { display: flex; flex-direction: column; gap: 12px; }

.barre-haut {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(6px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) 6px calc(16px + env(safe-area-inset-left));
  background: var(--fond);
  border-bottom: 1px solid var(--bord);
}

.nom-app {
  font-family: Georgia, "Noto Serif", "Times New Roman", serif;
  font-weight: 700;
  color: var(--principal-fonce);
  white-space: nowrap;
}

.espace { flex: 1; }

.bouton-barre {
  min-width: 56px;
  padding: 0 12px;
  background: var(--carte);
  border: 1.5px solid var(--bord-fort);
  color: var(--principal-fonce);
  font-weight: 700;
  white-space: nowrap;
}

.bouton-barre:disabled { color: var(--texte-doux); background: transparent; border-color: var(--bord); cursor: default; }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 16px calc(16px + env(safe-area-inset-right)) 16px calc(16px + env(safe-area-inset-left));
  outline: none;
}

/* Accueil */
.bandeau {
  margin-bottom: 16px;
  padding: 20px;
  border-radius: var(--rayon);
  background: linear-gradient(145deg, var(--principal) 0%, var(--principal-fonce) 100%);
  color: #fff;
  box-shadow: var(--ombre);
}

.bandeau h1 { margin-bottom: 4px; font-size: 1.7rem; }
.bandeau p { margin: 0; }

.pastilles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.pastille {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .17);
  font-weight: 600;
}

.bouton-jour {
  width: 100%;
  margin-top: 14px;
  padding: 10px 14px;
  background: #fff;
  border: 0;
  color: var(--principal-fonce);
  font-weight: 700;
}

.jour-faite { margin-top: 14px !important; font-weight: 600; }

.tuile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 88px;
  padding: 12px 16px;
  background: var(--carte);
  border: 0;
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  text-align: left;
}

.tuile-texte { flex: 1; min-width: 0; }
.tuile-titre { display: block; font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.tuile-detail { display: block; color: var(--texte-doux); line-height: 1.3; }
.fleche { flex: none; color: var(--texte-doux); }

.icone {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: var(--ton, var(--principal));
  background: var(--ton-clair, var(--principal-clair));
}

.icone svg { width: 30px; height: 30px; }
.ton-principal { --ton: var(--principal); --ton-clair: var(--principal-clair); }
.ton-prune { --ton: var(--prune); --ton-clair: var(--prune-clair); }
.ton-corail { --ton: var(--corail); --ton-clair: var(--corail-clair); }
.ton-sapin { --ton: var(--sapin); --ton-clair: var(--sapin-clair); }

.lien-secondaire {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  background: transparent;
  border: 1.5px solid var(--principal);
  color: var(--principal-fonce);
  font-weight: 700;
}

.lien-secondaire svg { width: 24px; height: 24px; flex: none; }

/* Menus */
.vedette { background: var(--prune); color: #fff; }
.vedette .tuile-detail, .vedette .fleche { color: #f6edf7; }
.vedette .icone { --ton: #fff; --ton-clair: rgba(255, 255, 255, .18); }

.bouton-action {
  width: 100%;
  min-height: 56px;
  background: var(--principal);
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--ombre);
}

.bouton-action:disabled { background: #d8d6cf; color: #3d4852; box-shadow: none; cursor: default; }

/* Connexion */
.champ-code {
  width: 100%;
  min-height: 64px;
  padding: 8px 16px;
  background: var(--carte);
  border: 2px solid var(--bord-fort);
  border-radius: 14px;
  font-size: 1.6rem;
  letter-spacing: .3em;
  text-align: center;
}

label { display: block; margin-bottom: 8px; font-weight: 700; }

.message {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--principal-clair);
}

.message.erreur { background: var(--rouge-clair); color: var(--rouge); font-weight: 600; }

/* Quiz */
.avancement {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--texte-doux);
}

.jauge {
  height: 10px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--bord);
  overflow: hidden;
}

.jauge > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--principal);
  transition: width .25s ease-out;
}

.etiquette {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--orange-clair);
  color: var(--orange);
  font-weight: 700;
}

.carte-reponse {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px;
  background: var(--carte);
  border: 2px solid var(--bord);
  font-weight: 500;
  text-align: left;
  box-shadow: 0 1px 2px rgba(31, 42, 51, .06);
}

.coche {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: .05rem;
  border: 2px solid var(--bord-fort);
  border-radius: 7px;
  background: #fff;
  font-weight: 700;
  line-height: 1;
}

.carte-reponse.unique .coche { border-radius: 50%; }
.carte-reponse[aria-pressed="true"] { border-color: var(--principal); border-width: 3px; padding: 13px; background: var(--principal-clair); }
.carte-reponse[aria-pressed="true"] .coche { background: var(--principal); border-color: var(--principal); color: #fff; }
.carte-reponse.bonne { border-color: var(--vert); border-width: 3px; padding: 13px; background: var(--vert-clair); }
.carte-reponse.bonne .coche { background: var(--vert); border-color: var(--vert); color: #fff; }
.carte-reponse.fausse { border-color: var(--rouge); border-width: 3px; padding: 13px; background: var(--rouge-clair); }
.carte-reponse.fausse .coche { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.carte-reponse:disabled { color: var(--texte); opacity: 1; cursor: default; }

.mention { display: block; margin-top: 4px; font-weight: 700; }
.bonne .mention { color: var(--vert); }
.fausse .mention { color: var(--rouge); }

.correction {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--rayon);
  background: var(--carte);
  box-shadow: var(--ombre);
  border-top: 6px solid var(--principal);
  scroll-margin-top: calc(72px + env(safe-area-inset-top));
  scroll-margin-bottom: calc(112px + env(safe-area-inset-bottom));
}

.correction.reussie { border-top-color: var(--vert); }
.correction.a-revoir { border-top-color: #c26a00; }
.correction strong { display: block; margin-bottom: 8px; font-size: 1.1rem; }
.source { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--bord); color: var(--texte-doux); }

.barre-action {
  position: sticky;
  bottom: 0;
  margin: auto -16px -16px;
  padding: 12px calc(16px + env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background: var(--fond);
  border-top: 1px solid var(--bord);
}

.pile + .barre-action, .correction + .barre-action { margin-top: 16px; }

/* Mises en situation */
.scene { margin-bottom: 12px; border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre); }
.scene svg { display: block; width: 100%; height: auto; }
.texte-etape { font-size: 1.1rem; font-weight: 500; }
.question-pause { margin-top: 16px; font-size: 1.25rem; }
.note-bas { margin-top: 16px; }

.bouton-voix {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  padding: 8px 16px;
  background: transparent;
  border: 1.5px solid var(--principal);
  color: var(--principal-fonce);
  font-weight: 700;
}

.bouton-voix svg { width: 24px; height: 24px; flex: none; }

.barre-double { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px; }

.bouton-nav {
  min-height: 56px;
  padding: 0 8px;
  background: var(--carte);
  border: 1.5px solid var(--bord-fort);
  color: var(--principal-fonce);
  font-weight: 700;
}

.bouton-nav:disabled { color: var(--texte-doux); background: transparent; border-color: var(--bord); cursor: default; }

@media (prefers-reduced-motion: no-preference) {
  .etape-avant { animation: glisse-gauche .28s ease-out; }
  .etape-arriere { animation: glisse-droite .28s ease-out; }
  .anim-entree { animation: apparition .5s ease-out both; }
  .anim-clignote { animation: clignote 1.2s ease-in-out infinite; }
  .anim-battement { transform-box: fill-box; transform-origin: center; animation: battement 1.6s ease-in-out infinite; }
  .anim-larme { animation: larme 1.8s ease-in infinite; }
  .anim-approche { animation: approche 1.2s ease-out both; }
  .anim-claque { animation: claque .9s ease-in-out infinite; }
  .anim-aiguille { transform-box: fill-box; transform-origin: bottom; animation: aiguille 4s linear infinite; }
  @keyframes claque { 50% { translate: -7px 0; } }
  @keyframes aiguille { to { rotate: 360deg; } }
  .anim-ligne { transform-box: fill-box; transform-origin: left; animation: ligne .7s ease-out both; }
  .anim-retard { animation-delay: .5s; }
  .anim-retard2 { animation-delay: 1s; }
  @keyframes glisse-gauche { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
  @keyframes glisse-droite { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
  @keyframes clignote { 50% { opacity: .25; } }
  @keyframes battement { 50% { transform: scale(1.12); } }
  @keyframes larme { 0% { opacity: 0; transform: translateY(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(26px); } }
  @keyframes approche { from { translate: -40px 0; } to { translate: 0 0; } }
  @keyframes ligne { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* Cours en vidéo */
.sans-marge { margin-top: 0; }

.ecran-cours {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 230px;
  margin-bottom: 12px;
  padding: 20px 16px;
  border-radius: var(--rayon);
  background: linear-gradient(145deg, var(--principal) 0%, var(--principal-fonce) 100%);
  color: #fff;
  text-align: center;
  box-shadow: var(--ombre);
}

.ecran-icone { display: inline-flex; width: 64px; height: 64px; margin-bottom: 6px; color: #ffe2a8; }
.ecran-icone svg { width: 100%; height: 100%; }
.ecran-grand { margin: 0; font-family: Georgia, "Noto Serif", "Times New Roman", serif; font-size: 2rem; font-weight: 700; line-height: 1.15; font-variant-numeric: lining-nums; overflow-wrap: normal; }
.ecran-petit { margin: 0; font-size: 1.1rem; }
.sous-titre { padding: 12px 14px; border-radius: 14px; background: var(--carte); font-size: 1.05rem; box-shadow: 0 1px 2px rgba(31, 42, 51, .06); }

.barre-cours { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bouton-lecture { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; }
.bouton-lecture svg { width: 26px; height: 26px; flex: none; }

/* Jury et fiches */
.bloc-fiche { margin-bottom: 12px; padding: 14px 16px; border-radius: var(--rayon); background: var(--carte); box-shadow: var(--ombre); }
.bloc-fiche h2 { margin: 0 0 8px; color: var(--principal-fonce); }
.bloc-fiche ul { margin: 0; padding-left: 1.2em; }
.bloc-fiche li + li { margin-top: 8px; }

.bouton-exemple {
  width: 100%;
  min-height: 56px;
  padding: 10px 16px;
  background: var(--prune);
  border: 0;
  color: #fff;
  font-weight: 700;
}

.bloc-exemple { padding: 14px 16px; border-radius: var(--rayon); background: var(--prune-clair); scroll-margin-bottom: 112px; }
.bloc-exemple strong { display: block; margin-bottom: 8px; color: var(--prune); font-size: 1.1rem; }
.bloc-exemple p:last-child { margin-bottom: 0; }
.a-completer { padding: 1px 5px; border-radius: 6px; background: #fff0c2; color: #5f3b00; font-weight: 600; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* Flashcards */
.flashcard {
  display: grid;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  perspective: 1000px;
}

/* Les deux faces partagent la même case : la carte prend la hauteur de la plus grande. */
.face {
  grid-area: 1 / 1;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform .4s ease;
}

.face-recto { background: linear-gradient(145deg, var(--prune) 0%, #4e2953 100%); color: #fff; }
.face-verso { background: var(--carte); color: var(--texte); transform: rotateY(180deg); }
.flashcard.retournee .face-recto { transform: rotateY(-180deg); }
.flashcard.retournee .face-verso { transform: rotateY(0); }
.recto-texte { font-family: Georgia, "Noto Serif", "Times New Roman", serif; font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.verso-texte { font-size: 1.2rem; font-weight: 700; }
.verso-plus { color: var(--texte-doux); }
.indication-carte { display: block; margin-top: 8px; color: var(--texte-doux); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .face { transition: none; }
}

/* Résultat */
.resultat { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; padding: 20px; border-radius: var(--rayon); background: var(--carte); box-shadow: var(--ombre); text-align: center; }
.anneau { position: relative; width: 150px; height: 150px; margin-bottom: 12px; }
.anneau svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anneau circle { fill: none; stroke-width: 11; }
.anneau .piste { stroke: var(--bord); }
.anneau .valeur { stroke: var(--principal); stroke-linecap: round; }
.score-texte { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; font-weight: 700; color: var(--principal-fonce); }

/* Progression */
.resume { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.chiffre { padding: 14px; border-radius: var(--rayon); background: var(--carte); box-shadow: var(--ombre); }
.chiffre strong { display: block; font-family: Georgia, "Noto Serif", "Times New Roman", serif; font-size: 1.7rem; line-height: 1.1; color: var(--principal-fonce); }

.ligne-progres { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--rayon); background: var(--carte); box-shadow: 0 1px 2px rgba(31, 42, 51, .06); }
.ligne-progres .libelle { font-weight: 600; }
.ligne-progres .jauge { margin: 0; }
.vert .jauge > span { background: var(--vert); }
.orange .jauge > span { background: #c26a00; }
.rouge .jauge > span { background: var(--rouge); }
.vert .etat { color: var(--vert); font-weight: 700; }
.orange .etat { color: var(--orange); font-weight: 700; }
.rouge .etat { color: var(--rouge); font-weight: 700; }
.etat { color: var(--texte-doux); }

@media (prefers-reduced-motion: no-preference) {
  main > * { animation: apparition .2s ease-out; }
  @keyframes apparition { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}

@media (prefers-reduced-motion: reduce) {
  .jauge > span { transition: none; }
  button:active:not(:disabled) { transform: none; }
}

@media (min-width: 600px) {
  main { max-width: 640px; margin: 0 auto; padding-top: 24px; }
  .barre-action { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}

@media (min-width: 1000px) {
  main { max-width: 720px; }
}

@media print {
  .barre-haut, .barre-action, .pas-imprime { display: none; }
  body { background: #fff; }
  main { max-width: none; padding: 0; }
  .bloc-fiche { box-shadow: none; border: 1px solid var(--bord); break-inside: avoid; }
  main > * { animation: none; }
}

.lecteur-video {
  display: block; width: 100%; max-height: 70vh; margin: 0 0 16px;
  border-radius: 16px; background: #000; aspect-ratio: 16 / 9;
}

/* ===== Nouveau design (validé le 2026-11-03) ===== */

/* Barre de navigation du bas */
.onglets {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 6px calc(4px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(4px + env(safe-area-inset-left));
  background: var(--carte);
  border-top: 1px solid var(--bord);
}
.onglets[hidden] { display: none; }
body.avec-onglets main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.onglet {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px;
  color: var(--texte-doux);
  font-size: .72rem; font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.onglet-icone { display: flex; align-items: center; justify-content: center; width: 56px; height: 30px; border-radius: 15px; }
.onglet-icone svg { width: 24px; height: 24px; }
.onglet.actif { color: var(--principal-fonce); font-weight: 700; }
.onglet.actif .onglet-icone { background: var(--principal-clair); }

/* Accueil */
.accueil-entete { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.accueil-entete h1 { margin: 0; font-size: 1.75rem; }
.accueil-entete p { margin: 2px 0 0; }
.compte-jury {
  flex: none; display: flex; flex-direction: column; align-items: center;
  padding: 8px 12px; border-radius: 16px; background: var(--prune); color: #fff;
}
.compte-legende { font-size: .68rem; font-weight: 700; letter-spacing: .05em; }
.compte-jury strong { font-family: Georgia, "Noto Serif", serif; font-size: 1.3rem; line-height: 1.1; }

.carte-reprise {
  display: flex; flex-direction: column; gap: 12px; width: 100%;
  padding: 18px; border: 0; border-radius: 22px;
  background: var(--principal); color: #fff; text-align: left; box-shadow: var(--ombre);
}
.reprise-legende { font-size: .74rem; font-weight: 700; letter-spacing: .06em; color: #cfe6ea; }
.reprise-ligne { display: flex; align-items: center; gap: 14px; }
.reprise-lecture { flex: none; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #fff; color: var(--principal); }
.reprise-lecture svg { width: 26px; height: 26px; fill: currentColor; }
.reprise-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reprise-titre { font-size: 1.08rem; font-weight: 700; line-height: 1.2; }
.reprise-detail { color: var(--principal-clair); font-size: .88rem; }
.carte-reprise .jauge { background: rgba(255, 255, 255, .25); }
.carte-reprise .jauge span { background: #fff; }

.carte-jour {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px;
  padding: 12px 16px; border: 2px dashed var(--corail); border-radius: var(--rayon);
  background: var(--carte); text-align: left;
}

.grille-accueil { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.case-accueil {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 14px; border: 0; border-radius: var(--rayon);
  background: var(--carte); box-shadow: var(--ombre); text-align: left;
}
.case-accueil .icone { width: 48px; height: 48px; border-radius: 14px; }
.case-accueil .icone svg { width: 26px; height: 26px; }
.case-titre { font-size: 1.05rem; font-weight: 700; }
.case-detail { color: var(--texte-doux); font-size: .85rem; line-height: 1.3; }

.carte-semaine {
  display: flex; flex-direction: column; gap: 8px; width: 100%;
  padding: 14px 16px; border: 0; border-radius: var(--rayon); background: var(--carte); text-align: left;
}
.semaine-entete { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; }
.semaine-serie { color: var(--sapin); font-weight: 700; }
.semaine-jours { display: flex; gap: 6px; }
.jour {
  flex: 1; display: flex; align-items: center; justify-content: center; height: 30px;
  border-radius: 8px; background: var(--creme-fonce); color: var(--texte-doux);
  font-size: .75rem; font-weight: 700;
}
.jour.fait { background: var(--sapin); color: #fff; }
.jour.aujourdhui:not(.fait) { background: var(--carte); color: var(--sapin); box-shadow: inset 0 0 0 2px var(--sapin); }
.jour.avenir { opacity: .7; }

/* Vidéos */
.filtres { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; margin-bottom: 4px; scrollbar-width: none; }
.filtres::-webkit-scrollbar { display: none; }
.filtre {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 22px;
  border: 1.5px solid var(--bord); background: var(--carte); font-weight: 700;
}
.filtre[aria-pressed="true"] { background: var(--principal); border-color: var(--principal); color: #fff; }

.carte-video {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px; border: 0; border-radius: var(--rayon);
  background: var(--carte); box-shadow: var(--ombre); text-align: left;
}
.vignette {
  flex: none; position: relative; display: flex; align-items: center; justify-content: center;
  width: 104px; height: 72px; border-radius: 12px; color: #fff; background: var(--principal);
}
.vignette svg { width: 26px; height: 26px; fill: currentColor; }
.vignette-prune { background: var(--prune); }
.vignette-corail { background: var(--corail); }
.vignette-sapin { background: var(--sapin); }
.vignette-orange { background: var(--orange); }
.vignette-jury { background: var(--principal-fonce); }
.vignette-duree {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, .6); font-size: .7rem; font-weight: 700;
}
.carte-video-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.carte-video .tuile-titre { font-size: 1rem; }
.carte-video-bloc { color: var(--texte-doux); font-size: .8rem; line-height: 1.3; }
.mention-vue { color: var(--vert); font-size: .82rem; font-weight: 700; }
.carte-video .jauge { height: 5px; }
.lecteur-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Lecteur */
.zone-lecteur {
  margin: -16px calc(-16px - env(safe-area-inset-right)) 14px calc(-16px - env(safe-area-inset-left));
  padding: 16px calc(16px + env(safe-area-inset-right)) 14px calc(16px + env(safe-area-inset-left));
  background: var(--principal-fonce); color: #fff;
}
.zone-lecteur h1 { font-size: 1.25rem; color: #fff; }
.zone-lecteur .lecteur-video { margin-bottom: 12px; }
.commandes-lecteur { display: flex; justify-content: center; gap: 16px; }
.bouton-rond {
  min-width: 64px; min-height: 48px; padding: 0 14px; border-radius: 24px;
  border: 1.5px solid rgba(255, 255, 255, .6); background: transparent; color: #fff; font-weight: 700;
}
.lien-simple {
  min-height: 0; padding: 0; border: 0; background: none;
  color: var(--principal-fonce); font-weight: 700; text-decoration: underline;
}
.chapitres { gap: 8px; }
.chapitre {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px;
  padding: 6px 12px; border: 0; border-radius: 14px; background: var(--carte); text-align: left;
}
.chapitre-numero {
  flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--creme-fonce); color: var(--texte-doux); font-size: .8rem; font-weight: 700;
}
.chapitre-titre { flex: 1; font-weight: 600; line-height: 1.3; }
.chapitre-temps { flex: none; color: var(--texte-doux); font-size: .8rem; font-variant-numeric: tabular-nums; }
.chapitre.passe .chapitre-numero { background: var(--vert-clair); color: var(--vert); }
.chapitre.courant { background: var(--principal-clair); color: var(--principal-fonce); }
.chapitre.courant .chapitre-numero { background: var(--principal); color: #fff; }
.espace-haut { margin-top: 18px; }

/* Quiz */
.etiquette-competence {
  display: inline-block; margin-bottom: 10px; padding: 4px 10px; border-radius: 8px;
  background: var(--sapin-clair); color: var(--sapin); font-size: .8rem; font-weight: 700;
}
.bouton-ecouter {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 0 14px;
  border: 1.5px solid var(--principal); border-radius: 22px; background: transparent;
  color: var(--principal-fonce); font-weight: 700;
}
.bouton-ecouter svg { width: 20px; height: 20px; }

/* Progression */
.carte-jury {
  display: flex; align-items: center; gap: 16px; margin-bottom: 12px;
  padding: 16px 18px; border-radius: 20px; background: var(--prune); color: #fff;
}
.jury-anneau {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 80px; height: 80px; border-radius: 50%; background: #fff; color: var(--prune);
}
.jury-anneau strong { font-family: Georgia, "Noto Serif", serif; font-size: 1.4rem; line-height: 1; }
.jury-anneau span { font-size: .65rem; font-weight: 700; }
.jury-texte { display: flex; flex-direction: column; gap: 3px; font-size: .9rem; color: #f6edf7; }
.jury-texte strong { color: #fff; font-size: 1rem; }
.ligne-entete { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ligne-entete .etat { flex: none; font-weight: 700; font-size: .85rem; }
.carte-faible {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 2px solid var(--orange); border-radius: var(--rayon);
  background: var(--carte); text-align: left;
}
.bouton-revoir {
  flex: none; display: flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 12px; background: var(--orange); color: #fff; font-weight: 700;
}
.carte-faible + .resume, .pile + .resume { margin-top: 16px; }

@media (min-width: 700px) {
  .onglets { padding-left: calc(50% - 340px); padding-right: calc(50% - 340px); }
}
@media print { .onglets { display: none !important; } }

/* Jour J */
.carte-jour-j {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px;
  padding: 12px 16px; border: 0; border-radius: var(--rayon);
  background: var(--corail-clair); box-shadow: inset 0 0 0 2px var(--corail); text-align: left;
}
.ligne-coche {
  display: flex; align-items: center; gap: 14px; min-height: 56px; margin: 0;
  padding: 10px 14px; border-radius: 14px; background: var(--carte); font-weight: 600; cursor: pointer;
}
.ligne-coche input { flex: none; width: 26px; height: 26px; accent-color: var(--sapin); }
.ligne-coche:has(input:checked) span { color: var(--texte-doux); text-decoration: line-through; }
.champ-texte {
  width: 100%; min-height: 52px; padding: 8px 14px;
  border: 2px solid var(--bord-fort); border-radius: 14px; background: var(--carte); font-size: 1.05rem;
}
.phrases-jour-j { margin: 0; padding: 0; list-style: none; counter-reset: phrase; display: flex; flex-direction: column; gap: 10px; }
.phrases-jour-j li {
  counter-increment: phrase; position: relative; padding: 14px 14px 14px 56px;
  border-radius: 14px; background: var(--carte); font-weight: 600; line-height: 1.4;
}
.phrases-jour-j li::before {
  content: counter(phrase); position: absolute; left: 14px; top: 12px;
  display: flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--prune); color: #fff; font-weight: 700;
}
.message ul { margin: 0; padding-left: 20px; }
.message li + li { margin-top: 6px; }

/* Rappel du soir */
.zone-rappel:empty { display: none; }
.carte-rappel { border-color: var(--sapin); }
