/* La Ruche v5.49 — cahier multimédia (couleurs de La Ruche : jaune miel, crème, encre brune). */
:root { --fond: #FFFBEA; --encre: #2B241D; --doux: #7A6E4E; --line: #EFE3B8; --miel: #F5C21B; --miel-doux: #FFF3C2; --ambre: #9A6400; --ok: #2E7D4F;
  font-family: "Nunito Sans", "Segoe UI", Roboto, system-ui, sans-serif; color: var(--encre); }
* { box-sizing: border-box; }
html, body { margin: 0; background: #FFF6D6; }
button { font: inherit; cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid #1F5C8B; outline-offset: 2px; }
.etat { padding: 3rem; text-align: center; font-weight: 800; }
.cahier { position: relative; height: 100vh; height: 100dvh; padding: 18px 70px 18px 44px; }
.spirale { position: absolute; left: 22px; top: 44px; bottom: 44px; display: flex; flex-direction: column; justify-content: space-between; z-index: 2; }
.spirale span { display: block; width: 32px; height: 7px; border-radius: 4px; background: #4a4f58; }
.feuille { position: relative; height: 100%; background: #fff; border: 1px solid var(--line); border-radius: 24px; display: flex; flex-direction: column; overflow: hidden; padding: 16px 20px 18px 34px; }
.cahier[data-type="couverture"] .feuille { background: var(--miel); border: 0; box-shadow: 0 8px 0 #D9A400; padding: 28px 60px; }
.cahier[data-type="mission"] .feuille, .cahier[data-type="bravo"] .feuille { background: #fff repeating-linear-gradient(#fff 0 31px, #EFE6CC 31px 32px); }
.couverture { flex: 1; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.titre { background: #fff; border: 2px solid var(--encre); border-radius: 18px; padding: 10px 22px 12px; }
.titre .niveau { display: block; font-weight: 800; color: var(--doux); font-size: .85rem; border-bottom: 2px solid #EEE6CF; padding-bottom: 4px; }
.titre h1 { margin: 4px 0; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.15; font-weight: 800; }
.titre .sous { display: block; font-size: .95rem; color: var(--doux); border-top: 2px solid #EEE6CF; padding-top: 4px; }
.image { flex: 1; min-height: 0; background: #fff; border-radius: 22px; display: flex; align-items: center; justify-content: center; padding: 16px; }
.image img { max-height: 100%; max-width: 100%; object-fit: contain; }
.apercu table { border-collapse: collapse; font: 700 clamp(1.2rem, 3.2vw, 2.4rem) Andika, sans-serif; }
.apercu th, .apercu td { border: 2px solid #3a3a3a; padding: .15em .5em; text-align: center; }
.apercu th { background: var(--miel-doux); color: #C62828; }
.apercu.petit table { font-size: 1.1rem; }
.bas { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: .9rem; }
.logo img { height: 36px; width: 36px; background: #fff; border-radius: 10px; padding: 3px; }
.ouvrir, .commencer { background: var(--encre); color: #fff; border: 0; border-radius: 12px; padding: .6em 1.5em; font-weight: 800; font-size: 1.2rem; }
.tete { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 10px; }
.pastille { background: var(--miel); color: var(--encre); font-weight: 800; padding: .25em .9em; border-radius: 999px; }
.phrase { flex: 1; min-width: 12em; font-weight: 800; }
.nav { display: inline-flex; align-items: center; gap: .8rem; }
.avant { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .35em 1em; font-weight: 800; }
.num { font-size: .85rem; color: var(--doux); font-weight: 800; white-space: nowrap; }
.cadre { flex: 1; width: 100%; min-height: 0; border: 0; border-radius: 14px; background: var(--fond); margin-bottom: 44px; }
.coin { position: absolute; right: 0; bottom: 0; width: 96px; height: 96px; border: 0; background: transparent; padding: 0; }
.coin::after { content: ""; position: absolute; right: 0; bottom: 0; width: 76px; height: 76px; background: var(--miel); clip-path: polygon(100% 0, 100% 100%, 0 100%); border-bottom-right-radius: 24px; }
.coin span { position: absolute; right: 6px; top: -34px; width: 80px; font-size: .72rem; font-weight: 800; line-height: 1.1; text-align: center; }
.outils { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; align-content: center; padding: 0 3rem 60px; }
.outil { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2rem 1rem; background: #fffdf5; border: 1px solid var(--line); border-radius: 22px; text-align: center; }
.outil .ico { font-size: 3.6rem; }
.outil strong { font-size: 1.4rem; }
.mission { flex: 1; display: flex; flex-direction: column; gap: 1.1rem; padding: 1.6rem clamp(1rem, 6vw, 6rem) 0; overflow-y: auto; min-height: 0; }
.tampon { align-self: flex-start; background: var(--miel); font-weight: 800; font-size: clamp(1.7rem, 4.4vw, 3rem); padding: .1em .6em; border-radius: 12px; transform: rotate(-2deg); }
.mission-corps { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.boite { flex: 1; min-width: 16rem; background: #fff; border: 2px solid var(--encre); border-radius: 18px; padding: 1rem 1.5rem 1.1rem; }
.boite span { color: var(--ambre); font-weight: 800; }
.boite p { margin: .3rem 0 0; font-size: clamp(1.2rem, 2.4vw, 1.75rem); font-weight: 800; line-height: 1.35; }
.boite p.detail { font-size: 1rem; font-weight: 400; color: var(--doux); }
.mission-image { width: clamp(110px, 18vw, 190px); height: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.boutons { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.ecouter { background: var(--miel-doux); border: 2px solid var(--miel); border-radius: 12px; padding: .45em 1.2em; font-weight: 800; font-size: 1.1rem; }
.sans-voix .ecouter { display: none; }
.mission-bas { margin-top: auto; display: flex; align-items: center; gap: 1rem; padding-bottom: .5rem; }
.bravo { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; text-align: center; overflow-y: auto; }
.bravo .etoile { font-size: 4.5rem; line-height: 1; }
.bravo h1 { font-size: 2.8rem; margin: 0; }
.fait { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; max-width: 860px; max-height: 40vh; overflow: auto; }
.fait button { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: .25em .7em; font-size: .9rem; }
.fait button.vu { border-color: var(--ok); color: var(--ok); font-weight: 800; }
.marge { position: absolute; right: 8px; top: 18px; bottom: 18px; width: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.grand { position: absolute; top: 0; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; }
.onglet { writing-mode: vertical-rl; background: var(--miel); border: 0; border-radius: 0 14px 14px 0; padding: 1.6rem .55rem; font-weight: 800; margin-left: -8px; }
.etapes { position: absolute; right: 70px; top: 50%; transform: translateY(-50%); z-index: 5; display: grid; grid-template-columns: repeat(3, auto); gap: 6px; max-height: 88vh; overflow: auto; padding: 4px; }
.etapes[hidden] { display: none; }
.etapes button { background: var(--miel); border: 2px solid #fff; border-radius: 12px; padding: .3em .8em; font-weight: 800; text-align: left; font-size: .85rem; }
.etapes button small { display: block; font-weight: 400; }
.etapes button.ici { background: var(--encre); color: #fff; }
.etapes button.vu::after { content: " ✔"; }
@media (max-height: 640px) {
  .mission { gap: .6rem; padding-top: .8rem; } .tampon { font-size: 1.5rem; } .boite { padding: .6rem 1rem .8rem; } .boite p { font-size: 1.15rem; }
  .mission-image { width: 90px; }
}
@media (max-width: 700px) {
  .cahier { padding: 8px; } .spirale { display: none; } .feuille { padding: 12px; } .cahier[data-type="couverture"] .feuille { padding: 16px; }
  .marge { right: 12px; top: 12px; bottom: auto; width: auto; flex-direction: row; gap: 6px; z-index: 6; } .grand { position: static; }
  .onglet { writing-mode: horizontal-tb; border-radius: 12px; padding: .5rem .9rem; margin: 0; }
  .etapes { right: 12px; top: 64px; transform: none; grid-template-columns: repeat(2, auto); } .tete { padding-right: 9rem; } .mission { padding: 1rem .5rem 0; }
}
