/* Leçons futées — Design v2, partie C : écrans de préparation dans la coque « Nuit étoilée ».
   Chargée SEULEMENT par /app/ et /decouverte/, SANS data-lf : jamais dans le fichier partagé, jamais dans /lecteur/.
   Toutes les règles visent body.avec-coque .v2 (écrans affichés par js/ecrans-v2.js).
   Couleurs : celles de l'ambiance choisie (var(--bg), var(--surface), var(--line), var(--ink), var(--muted),
   var(--btn), var(--focus), couleurs des jeux --gc / --gi), pour que les 9 ambiances claires et sombres s'appliquent.
   Couleurs fixes, lisibles dans toutes les ambiances : jaune #FFCC3F avec l'encre #171A33, cartes nuit au texte blanc.
   Violet pâle « À retenir » et jaune pâle : variables --v2-*, redéfinies pour les ambiances sombres.
   Tailles en rem (« Taille du texte »), police d'accessibilité : classe lf-police. Un seul point de rupture : 900 px. */

:root{--v2-violet-bg:#F1EAFB;--v2-violet-bord:#D9C8F5;--v2-violet:#5B3DB8;--v2-jaune-bg:#FFF3C4;--v2-jaune-txt:#6B4E00;--v2-ok-bg:#E3F3EA;--v2-ok-txt:#1F5A38}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){--v2-violet-bg:#2A2150;--v2-violet-bord:#4A3A86;--v2-violet:#CDB8FF;--v2-jaune-bg:#3D3210;--v2-jaune-txt:#FFE69A;--v2-ok-bg:#123B30;--v2-ok-txt:#9BE8C2}
}
:root[data-theme="dark"]{--v2-violet-bg:#2A2150;--v2-violet-bord:#4A3A86;--v2-violet:#CDB8FF;--v2-jaune-bg:#3D3210;--v2-jaune-txt:#FFE69A;--v2-ok-bg:#123B30;--v2-ok-txt:#9BE8C2}

/* ---------- Commun ---------- */
body.avec-coque .v2{font-family:Nunito,var(--font-body);font-size:1rem;line-height:1.45;display:flex;flex-direction:column;gap:24px}
body.avec-coque .v2 h1,body.avec-coque .v2 h2,body.avec-coque .v2 h3{font-family:Fredoka,var(--font-display);letter-spacing:-.01em;font-weight:700}
.lf-police .v2,.lf-police .v2 h1,.lf-police .v2 h2,.lf-police .v2 h3{font-family:var(--font-body)}
body.avec-coque .v2 h1{font-size:2.25rem;line-height:1.15}
body.avec-coque .v2 p{text-wrap:pretty}
.v2-tete{display:flex;flex-direction:column;gap:6px}
.v2-tete>p{color:var(--muted);font-size:1rem}
.v2-carte{background:var(--surface);border:1.5px solid var(--line);border-radius:24px;padding:24px;display:flex;flex-direction:column;gap:18px;min-width:0}
.v2-h{display:flex;align-items:center;gap:10px;font-size:1.125rem}
.v2-h3{font-size:1.125rem}
.v2-pastille{flex:none;width:28px;height:28px;border-radius:50%;background:var(--btn);color:var(--btn-ink);display:inline-flex;align-items:center;justify-content:center;font-family:Nunito,var(--font-body);font-weight:800;font-size:.875rem}
.v2-petit{color:var(--muted);font-size:.875rem;line-height:1.45;margin:0}
.v2-lbl{display:block;font-size:.875rem;font-weight:800;color:var(--muted);margin:6px 0 -6px}
.v2-nuit{background:linear-gradient(135deg,#120F38 0%,#3A2A7E 100%);color:#FFFFFF;border-radius:24px}

/* Boutons : pilules. Principal = marine de l'ambiance (var(--btn)). */
.v2-btn,body.avec-coque .v2 .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;padding:12px 22px;border-radius:999px;
  font-family:Nunito,var(--font-body);font-weight:800;font-size:.9375rem;line-height:1.25;text-align:center;text-decoration:none;border:2px solid transparent;cursor:pointer;flex:0 1 auto}
.lf-police .v2-btn,.lf-police .v2 .btn{font-family:var(--font-body)}
.v2-btn.principal,body.avec-coque .v2 .btn:not(.ghost){background:var(--btn);color:var(--btn-ink);border-color:var(--btn)}
.v2-btn.principal{font-size:1.0625rem;padding:14px 26px}
.v2-btn.marine{background:transparent;color:var(--btn);border-color:var(--btn)}
.v2-btn.contour,body.avec-coque .v2 .btn.ghost{background:var(--surface);color:var(--ink);border-color:var(--line)}
.v2-btn.jaune{background:#FFCC3F;color:#171A33;border-color:#FFCC3F}
.v2-btn:hover:not(:disabled),body.avec-coque .v2 .btn:hover:not(:disabled){filter:brightness(1.06)}
.v2-btn.contour:hover:not(:disabled),body.avec-coque .v2 .btn.ghost:hover:not(:disabled){border-color:var(--btn);filter:none}
.v2-btn:disabled,body.avec-coque .v2 .btn:disabled{background:var(--line);border-color:var(--line);color:var(--muted);opacity:1;cursor:not-allowed;filter:none}
.v2-btn:focus-visible,body.avec-coque .v2 .btn:focus-visible,body.avec-coque .v2 .lv:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
body.avec-coque .v2 .msg{margin:0}

/* ---------- 1. Nouvelle leçon ---------- */
.v2-cols{display:grid;grid-template-columns:minmax(0,1fr);gap:24px;align-items:start}
@media (min-width:1200px){.v2-imp .v2-cols{grid-template-columns:minmax(0,1fr) 320px}}
.v2-etape{display:flex;flex-direction:column;gap:14px}
body.avec-coque .v2 .v2-niveaux{margin:0;gap:8px}
body.avec-coque .v2 .lv{min-width:0;min-height:44px;padding:8px 20px;border-radius:999px;border:2px solid var(--line);background:var(--surface);color:var(--ink);
  font-family:Nunito,var(--font-body);font-weight:800;font-size:.9375rem}
body.avec-coque .v2 .lv:hover{border-color:var(--btn)}
body.avec-coque .v2 .lv[aria-pressed="true"]{background:var(--btn);border-color:var(--btn);color:var(--btn-ink)}
.lf-police .v2 .lv{font-family:var(--font-body)}
body.avec-coque .v2 .v2-depot{flex-direction:column;justify-content:center;text-align:center;gap:10px;min-height:170px;padding:24px 20px;border:2px dashed var(--line);
  border-color:color-mix(in srgb,var(--line) 45%,var(--muted));border-radius:20px;background:var(--bg)}
body.avec-coque .v2 .v2-depot:hover,body.avec-coque .v2 .v2-depot.over{border-color:var(--btn)}
body.avec-coque .v2 .v2-depot b{font-family:Nunito,var(--font-body);font-size:1rem;font-weight:800}
body.avec-coque .v2 .v2-depot u{color:var(--btn);text-underline-offset:3px}
body.avec-coque .v2 .v2-depot small{font-size:.875rem;margin-top:4px}
.v2-depico{width:52px;height:52px;border-radius:16px;background:var(--g1);color:var(--g1i);display:inline-flex;align-items:center;justify-content:center}
body.avec-coque .v2 .thumbs{margin:0}
body.avec-coque .v2 .fname{margin:0}
body.avec-coque .v2 textarea{min-height:11rem;border:1.5px solid var(--line);border-radius:20px;background:var(--bg);padding:14px 16px;font-family:inherit;font-size:1rem}
body.avec-coque .v2 textarea:focus{outline:3px solid var(--focus);outline-offset:1px;border-color:var(--focus)}
.v2-pied{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px;border-top:1.5px solid var(--line);padding-top:20px}
body.avec-coque .v2 .v2-pied .mp-case{margin:0;font-size:.9375rem}
.v2-duree{margin-left:auto;color:var(--muted);font-size:.875rem;font-weight:700}
.v2-cote{display:flex;flex-direction:column;gap:20px;min-width:0}
.v2-pile{display:flex;flex-direction:column;align-items:stretch;gap:10px}
.v2-pile .v2-btn,body.avec-coque .v2 .v2-pile .btn{width:100%}
.v2-kalix{display:flex;align-items:center;gap:14px;padding:18px 20px}
.v2-kalix p{font-size:.9375rem;line-height:1.45;color:#DCD8F5}
.v2-kalix b{color:#FFFFFF}
.v2-kimg{width:72px;height:auto;flex:none}

/* ---------- 2. Préparation en cours ---------- */
.v2-prep{align-items:center;padding-top:24px}
.v2-prepcarte{width:100%;max-width:640px;align-items:center;text-align:center;gap:14px;padding:36px 32px 28px;border-radius:28px;box-shadow:0 18px 40px rgba(23,26,51,.10)}
.v2-halo{position:relative;width:180px;height:180px;display:flex;align-items:center;justify-content:center}
.v2-halo::before{content:"";position:absolute;inset:6px;border-radius:50%;background:radial-gradient(circle,rgba(255,204,63,.55) 0%,rgba(255,204,63,.18) 55%,rgba(255,204,63,0) 72%)}
.v2-prepimg{position:relative;width:150px;height:auto}
body.avec-coque .v2-prep h1{font-size:1.75rem}
.v2-sous{color:var(--muted);font-size:1rem;font-weight:700}
body.avec-coque .v2 .v2-barre{width:100%;height:12px;margin:8px 0 0;background:var(--bg);border:1px solid var(--line)}
body.avec-coque .v2 .v2-barre i{background:linear-gradient(90deg,#FFCC3F,#FFB03B)}
.v2-etat{font-size:1.0625rem;font-weight:700;min-height:1.5em}
.v2-prep-pied{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px 20px;margin-top:6px}
.v2-prep-pied .v2-duree{margin-left:0}
@media (prefers-reduced-motion:reduce){body.avec-coque .v2 .v2-barre i{transition:none}}
@media (prefers-reduced-motion:no-preference){.v2-halo::before{animation:v2Halo 2.4s ease-in-out infinite}}
@keyframes v2Halo{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.06);opacity:.8}}
@media (max-width:900px){.v2-prepcarte{padding:28px 18px 22px}.v2-halo{width:150px;height:150px}.v2-prepimg{width:120px}}

/* ---------- 3. Parcours de la leçon ---------- */
.v2-fil{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;min-height:44px;font-weight:800;font-size:.9375rem;color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.v2-entete{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px 24px}
.v2-entete .v2-tete{flex:1 1 320px;min-width:0}
.v2-entete h1{overflow-wrap:anywhere}
.v2-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.v2-chip{display:inline-flex;align-items:center;min-height:28px;padding:4px 12px;border-radius:999px;background:var(--surface);border:1.5px solid var(--line);color:var(--ink);font-size:.8125rem;font-weight:800}
.v2-chip.jaune{background:var(--v2-jaune-bg);border-color:var(--v2-jaune-bg);color:var(--v2-jaune-txt)}
.v2-chip.violet{background:var(--v2-violet-bg);border-color:var(--v2-violet-bord);color:var(--v2-violet);font-size:.75rem;min-height:24px;padding:2px 10px;margin-left:auto}
.v2-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.v2-plus{position:relative}
.v2-plus>summary{list-style:none;padding:0;width:48px}
.v2-plus>summary::-webkit-details-marker{display:none}
.v2-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:20;min-width:280px;display:flex;flex-direction:column;padding:8px;border-radius:16px;background:var(--surface);border:1.5px solid var(--line);box-shadow:0 18px 40px rgba(23,26,51,.18)}
.v2-mitem{display:flex;align-items:center;gap:10px;min-height:44px;padding:10px 12px;border-radius:10px;font-weight:700;font-size:.9375rem;text-align:left;color:var(--ink);width:100%}
.v2-mitem:hover{background:var(--bg)}
.v2-mitem:focus-visible{outline:3px solid var(--focus);outline-offset:-2px}
body.avec-coque .v2 .mp-sauv .btn{align-self:flex-start}
.v2-chaine{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:14px 28px;counter-reset:none}
.v2-pe{position:relative;flex:1 1 170px;min-width:0;max-width:240px;display:flex;flex-direction:column;gap:6px;padding:16px;border-radius:18px;border:1.5px solid var(--line);border-top:5px solid var(--gc);background:var(--bg)}
.v2-pe:not(:last-child)::after{content:"";position:absolute;right:-26px;top:50%;width:24px;border-top:2px dashed color-mix(in srgb,var(--line) 40%,var(--muted))}
.v2-pe b{font-size:.9375rem;line-height:1.3;overflow-wrap:anywhere}
.v2-pe small{font-size:.8125rem;color:var(--muted);font-weight:700}
.v2-pn{width:28px;height:28px;border-radius:50%;background:#FFCC3F;color:#171A33;display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:.875rem}
.v2-test{border:0;background:linear-gradient(135deg,#120F38 0%,#3A2A7E 100%)}
.v2-test b{color:#FFFFFF}
body.avec-coque .v2 .v2-test small{color:#DCD8F5}
.v2-retenir{display:flex;flex-direction:column;gap:8px;padding:20px 24px;border-radius:18px;background:var(--v2-violet-bg);border:1.5px solid var(--v2-violet-bord)}
body.avec-coque .v2 .v2-retenir h2{font-family:Nunito,var(--font-body);font-size:.8125rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--v2-violet)}
.v2-retenir p{font-size:1.125rem;line-height:1.5}
.v2-retenir .link{align-self:flex-start;color:var(--v2-violet);font-size:.9375rem;min-height:44px;padding:0}
.v2-jeux{display:flex;flex-direction:column;gap:6px}
.v2-compte{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:24px;padding:0 8px;border-radius:999px;background:var(--btn);color:var(--btn-ink);font-family:Nunito,var(--font-body);font-size:.8125rem;font-weight:800}
body.avec-coque .v2 .grid{grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:14px;margin-top:10px}
body.avec-coque .v2 .gcell{gap:6px;background:var(--surface);border:1.5px solid var(--line);border-radius:20px;padding:10px}
body.avec-coque .v2 .v2-tuile{display:flex;flex-direction:row;align-items:center;gap:12px;min-height:72px;padding:8px;border:0;border-radius:14px;background:transparent;text-align:left;box-shadow:none;transform:none;color:var(--ink)}
body.avec-coque .v2 .v2-tuile:hover:not(:disabled){background:var(--bg);transform:none}
body.avec-coque .v2 .v2-tuile:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
body.avec-coque .v2 .v2-tuile .glyph{flex:none;width:52px;height:52px;border-radius:14px;font-size:1rem}
.v2-tnom{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}
body.avec-coque .v2 .v2-tuile h3{font-family:Nunito,var(--font-body);font-size:1rem;font-weight:800;letter-spacing:0}
body.avec-coque .v2 .v2-tuile .meta{margin:0;padding:0;font-size:.8125rem;font-weight:700;flex-direction:column;align-items:flex-start;gap:2px}
body.avec-coque .v2 .addp{min-height:44px;border-radius:12px;border:1.5px solid var(--line);background:var(--bg);font-family:Nunito,var(--font-body);font-size:.875rem;font-weight:800;color:var(--ink)}
body.avec-coque .v2 .addp:hover:not(:disabled){border-color:var(--btn)}
body.avec-coque .v2 .addp.on{border-style:solid;border-color:var(--good);background:var(--v2-ok-bg);color:var(--v2-ok-txt)}
body.avec-coque .v2 .addp:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
body.avec-coque .v2 .replbox{border-radius:16px;border:1.5px solid var(--line);background:var(--bg)}
body.avec-coque .v2 .card{background:var(--surface);border:1.5px solid var(--line);border-radius:24px;padding:22px 24px;margin:0}
@media (max-width:900px){
  .v2-chaine{flex-direction:column;gap:22px}
  .v2-pe{max-width:none;flex:none}
  .v2-pe:not(:last-child)::after{right:auto;left:36px;top:auto;bottom:-22px;width:0;height:20px;border-top:0;border-left:2px dashed color-mix(in srgb,var(--line) 40%,var(--muted))}
  .v2-menu{right:auto;left:0;min-width:min(280px,calc(100vw - 48px))}
  .v2-actions .v2-btn.jaune{flex:1 1 100%}
}

/* ---------- 4. Éditeur des jeux ---------- */
.v2-edbarre{position:sticky;top:0;z-index:15;display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;margin:-12px -8px 0;padding:12px 8px;background:var(--bg);border-bottom:1.5px solid var(--line)}
.v2-edtitre{flex:1 1 220px;min-width:0;display:flex;flex-direction:column}
body.avec-coque .v2-ed .v2-edtitre h1{font-size:1.5rem}
.v2-edtitre span{color:var(--muted);font-weight:700;font-size:.9375rem;overflow-wrap:anywhere}
.v2-edact{display:flex;flex-wrap:wrap;gap:10px}
.v2-rond{width:48px;padding:0;flex:none}
.v2-edcols{display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-items:start}
@media (min-width:1100px){.v2-edcols{grid-template-columns:300px minmax(0,1fr)}.v2-edg{position:sticky;top:96px}}
.v2-edg,.v2-edd{display:flex;flex-direction:column;gap:18px;min-width:0}
body.avec-coque .v2 .steprow.vert{display:flex;flex-direction:column;align-items:stretch;gap:8px;margin:0}
body.avec-coque .v2 .steprow.vert .stepchip{display:flex;width:100%}
body.avec-coque .v2 .steprow.vert .tab{flex:1;min-width:0;display:flex;align-items:center;gap:10px;min-height:56px;padding:8px 12px;text-align:left;border:1.5px solid var(--line);border-right:0;border-radius:14px 0 0 14px;background:var(--surface);color:var(--ink);font-family:Nunito,var(--font-body)}
body.avec-coque .v2 .steprow.vert .grab{min-width:44px;border:1.5px solid var(--line);border-left:0;border-radius:0 14px 14px 0;background:var(--surface)}
body.avec-coque .v2 .steprow.vert .tab:hover{background:var(--bg)}
body.avec-coque .v2 .steprow.vert .tab[aria-pressed="true"]{background:var(--btn);border-color:var(--btn);color:var(--btn-ink)}
body.avec-coque .v2 .steprow.vert .tab[aria-pressed="true"] small{color:var(--btn-ink)}
body.avec-coque .v2 .steprow.vert .tab[aria-pressed="true"]+.grab{background:var(--btn);border-color:var(--btn);color:var(--btn-ink)}
body.avec-coque .v2 .steprow.vert .tab:focus-visible,body.avec-coque .v2 .steprow.vert .tab.add:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
body.avec-coque .v2 .steprow.vert .tab.add{flex:none;justify-content:center;min-height:48px;border:1.5px dashed var(--line);border-color:color-mix(in srgb,var(--line) 45%,var(--muted));border-radius:14px;font-weight:800;color:var(--ink);background:transparent}
.v2-sn{flex:none;width:28px;height:28px;border-radius:50%;background:var(--gc);color:var(--gi);display:inline-flex;align-items:center;justify-content:center;font-weight:800;font-size:.875rem}
.v2-st{display:flex;flex-direction:column;min-width:0}
.v2-st b{font-size:.9375rem;line-height:1.25;overflow-wrap:anywhere}
.v2-st small{font-size:.8125rem;font-weight:700;color:var(--muted)}
body.avec-coque .v2 .steprow.vert .dropbefore::before,body.avec-coque .v2 .steprow.vert .dropafter::after{left:0;right:0;width:auto;height:5px;top:auto;bottom:auto}
body.avec-coque .v2 .steprow.vert .dropbefore::before{top:-7px}
body.avec-coque .v2 .steprow.vert .dropafter::after{bottom:-7px}
body.avec-coque .dragghost.stepchip{max-width:280px}
.v2-edtete{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
.v2-suppr{color:var(--try)}
body.avec-coque .v2 .field{font-size:.875rem;font-weight:800;color:var(--muted);gap:6px}
body.avec-coque .v2 .field input,body.avec-coque .v2 .field select,body.avec-coque .v2 .eitem input[type=text],body.avec-coque .v2 .eitem textarea,body.avec-coque .v2 .eitem select{font-family:Nunito,var(--font-body);font-size:1rem;font-weight:400;color:var(--ink);border-radius:12px}
.v2-jeuact{display:flex;align-items:center;gap:12px}
.v2-jeuact span:last-child{display:flex;flex-direction:column}
.v2-jeuact small{font-size:.8125rem;font-weight:800;color:var(--muted)}
.v2-jeuact b{font-size:1.0625rem}
body.avec-coque .v2 .v2-jeuact .glyph{width:48px;height:48px;border-radius:14px;font-size:1rem;flex:none}
.v2-changer>summary{list-style:none;align-self:flex-start;display:inline-flex}
.v2-changer>summary::-webkit-details-marker{display:none}
.v2-changer[open]>summary{margin-bottom:12px}
body.avec-coque .v2 .gpick{border-width:1.5px;border-radius:12px;font-family:Nunito,var(--font-body);font-weight:700}
body.avec-coque .v2 .gpick:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
body.avec-coque .v2 .eitem{border-width:1.5px;border-radius:18px;background:var(--bg);margin-top:12px}
body.avec-coque .v2 .eh b{font-family:Fredoka,var(--font-display);font-size:1rem}
.lf-police .v2 .eh b{font-family:var(--font-body)}
body.avec-coque .v2 .v2-elems>.actions{margin-top:14px}
@media (max-width:900px){
  .v2-edbarre{margin:0;padding:10px 0;position:static}
  .v2-edact{width:100%}
  .v2-edact .v2-btn{flex:1 1 0}
}

@media (max-width:900px){
  body.avec-coque .v2 h1{font-size:1.875rem}
  .v2-carte{padding:18px 16px;border-radius:20px}
  .v2-duree{margin-left:0}
  .v2-pied .v2-btn.principal{width:100%}
}

/* ---------- V2F : icône de chaque étape du parcours (même glyphe et même couleur que les « Jeux en plus ») ---------- */
.v2-pe-tete{display:flex;align-items:center;gap:8px}
body.avec-coque .v2 .v2-pe .glyph{flex:none;width:36px;height:36px;border-radius:10px;font-size:.8125rem}
/* Boutons répétés sous « Le parcours » et en bas de la page. */
.v2-actions-bas{margin-top:4px}

