/* Pages /exercices (HTML statique) : mêmes jetons que les pages publiques « Aventure » (public-aventure.css). */
@font-face { font-family: 'Baloo 2'; font-weight: 800; font-display: swap; src: url(/fonts/baloo-2/baloo-2-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-weight: 700; font-display: swap; src: url(/fonts/baloo-2/baloo-2-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url(/fonts/nunito/nunito-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url(/fonts/nunito/nunito-latin-800-normal.woff2) format('woff2'); }

:root {
  --bg: #fffaf3;
  --paper: #fff;
  --ink: #221a42;
  --ink-soft: #5d5779;
  --line: #ece4f4;
  --brand: #5b35dc;
  --brand-strong: #4a26c4;
  --brand-soft: #f1edff;
  --nina: #e0457b;
  --ok: #0f7a55;
  --ok-soft: #dcf7ea;
  --ko: #b4232f;
  --ko-soft: #ffe4e6;
  --sun-soft: #fff1d1;
  --display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.05rem/1.6 var(--body); }
a { color: var(--brand); }
img { max-width: 100%; height: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr-focus:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 10; background: #fff; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.ea-entete { background: rgba(255, 250, 243, 0.95); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.ea-entete__in, .ea-pied__in, .ea-page { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.ea-entete__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.ea-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font: 800 1.25rem var(--display); }
.ea-logo b { color: var(--brand); }
.ea-entete nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ea-entete nav a { text-decoration: none; font-weight: 800; color: var(--ink); }

.ea-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--brand); color: #fff !important; font: 800 1rem var(--body); text-decoration: none; cursor: pointer; }
.ea-btn:hover { background: var(--brand-strong); }
.ea-btn--petit { min-height: 38px; padding: 0 14px; font-size: 0.92rem; }
.ea-btn--doux { background: var(--brand-soft); color: var(--brand) !important; }
.ea-btn--doux:hover { background: #e4dcff; }

.ea-fil ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 16px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.ea-fil li + li::before { content: '›'; margin-right: 4px; }
.ea-tete { padding: 12px 0 8px; }
.ea-surtitre { margin: 8px 0 0; color: var(--brand); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 6px 0 10px; }
h2 { font-size: 1.5rem; margin: 32px 0 12px; }
.ea-mini { font-size: 1.1rem; margin: 16px 0 6px; }
.ea-chapo { font-size: 1.12rem; color: var(--ink-soft); margin: 0 0 8px; }
.ea-objectifs { margin: 0; padding-left: 1.2rem; color: var(--ink-soft); }
.ea-boutons { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }

.ea-retenir { background: var(--sun-soft); border-radius: 20px; padding: 4px 20px 12px; margin-top: 24px; }
.ea-regle h3 { margin: 14px 0 2px; font-size: 1.1rem; }
.ea-regle p { margin: 0 0 8px; }

.ea-consigne { color: var(--ink-soft); margin-top: 0; }
.exo { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; margin: 14px 0; box-shadow: 0 10px 24px -18px rgba(60, 40, 120, 0.3); }
.exo-titre { font-family: var(--body); font-size: 1.08rem; font-weight: 800; margin: 0 0 12px; line-height: 1.45; }
.exo-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 0.95rem; margin-right: 6px; }
.exo-phrase, .exo-sous { display: block; font-weight: 400; margin-top: 6px; }
.exo-cartes { display: flex; flex-wrap: wrap; gap: 8px; }
.exo-carte { position: relative; }
.exo-carte input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.exo-carte span { display: inline-flex; min-height: 44px; align-items: center; padding: 6px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-weight: 800; }
.exo-carte input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.exo-carte input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.exo-ligne { margin: 8px 0; line-height: 2.4; }
.exo-saisie, .exo-choix { font: 800 1.05rem var(--body); min-height: 40px; padding: 4px 8px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); max-width: 100%; }
.exo-saisie:not(.exo-trou) { width: min(240px, 100%); }
.exo-juste { border-color: var(--ok) !important; background: var(--ok-soft) !important; }
.exo-faux { border-color: var(--ko) !important; background: var(--ko-soft) !important; }
.exo-gauche { font-weight: 800; }
.exo-imp { display: none; }
.exo-tri { border-collapse: collapse; width: 100%; max-width: 100%; display: block; overflow-x: auto; }
.exo-tri th, .exo-tri td { border-bottom: 1px solid var(--line); padding: 6px 10px; text-align: center; }
.exo-tri tbody th { text-align: left; font-weight: 800; }
.exo-tri thead th { font-size: 0.92rem; color: var(--ink-soft); }
.exo-tri input { width: 22px; height: 22px; accent-color: var(--brand); }
.exo-tri tr.exo-juste th { color: var(--ok); }
.exo-tri tr.exo-faux th { color: var(--ko); }
.exo-mot { font: 800 1.05rem var(--body); min-height: 40px; padding: 2px 8px; border: 2px dashed transparent; border-radius: 10px; background: #f6f3fc; color: var(--ink); cursor: pointer; }
.exo-mot[aria-pressed='true'] { border-color: var(--brand); background: var(--brand-soft); }
.exo-ecouter { border: 0; background: var(--brand-soft); border-radius: 50%; width: 36px; height: 36px; cursor: pointer; font-size: 1.05rem; vertical-align: middle; }
.exo-indice summary { cursor: pointer; color: var(--brand); font-weight: 800; margin-top: 10px; }
.exo-indice p { margin: 6px 0 0; color: var(--ink-soft); }
.exo-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.exo-verifier { min-height: 42px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--brand); background: #fff; color: var(--brand); font: 800 1rem var(--body); cursor: pointer; }
.exo-retour { margin: 0; font-weight: 800; }
.exo-retour--ok { color: var(--ok); }
.exo-retour--ko { color: var(--ko); }
.exo-correction { margin-top: 10px; padding: 10px 14px; border-radius: 14px; background: #f8f6fd; }
.exo-correction p { margin: 4px 0; }
.exo-reponse { font-weight: 800; }
.ea-score { font-weight: 800; color: var(--brand); font-size: 1.1rem; }

.ea-corrige { margin: 24px 0; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; }
.ea-corrige summary, .ea-faq summary { cursor: pointer; font-weight: 800; }
.ea-corrige li { margin: 6px 0; }
.ea-corrige__why { color: var(--ink-soft); }

.ea-cta { display: flex; gap: 18px; align-items: center; background: linear-gradient(120deg, #f1edff, #ffe4ef); border-radius: 24px; padding: 18px 22px; margin: 32px 0; }
.ea-cta h2 { margin: 4px 0 6px; font-size: 1.35rem; }
.ea-cta p { margin: 0 0 12px; }
.ea-cta img { flex: none; width: 120px; }

.ea-faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 8px 0; }
.ea-faq p { margin: 8px 0 0; color: var(--ink-soft); }
.ea-voisins ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.ea-voisins a { display: block; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 800; }
.ea-voisins a span { color: var(--ink-soft); font-weight: 400; font-size: 0.9rem; }

.ea-groupe h2 a { text-decoration: none; color: var(--ink); }
.ea-cartes { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ea-carte { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); }
.ea-carte:hover { border-color: var(--brand); }
.ea-carte__titre { font-weight: 800; }
.ea-carte__info { color: var(--ink-soft); font-size: 0.9rem; }
.ea-lien-fort { font-weight: 800; }

.ea-pied { margin-top: 48px; border-top: 1px solid var(--line); padding: 20px 0 32px; font-size: 0.92rem; color: var(--ink-soft); }
.ea-pied a { color: var(--ink-soft); }

@media (max-width: 600px) {
  .ea-entete { position: static; }
  .ea-entete__in { padding-top: 6px; padding-bottom: 6px; }
  .ea-entete nav { gap: 10px; }
  .ea-entete nav a:not(.ea-btn) { font-size: 0.92rem; }
  .ea-cta { flex-direction: column; text-align: center; }
  .exo { padding: 14px; }
}

/* La fiche imprimée : exercices à remplir au crayon, puis le corrigé sur une nouvelle page. */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11.5pt; }
  .ea-entete, .ea-pied, .ea-fil, .ea-boutons, .ea-cta, .ea-faq, .ea-voisins, .exo-actions, .exo-indice, .exo-correction, .ea-consigne, .ea-score, .exo-ecouter, .sr-focus { display: none !important; }
  .ea-retenir { background: none; border: 1.5px solid #999; }
  .exo { box-shadow: none; border: 0; border-bottom: 1px solid #ccc; border-radius: 0; padding: 8px 0; margin: 0; break-inside: avoid; }
  .exo-num { background: none; color: #000; border: 1.5px solid #000; }
  .exo-carte input { display: none; }
  .exo-carte span { min-height: 0; padding: 2px 10px; border: 1.5px solid #555; }
  .exo-carte span::before { content: '☐ '; }
  .exo-saisie { border: 0; border-bottom: 1.5px dotted #000; border-radius: 0; background: none; min-height: 0; }
  .exo-saisie:not(.exo-trou) { width: 60mm; }
  .exo-choix { display: none; }
  .exo-imp { display: inline; }
  .exo-mot { background: none; border: 0; padding: 0 2px; }
  .exo-tri input { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; border: 1.5px solid #000; }
  .ea-corrige { break-before: page; border: 0; padding: 0; }
  .ea-corrige summary { font: 800 16pt var(--display); list-style: none; }
  .ea-corrige summary::-webkit-details-marker { display: none; }
  .exo-juste, .exo-faux { background: none !important; border-color: #000 !important; }
}
