/* SNS — feuille de style unique. Aucune ressource externe. */
:root {
  --fond: #fbf8f3; --carte: #ffffff; --encre: #1f2a37; --doux: #4b5563;
  --trait: #e4dccf; --vert: #0f766e; --vert-clair: #ccfbf1; --vert-fonce: #115e59;
  --terre: #c2410c; --terre-clair: #ffedd5; --or: #b45309; --or-clair: #fef3c7;
  --bleu: #1d4ed8; --bleu-clair: #dbeafe; --sable: #f5efe6;
  --titres: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --rayon: 14px;
}
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font-family: var(--texte); line-height: 1.5; }
h1, h2, h3 { font-family: var(--titres); line-height: 1.2; margin: 0 0 .5rem; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8rem; }
a { color: var(--vert-fonce); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; border-radius: 6px; }
.evitement { position: absolute; left: -999px; top: 0; background: var(--encre); color: #fff; padding: .6rem 1rem; z-index: 10; }
.evitement:focus { left: .5rem; top: .5rem; }

.bandeau { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between; padding: .7rem clamp(1rem, 4vw, 2.5rem); background: var(--carte); border-bottom: 1px solid var(--trait); position: sticky; top: 0; z-index: 5; }
.marque { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--encre); }
.marque-sigle { font-family: var(--titres); font-weight: 700; font-size: 1.25rem; background: var(--vert); color: #fff; padding: .15rem .6rem; border-radius: 8px; letter-spacing: .04em; }
.marque-texte { font-size: .9rem; color: var(--doux); }
.bandeau nav { display: flex; gap: .3rem; }
.bandeau nav a { text-decoration: none; padding: .45rem .8rem; border-radius: 999px; color: var(--encre); font-weight: 600; font-size: .95rem; }
.bandeau nav a[aria-current="page"] { background: var(--vert-clair); color: var(--vert-fonce); }

main { max-width: 980px; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2rem) 4rem; outline: none; }
.pied { text-align: center; color: var(--doux); font-size: .85rem; padding: 1rem; border-top: 1px solid var(--trait); }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: clamp(1rem, 3vw, 1.6rem); margin-bottom: 1rem; }
.sur { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--terre); margin: 0 0 .3rem; }
.discret { color: var(--doux); font-size: .92rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: .6rem 1.3rem; border-radius: 999px; border: 2px solid var(--vert); background: var(--vert); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--vert-fonce); border-color: var(--vert-fonce); }
.btn:disabled { background: #d6d3cd; border-color: #d6d3cd; color: #57534e; cursor: not-allowed; }
.btn.second { background: transparent; color: var(--vert-fonce); }
.btn.second:hover { background: var(--vert-clair); }
.btn.petit { min-height: 40px; padding: .35rem .9rem; font-size: .9rem; }
.rangee { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.rangee.fin { justify-content: space-between; margin-top: 1.2rem; }

/* Accueil : le chemin */
.hero { background: linear-gradient(135deg, var(--vert-clair), var(--sable)); border: 1px solid var(--trait); }
.rythme { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1rem 0; padding: 0; list-style: none; }
.rythme li { background: var(--carte); border-radius: 10px; padding: .6rem .8rem; border: 1px solid var(--trait); font-size: .92rem; }
.rythme strong { display: block; font-family: var(--titres); font-size: 1.05rem; }
.jauge { height: 10px; background: var(--trait); border-radius: 999px; overflow: hidden; margin: .4rem 0; }
.jauge span { display: block; height: 100%; background: var(--vert); border-radius: 999px; }
.cours-titre { margin-top: 2rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .8rem; }
.cours-titre .heures { font-family: var(--texte); font-size: .85rem; font-weight: 700; color: var(--terre); background: var(--terre-clair); padding: .1rem .6rem; border-radius: 999px; }
.seance-titre { margin: 1.2rem 0 .5rem; font-family: var(--texte); font-size: .95rem; font-weight: 700; color: var(--doux); }
.chemin { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 3px solid var(--trait); }
.chemin li { position: relative; margin: 0 0 .55rem; }
.chemin li::before { content: ""; position: absolute; left: -1.62rem; top: 1.1rem; width: 14px; height: 14px; border-radius: 50%; background: var(--carte); border: 3px solid var(--trait); }
.chemin li.fait::before { background: var(--vert); border-color: var(--vert); }
.chemin li.encours::before { background: var(--or-clair); border-color: var(--or); }
.pas { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .9rem; align-items: center; width: 100%; text-align: left; background: var(--carte); border: 1px solid var(--trait); border-radius: 12px; padding: .7rem .9rem; color: inherit; text-decoration: none; font: inherit; }
a.pas:hover { border-color: var(--vert); }
.pas .num { font-family: var(--titres); font-size: 1.5rem; font-weight: 700; color: var(--vert-fonce); min-width: 2ch; text-align: center; }
.pas .nom { font-weight: 700; }
.pas .quoi { grid-column: 2; color: var(--doux); font-size: .9rem; }
.pas .etat { grid-row: 1 / span 2; grid-column: 3; font-size: .8rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; background: var(--sable); color: var(--doux); white-space: nowrap; }
.fait .pas .etat { background: var(--vert-clair); color: var(--vert-fonce); }
.encours .pas .etat { background: var(--or-clair); color: var(--or); }
.ferme .pas { opacity: .62; }

/* Étape */
.fil { color: var(--doux); font-size: .9rem; margin-bottom: .3rem; }
.temps { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; list-style: none; margin: 1rem 0; padding: 0; }
.temps button { width: 100%; min-height: 54px; border-radius: 12px; border: 2px solid var(--trait); background: var(--carte); font: inherit; font-weight: 700; color: var(--doux); padding: .3rem .5rem; cursor: pointer; }
.temps button small { display: block; font-weight: 400; font-size: .78rem; }
.temps button[aria-current="step"] { border-color: var(--vert); background: var(--vert-clair); color: var(--vert-fonce); }
.temps button:disabled { cursor: default; opacity: .7; }
.consigne { font-size: 1.08rem; background: var(--sable); border-left: 5px solid var(--terre); padding: .7rem 1rem; border-radius: 0 10px 10px 0; }
.avancee { font-size: .85rem; font-weight: 700; color: var(--doux); text-transform: uppercase; letter-spacing: .06em; }

/* Jeux */
.jeu-carte { font-family: var(--titres); font-size: clamp(1.2rem, 3.2vw, 1.6rem); background: var(--or-clair); border: 2px solid var(--or); border-radius: var(--rayon); padding: 1.1rem; text-align: center; margin: .8rem 0; }
.choix { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: .8rem 0; padding: 0; list-style: none; }
.choix button, .option { width: 100%; min-height: 56px; text-align: left; padding: .7rem 1rem; border-radius: 12px; border: 2px solid var(--trait); background: var(--carte); font: inherit; color: inherit; cursor: pointer; }
.choix button:hover:not(:disabled), .option:hover:not(:disabled) { border-color: var(--vert); background: var(--vert-clair); }
.choix button strong { display: block; }
.choix button small { color: var(--doux); }
.choix button:disabled, .option:disabled { cursor: default; }
.choix button.attendu, .option.attendu { border-color: var(--vert); background: var(--vert-clair); }
.choix button.choisi, .option.choisi { border-style: dashed; border-color: var(--encre); }
.option[aria-pressed="true"] { border-color: var(--bleu); background: var(--bleu-clair); }
.retour { border-radius: 12px; padding: .8rem 1rem; margin: .8rem 0; border: 2px solid; }
.retour.juste { border-color: var(--vert); background: var(--vert-clair); }
.retour.faux { border-color: var(--terre); background: var(--terre-clair); }
.retour.neutre { border-color: var(--bleu); background: var(--bleu-clair); }
.retour-titre { font-weight: 700; margin-bottom: .3rem; }
.retour p:last-child { margin-bottom: 0; }
.schema { display: grid; gap: .5rem; margin: .8rem 0; }
.schema-rang { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.schema-rang button { min-height: 72px; border: 2px dashed var(--doux); border-radius: 12px; background: var(--carte); font: inherit; padding: .5rem; cursor: pointer; color: inherit; }
.schema-rang button small { display: block; color: var(--doux); }
.schema-rang button.pose { border-style: solid; border-color: var(--vert); background: var(--vert-clair); cursor: default; }
.liste-ordre { list-style: none; margin: .8rem 0; padding: 0; display: grid; gap: .45rem; }
.liste-ordre li { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; background: var(--carte); border: 2px solid var(--trait); border-radius: 12px; padding: .5rem .7rem; }
.liste-ordre .rang { font-family: var(--titres); font-weight: 700; font-size: 1.2rem; min-width: 2ch; text-align: center; }
.liste-ordre li.ok { border-color: var(--vert); background: var(--vert-clair); }
.liste-ordre li.ko { border-color: var(--terre); }
.fleches { display: flex; gap: .3rem; }
.fleches button { width: 44px; height: 44px; border-radius: 10px; border: 2px solid var(--trait); background: var(--carte); font-size: 1.1rem; cursor: pointer; }
.fleches button:disabled { opacity: .35; cursor: default; }
table { border-collapse: collapse; width: 100%; margin: .6rem 0; font-size: .95rem; }
th, td { border: 1px solid var(--trait); padding: .45rem .6rem; text-align: left; vertical-align: top; }
th { background: var(--sable); }
td.nb, th.nb { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.moi td { background: var(--or-clair); font-weight: 700; }
tr.alerte td:last-child { color: var(--terre); font-weight: 700; }
.defile { overflow-x: auto; }
.saisie { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .6rem 0; }
.saisie input[type="text"] { font: inherit; font-size: 1.2rem; width: 11ch; min-height: 48px; padding: .3rem .7rem; border: 2px solid var(--doux); border-radius: 10px; }
input[type="range"] { width: 100%; accent-color: var(--vert); height: 44px; }
.grand-nombre { font-family: var(--titres); font-size: 2rem; font-weight: 700; color: var(--vert-fonce); }
.compteurs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; padding: 0; list-style: none; }
.compteurs li { background: var(--sable); border-radius: 999px; padding: .25rem .8rem; font-weight: 700; font-size: .9rem; }
.recit { font-size: 1.1rem; }
.budget-barre { position: sticky; top: 4.2rem; background: var(--carte); border: 2px solid var(--vert); border-radius: 12px; padding: .5rem .9rem; z-index: 2; }
.resultat { border: 2px solid var(--vert); border-radius: var(--rayon); padding: 1rem; background: var(--carte); margin: 1rem 0; }
.resultat ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.score { font-family: var(--titres); font-size: 1.6rem; font-weight: 700; color: var(--vert-fonce); }

/* Diapositives */
.deck { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden; }
.scene { min-height: min(62vh, 520px); padding: clamp(1.2rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: center; outline-offset: -4px; }
.scene h2 { font-size: clamp(1.5rem, 4vw, 2.4rem); color: var(--vert-fonce); }
.scene .gros { font-family: var(--titres); font-size: clamp(1.3rem, 3.4vw, 2rem); }
.scene ul { font-size: clamp(1.05rem, 2.5vw, 1.4rem); padding-left: 1.3rem; }
.scene li { margin-bottom: .6rem; }
.scene .chiffre { font-family: var(--titres); font-weight: 700; font-size: clamp(3rem, 12vw, 6.5rem); color: var(--terre); line-height: 1; margin: .5rem 0; }
.scene .terme { font-family: var(--titres); font-size: clamp(1.8rem, 5vw, 3rem); color: var(--terre); }
.scene figure { margin: 0; text-align: center; }
.scene figure img { max-height: 46vh; width: auto; border-radius: 10px; }
.scene figcaption, .scene .note { color: var(--doux); font-size: .95rem; margin-top: .5rem; }
.scene.titre { background: linear-gradient(135deg, var(--vert), var(--vert-fonce)); color: #fff; }
.scene.titre h2 { color: #fff; font-size: clamp(1.8rem, 5.5vw, 3.4rem); }
.scene.titre .sur { color: var(--or-clair); }
.deck-barre { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .9rem; border-top: 1px solid var(--trait); background: var(--sable); }
.deck:fullscreen { display: flex; flex-direction: column; border-radius: 0; }
.deck:fullscreen .scene { flex: 1; min-height: 0; font-size: 1.35rem; padding: 4vw 7vw; }
.deck:fullscreen .scene figure img { max-height: 62vh; }

/* Construire */
.mots { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; list-style: none; margin: .5rem 0; }
.mots li { background: var(--bleu-clair); color: var(--bleu); font-weight: 700; padding: .2rem .7rem; border-radius: 999px; font-size: .9rem; }
textarea, .champ { width: 100%; font: inherit; font-size: 1.08rem; padding: .7rem .9rem; border: 2px solid var(--doux); border-radius: 12px; background: #fff; color: inherit; }
textarea { min-height: 7rem; resize: vertical; }
label { font-weight: 700; display: block; margin: .6rem 0 .3rem; }
.carnet { width: 100%; height: auto; aspect-ratio: 5 / 3; background: #fff; border: 2px solid var(--doux); border-radius: 12px; touch-action: none; cursor: crosshair; display: block; }
.pastille { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--carte); outline: 2px solid var(--trait); cursor: pointer; }
.pastille[aria-pressed="true"] { outline: 3px solid var(--encre); }
.c0 { background: #1f2a37; } .c1 { background: #0f766e; } .c2 { background: #c2410c; } .c3 { background: #1d4ed8; }
.essentiel { border: 2px solid var(--vert); background: var(--vert-clair); border-radius: var(--rayon); padding: 1rem 1.2rem; }
.essentiel ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.essentiel li { margin-bottom: .35rem; }
.coche { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; margin: .4rem 0; }
.coche input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--vert); flex: none; }
.figure-etape { display: block; margin: .8rem auto; max-height: 300px; border-radius: 10px; }

/* Mon cours */
.fiche { break-inside: avoid; }
.fiche h3 { color: var(--vert-fonce); }
.fiche .ma-phrase { border-left: 5px solid var(--bleu); background: var(--bleu-clair); padding: .6rem .9rem; border-radius: 0 10px 10px 0; white-space: pre-wrap; }
.fiche svg.dessin { width: 100%; max-width: 520px; height: auto; border: 1px solid var(--trait); border-radius: 10px; background: #fff; display: block; margin: .5rem 0; }
.deux { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .deux, .rythme { grid-template-columns: 1fr; } .marque-texte { display: none; } .pas { grid-template-columns: auto 1fr; } .pas .etat { grid-row: auto; grid-column: 2; justify-self: start; } }
@media (prefers-reduced-motion: no-preference) { .btn, .pas, .choix button { transition: background-color .15s, border-color .15s; } }
@media print {
  .bandeau, .pied, .no-print, .evitement { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  main { max-width: none; padding: 0; }
  .carte { border: 1px solid #bbb; }
  .essentiel, .fiche .ma-phrase { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
