[hidden] { display: none !important; }
:root {
  --ecume: #EAF5F3;      /* fond : eau claire */
  --papier: #FFFFFF;
  --encre: #17324D;      /* texte : bleu nuit marine */
  --encre-douce: #4B6478;
  --mer: #0F5E6E;        /* couleur principale */
  --lagon: #2AA7B2;
  --sable: #F6DFA4;
  --soleil: #FFB627;     /* étoiles */
  --algue: #1E8C55;      /* juste */
  --corail: #E5484D;     /* faux */
  --ligne: #C7E1DD;
  --rayon: 14px;
  --ombre: 0 2px 0 #C2DCD8;
  --titre: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --texte: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ecume); color: var(--encre); font: 18px/1.5 var(--texte); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--soleil); outline-offset: 2px; border-radius: 6px; }
a { color: var(--mer); }
#app { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; min-height: 100dvh; }
.chargement { text-align: center; margin-top: 30vh; color: var(--encre-douce); }
.ecran.centre { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 8vh; gap: 8px; }

.titre { font-family: var(--titre); font-weight: 800; font-size: clamp(1.7rem, 5.5vw, 2.4rem); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
.sous-titre { font-family: var(--titre); font-weight: 700; font-size: 1.4rem; margin: 32px 0 10px; }
.sous { margin: 6px 0 0; color: var(--encre-douce); }

/* Boutons */
.btn { border: 0; border-radius: 999px; padding: 12px 22px; font-weight: 700; min-height: 48px; }
.btn-principal { background: var(--mer); color: #fff; box-shadow: 0 3px 0 #0A3F4A; }
.btn-principal:active { transform: translateY(2px); box-shadow: 0 1px 0 #0A3F4A; }
.btn-principal:disabled { background: #9FBFC4; box-shadow: none; cursor: default; }
.btn-secondaire { background: var(--papier); color: var(--mer); border: 2px solid var(--ligne); }
.btn-grand { font-family: var(--titre); font-size: 1.3rem; padding: 14px 30px; width: 100%; max-width: 420px; }
.btn-lien { background: none; border: 0; color: var(--mer); font-weight: 700; padding: 6px 4px; text-decoration: underline; text-underline-offset: 3px; font-size: .92rem; }
.btn-icone { background: var(--papier); border: 2px solid var(--ligne); border-radius: 999px; min-width: 44px; height: 44px; font-size: 1.1rem; padding: 0 12px; }
.btn-icone.confirme { background: var(--corail); color: #fff; border-color: var(--corail); font-weight: 700; }

/* Accueil */
.barre { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.salut { font-family: var(--titre); font-weight: 700; font-size: 1.25rem; margin: 0; color: var(--mer); }
.compteurs { display: flex; gap: 8px; margin: 0; font-weight: 700; font-size: .95rem; }
.compteurs span { background: var(--papier); border-radius: 999px; padding: 4px 12px; box-shadow: var(--ombre); }
.etoiles { color: #A86A00; }
.onglets { display: flex; gap: 8px; margin: 14px 0 0; overflow-x: auto; }
.onglet { border: 2px solid var(--ligne); background: var(--papier); border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .9rem; white-space: nowrap; }
.onglet[aria-pressed="true"] { background: var(--encre); color: #fff; border-color: var(--encre); }

.hero { margin-top: 18px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero .titre { max-width: 18ch; }
.duree { color: var(--encre-douce); font-size: .9rem; margin: 10px 0 0; }

/* Carte marine : l'élément signature */
.carte-defile { width: calc(100% + 32px); margin: 18px -16px 18px; overflow-x: auto; scrollbar-width: thin; background:
  radial-gradient(circle at 20% 30%, #d6efeb 0 2px, transparent 3px) 0 0/38px 38px,
  linear-gradient(#cfeae6, #bfe2dd); border-block: 2px solid #b2d9d3; }
.carte { display: block; }
.route { fill: none; stroke: #fff; stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; opacity: .9; }
.ile-sable { fill: var(--sable); stroke: #E2C474; stroke-width: 2; }
.ile-coeur { fill: #8BC48A; }
.ile-txt { font: 700 12px var(--texte); fill: var(--encre); text-anchor: middle; }
.ile.future .ile-sable { fill: #F3E7C6; stroke: #E5D6A8; }
.ile.future .ile-coeur { fill: #B6D6B1; }
.ile.future .ile-txt { fill: var(--encre-douce); font-weight: 400; }
.ile.manquee { opacity: .55; }
.ile.aujourdhui .ile-sable { stroke: var(--soleil); stroke-width: 4; }
.ile.aujourdhui .ile-txt { fill: var(--mer); }
.ile.faite .ile-coeur { fill: #4FA36B; }
.drapeau { fill: var(--corail); stroke: var(--encre); stroke-width: 1.5; stroke-linejoin: round; }
.ile.examen .ile-sable { fill: var(--sable); stroke: #C99A2E; stroke-width: 3; }
.ile.examen .ile-coeur { fill: #6DB36C; }
.coffre rect, .coffre path { fill: #9A5B22; stroke: var(--encre); stroke-width: 1.5; }
.coffre .serrure { fill: var(--soleil); }
.ile.examen .ile-txt { font-family: var(--titre); font-size: 14px; fill: var(--encre); }
.bateau path { fill: var(--encre); }
.bateau .voile { fill: #fff; stroke: var(--encre); stroke-width: 1.5; }
.bateau .voile2 { fill: var(--soleil); stroke: var(--encre); stroke-width: 1.5; }
@media (prefers-reduced-motion: no-preference) {
  .bateau { animation: tangue 3s ease-in-out infinite; transform-box: fill-box; }
  @keyframes tangue { 50% { translate: 0 -3px; rotate: -3deg; } }
}

/* Notions */
.notions { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notion { background: var(--papier); border-radius: var(--rayon); padding: 14px 16px 8px; box-shadow: var(--ombre); border-left: 6px solid var(--ligne); }
.notion-haut, .notion-bas { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.notion-titre { font-weight: 700; }
.badge { font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: #E6EEF0; color: var(--encre-douce); }
.jauge { height: 8px; border-radius: 99px; background: #E6EEF0; margin: 10px 0 4px; overflow: hidden; }
.jauge span { display: block; height: 100%; border-radius: 99px; background: #9FB4BE; }
.vus { font-size: .85rem; color: var(--encre-douce); }
.n-a-revoir { border-left-color: var(--corail); } .n-a-revoir .badge { background: #FDE4E4; color: #A3262B; } .n-a-revoir .jauge span { background: var(--corail); }
.n-en-progres { border-left-color: var(--soleil); } .n-en-progres .badge { background: #FFF0CC; color: #845200; } .n-en-progres .jauge span { background: var(--soleil); }
.n-solide { border-left-color: var(--algue); } .n-solide .badge { background: #DDF3E6; color: #14623B; } .n-solide .jauge span { background: var(--algue); }
.pied { margin-top: 36px; text-align: center; font-size: .9rem; }

/* Séance */
.seance-haut { display: flex; align-items: center; gap: 12px; }
.progression { flex: 1; height: 12px; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 2px var(--ligne); overflow: hidden; }
.progression span { display: block; height: 100%; background: var(--lagon); border-radius: 99px; transition: width .3s; }
.compte { font-weight: 700; font-size: .95rem; min-width: 3.5em; text-align: right; }
.etiquette-seance { margin: 18px 0 6px; font-weight: 700; color: var(--mer); font-size: .95rem; }
.question { background: var(--papier); border-radius: 20px; padding: 22px 20px; box-shadow: var(--ombre); }
.consigne { font-family: var(--titre); font-weight: 700; font-size: 1.35rem; line-height: 1.25; margin: 0 0 16px; }
.phrase { font-size: 1.2rem; line-height: 2.1; margin: 0; }
.saisie { font: inherit; font-weight: 700; color: var(--mer); width: 9em; max-width: 100%; border: 0; border-bottom: 3px solid var(--lagon); background: #F2FAF9; padding: 2px 8px; margin: 0 4px; border-radius: 6px 6px 0 0; }
.saisie:focus { outline: none; background: #E3F5F3; }
.saisie.juste { border-color: var(--algue); color: var(--algue); }
.saisie.faux { border-color: var(--corail); color: var(--corail); text-decoration: line-through; }
.accents { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.accent { min-width: 40px; height: 40px; border-radius: 10px; border: 2px solid var(--ligne); background: #fff; font-weight: 700; }

.choix { display: grid; gap: 10px; }
.choix-btn { text-align: left; background: #fff; border: 2px solid var(--ligne); border-radius: 12px; padding: 12px 16px; min-height: 52px; font-size: 1.05rem; }
.choix-btn[aria-checked="true"] { border-color: var(--mer); background: #E3F3F4; box-shadow: inset 0 0 0 1px var(--mer); }

.trou { display: inline-flex; gap: 0; margin: 0 3px; vertical-align: middle; border-radius: 10px; }
.trou-btn { border: 2px solid var(--ligne); background: #fff; padding: 0 10px; font-size: 1rem; line-height: 1.9; font-weight: 700; color: var(--encre-douce); }
.trou-btn:first-child { border-radius: 10px 0 0 10px; } .trou-btn:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.trou-btn[aria-pressed="true"] { background: var(--mer); border-color: var(--mer); color: #fff; }

.classer { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.classer li { border-bottom: 1px dashed var(--ligne); padding-bottom: 12px; }
.classer-texte { margin: 0 0 8px; font-weight: 700; font-size: 1.1rem; }
.classer-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-btn { border: 2px solid var(--ligne); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: .95rem; }
.cat-btn[aria-pressed="true"] { background: var(--mer); border-color: var(--mer); color: #fff; }

.texte-mots { line-height: 2.3; }
.mot { border: 0; background: none; padding: 1px 3px; border-radius: 6px; font-size: inherit; }
.mot:hover { background: #E3F3F4; }
.mot[aria-pressed="true"] { background: var(--soleil); }

/* Correction */
.corrigee button { cursor: default; }
.choix-btn.juste, .mot.juste { background: #DDF3E6 !important; border-color: var(--algue) !important; box-shadow: inset 0 0 0 1px var(--algue); }
.choix-btn.faux, .mot.faux { background: #FDE4E4 !important; border-color: var(--corail) !important; text-decoration: line-through; }
.mot.manque { box-shadow: inset 0 -3px 0 var(--algue); background: #EFFAF3; }
.trou.juste .trou-btn[aria-pressed="true"] { background: var(--algue); border-color: var(--algue); }
.trou.faux .trou-btn[aria-pressed="true"] { background: var(--corail); border-color: var(--corail); text-decoration: line-through; }
.classer li.faux .cat-btn[aria-pressed="true"] { background: var(--corail); border-color: var(--corail); text-decoration: line-through; }
.classer li.juste .cat-btn[aria-pressed="true"] { background: var(--algue); border-color: var(--algue); }
.classer li.faux .cat-btn.attendu { border-color: var(--algue); box-shadow: inset 0 0 0 2px var(--algue); color: var(--algue); font-weight: 700; }

.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.actions .btn-principal { min-width: 9em; }
.retour { margin-top: 16px; border-radius: 18px; padding: 16px 18px; background: #fff; border: 3px solid; }
.retour.ok { border-color: var(--algue); background: #F1FBF5; }
.retour.ko { border-color: var(--corail); background: #FFF5F5; }
.verdict { font-family: var(--titre); font-weight: 800; font-size: 1.5rem; margin: 0; }
.retour.ok .verdict { color: var(--algue); } .retour.ko .verdict { color: #B8262C; }
.bonne { margin: 6px 0 0; white-space: pre-line; }
.explication { margin: 6px 0 12px; }
.note { font-size: .9rem; color: var(--encre-douce); margin: 0 0 12px; }

/* Fin */
.etoiles-gagnees { color: var(--soleil); font-size: 2rem; letter-spacing: 4px; margin: 0; max-width: 14em; word-wrap: break-word; text-shadow: 0 2px 0 #C98A00; }
.score { font-weight: 700; margin: 4px 0 12px; }
.a-revoir { background: #fff; border-radius: var(--rayon); padding: 14px 20px; box-shadow: var(--ombre); text-align: left; margin-bottom: 18px; max-width: 460px; width: 100%; }
.a-revoir h2 { margin: 0; font-family: var(--titre); font-size: 1.15rem; }
.a-revoir p { margin: 6px 0 0; font-size: .9rem; color: var(--encre-douce); }

/* Feuille de rappel */
.feuille { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.feuille[hidden] { display: none; }
.feuille-fond { position: absolute; inset: 0; background: rgba(23, 50, 77, .45); }
.feuille-contenu { position: relative; background: var(--papier); width: 100%; max-width: 680px; max-height: 85dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 22px 22px 32px; }
.feuille-contenu h2 { font-family: var(--titre); margin: 0 48px 8px 0; font-size: 1.5rem; }
.feuille .fermer { position: absolute; top: 14px; right: 14px; }
.rappel { padding-left: 1.1em; margin: 0; display: grid; gap: 10px; }
.rappel li::marker { color: var(--lagon); }
@media (min-width: 700px) { .feuille { align-items: center; } .feuille-contenu { border-radius: 22px; } }

/* Connexion */
.boussole { width: 84px; height: 84px; }
.boussole circle:first-child { fill: #fff; stroke: var(--mer); stroke-width: 4; }
.boussole path { fill: var(--corail); } .boussole circle:last-child { fill: var(--encre); }
.form-connexion { display: grid; gap: 8px; width: 100%; max-width: 320px; text-align: left; margin-top: 12px; }
.form-connexion input { font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--ligne); }
.erreur { color: #B8262C; min-height: 1.5em; margin: 0; }

@media (max-width: 480px) {
  body { font-size: 17px; }
  .question { padding: 18px 14px; }
  .phrase { font-size: 1.1rem; }
  .actions .btn { flex: 1; }
}

/* Cagnotte Steam */
.cagnotte { margin-top: 14px; background: var(--encre); color: #fff; border-radius: 16px; padding: 12px 16px; }
.cagnotte-haut { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cagnotte-titre { font-weight: 700; }
.cagnotte-montant { font-family: var(--titre); font-weight: 800; font-size: 1.7rem; color: var(--soleil); line-height: 1; }
.cagnotte-regle { margin: 6px 0 0; font-size: .92rem; color: #D5E3EC; }
.gain { font-family: var(--titre); font-weight: 800; font-size: 1.6rem; color: var(--algue); margin: 6px 0 0; }
.gain-total { margin: 0 0 8px; font-weight: 700; }
.gain-rate { margin: 6px 0 8px; color: var(--encre-douce); max-width: 30em; }
.jarre { height: 14px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; margin: 10px 0 2px; }
.jarre span { display: block; height: 100%; background: var(--soleil); border-radius: 99px; transition: width .6s; }
.tirelire { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.18); }
.tirelire strong { color: var(--soleil); font-size: 1.1rem; }
.attente { color: #D5E3EC; font-size: .85rem; }
.btn-tirelire { background: var(--soleil); color: var(--encre); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 700; min-height: 40px; }
.jauge-pleine { color: #A86A00; }

/* Navigation Révisions / Cadeaux */
.nav-principale { display: flex; gap: 4px; background: #fff; border-radius: 999px; padding: 4px; box-shadow: var(--ombre); }
.nav-principale button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-weight: 700; min-height: 36px; color: var(--encre-douce); }
.nav-principale button[aria-current="page"] { background: var(--encre); color: #fff; }
.pastille { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 99px; background: var(--corail); color: #fff; font-size: .75rem; line-height: 1.4em; }

/* Onglet Cadeaux */
.tirelire-grande { margin-top: 16px; background: var(--encre); color: #fff; border-radius: 20px; padding: 18px 20px; text-align: center; }
.tg-label { margin: 0; font-weight: 700; color: #D5E3EC; }
.tg-montant { margin: 2px 0; font-family: var(--titre); font-weight: 800; font-size: clamp(2.4rem, 10vw, 3.4rem); line-height: 1.05; color: var(--soleil); }
.tg-info { margin: 0; font-size: .9rem; color: #D5E3EC; }
.message-ok { background: #DDF3E6; color: #14623B; border-radius: 12px; padding: 10px 14px; font-weight: 700; margin: 14px 0 0; }
.boutique { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.carte-cadeau { background: #fff; border-radius: 18px; padding: 10px; box-shadow: var(--ombre); display: grid; gap: 10px; }
.carte-visuel { position: relative; aspect-ratio: 16 / 10; border-radius: 12px; padding: 12px 14px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  background: linear-gradient(135deg, #1B3A5C, #23577F); }
.carte-visuel::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; border: 16px solid rgba(255,255,255,.12); }
.v-1000 { background: linear-gradient(135deg, #3B2A6B, #5A3F9E); }
.v-2500 { background: linear-gradient(135deg, #1E5B45, #2C8A63); }
.v-5000 { background: linear-gradient(135deg, #6B4A12, #B07D1E); }
.carte-nom { font-weight: 700; font-size: .95rem; opacity: .9; }
.carte-prix { font-family: var(--titre); font-weight: 800; font-size: 2.6rem; line-height: 1; }
.carte-prix small { font-size: 1rem; }
.carte-cadeau:not(.abordable) .carte-visuel { filter: grayscale(.55); opacity: .8; }
.carte-cadeau .btn { width: 100%; }
.confirme-achat { background: var(--algue); box-shadow: 0 3px 0 #0F5A35; }
.carte-manque { display: grid; gap: 4px; font-size: .9rem; color: var(--encre-douce); font-weight: 700; padding: 0 4px 4px; }
.carte-manque .jauge { margin: 0; }
.carte-manque .jauge span { background: var(--soleil); }
.commandes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.commandes li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: var(--ombre); border-left: 6px solid var(--soleil); }
.commandes .c-acceptee { border-left-color: var(--algue); }
.commandes .c-refusee { border-left-color: var(--corail); }
.barre { row-gap: 10px; }
