/* ============================================================================
   AONOH DESIGN SYSTEM — direction artistique « L'aventure de lecture »
   ============================================================================
   Chargé APRÈS style.css. Phase pilote : il n'habille QUE les 3 écrans pilotes
   (body.ds-accueil, body.mode-focus = séance, body.ds-biblio) + le composant
   renard. Le reste de l'app garde son rendu actuel jusqu'à validation.

   Principes :
   - L'espace ENFANT vit sur un fond PAPIER CHAUD (crème) qui répond au pelage
     du renard ; l'espace PARENT restera marine/blanc, sobre (phase 4).
   - Une seule couleur d'ACTION : le bleu #3569D4. Le jaune = étoiles et
     récompenses, le vert = réussite et progression, le rose = coups de cœur.
   - UNE scène par écran : une grande composition, peu de cartes, de l'air.
   - Le renard est un PERSONNAGE (pose + bulle + état), pas une décoration.
   ========================================================================== */

:root {
  /* palette rationalisée */
  --ds-bleu: #3569D4; --ds-bleu-d: #2A54AC; --ds-bleu-p: #E8F0FE;
  --ds-marine: #202A44;
  --ds-vert: #42B883; --ds-vert-p: #E4F6ED;
  --ds-jaune: #F2A63B; --ds-jaune-p: #FDF0DC;
  --ds-rose: #D0457A; --ds-rose-p: #FAE8F0;
  /* le papier chaud de l'espace enfant */
  --ds-papier: #FFF9F0; --ds-papier-2: #FBF1E2;
  --ds-carte: #FFFFFF; --ds-ligne: #F0E4D2;
  --ds-encre: #2B3042; --ds-encre-2: #70655A;
  /* échelle d'espacement : 4 / 8 / 12 / 16 / 24 / 32 / 48 */
  --ds-r: 22px; --ds-r-s: 14px;
  --ds-ombre: 0 10px 30px rgba(146, 104, 43, .10);
  --ds-ombre-s: 0 4px 14px rgba(146, 104, 43, .08);
}

/* ---------- fond papier + typo des écrans pilotes ---------- */
body.ds-accueil, body.ds-biblio, body.mode-focus {
  background: linear-gradient(180deg, var(--ds-papier) 0%, var(--ds-papier-2) 100%);
}
body.ds-accueil main#view, body.ds-biblio main#view, body.mode-focus main#view {
  color: var(--ds-encre);
}
body.ds-accueil h1, body.ds-biblio h1, body.mode-focus h1 { letter-spacing: -.3px; }

/* états interactifs soignés, partout (inoffensif hors pilotes) */
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--ds-jaune); outline-offset: 2px; border-radius: 10px;
}
.btn:active, .ds-cta:active, .pill-onglet:active { transform: scale(.97); }

/* ============================================================
   LE RENARD — composant mascotte à états
   poses img/mascotte-*.png : pointe, lit, bravo, encourage,
   reflechit, astuce, defi. États : .celebre (réussite),
   .encourage (petit rebond doux).
   ============================================================ */
.renard { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.renard img { display: block; filter: drop-shadow(0 10px 14px rgba(146, 104, 43, .25)); }
.renard-l img { width: 180px; } .renard-m img { width: 120px; } .renard-s img { width: 76px; }
@keyframes renard-idle { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
.renard img { animation: renard-idle 4.5s ease-in-out infinite; }
@keyframes renard-pop { 0% { transform: scale(1) } 30% { transform: scale(1.14) rotate(-4deg) } 60% { transform: scale(.96) rotate(2deg) } 100% { transform: scale(1) } }
.renard.celebre img { animation: renard-pop .7s ease; }
@keyframes renard-nod { 0%, 100% { transform: translateY(0) } 40% { transform: translateY(4px) } }
.renard.encourage img { animation: renard-nod .5s ease 2; }
/* la bulle du renard */
.renard-bulle { position: relative; background: #fff; border: 2px solid var(--ds-ligne);
  border-radius: 16px; padding: 10px 14px; font-weight: 800; color: var(--ds-marine);
  font-size: 15px; max-width: 230px; box-shadow: var(--ds-ombre-s); }
.renard-bulle::after { content: ''; position: absolute; bottom: -10px; left: 34px;
  border: 10px solid transparent; border-top-color: #fff; border-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
  .renard img, .renard.celebre img, .renard.encourage img { animation: none !important; }
  * { transition-duration: .01ms !important; }
}

/* ============================================================
   ÉCRAN PILOTE 1 — ACCUEIL ENFANT : une scène, un objectif
   ============================================================ */
.ds-page { max-width: 1060px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* — le héros : la mission du jour, le renard qui la présente — */
.ds-hero { position: relative; display: flex; align-items: center; gap: 24px;
  background:
    radial-gradient(640px 240px at 86% 110%, rgba(242, 166, 59, .18), transparent 60%),
    linear-gradient(135deg, #FFFFFF 0%, #FFF4E2 100%);
  border: 1px solid var(--ds-ligne); border-radius: 28px; padding: 30px 34px;
  box-shadow: var(--ds-ombre); overflow: visible; }
.ds-hero-txt { flex: 1; min-width: 0; }
.ds-bonjour { font-size: clamp(26px, 3.2vw, 36px); font-weight: 900; color: var(--ds-marine); margin: 0; }
.ds-sous { margin: 4px 0 14px; color: var(--ds-encre-2); font-size: 16.5px; font-weight: 700; }
.ds-plan { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.ds-plan-etape { display: inline-flex; align-items: center; gap: 7px; background: #fff;
  border: 1.5px solid var(--ds-ligne); border-radius: 999px; padding: 7px 13px;
  font-size: 14px; font-weight: 800; color: var(--ds-marine); }
.ds-plan-etape .num { display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; border-radius: 50%; background: var(--ds-jaune); color: #fff; font-size: 12.5px; }
.ds-plan-min { font-size: 13.5px; color: var(--ds-encre-2); font-weight: 800; }
.ds-cta { display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer;
  background: linear-gradient(180deg, #4478E2, var(--ds-bleu)); color: #fff;
  font-family: inherit; font-size: 19px; font-weight: 900; padding: 16px 30px;
  border-radius: 999px; box-shadow: 0 10px 22px rgba(53, 105, 212, .35), inset 0 1.5px 0 rgba(255,255,255,.35);
  transition: transform .12s, box-shadow .12s; }
.ds-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(53, 105, 212, .4), inset 0 1.5px 0 rgba(255,255,255,.35); }
.ds-hero-aside { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: -8px; }
.ds-hero .renard-bulle { margin-bottom: 2px; }
.ds-hero-sub { display: flex; gap: 14px; align-items: center; margin-top: 12px; }
.ds-mode { font-size: 13.5px; color: var(--ds-encre-2); font-weight: 700; }
.ds-mode button { border: 0; background: transparent; font: inherit; color: var(--ds-bleu); cursor: pointer; font-weight: 800; }

/* — duo : mon livre + ma progression — */
.ds-duo { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.ds-carte { background: var(--ds-carte); border: 1px solid var(--ds-ligne); border-radius: var(--ds-r);
  box-shadow: var(--ds-ombre-s); padding: 20px 22px; }
.ds-carte h3 { margin: 0 0 10px; color: var(--ds-marine); font-size: 17px; }
.ds-livre-ligne { display: flex; align-items: center; gap: 16px; }
.ds-cover { width: 64px; height: 84px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; background: linear-gradient(160deg, #FFF4E2, #FBE4C4); border: 1px solid var(--ds-ligne);
  box-shadow: inset -5px 0 0 rgba(146, 104, 43, .12); }
.ds-livre-ligne b { font-size: 17px; color: var(--ds-marine); }
.ds-stats { display: flex; gap: 10px; }
.ds-stat { flex: 1; text-align: center; background: var(--ds-papier); border: 1px solid var(--ds-ligne);
  border-radius: var(--ds-r-s); padding: 12px 8px 10px; }
.ds-stat b { display: block; font-size: 24px; color: var(--ds-marine); }
.ds-stat span { font-size: 12.5px; color: var(--ds-encre-2); font-weight: 700; }
.ds-stat.ds-stat-j b { color: var(--ds-jaune); }
.ds-stat.ds-stat-v b { color: var(--ds-vert); }

/* — bande défi / mission : UNE ligne discrète — */
.ds-strip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--ds-vert-p); border: 1px solid #CDEBDC; border-radius: var(--ds-r-s);
  padding: 12px 18px; font-size: 14.5px; font-weight: 700; color: #1D6B48; }
.ds-strip .sep { opacity: .4; }
.ds-strip.fait { background: var(--ds-jaune-p); border-color: #F2DDB8; color: #8A5B13; }

/* — 3 tuiles d'accès, pas plus — */
.ds-tuiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ds-tuile { display: flex; align-items: center; gap: 12px; background: var(--ds-carte);
  border: 1px solid var(--ds-ligne); border-radius: var(--ds-r-s); padding: 15px 18px;
  cursor: pointer; font-family: inherit; font-size: 15.5px; font-weight: 800; color: var(--ds-marine);
  box-shadow: var(--ds-ombre-s); transition: transform .12s, box-shadow .12s; text-align: left; }
.ds-tuile:hover { transform: translateY(-2px); box-shadow: var(--ds-ombre); }
.ds-tuile .ico { display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 13px; font-size: 21px; flex: 0 0 42px; }
.ds-tuile .ico.b { background: var(--ds-bleu-p); } .ds-tuile .ico.j { background: var(--ds-jaune-p); }
.ds-tuile .ico.r { background: var(--ds-rose-p); } .ds-tuile .ico.v { background: var(--ds-vert-p); }
.ds-tuile small { display: block; font-size: 12.5px; color: var(--ds-encre-2); font-weight: 700; }

/* habillage par âge : CM1-CM2 = moins « petit enfant » */
body.age-cm .ds-hero { background: linear-gradient(135deg, #FFFFFF 0%, #F2F5FC 100%); }
body.age-cm .ds-hero-aside .renard-l img { width: 120px; }
body.age-cm .renard-bulle { display: none; }

@media (max-width: 900px) {
  .ds-hero { flex-direction: column-reverse; text-align: center; padding: 22px 18px; gap: 8px; }
  .ds-plan { justify-content: center; }
  .ds-hero-sub { justify-content: center; }
  .ds-duo, .ds-tuiles { grid-template-columns: 1fr; }
  .ds-cta { width: 100%; justify-content: center; }
}

/* ============================================================
   ÉCRAN PILOTE 2 — LA SÉANCE : mode concentration + scène
   ============================================================ */
body.mode-focus #nav, body.mode-focus #fabs, body.mode-focus #debug-badge,
body.mode-focus #tiroir, body.mode-focus #tiroir-fond { display: none !important; }
body.mode-focus .topbar { padding: 10px 22px 0; }
body.mode-focus main#view { padding-top: 4px; }
body.mode-focus.menu-refuge #nav { display: flex !important; position: fixed; left: 12px; top: 12px;
  bottom: 12px; height: auto; z-index: 70; margin: 0; box-shadow: 0 20px 60px rgba(30, 20, 8, .45); }
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  body.mode-focus.menu-refuge #nav { left: 8px; right: 8px; top: 8px; bottom: auto;
    max-height: 86vh; border-radius: 18px; }
  body.mode-focus.menu-refuge #nav .nav-groupe { display: flex; }
}

.scene { max-width: 860px; margin: 0 auto; }
.scene-haut { display: flex; align-items: center; gap: 14px; padding: 6px 2px 14px; }
.scene-quitte { border: 0; background: #fff; border: 1.5px solid var(--ds-ligne); color: var(--ds-encre-2);
  font-family: inherit; font-size: 14px; font-weight: 800; border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.scene-menu { margin-left: 0; }
.scene-quitte:hover { color: var(--ds-marine); border-color: #DCC9A8; }
.scene-prog { flex: 1; height: 14px; background: #F3E7D3; border-radius: 999px; overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(146, 104, 43, .15); }
.scene-prog i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--ds-jaune), #F7C56E); transition: width .4s ease; }
.scene-etape { font-size: 13.5px; font-weight: 900; color: var(--ds-encre-2); white-space: nowrap; }
.scene-mat { font-size: 13px; font-weight: 800; background: #fff; border: 1.5px solid var(--ds-ligne);
  color: var(--ds-marine); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.scene-corps { display: flex; gap: 18px; align-items: flex-start; }
.scene-renard { flex: 0 0 120px; position: sticky; top: 14px; display: flex; flex-direction: column;
  align-items: center; gap: 8px; padding-top: 26px; }
.renard-mot { font-size: 13.5px; font-weight: 800; color: var(--ds-encre-2); text-align: center;
  background: #fff; border: 1.5px solid var(--ds-ligne); border-radius: 12px; padding: 7px 10px; max-width: 120px; }
.renard-mot.ok { color: #1D6B48; background: var(--ds-vert-p); border-color: #CDEBDC; }
.renard-mot.ko { color: #8A5B13; background: var(--ds-jaune-p); border-color: #F2DDB8; }
.scene-carte { flex: 1; min-width: 0; }
/* la carte d'exercice devient une « scène de travail » */
body.mode-focus .carte-question { border-radius: 26px; border: 1px solid var(--ds-ligne);
  box-shadow: var(--ds-ombre); padding: 28px 30px 30px; }
body.mode-focus .consigne { font-size: 21px; font-weight: 800; color: var(--ds-marine); }
body.mode-focus .choix button { border-radius: 16px; border-width: 2px; font-size: 17.5px;
  padding: 15px 18px; transition: transform .1s, border-color .1s, background .1s; }
body.mode-focus .choix button:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--ds-bleu); }
body.mode-focus .choix button.bon { background: var(--ds-vert-p); border-color: var(--ds-vert); }
body.mode-focus .choix button.mauvais { background: var(--ds-jaune-p); border-color: var(--ds-jaune); }
body.mode-focus .feedback.ok { color: #1D6B48; }
body.mode-focus .feedback.ko { color: #8A5B13; }
@media (max-width: 760px) {
  .scene-haut { flex-wrap: wrap; gap: 10px; }
  .scene-prog { order: 9; flex: 1 0 100%; }
  .scene-corps { flex-direction: column; }
  .scene-renard { position: static; flex-direction: row; padding-top: 0; }
  .scene-renard .renard-m img { width: 66px; }
  .renard-mot { max-width: none; }
  body.mode-focus .carte-question { padding: 18px 16px 22px; }
}
/* pendant qu'on LIT (texte affiché), le renard se fait tout petit et immobile */
body.mode-focus .scene-lecture .scene-renard img { width: 66px; animation: none; }

/* ============================================================
   MA BIBLIOTHÈQUE — refonte handoff (01_bibliotheque.png)
   Tokens DESIGN_TOKENS.css fusionnés dans le système --ds-*
   (pas deux systèmes concurrents) : fond quasi blanc, cartes
   blanches r20, ombre légère, cibles tactiles ≥ 44 px.
   ============================================================ */
body.ds-biblio { background: #F7F8FC; }
.bib { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

/* — bandeau : la pièce chaleureuse du projet (vraie ressource img/) + renard — */
.bib-hero { position: relative; display: flex; align-items: center; justify-content: space-between;
  min-height: 170px; border-radius: 20px; overflow: hidden; padding: 24px 28px;
  background:
    linear-gradient(90deg, rgba(255, 250, 240, .94) 0%, rgba(255, 250, 240, .72) 46%, rgba(255, 250, 240, .05) 100%),
    url('../img/illus-bibliotheque.png') right center / cover no-repeat;
  border: 1px solid #E3E9F2; box-shadow: 0 10px 28px rgba(26, 48, 85, .08); }
.bib-hero-txt h1 { margin: 0 0 4px; color: var(--ds-marine); font-size: clamp(24px, 3vw, 32px); }
.bib-hero-txt p { margin: 0; color: #4A5571; font-weight: 800; }
.bib-hero-fox { display: flex; align-items: flex-end; gap: 10px; }
.bib-hero-fox .renard img { width: 120px; }
.bib-hero-fox .renard-bulle { font-size: 13.5px; max-width: 210px; margin-bottom: 26px; }
.bib-hero-fox .renard-bulle::after { left: auto; right: 30px; }

/* — recherche + action primaire — */
.bib-actions { display: flex; gap: 12px; align-items: stretch; }
.bib-search { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 48px;
  background: #fff; border: 1.5px solid #E3E9F2; border-radius: 999px; padding: 4px 18px;
  font-size: 16px; color: #617089; box-shadow: 0 4px 14px rgba(26, 48, 85, .05); }
.bib-search input { flex: 1; border: 0; outline: none; font: inherit; font-weight: 700;
  color: var(--ds-marine); background: transparent; min-width: 0; }
.bib-search input::placeholder { color: #93A0B8; font-weight: 600; }
.bib-add { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  border: 0; cursor: pointer; background: var(--ds-bleu); color: #fff; font-family: inherit;
  font-size: 15.5px; font-weight: 800; padding: 0 22px; border-radius: 14px;
  box-shadow: 0 8px 18px rgba(53, 105, 212, .3); transition: background .12s, transform .12s; }
.bib-add:hover { background: #2859BB; } .bib-add:active { transform: scale(.97); }

/* — filtres (une seule couleur d'action : le filtre actif est bleu) — */
.bib-filtres { display: flex; gap: 8px; flex-wrap: wrap; }
.bib-chip { min-height: 44px; border: 1.5px solid #E3E9F2; background: #fff; border-radius: 999px;
  padding: 0 18px; font-family: inherit; font-size: 14.5px; font-weight: 800; color: #4A5571; cursor: pointer; }
.bib-chip:hover { border-color: var(--ds-bleu); color: var(--ds-bleu); }
.bib-chip.actif { background: var(--ds-bleu); border-color: var(--ds-bleu); color: #fff; }
.bib-h2 { margin: 0; color: var(--ds-marine); font-size: 20px; }
.bib-count { color: #617089; font-size: 14px; font-weight: 800; }

/* — la grille de livres — */
.bib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 16px; }
.bib-carte { display: flex; flex-direction: column; background: #fff; border: 1px solid #E3E9F2;
  border-radius: 20px; overflow: hidden; cursor: pointer; text-align: left; font-family: inherit; padding: 0;
  box-shadow: 0 10px 28px rgba(26, 48, 85, .08); transition: transform .14s, box-shadow .14s; }
.bib-carte:hover { transform: translateY(-4px); box-shadow: 0 16px 32px rgba(26, 48, 85, .13); }
.bib-cover { position: relative; aspect-ratio: 4 / 5; background: #EDF2FA; }
.bib-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bib-coeur { position: absolute; top: 8px; right: 8px; background: #fff; border-radius: 50%;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; box-shadow: 0 2px 8px rgba(26, 48, 85, .2); }
.bib-carte-bas { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.bib-titre { font-weight: 800; color: var(--ds-marine); font-size: 14.5px; line-height: 1.25;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bib-auteur { font-size: 12.5px; color: #617089; font-weight: 700; }
.bib-statut { align-self: flex-start; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; }
.bib-statut.st-en_cours { background: #E8F0FE; color: #2859BB; }
.bib-statut.st-termine { background: #E4F6ED; color: #1D6B48; }
.bib-statut.st-a_lire { background: #FDF0DC; color: #8A5B13; }
.bib-note { color: var(--ds-jaune); font-size: 13px; font-weight: 800; }
.bib-prog { height: 7px; background: #EDF2FA; border-radius: 999px; overflow: hidden; }
.bib-prog i { display: block; height: 100%; background: var(--ds-vert); border-radius: 999px; }
.bib-pct { font-size: 11.5px; font-weight: 800; color: #617089; }
.bib-pct span { font-weight: 600; }
.bib-ajout { border-style: dashed; border-width: 2px; border-color: #C4D2E8; box-shadow: none;
  background: transparent; align-items: center; justify-content: center; }
.bib-ajout:hover { border-color: var(--ds-bleu); }
.bib-cover-plus { display: flex; align-items: center; justify-content: center; font-size: 36px;
  color: #93A0B8; background: transparent; width: 100%; }
.bib-ajout .bib-titre { text-align: center; color: #4A5571; }

/* — états vides — */
.bib-vide { text-align: center; background: #fff; border: 1px solid #E3E9F2; border-radius: 20px;
  padding: 34px 18px; box-shadow: 0 10px 28px rgba(26, 48, 85, .08); }
.bib-vide .renard img { width: 130px; }
.bib-vide h3 { margin: 10px 0 4px; color: var(--ds-marine); font-size: 21px; }
.bib-vide p { margin: 0 0 16px; color: #617089; font-weight: 700; }
.bib-vide-filtre { padding: 22px; }
.bib-prive { font-size: 12.5px; color: #93A0B8; font-weight: 700; margin: 14px 0 0; }

/* — « À découvrir » : honnête (pas de faux livres) — */
.bib-decouvrir { background: #fff; border: 1px solid #E3E9F2; border-radius: 20px; padding: 18px 22px;
  box-shadow: 0 10px 28px rgba(26, 48, 85, .08); }
.bib-soon { margin: 6px 0 10px; color: #4A5571; font-weight: 700; font-size: 14.5px; }
.bib-pistes { display: flex; gap: 8px; flex-wrap: wrap; }
.bib-pistes span { background: #F2F6FD; border: 1px solid #E3E9F2; border-radius: 999px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 800; color: var(--ds-marine); }

/* — formulaire d'ajout (fenêtre) — */
.pl-form { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.pl-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; font-weight: 800; color: var(--ds-marine); }
.pl-form input { min-height: 44px; border: 1.5px solid #E3E9F2; border-radius: 12px; padding: 0 14px;
  font: inherit; font-weight: 700; color: var(--ds-marine); width: 100%; box-sizing: border-box; }
.pl-form input:focus { border-color: var(--ds-bleu); outline: none; }
.pl-req { color: var(--ds-rose); }
.pl-section { font-size: 14px; color: var(--ds-marine); margin-top: 4px; }
.pl-puces { display: flex; gap: 8px; flex-wrap: wrap; }
.pl-puce { min-height: 44px; flex: 1; min-width: 110px; border: 1.5px solid #E3E9F2; background: #fff;
  border-radius: 14px; padding: 6px 10px; font-family: inherit; font-size: 13.5px; font-weight: 800;
  color: #4A5571; cursor: pointer; }
.pl-puce.actif { background: #E8F0FE; border-color: var(--ds-bleu); color: #2859BB; }

/* — responsive : 390 / 768 / 1440 — */
@media (max-width: 760px) {
  .bib { gap: 12px; }
  .bib-hero { padding: 18px; min-height: 0; }
  .bib-hero-fox .renard img { width: 84px; }
  .bib-hero-fox .renard-bulle { display: none; }
  .bib-actions { flex-direction: column; }
  .bib-add { min-height: 48px; }
  .bib-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
}

/* en mode focus, le renard de la SCÈNE suffit : l'ancien petit renard de la
   carte d'exercice disparaît (doublon) */
body.mode-focus .masc-seance { display: none; }

/* mobile : la scène ne doit JAMAIS faire défiler horizontalement */
@media (max-width: 760px) {
  body.mode-focus .scene, body.mode-focus .scene-carte { min-width: 0; max-width: 100%; }
  body.mode-focus .carte-question { overflow-x: hidden; }
  body.mode-focus .lire-grand { flex-wrap: wrap; justify-content: center; }
  body.mode-focus .mot-lire { font-size: 26px; padding: 7px 12px; letter-spacing: 1px; }
  body.mode-focus .consigne { font-size: 18px; }
}
body.mode-focus main#view { overflow-x: hidden; }

/* ---- une fenêtre modale ne sort JAMAIS du cadre : hauteur plafonnée à
   l'écran + défilement interne (le formulaire « Ajouter un livre » est haut) ---- */
.dico-pop { padding: 14px; box-sizing: border-box; }
.dico-carte { max-height: calc(100vh - 28px); overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#app-modal .dico-carte:has(.pl-form) { max-width: 470px; text-align: left; }

/* ============================================================
   ACCUEIL « REFUGE » plein écran — LE DÉCOR EST L'INTERFACE
   (pas de sidebar, pas de cards : une scène, un CTA, 4 objets
   lumineux qui naviguent ; labels au survol/focus)
   ============================================================ */
body.ds-accueil #nav, body.ds-accueil #fabs, body.ds-accueil #debug-badge,
body.ds-accueil #tiroir, body.ds-accueil #tiroir-fond { display: none !important; }
body.ds-accueil main#view { padding: 0; max-width: none; margin: 0; width: 100%; }
body.ds-accueil .topbar { position: fixed; top: 0; right: 0; left: 0; z-index: 30;
  padding: 14px 18px; pointer-events: none; background: none; }
body.ds-accueil .nav-profil { pointer-events: auto; margin-left: auto;
  background: rgba(255, 252, 245, .85); box-shadow: 0 2px 10px rgba(74, 47, 8, .2); }

.refuge { position: relative; min-height: 100vh; overflow: hidden;
  background: url('../img/home-refuge-background-desktop.png') center / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .22s ease, transform .22s ease; }
.refuge-depart { opacity: 0; transform: scale(1.04); }
.refuge-logo { position: absolute; top: 14px; left: 20px; z-index: 3; }
.refuge-logo img { height: 50px; width: auto; filter: drop-shadow(0 2px 6px rgba(74, 47, 8, .35)); }
.refuge-fox { position: absolute; left: 3%; bottom: 0; width: 24%; max-width: 360px; z-index: 2; pointer-events: none; }
.refuge-fox img { width: 100%; display: block; animation: renard-idle 5.5s ease-in-out infinite; }
body.age-cm .refuge-fox { width: 17%; }

.refuge-centre { position: relative; z-index: 2; text-align: center; max-width: 560px;
  margin-left: 4%; padding: 0 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.refuge-centre h1 { margin: 0; font-size: clamp(30px, 3.6vw, 46px); font-weight: 900; color: #3C2607;
  text-shadow: 0 1px 0 rgba(255, 248, 236, .85), 0 3px 18px rgba(255, 244, 222, .8); }
.refuge-mission { margin: 0; font-size: clamp(16px, 1.7vw, 21px); font-weight: 800; color: #5A3C12;
  text-shadow: 0 1px 12px rgba(255, 244, 222, .9); }
.refuge-mission b { color: #3C2607; }
.refuge-duree { margin: 0 0 12px; font-size: 14.5px; font-weight: 800; color: #7A5A28;
  text-shadow: 0 1px 8px rgba(255, 244, 222, .9); }
.refuge-cta { border: 0; cursor: pointer; font-family: inherit; font-size: 19px; font-weight: 900;
  color: #3C2607; background: var(--ds-jaune); border-radius: 999px; padding: 16px 34px;
  box-shadow: 0 8px 20px rgba(74, 47, 8, .35), inset 0 1.5px 0 rgba(255, 255, 255, .45);
  transition: transform .12s, box-shadow .12s; }
.refuge-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(74, 47, 8, .4), inset 0 1.5px 0 rgba(255, 255, 255, .45); }
.refuge-cta:active { transform: scale(.97); }

/* — hotspots : un point de lumière SUR l'objet, label au survol/focus — */
.rf-spot { position: absolute; z-index: 3; background: none; border: 0; padding: 14px; cursor: pointer;
  transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; font-family: inherit; }
.rf-dot { width: 14px; height: 14px; border-radius: 50%; background: #FFE9B8; flex: 0 0 14px;
  animation: rf-lueur 2.6s ease-in-out infinite; }
@keyframes rf-lueur {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 233, 184, .35), 0 0 12px 3px rgba(255, 214, 130, .75); }
  50% { box-shadow: 0 0 0 6px rgba(255, 233, 184, .18), 0 0 20px 7px rgba(255, 214, 130, .95); }
}
.rf-lab { opacity: 1; transition: background .15s;
  background: rgba(40, 26, 8, .85); color: #FFF3DC; font-size: 13.5px; font-weight: 800;
  border-radius: 8px; padding: 5px 10px; white-space: nowrap; pointer-events: none; }
.rf-spot:hover .rf-lab, .rf-spot:focus-visible .rf-lab { background: rgba(40, 26, 8, .97); }
.rf-spot:focus-visible .rf-dot { outline: 3px solid var(--ds-jaune); outline-offset: 3px; }
/* positions calées sur le décor desktop */
.rf-bureau { left: 9%; top: 60%; }
.rf-carte  { left: 63%; top: 22%; }
.rf-biblio { left: 84%; top: 38%; }
.rf-coffre { left: 79%; top: 66%; }

@media (prefers-reduced-motion: reduce) {
  .rf-dot, .refuge-fox img { animation: none !important; }
  .refuge { transition: none; }
}
/* téléphone ET tablette en portrait : le décor « mobile » (vertical) garde la scène et ses objets */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .refuge { background-image: url('../img/home-refuge-background-mobile.png');
    align-items: flex-end; min-height: 100vh; min-height: 100dvh; }
  .refuge-centre { margin: 0 auto; padding-bottom: 46px; }
  .refuge-fox { width: 33%; bottom: auto; top: 31%; left: 2%; }
  .refuge-cta { width: min(92vw, 420px); }
  .refuge-logo img { height: 40px; }
  .rf-lab { opacity: 1; transform: none; font-size: 12px; padding: 4px 8px; } /* pas de survol au doigt */
  .rf-bureau { left: 13%; top: 57%; } .rf-carte { left: 58%; top: 40%; }
  .rf-biblio { left: 85%; top: 47%; } .rf-coffre { left: 70%; top: 63%; }
}

/* — le menu du refuge : un ☰ discret ouvre la navigation complète en panneau — */
.refuge-menu { position: absolute; top: 18px; left: 150px; z-index: 4; cursor: pointer;
  background: rgba(255, 252, 245, .85); border: 0; border-radius: 12px; height: 44px; padding: 0 14px;
  font-size: 16px; font-weight: 800; color: #3C2607; font-family: inherit; box-shadow: 0 2px 10px rgba(74, 47, 8, .2); }
.refuge-menu:hover { background: rgba(255, 252, 245, .97); }
.refuge-voile { display: none; }
body.menu-refuge .refuge-voile { display: block; position: fixed; inset: 0; z-index: 65;
  background: rgba(30, 20, 8, .45); }
body.ds-accueil.menu-refuge #nav { display: flex !important; position: fixed; left: 12px; top: 12px;
  bottom: 12px; height: auto; z-index: 70; margin: 0; box-shadow: 0 20px 60px rgba(30, 20, 8, .45); }
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
  .refuge-menu { left: auto; right: 16px; top: 64px; }
  body.ds-accueil.menu-refuge #nav { left: 8px; right: 8px; top: 8px; bottom: auto;
    max-height: 86vh; border-radius: 18px; }
  body.ds-accueil.menu-refuge #nav .nav-groupe { display: flex; }
}

/* — tablette & téléphone : les boutons flottants deviennent des pastilles
     rondes (icône seule) et ne recouvrent plus le contenu ; le badge de debug
     (doublon du bouton 🐞) disparaît — */
@media (max-width: 1100px) {
  #debug-badge { display: none !important; }
  #fabs { right: 10px; bottom: 12px; gap: 8px; flex-direction: row; }
  #fabs .fab-pill { width: 50px; height: 50px; padding: 0; border-radius: 50%; font-size: 22px;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
  #fabs .fab-txt { display: none; }
  body:not(.ds-accueil):not(.mode-focus) main#view { padding-bottom: 90px; }
}

/* home publique / landing : pas de boutons flottants ni de badge */
body.mode-landing #fabs, body.mode-landing #debug-badge { display: none !important; }
