/* ═══════════════════════════════════════════════════════════
   Cartes flash de poche — feuille de style PROPRE à l'appli
   Le socle (/shared/appli-socle.css) porte le reste : reset, barre, boutons, dock, feuilles, listes,
   message passager, clavier, visite, micro, onglets. On y redéfinit ici les jetons de couleur (la teinte
   de l'appli) et ce qui ne vaut que pour elle. Rayons et ombres : jamais de littéral
   (--r-*, --sh-* de /shared/jetons.css — controle-jetons.mjs le refuserait).
   ⚠️ La couleur d'un univers (--u) ne porte JAMAIS de texte : filet, pastille, barre de progression. Un jaune
   ou un cyan n'atteint pas 4,5 : 1 sous du blanc, et personne ne choisirait de lire sur eux.
   ═══════════════════════════════════════════════════════════ */

:root {
  --accent: #3d4a9c; --accent-fort: #2b3573; --accent-clair: #e5e8f4;
}
html[data-theme="sombre"] {
  --accent: #8e9be0; --accent-fort: #b9c2ef; --accent-clair: #1f2336;
}

#ecran { padding-bottom: calc(var(--dock-h) + 28px + var(--bas)); }
#toast { bottom: calc(var(--dock-h) + var(--bas) + 16px); }

/* La pastille « 🐞 Contact » du panneau du site est posée juste sous la barre, à droite (jamais dans l'appli emballée) : sur téléphone, on lui laisse sa ligne plutôt que de la poser sur le titre. */
@media (max-width: 480px) { html.avec-panneau-bug #ecran { padding-top: 62px; } html.avec-panneau-bug.clavier #ecran { padding-top: 18px; } }

/* ── l'écran d'accueil ───────────────────────────────────── */
#hero:empty { display: none; }
.hero-seance {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 72px; padding: 14px 16px; margin-bottom: 18px;
  border-radius: var(--r-lg); background: var(--accent); color: var(--sur-accent); box-shadow: var(--sh-2);
}
.hero-seance:active { transform: translateY(1px); }
.hero-ico { font-size: 30px; line-height: 1; flex: 0 0 auto; }
.hero-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.hero-txt b { font-size: 1.05rem; line-height: 1.25; }
.hero-txt small { font-size: .82rem; opacity: .9; line-height: 1.35; margin-top: 2px; }
.hero-fin { font-size: 1.4rem; flex: 0 0 auto; }
.hero-serie { font-weight: 700; }

.champ-saisie { position: relative; }
.champ-saisie input[type="search"] { padding-right: 52px; min-height: 52px; font-size: 1rem; -webkit-appearance: none; appearance: none; }
.champ-saisie input[type="search"]::-webkit-search-cancel-button { display: none; }
.effacer { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border-radius: var(--r-pill); font-size: 16px; color: var(--doux); }
.effacer:active { background: var(--panneau-2); }
.champ-pied { justify-content: flex-end; min-height: 8px; }

/* Les rangées de puces défilent du doigt, jamais sur trois lignes. */
.rubriques {
  display: flex; flex-wrap: nowrap; gap: 8px; margin: 12px -16px 0; padding: 2px 16px 6px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.rubriques::-webkit-scrollbar { display: none; }
.rubriques .puce { flex: 0 0 auto; white-space: nowrap; }
.rubriques .puce.lettre { min-width: 44px; padding: 8px 10px; text-align: center; }

.resume-ligne { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 10px; }
.resume { font-size: .82rem; color: var(--doux); margin: 0; min-width: 0; }
#suite { margin-top: 12px; }
.vide .pile { margin-top: 12px; }
#note-langue { margin-top: 14px; }

mark.trouve { background: rgba(250, 204, 21, .42); color: inherit; border-radius: var(--r-xs); padding: 0 1px; }
html[data-theme="sombre"] mark.trouve { background: rgba(250, 204, 21, .28); }

/* ── les univers ─────────────────────────────────────────── */
.univers { --u: var(--accent); }
.univers .item-ico { position: relative; }
.univers-tete { border-left: 5px solid var(--u); }
.prog { display: block; height: 6px; margin-top: 6px; border-radius: var(--r-pill); background: var(--trait); overflow: hidden; }
.prog > i { display: block; height: 100%; width: 0; background: var(--u); border-radius: var(--r-pill); }
.prog.double > i.maitrisee { background: var(--ok); }

/* Un résultat, une entrée du glossaire : pastille de catégorie sur le côté. */
.point { display: inline-block; width: 9px; height: 9px; border-radius: var(--r-pill); background: var(--u, var(--accent)); margin-right: 6px; vertical-align: 0; flex: 0 0 auto; }
.item-site .item-txt b { overflow-wrap: anywhere; }
.item-txt .extrait { overflow-wrap: anywhere; }

/* Le nombre de favoris, sur l'étoile de la barre du bas. */
.dock .d-ico { position: relative; }
.d-badge {
  position: absolute; top: -6px; left: 60%; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--accent); color: var(--sur-accent);
  font-size: .66rem; font-weight: 800; line-height: 18px; text-align: center;
}

/* ── l'étude : la feuille haute, ses modes, la carte ─────── */
.cats { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 -16px 8px; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats .puce { flex: 0 0 auto; white-space: nowrap; }
.outils-etude { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 8px; }
.outils-etude .btn-lien { padding: 0 6px; }

.avancee { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .8rem; color: var(--doux); margin: 4px 0 6px; }
.avancee b { color: var(--encre); }

.carte {
  --u: var(--accent);
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  min-height: 300px; padding: 22px 18px 20px; text-align: center;
  background: var(--panneau); border: 1.5px solid var(--trait); border-top: 6px solid var(--u);
  border-radius: var(--r-xl); box-shadow: var(--sh-2);
  cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: pan-y;
}
.carte:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.carte.verso { align-items: stretch; justify-content: flex-start; text-align: left; -webkit-user-select: text; user-select: text; cursor: default; background: linear-gradient(180deg, var(--panneau), var(--panneau-2)); }
.carte .etiquettes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.carte.verso .etiquettes { justify-content: flex-start; }
.etiq { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--panneau-2); border: 1px solid var(--trait); font-size: .72rem; font-weight: 700; letter-spacing: .02em; color: var(--encre); }
.etiq .point { margin-right: 6px; }
.carte .terme { font-family: var(--police-titre); font-size: 1.7rem; line-height: 1.2; font-weight: 600; overflow-wrap: anywhere; }
.carte.verso .terme { font-size: 1.15rem; }
.carte .consigne { font-size: .8rem; color: var(--doux); }
.carte .def { white-space: pre-line; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
.carte .liens { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.carte .liens a { color: var(--accent-fort); font-weight: 700; font-size: .88rem; min-height: 44px; display: inline-flex; align-items: center; }
.carte .attente { color: var(--doux); font-size: .92rem; }

@keyframes tourne-sortie { to { transform: rotateY(90deg); opacity: .4; } }
@keyframes tourne-entree { from { transform: rotateY(-90deg); opacity: .4; } }
.carte.tourne-1 { animation: tourne-sortie .15s ease-in forwards; }
.carte.tourne-2 { animation: tourne-entree .17s ease-out; }

.nav-cartes { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 8px; margin-top: 12px; }
.nav-cartes .btn-2, .nav-cartes .btn-1 { min-height: 52px; padding: 0 8px; font-size: .95rem; }
.actions-carte { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; margin-top: 6px; }
.actions-carte .btn-lien { padding: 0 10px; }
.actions-carte .btn-lien[aria-pressed="true"] { color: var(--encre); }

/* Réviser : deux gros boutons après le retournement. */
.note-carte { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.note-carte button { min-height: 60px; border-radius: var(--r-lg); font-weight: 800; font-size: 1rem; border: 2px solid var(--trait); background: var(--panneau); }
.note-carte .rate { border-color: var(--alerte); color: var(--alerte); background: var(--alerte-clair); }
.note-carte .sais { border-color: var(--ok); color: var(--ok); background: var(--panneau); }
.note-carte button:active { transform: translateY(1px); }
.boites { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 14px; }
.boite { padding: 10px 4px; text-align: center; border-radius: var(--r-md); background: var(--panneau-2); border: 1.5px solid var(--trait); }
.boite b { display: block; font-size: 1.3rem; line-height: 1.1; }
.boite small { display: block; font-size: .68rem; color: var(--doux); font-weight: 700; margin-top: 3px; line-height: 1.2; }
.boite.b1 { border-color: var(--alerte); }
.boite.b3 { border-color: var(--ok); }
.bilan { text-align: center; padding: 8px 0 4px; }
.bilan .gros { font-family: var(--police-titre); font-size: 2.2rem; line-height: 1.1; margin: 6px 0; }

/* Le quiz. */
.quiz-enonce { background: var(--panneau-2); border-left: 5px solid var(--u, var(--accent)); border-radius: var(--r-md); padding: 14px 14px 14px 16px; font-size: 1rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; margin: 8px 0 12px; }
.quiz-question { font-weight: 700; margin: 10px 0 4px; }
.quiz-choix { display: grid; gap: 8px; list-style: none; }
.quiz-choix button { width: 100%; text-align: left; min-height: 56px; padding: 10px 14px; border-radius: var(--r-md); border: 2px solid var(--trait); background: var(--panneau); font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; display: flex; align-items: center; gap: 10px; }
.quiz-choix .lettre { flex: 0 0 auto; width: 28px; height: 28px; border-radius: var(--r-pill); background: var(--panneau-2); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; }
.quiz-choix button:active { border-color: var(--accent); }
.quiz-choix button.juste { border-color: var(--ok); background: var(--panneau-2); }
.quiz-choix button.faux { border-color: var(--alerte); background: var(--alerte-clair); }
.quiz-choix button[disabled] { opacity: 1; cursor: default; }
.quiz-suite { margin-top: 12px; }
.explication { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--accent-clair); font-size: .95rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }

/* Lignes de liste : un petit bouton à côté (étoile). */
.ligne-double { display: flex; gap: 8px; align-items: stretch; }
.ligne-double .item { flex: 1 1 auto; min-width: 0; }
.etoile { width: 52px; height: 52px; min-height: 52px; font-size: 22px; align-self: center; }
.etoile[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-clair); }
.vue-ok { color: var(--ok); font-weight: 800; }

/* Plus : réglages. */
.reglage { display: grid; gap: 6px; margin-bottom: 14px; }
.reglage label { font-weight: 700; font-size: .9rem; }
.lien-partage { width: 100%; font-size: .78rem; padding: 10px 12px; min-height: 0; height: 72px; resize: none; font-family: ui-monospace, monospace; }
.signature { display: flex; align-items: center; justify-content: flex-start; gap: 12px; margin: 0 0 4px; padding: 2px 12px 8px; border-radius: var(--r-md); color: var(--doux); text-decoration: none; }
.signature:hover, .signature:focus-visible { background: var(--panneau-2); }
.signature img { flex: 0 0 auto; }
.note.note-infos { font-size: .92rem; line-height: 1.5; }
.signature-txt { display: flex; flex-direction: column; line-height: 1.3; font-size: .92rem; }
.signature-txt b { color: var(--encre); font-family: var(--police-titre); font-size: 1.05rem; }
.signature-txt small { font-size: .8rem; }
.maj-appli + .signature { margin-top: 2px; }

@media (max-width: 359px) {
  .carte .terme { font-size: 1.45rem; }
  .boites { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tiroir:empty { display: none; } .tiroir { margin-top: 8px; }
.outils-etude { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--trait); }

/* La croix de fermeture ne rétrécit pas quand le titre d'un univers est long. */
.feuille-fermer { flex: 0 0 44px; }
.feuille-tete h2 { min-width: 0; overflow-wrap: anywhere; }
