/* =====================================================
   LILYA.FR — Design System v3
   ===================================================== */

:root {
  --bg:      #FDFAF4;
  --surface: #FFFFFF;
  --ink:     #0F0E0C;
  --ink-2:   #3D3A35;
  --muted:   #78726A;
  --border:  rgba(15,14,12,0.09);
  --bdr-str: rgba(15,14,12,0.18);

  --purple:   #6D28D9;
  --purple-d: #5B21B6;
  --purple-l: #F5F3FF;
  --purple-m: #8B5CF6;
  --purple-mm:#C4B5FD;

  --coral:   #E54D2E;
  --coral-d: #C2410C;
  --coral-l: #FFF4F2;

  --green: #059669; --green-l: #ECFDF5;
  --red:   #DC2626; --red-l:   #FEF2F2;

  --sh-xs: 0 1px 4px rgba(0,0,0,0.05);
  --sh-sm: 0 3px 12px rgba(0,0,0,0.07);
  --sh:    0 10px 32px rgba(0,0,0,0.09);
  --sh-lg: 0 24px 64px rgba(109,40,217,0.18);
  --sh-purple: 0 12px 40px rgba(109,40,217,0.4);

  --r-xs: 6px; --r-sm: 12px; --r: 20px; --r-lg: 32px; --pill: 999px;

  --body: "Nunito", system-ui, sans-serif;
  --head: "Fraunces", Georgia, serif;
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; text-size-adjust: 100%; }
body {
  font-family: var(--body); color: var(--ink);
  background: var(--bg); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img,video { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button { font-family: inherit; cursor: pointer; }
fieldset { border: none; }
a { color: var(--purple); }

/* === LAYOUT === */
.wrap    { width: min(1140px, 100% - 40px); margin: 0 auto; }
.wrap-md { width: min(820px,  100% - 40px); margin: 0 auto; }
.wrap-sm { width: min(600px,  100% - 40px); margin: 0 auto; }
.section { padding: 80px 0; }
.section-top { padding-top: 48px; }

.skip { position:absolute; left:-9999px; background:#000; color:#fff; padding:8px 16px; border-radius:var(--r-sm); }
.skip:focus { left:16px; top:16px; z-index:200; }

/* ============================
   HEADER
   ============================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253,250,244,0.88); backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}
.hd-inner {
  display: flex; align-items: center;
  height: 68px; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-img { height: 46px; background: #fff; border-radius: 14px; padding: 5px 14px; box-shadow: var(--sh-sm); }

.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a {
  text-decoration: none; color: var(--ink-2); font-weight: 700;
  padding: 8px 13px; border-radius: var(--r-sm); font-size: 0.94rem;
  transition: background 0.14s, color 0.14s;
}
.main-nav a:hover { background: var(--purple-l); color: var(--purple); }
.main-nav a.active { color: var(--purple); }
.main-nav a.nav-cta {
  background: var(--ink); color: #fff; border-radius: var(--pill); padding: 9px 18px; margin-left: 6px;
}
.main-nav a.nav-cta:hover { background: var(--purple); color: #fff; }

.burger {
  display: none; border: none; background: none;
  width: 40px; height: 40px; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
}
.burger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ============================
   FLASH
   ============================ */
.flash {
  width: min(1140px,100% - 40px); margin: 14px auto;
  padding: 12px 18px; border-radius: var(--r-sm); font-weight: 700;
}
.flash-success { background: var(--green-l); color: #065F46; border-left: 3px solid var(--green); }
.flash-error   { background: var(--red-l);   color: #7F1D1D; border-left: 3px solid var(--red); }

/* ============================
   TYPOGRAPHY
   ============================ */
h1 { font-family: var(--head); font-weight: 700; line-height: 1.05; letter-spacing: -0.03em; font-size: clamp(2.4rem,5vw,4.4rem); }
h2 { font-family: var(--head); font-weight: 700; line-height: 1.1;  letter-spacing: -0.025em; font-size: clamp(1.7rem,3.5vw,2.6rem); }
h3 { font-weight: 800; line-height: 1.2; font-size: 1.05rem; }
em { font-style: italic; }
.lede    { font-size: 1.1rem; color: var(--muted); line-height: 1.7; }
.lede-sm { font-size: 0.95rem; color: var(--muted); line-height: 1.65; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--purple-l); color: var(--purple);
  font-weight: 800; font-size: 0.78rem; padding: 5px 12px;
  border-radius: var(--pill); text-transform: uppercase; letter-spacing: 0.08em;
}
.eyebrow-coral { background: var(--coral-l); color: var(--coral-d); }

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--pill); padding: 14px 26px;
  font-weight: 800; font-size: 1rem; font-family: var(--body);
  text-decoration: none; transition: all 0.2s; white-space: nowrap; cursor: pointer;
}
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 2px 16px rgba(109,40,217,0.28); }
.btn-primary:hover { background: var(--purple-d); transform: translateY(-2px); box-shadow: 0 6px 28px rgba(109,40,217,0.42); color: #fff; }

.btn-coral { background: var(--coral); color: #fff; box-shadow: 0 2px 14px rgba(229,77,46,0.24); }
.btn-coral:hover { background: var(--coral-d); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(229,77,46,0.36); color: #fff; }

.btn-outline { background: transparent; color: var(--purple); box-shadow: inset 0 0 0 2px var(--purple); }
.btn-outline:hover { background: var(--purple-l); transform: translateY(-2px); color: var(--purple); }

.btn-ghost { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--bdr-str); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); transform: translateY(-1px); }

.btn-sm { padding: 9px 18px; font-size: 0.88rem; }
.btn-xs { padding: 6px 12px; font-size: 0.8rem; }

.card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh-xs); }
.panel { background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-sm); padding: 28px; }

/* ============================
   HERO — split layout
   ============================ */
.hero {
  padding: 80px 0 100px;
  background-image:
    radial-gradient(ellipse 60% 60% at 10% 70%, rgba(109,40,217,0.06) 0%, transparent 100%),
    radial-gradient(ellipse 40% 40% at 90% 25%, rgba(229,77,46,0.05) 0%, transparent 100%);
}
.hero-layout {
  display: grid; grid-template-columns: 1fr 0.72fr;
  align-items: center; gap: 60px;
}
.hero-text { max-width: 580px; }
.hero-eyebrow { margin-bottom: 22px; }
.hero-title { margin: 0 0 18px; }
.hero-title em { color: var(--purple); }
.hero-sub { max-width: 460px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hero-trust {
  display: flex; gap: 16px; align-items: center;
  margin-top: 22px; font-size: 0.8rem; color: var(--muted); font-weight: 700; flex-wrap: wrap;
}
.hero-trust span { display: flex; align-items: center; gap: 5px; }

/* Carte démo (décor) */
.hero-visual { position: relative; }
.hero-demo {
  background: #fff; border-radius: 22px;
  box-shadow: 0 28px 80px rgba(109,40,217,0.2), 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid rgba(109,40,217,0.12); overflow: hidden;
  transform: rotate(2.5deg);
  transition: transform 0.55s cubic-bezier(0.34,1.56,0.64,1);
  max-width: 310px; margin-left: auto;
}
.hero-visual:hover .hero-demo { transform: rotate(0deg); }

.hd-bar {
  background: var(--purple-l); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 800; font-size: 0.86rem; color: var(--purple);
}
.hd-pill {
  background: var(--purple); color: #fff;
  padding: 3px 10px; border-radius: var(--pill); font-size: 0.72rem;
}
.hd-content { padding: 16px; }
.hd-q { font-weight: 700; font-size: 0.88rem; line-height: 1.45; margin-bottom: 12px; color: var(--ink-2); }
.hd-qn { color: var(--purple); font-weight: 900; margin-right: 4px; }
.hd-opts { display: flex; flex-direction: column; gap: 6px; }
.hd-opt {
  padding: 8px 12px; border-radius: 10px; font-size: 0.83rem;
  font-weight: 700; border: 2px solid var(--border); color: var(--ink-2);
}
.hd-ko { border-color: var(--red); background: var(--red-l); color: var(--red); }
.hd-score {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border); background: #FAFAF8;
}
.hd-num {
  font-family: var(--head); font-size: 2rem; font-weight: 700;
  color: var(--purple); line-height: 1;
}
.hd-num span { font-size: 1rem; color: var(--muted); }
.hd-msg { font-weight: 800; font-size: 0.85rem; color: var(--ink-2); }
.hd-words { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.hd-words span { padding: 4px 9px; border-radius: 8px; border: 2px solid var(--border); font-size: .86rem; font-weight: 700; color: var(--ink-2); }
.hd-words .hd-w-ok { background: var(--green); border-color: var(--green); color: #fff; }
.hd-fb { background: var(--green-l); color: #065F46; border-radius: 10px; padding: 8px 10px; font-size: .8rem; font-weight: 700; }
.hd-stars { font-size: 1.4rem; color: #F59E0B; letter-spacing: 1px; }
.hd-stars i { color: #E4DFD6; font-style: normal; }
.hero-mascot {
  position: absolute; left: -30px; bottom: -20px; width: 200px; height: auto; z-index: 2;
  filter: drop-shadow(0 16px 28px rgba(109,40,217,.22));
  animation: floaty 4.5s ease-in-out infinite;
}

/* ============================
   CLASS GRID
   ============================ */
.classes-sec { padding: 0 0 80px; }
.classes-sec h2  { margin-bottom: 8px; }
.classes-sec .lede { margin-bottom: 44px; }

.cycle { margin-bottom: 38px; }
.cycle-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin-bottom: 14px;
}

.class-grid   { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.class-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Chaque carte = blanc, bordure nette, shadow lisible */
.class-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 22px 14px 18px; text-decoration: none;
  background: var(--surface);
  border: 2px solid #E8E2D9; /* bordure visible sur le fond crème */
  border-radius: var(--r); color: var(--ink); text-align: center;
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.class-card:hover {
  box-shadow: 0 10px 32px rgba(0,0,0,0.11);
  border-color: #C9C0B3;
  transform: translateY(-4px); color: var(--ink);
}

/* CM1 — seule classe disponible → gradient violet */
.class-card.is-lit {
  background: linear-gradient(150deg, #7C3AED 0%, #4C1D95 100%);
  border-color: transparent;
  box-shadow: var(--sh-purple);
}
.class-card.is-lit:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 20px 56px rgba(109,40,217,0.52);
}
.class-card.is-lit .cc-label { color: #fff; }
.class-card.is-lit .cc-sub   { color: rgba(255,255,255,0.62); }
.class-card.is-lit .cc-badge { background: rgba(255,255,255,0.2); color: #fff; border-color: rgba(255,255,255,0.28); }

/* Bulle colorée par classe */
.cc-bubble {
  width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; flex-shrink: 0;
  transition: transform 0.22s;
}
.class-card:hover .cc-bubble { transform: scale(1.1); }

.cc-label { font-weight: 800; font-size: 1.05rem; }
.cc-sub   { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }
.cc-badge {
  font-size: 0.7rem; font-weight: 800; padding: 3px 9px;
  border-radius: var(--pill); margin-top: 2px;
  border: 1.5px solid var(--border);
}
.badge-active { background: rgba(109,40,217,0.1); color: var(--purple); border-color: rgba(109,40,217,0.2); }
.badge-soon   { background: #F3EFE8; color: var(--muted); border-color: #E0D9CE; }

/* ============================
   NUMBERED STEPS
   ============================ */
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px; margin-top: 48px; }
.step-n {
  font-family: var(--head); font-size: 3.6rem; font-weight: 700;
  color: var(--purple-mm); line-height: 1; margin-bottom: 14px;
}
.step-item h3 { margin-bottom: 7px; }
.step-item p  { font-size: 0.88rem; color: var(--muted); line-height: 1.65; }

/* ============================
   PRINT TEASER
   ============================ */
.print-teaser {
  background: linear-gradient(140deg, #FFF9F7 0%, #FFEDE7 100%);
  border: 2px solid rgba(229,77,46,0.18); border-radius: var(--r-lg);
  padding: 56px 52px; display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 48px; margin-top: 24px;
}
.print-teaser h2 { margin: 14px 0 12px; }
.print-teaser .lede { font-size: 1rem; }
.print-teaser-vis { font-size: 5.5rem; line-height: 1.1; text-align: center; }

/* ============================
   SUBJECT GRID (classe.php)
   ============================ */
.subject-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; }
.subject-card {
  display: flex; align-items: center; gap: 14px; padding: 18px;
  background: var(--surface); border: 2px solid #E8E2D9;
  border-radius: var(--r); text-decoration: none; color: var(--ink);
  transition: all 0.2s; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.subject-card.avail:hover { border-color: var(--purple); box-shadow: var(--sh); transform: translateX(4px); color: var(--ink); }
.subject-card.soon { opacity: 0.58; }
.sc-icon { font-size: 2.2rem; flex-shrink: 0; }
.sc-label { font-weight: 800; font-size: 1.05rem; }
.sc-desc  { font-size: 0.84rem; color: var(--muted); }
.sc-arrow { margin-left: auto; font-size: 1.1rem; color: var(--purple); }

/* ============================
   UNITS (cm1-francais.php)
   ============================ */
.units-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 24px; }
.unit-card {
  display: block; padding: 22px;
  background: var(--surface); border: 2px solid #E8E2D9;
  border-radius: var(--r); text-decoration: none; color: var(--ink);
  transition: all 0.22s; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.unit-card:hover { border-color: var(--purple); box-shadow: var(--sh); transform: translateY(-3px); color: var(--ink); }
.uc-top   { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.uc-emoji { font-size: 1.8rem; flex-shrink: 0; margin-top: 1px; }
.uc-title { font-weight: 800; font-size: 1rem; line-height: 1.3; }
.uc-goal  { font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.uc-foot  { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.uc-score { font-size: 0.78rem; font-weight: 700; color: var(--purple); white-space: nowrap; }
.progress { flex: 1; height: 6px; background: #E8E2D9; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--purple); border-radius: 3px; }

/* ============================
   QUIZ (lecon.php)
   ============================ */
.quiz-wrap { max-width: 700px; margin: 0 auto; }

.lesson-block {
  background: var(--surface); border: 1px solid #E8E2D9;
  border-radius: var(--r); padding: 24px; margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.lesson-block-label {
  font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--purple); margin-bottom: 10px;
}
.lesson-block h3 { font-size: 0.97rem; margin: 12px 0 5px; }
.lesson-block ul, .lesson-block ol { padding-left: 18px; }
.lesson-block li { margin-bottom: 4px; font-size: 0.93rem; }
.lesson-block p  { font-size: 0.93rem; margin-bottom: 8px; }

.quiz-form { margin-top: 24px; }
.quiz-form-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.quiz-form-hd h2 { font-size: 1.2rem; }
.quiz-count { font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.quiz-hint  { font-size: 0.88rem; color: var(--muted); margin-bottom: 16px; }

.q-block {
  background: var(--surface); border: 1.5px solid #E8E2D9;
  border-radius: var(--r); padding: 18px; margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.q-hd  { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.q-num {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.76rem; font-weight: 800; color: var(--muted); flex-shrink: 0; margin-top: 1px;
}
.q-text  { font-weight: 700; font-size: 0.95rem; line-height: 1.5; }
.q-multi { font-size: 0.78rem; color: var(--purple); font-weight: 700; margin-bottom: 8px; }

.choice-list { display: grid; gap: 7px; }
.choice-lbl {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px;
  border: 2px solid #E8E2D9; border-radius: var(--r-sm);
  cursor: pointer; background: var(--surface);
  transition: border-color 0.12s, background 0.12s;
  font-weight: 600; font-size: 0.93rem;
}
.choice-lbl:hover { border-color: var(--purple-mm); background: var(--purple-l); }
.choice-lbl input { flex-shrink: 0; margin-top: 3px; accent-color: var(--purple); }

/* Seules les réponses sélectionnées incorrectes → rouge. Jamais de vert. */
.choice-lbl.is-wrong { border-color: var(--red); background: var(--red-l); color: var(--red); }
.choice-lbl.is-wrong:hover { border-color: var(--red); background: var(--red-l); }

.q-explain {
  margin-top: 10px; padding: 10px 14px;
  background: var(--red-l); border-left: 3px solid var(--red);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 0.84rem; color: #7F1D1D; font-weight: 600;
}

.quiz-submit-row { margin-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.score-box { text-align: center; padding: 32px 24px; margin-top: 18px; }
.score-emo   { font-size: 3rem; display: block; margin-bottom: 6px; }
.score-val   { font-family: var(--head); font-size: 4rem; font-weight: 700; color: var(--purple); line-height: 1; display: block; }
.score-denom { font-size: 1.6rem; color: var(--muted); }
.score-msg   { color: var(--muted); margin: 8px 0 22px; font-size: 0.97rem; }
.score-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ============================
   WIZARD (imprimer.php)
   ============================ */
.wiz-steps { display: flex; gap: 6px; margin: 14px 0 28px; }
.wiz-steps span { flex: 1; height: 5px; background: #E8E2D9; border-radius: 3px; transition: background 0.25s; }
.wiz-steps span.on { background: var(--purple); }

.dur-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0 4px; }
.dur-tile {
  position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 5px; padding: 16px 8px;
  border: 2px solid #E8E2D9; border-radius: var(--r-sm);
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.dur-tile input { position: absolute; opacity: 0; width: 0; height: 0; }
.dur-tile:has(input:checked) { border-color: var(--purple); background: var(--purple-l); }
.dur-time { font-family: var(--head); font-size: 1.4rem; font-weight: 700; line-height: 1; }
.dur-desc { font-size: 0.7rem; color: var(--muted); font-weight: 700; }
.dur-tile:has(input:checked) .dur-desc { color: var(--purple-d); }

.opt-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px;
  border: 2px solid #E8E2D9; border-radius: var(--r-sm);
  cursor: pointer; margin-bottom: 8px; transition: all 0.15s; font-weight: 600;
}
.opt-card:has(input:checked) { border-color: var(--purple); background: var(--purple-l); }
.opt-card input { flex-shrink: 0; margin-top: 3px; accent-color: var(--purple); }
.opt-title { font-weight: 800; display: block; }
.opt-desc  { font-size: 0.85rem; color: var(--muted); }
.opt-card:has(input:checked) .opt-desc { color: var(--purple-d); }

/* ============================
   FORMS
   ============================ */
.fg { margin-bottom: 18px; }
.fg label { display: block; font-weight: 800; margin-bottom: 6px; font-size: 0.95rem; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; border: 2px solid var(--bdr-str); border-radius: 14px;
  padding: 12px 16px; font: inherit; background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(109,40,217,0.1);
}
.fhelp { font-size: 0.85rem; color: var(--muted); margin-top: 5px; }
.chk { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; margin: 10px 0; cursor: pointer; }
.chk input { flex-shrink: 0; margin-top: 3px; accent-color: var(--purple); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* ============================
   BREADCRUMB
   ============================ */
.crumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.84rem; color: var(--muted); margin-bottom: 20px; flex-wrap: wrap;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--purple); }
.crumb-sep { color: #D5CFC7; }
.crumb-cur { color: var(--ink); font-weight: 700; }

/* ============================
   AUTH
   ============================ */
.auth-page { max-width: 420px; margin: 56px auto; }
.auth-page .panel { padding: 36px; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 0.9rem; color: var(--muted); }

/* ============================
   ESPACE
   ============================ */
.stats-row { display: flex; gap: 14px; margin: 24px 0; flex-wrap: wrap; }
.stat-box { flex: 1; min-width: 100px; text-align: center; padding: 22px 10px; }
.stat-n { font-family: var(--head); font-size: 2.8rem; font-weight: 700; color: var(--purple); line-height: 1; }
.stat-l { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* ============================
   LEGAL / CONTACT
   ============================ */
.legal-page { max-width: 680px; margin: 40px auto; }
.legal-page h2 { margin: 24px 0 8px; font-size: 1.15rem; }
.legal-page p, .legal-page ul { margin-bottom: 10px; font-size: 0.97rem; }
.legal-page li { margin-left: 18px; }

/* ============================
   FOOTER
   ============================ */
.site-footer { background: #0F0E0C; color: #C5BEB5; padding: 60px 0 28px; margin-top: 100px; }
.ft-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 44px; margin-bottom: 44px; }
.ft-logo { height: 40px; background: #fff; border-radius: 12px; padding: 5px 12px; margin-bottom: 14px; }
.ft-tag  { font-size: 0.88rem; line-height: 1.65; color: #9A9188; }
.site-footer h3 { color: #fff; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.13em; margin-bottom: 14px; }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.site-footer a  { color: #C5BEB5; text-decoration: none; font-size: 0.9rem; }
.site-footer a:hover { color: #fff; }
.ft-copy { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 22px; text-align: center; font-size: 0.78rem; color: #716B62; }

/* ============================
   CAHIER
   ============================ */
.cahier-body { background: #fff; }
.cahier-sheet { width: min(760px, calc(100% - 20px)); margin: 16px auto; background: #fff; padding: 28px; }
.cahier-hd { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 12px; margin-bottom: 16px; }
.cahier-q { margin: 18px 0; page-break-inside: avoid; }
.cahier-q p { margin-bottom: 6px; }
.dotline { border-bottom: 1px dotted #aaa; height: 28px; margin: 5px 0; }

/* ============================
   PARCOURS — STATUTS & ÉTOILES
   ============================ */
.statut-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--pill);
  font-size: 0.76rem; font-weight: 800; white-space: nowrap; letter-spacing: .01em;
}
.statut-nc { background: #F1EFEA; color: #6B6660; }
.statut-ec { background: #FEF3C7; color: #B45309; }
.statut-ok { background: var(--green-l); color: #047857; }
.statut-rv { background: #FEF2F2; color: #B91C1C; }

.etoiles { display: inline-flex; gap: 1px; font-size: 1rem; line-height: 1; }
.etoiles .et { color: #E4DFD6; }
.etoiles .et.on { color: #F59E0B; text-shadow: 0 1px 0 rgba(0,0,0,.08); }

.statut-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; background: #E1DCD3; }
.statut-dot-en_cours  { background: #F59E0B; }
.statut-dot-maitrisee { background: var(--green); }

/* ============================
   PARCOURS — PAGE CM1 (domaines)
   ============================ */
.page-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }

/* Carte joueur (XP / niveau / série) */
.player-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #1E1B4B 0%, #4C1D95 60%, #6D28D9 100%);
  color: #fff; border-radius: var(--r); padding: 18px 22px; margin-bottom: 22px;
  box-shadow: var(--sh-purple);
}
.pc-avatar { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; font-size: 1.8rem; }
.pc-avatar img { width: 46px; height: auto; }
.pc-name  { font-family: var(--head); font-size: 1.15rem; font-weight: 700; line-height: 1.2; }
.pc-level { font-size: 0.82rem; opacity: .85; margin-top: 2px; }
.pc-bar   { height: 8px; background: rgba(255,255,255,.18); border-radius: var(--pill); overflow: hidden; margin-top: 8px; }
.pc-bar i { display: block; height: 100%; background: linear-gradient(90deg, #FDE68A, #F59E0B); border-radius: var(--pill); }
.pc-bar-lbl { font-size: 0.72rem; opacity: .8; margin-top: 4px; }
.pc-stats { display: flex; gap: 14px; }
.pc-stat  { text-align: center; min-width: 54px; }
.pc-stat b { display: block; font-family: var(--head); font-size: 1.35rem; line-height: 1; }
.pc-stat span { font-size: 0.68rem; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }

/* Mission du jour */
.mission-box {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  background: var(--surface); border: 2px solid var(--purple-mm); border-radius: var(--r);
  padding: 18px 22px; margin-bottom: 26px; box-shadow: var(--sh-sm); position: relative; overflow: hidden;
}
.mission-box::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: linear-gradient(180deg, var(--purple), var(--coral)); }
.mission-bravo { border-color: #6EE7B7; }
.mission-cta   { border-color: #FECACA; }
.mission-icon  { width: 54px; height: 54px; border-radius: 16px; background: var(--purple-l); display: grid; place-items: center; font-size: 1.6rem; }
.mission-label { font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; color: var(--purple); margin-bottom: 2px; }
.mission-title { font-family: var(--head); font-size: 1.25rem; font-weight: 700; color: var(--ink); line-height: 1.2; }
.mission-desc  { font-size: 0.85rem; color: var(--muted); margin-top: 3px; }

/* Grille domaines */
.domaines-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.domaine-card {
  --c: var(--dc, var(--purple));
  display: block; text-decoration: none; color: var(--ink);
  background: var(--surface); border-radius: var(--r); padding: 18px 18px 16px;
  border: 2px solid var(--border); box-shadow: var(--sh-xs); position: relative; overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.domaine-card::after { content: ''; position: absolute; top: -40px; right: -40px; width: 120px; height: 120px; border-radius: 50%; background: color-mix(in srgb, var(--c) 10%, transparent); }
.domaine-card:hover { transform: translateY(-3px); box-shadow: var(--sh); border-color: var(--c); }
.dc-head  { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; position: relative; }
.dc-emoji { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.55rem; background: color-mix(in srgb, var(--c) 14%, white); }
.dc-label { display: block; font-size: 1.02rem; font-weight: 900; }
.dc-sub   { display: block; font-size: 0.78rem; color: var(--muted); }
.dc-accroche { font-size: 0.85rem; color: var(--ink-2); margin: 0 0 10px; }
.dc-progress { height: 8px; }
.dc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.dc-dots { display: flex; gap: 5px; }

.progress-bar { height: 8px; background: rgba(15,14,12,.07); border-radius: var(--pill); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--purple-m)); border-radius: var(--pill); transition: width .5s ease; }

/* Domaine hero */
.domaine-hero {
  --c: var(--dc, var(--purple));
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, white), color-mix(in srgb, var(--c) 4%, white));
  border: 2px solid color-mix(in srgb, var(--c) 22%, white);
  border-radius: var(--r); padding: 26px 30px; margin-bottom: 18px;
}
.dh-emoji { width: 68px; height: 68px; border-radius: 20px; background: #fff; display: grid; place-items: center; font-size: 2.1rem; box-shadow: var(--sh-xs); }
.dh-text h1 { margin-bottom: 2px; }
.dh-accroche { color: var(--ink-2); margin-bottom: 8px; }
.dh-stat  { font-size: 0.86rem; color: var(--muted); font-weight: 700; }

/* Chemin de compétences */
.comp-path { position: relative; display: flex; flex-direction: column; gap: 12px; padding-left: 26px; }
.comp-path::before { content: ''; position: absolute; left: 10px; top: 20px; bottom: 20px; width: 3px; background: #E9E4DB; border-radius: 3px; }
.comp-card {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  text-decoration: none; color: var(--ink);
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--r);
  padding: 14px 18px; box-shadow: var(--sh-xs); transition: all .18s;
}
.comp-card::before {
  content: ''; position: absolute; left: -26px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; border-radius: 50%; background: #E1DCD3; border: 3px solid var(--bg); box-shadow: 0 0 0 2px #E9E4DB;
}
.comp-card.st-en_cours::before  { background: #F59E0B; box-shadow: 0 0 0 2px #F59E0B; }
.comp-card.st-maitrisee::before { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.comp-card.is-next { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-l), var(--sh-sm); }
.comp-card:hover { border-color: var(--purple); box-shadow: var(--sh); transform: translateX(3px); }
.cc-emoji { width: 46px; height: 46px; border-radius: 14px; background: var(--purple-l); display: grid; place-items: center; font-size: 1.4rem; }
.cc-info strong { display: block; font-weight: 900; font-size: 1rem; line-height: 1.25; }
.cc-info span   { display: block; font-size: 0.82rem; color: var(--muted); }
.cc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.cc-duree { font-size: 0.74rem; color: var(--muted); font-weight: 700; }
.cc-next-tag { position: absolute; top: -10px; right: 14px; background: var(--purple); color: #fff; font-size: .68rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: var(--pill); }

/* ============================
   SESSION (mission)
   ============================ */
.session-body .site-footer { display: none; }
.session-body main { min-height: calc(100vh - 72px); }
.session { --c: var(--dc, var(--purple)); width: min(720px, 100% - 32px); margin: 0 auto; padding: 14px 0 120px; }

/* barre du haut */
.ses-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.ses-quit { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; color: var(--muted); background: var(--surface); border: 2px solid var(--border); font-weight: 700; }
.ses-quit:hover { color: var(--ink); border-color: var(--bdr-str); }
.ses-steps { list-style: none; display: flex; justify-content: center; gap: 6px; }
.ses-step { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--pill); font-size: .78rem; font-weight: 800; color: var(--muted); background: transparent; transition: all .25s; }
.ses-step.is-active { background: var(--purple); color: #fff; box-shadow: 0 4px 14px rgba(109,40,217,.3); }
.ses-step.is-done   { color: var(--green); }
.ses-step.is-done .ses-step-ico::after { content: ' ✓'; }
.ses-xp { justify-self: end; display: inline-flex; align-items: baseline; gap: 4px; background: #FFF7E6; border: 2px solid #FDE68A; color: #92400E; padding: 6px 12px; border-radius: var(--pill); font-weight: 900; font-size: .95rem; }
.ses-xp-bolt { font-size: .9rem; }
.ses-xp-unit { font-size: .7rem; letter-spacing: .05em; }
.ses-xp.bump { animation: bump .45s ease; }
@keyframes bump { 30% { transform: scale(1.18); } 100% { transform: scale(1); } }

.ses-progress { height: 10px; background: rgba(15,14,12,.07); border-radius: var(--pill); overflow: hidden; margin: 14px 0 22px; }
.ses-progress-fill { height: 100%; width: 0; border-radius: var(--pill); background: linear-gradient(90deg, var(--purple), var(--coral)); transition: width .6s cubic-bezier(.2,.8,.2,1); }

/* écrans */
.scr { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.slide-in { animation: fadeUp .3s ease; }

/* intro / prêt */
.scr-intro, .scr-ready { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: center; }
.intro-mascot img { width: 100%; height: auto; filter: drop-shadow(0 12px 24px rgba(109,40,217,.18)); animation: floaty 4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.intro-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-lg); padding: 28px 30px; box-shadow: var(--sh); }
.intro-domaine { display: inline-block; font-size: .74rem; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; color: var(--c); background: color-mix(in srgb, var(--c) 10%, white); padding: 4px 10px; border-radius: var(--pill); margin-bottom: 10px; }
.intro-title { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.1; margin-bottom: 8px; }
.intro-objectif { color: var(--ink-2); font-weight: 600; margin-bottom: 10px; }
.intro-msg { color: var(--muted); font-size: .95rem; margin-bottom: 18px; }
.intro-plan { display: grid; gap: 8px; margin-bottom: 20px; }
.plan-item { display: flex; align-items: center; gap: 12px; background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px; }
.plan-ico { width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; box-shadow: var(--sh-xs); }
.plan-item strong { display: block; font-size: .92rem; }
.plan-item span:last-child { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.intro-duree { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.btn-xl { width: 100%; padding: 16px 24px; font-size: 1.08rem; border-radius: 18px; }
.ready-badge { display: inline-block; background: var(--green-l); color: #047857; font-weight: 900; font-size: .78rem; padding: 5px 12px; border-radius: var(--pill); margin-bottom: 10px; }
.ready-rules { list-style: none; display: grid; gap: 8px; margin: 0 0 20px; }
.ready-rules li { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--ink-2); }
.ready-rules li span { background: #FFF7E6; color: #92400E; font-weight: 900; font-size: .8rem; padding: 3px 9px; border-radius: var(--pill); white-space: nowrap; }

/* échauffement */
.warm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.warm-eyebrow { font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; color: var(--purple); }
.warm-count { font-size: .82rem; font-weight: 800; color: var(--muted); background: var(--surface); border: 2px solid var(--border); padding: 3px 10px; border-radius: var(--pill); }
.slide { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-lg); padding: 26px 28px 28px; box-shadow: var(--sh); min-height: 300px; }
.slide-kind { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border-radius: var(--pill); margin-bottom: 12px; }
.slide-regle   .slide-kind { background: var(--purple-l); color: var(--purple); }
.slide-exemple .slide-kind { background: #ECFEFF; color: #0E7490; }
.slide-astuce  .slide-kind { background: #FFF7E6; color: #B45309; }
.slide-rappel  .slide-kind { background: #F1EFEA; color: #57534E; }
.slide-title { font-size: 1.5rem; margin-bottom: 14px; line-height: 1.15; }
.slide-body { font-size: 1.05rem; line-height: 1.7; color: var(--ink-2); }
.slide-body p { margin-bottom: 12px; }
.slide-body ul, .slide-body ol { margin: 0 0 12px 20px; }
.slide-body li { margin-bottom: 8px; }
.slide-body strong { color: var(--ink); }
.slide-body em { font-style: italic; color: var(--ink); background: #FBF7EE; padding: 1px 6px; border-radius: 6px; }
.slide-body mark { background: #FDE68A; color: var(--ink); padding: 0 4px; border-radius: 4px; font-weight: 800; }
.slide-body .tok { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--purple); color: #fff; font-weight: 900; margin: 0 2px; }
.slide-body .liste-4 { list-style: none; margin-left: 0; display: grid; gap: 8px; }
.slide-body .liste-4 li { background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px; }
.slide-body table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.slide-body td { padding: 8px 10px; border: 1px solid var(--border); font-size: 1rem; }
.slide-body .etapes { counter-reset: e; list-style: none; margin-left: 0; }
.slide-body .etapes li { position: relative; padding-left: 38px; }
.slide-body .etapes li::before { counter-increment: e; content: counter(e); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--purple); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: .85rem; }
.slide-dots { display: flex; justify-content: center; gap: 7px; margin: 16px 0 6px; }
.slide-dots span { width: 9px; height: 9px; border-radius: 50%; background: #E1DCD3; transition: all .25s; }
.slide-dots span.is-on { background: var(--purple); transform: scale(1.2); }
.slide-dots span.is-read { background: var(--green); }
.xp-pill { display: inline-block; margin-left: 8px; background: rgba(255,255,255,.22); padding: 2px 8px; border-radius: var(--pill); font-size: .74rem; font-weight: 900; letter-spacing: .04em; }

/* actions fixes en bas sur mobile */
.ses-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.ses-actions-epreuve { justify-content: stretch; }
.ses-actions-epreuve .btn { flex: 1; }

/* épreuve */
.combo { display: inline-flex; align-items: center; gap: 4px; background: #FFF1E6; color: #C2410C; border: 2px solid #FDBA74; font-weight: 900; font-size: .78rem; padding: 3px 10px; border-radius: var(--pill); }
.combo.pop { animation: bump .4s ease; }
.ex-block { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-lg); padding: 24px 26px; box-shadow: var(--sh); transition: border-color .25s; }
.ex-block.is-correct { border-color: var(--green); }
.ex-block.is-wrong-block { border-color: var(--red); }
.ex-block.shake { animation: shake .45s ease; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.ex-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ex-num { font-size: .78rem; font-weight: 900; color: var(--muted); }
.ex-type-badge { font-size: .7rem; font-weight: 900; padding: 3px 9px; border-radius: var(--pill); text-transform: uppercase; letter-spacing: .06em; }
.ex-type-qcm       { background: var(--purple-l); color: var(--purple); }
.ex-type-trou      { background: #FFF7E6; color: #B45309; }
.ex-type-selection { background: var(--green-l); color: #047857; }
.ex-type-ordre     { background: #ECFEFF; color: #0E7490; }
.ex-consigne { font-weight: 800; font-size: 1.12rem; line-height: 1.45; margin-bottom: 16px; color: var(--ink); }
.ex-contexte { background: #FBF7EE; border-left: 4px solid #F59E0B; border-radius: var(--r-xs); padding: 10px 14px; margin-bottom: 14px; font-style: italic; color: var(--ink-2); }
.ex-phrase { font-size: 1.25rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; line-height: 1.6; }
.ex-blank { min-width: 90px; display: inline-block; text-align: center; border-bottom: 3px dashed var(--purple-mm); color: var(--purple); font-weight: 900; padding: 0 10px; transition: all .2s; }
.ex-blank.filled { border-bottom-color: transparent; background: var(--purple-l); border-radius: 10px; padding: 2px 12px; }
.ex-blank.is-right { background: var(--green-l); color: #047857; }

/* choix QCM */
.ex-qcm-choices { display: grid; gap: 10px; }
.ex-choice { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 13px 14px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); font-size: 1rem; font-weight: 600; color: var(--ink); transition: all .15s; }
.ex-choice:hover:not(:disabled) { border-color: var(--purple-mm); background: #FCFAFF; }
.ex-choice-letter { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--bg); display: grid; place-items: center; font-weight: 900; font-size: .85rem; color: var(--muted); }
.ex-choice.is-selected { border-color: var(--purple); background: var(--purple-l); }
.ex-choice.is-selected .ex-choice-letter { background: var(--purple); color: #fff; }
.ex-choice.is-wrong { border-color: var(--red); background: var(--red-l); }
.ex-choice.is-wrong .ex-choice-letter { background: var(--red); color: #fff; }
.ex-choice.is-right { border-color: var(--green); background: var(--green-l); }
.ex-choice.is-right .ex-choice-letter { background: var(--green); color: #fff; }
.ex-choice:disabled { cursor: default; }

/* chips (trou + ordre) */
.ex-chips, .ex-ordre-pool { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-chip { padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 2px solid var(--bdr-str); font-size: 1rem; font-weight: 800; color: var(--ink); transition: all .15s; box-shadow: 0 2px 0 var(--bdr-str); }
.ex-chip:hover:not(:disabled) { border-color: var(--purple); color: var(--purple); transform: translateY(-1px); }
.ex-chip.is-selected { border-color: var(--purple); background: var(--purple-l); color: var(--purple); box-shadow: 0 2px 0 var(--purple); }
.ex-chip.is-wrong { border-color: var(--red); background: var(--red-l); color: var(--red); box-shadow: 0 2px 0 var(--red); }
.ex-chip.is-right { border-color: var(--green); background: var(--green-l); color: #047857; box-shadow: 0 2px 0 var(--green); }
.ex-chip:disabled { cursor: default; opacity: .85; }

/* sélection de mots */
.ex-mots { display: flex; gap: 6px 8px; flex-wrap: wrap; align-items: center; font-size: 1.2rem; line-height: 1.5; }
.ex-mot { padding: 6px 12px; border-radius: 12px; background: transparent; border: 2px solid transparent; font-size: 1.15rem; font-weight: 600; color: var(--ink); transition: all .15s; }
.ex-mot:hover:not(:disabled) { background: var(--purple-l); border-color: var(--purple-mm); }
.ex-mot.is-selected { background: var(--purple); color: #fff; border-color: var(--purple); }
.ex-mot.is-wrong { background: var(--red); color: #fff; border-color: var(--red); }
.ex-mot.is-right { background: var(--green); color: #fff; border-color: var(--green); }
.ex-mot:disabled { cursor: default; }
.ex-punct { font-size: 1.15rem; color: var(--muted); }

/* ordre */
.ex-ordre-zone { min-height: 62px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; border: 2px dashed var(--purple-mm); border-radius: 16px; background: #FCFAFF; margin-bottom: 14px; transition: all .2s; }
.ex-ordre-zone.is-wrong { border-color: var(--red); background: var(--red-l); }
.ex-ordre-zone.is-right { border-color: var(--green); background: var(--green-l); border-style: solid; }
.ex-ordre-placeholder { color: var(--muted); font-size: .9rem; font-style: italic; }
.ex-ordre-fin { font-size: 1.3rem; font-weight: 900; color: var(--muted); margin-left: -4px; }

/* feedback */
.ex-feedback { margin-top: 18px; padding: 14px 16px; border-radius: 16px; border: 2px solid; animation: fadeUp .3s ease; }
.ex-feedback-head { font-weight: 900; font-size: 1.02rem; margin-bottom: 4px; }
.ex-feedback-txt { font-size: .95rem; line-height: 1.55; margin: 0; }
.fb-ok    { background: var(--green-l); border-color: #6EE7B7; color: #065F46; }
.fb-retry { background: #FFF7E6; border-color: #FCD34D; color: #92400E; }
.fb-ko    { background: var(--red-l); border-color: #FCA5A5; color: #991B1B; }

/* +XP flottant */
.xp-float { position: absolute; inset: 0; pointer-events: none; }
.xp-float-item { position: absolute; transform: translate(-50%, 0); font-weight: 900; color: #B45309; background: #FDE68A; padding: 4px 10px; border-radius: var(--pill); font-size: .9rem; animation: floatUp 1.1s ease forwards; box-shadow: var(--sh-sm); z-index: 40; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, -6px) scale(1.05); } 100% { opacity: 0; transform: translate(-50%, -60px) scale(1); } }

/* résultat */
.scr-result { position: relative; text-align: center; }
.res-mascot img { width: 170px; height: auto; margin: 0 auto -30px; position: relative; z-index: 2; filter: drop-shadow(0 14px 24px rgba(109,40,217,.2)); animation: popIn .6s cubic-bezier(.2,1.4,.4,1); }
@keyframes popIn { from { opacity: 0; transform: scale(.6) translateY(20px); } to { opacity: 1; transform: none; } }
.res-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-lg); padding: 44px 28px 28px; box-shadow: var(--sh); }
.res-stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.res-star { font-size: 2.6rem; color: #E4DFD6; transform: scale(.7); opacity: .6; }
.res-star.on { color: #F59E0B; text-shadow: 0 4px 12px rgba(245,158,11,.45); animation: starPop .5s cubic-bezier(.2,1.6,.4,1) forwards; animation-delay: var(--d, 0s); }
@keyframes starPop { 0% { transform: scale(.3) rotate(-20deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.res-title { font-size: 2rem; margin-bottom: 6px; }
.res-sub { color: var(--muted); max-width: 440px; margin: 0 auto 18px; }
.res-xp { display: inline-flex; align-items: baseline; gap: 6px; background: linear-gradient(135deg, #FDE68A, #F59E0B); color: #78350F; padding: 10px 22px; border-radius: var(--pill); margin-bottom: 20px; box-shadow: 0 8px 22px rgba(245,158,11,.35); }
.res-xp-val { font-family: var(--head); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.res-xp-unit { font-weight: 900; font-size: .9rem; letter-spacing: .06em; }
.res-detail { list-style: none; display: grid; gap: 6px; max-width: 380px; margin: 0 auto 16px; text-align: left; }
.res-detail li { display: flex; justify-content: space-between; padding: 8px 12px; background: var(--bg); border-radius: var(--r-sm); font-size: .92rem; }
.res-detail li span:last-child { font-weight: 900; }
.res-detail .res-bonus { background: #FFF7E6; color: #92400E; }
.res-statut { font-weight: 900; margin-bottom: 8px; color: var(--muted); }
.res-statut.is-ok { color: #047857; }
.res-chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.res-chip { background: var(--surface); border: 2px solid var(--border); padding: 5px 12px; border-radius: var(--pill); font-weight: 800; font-size: .84rem; }
.res-niveau { background: var(--bg); border-radius: var(--r); padding: 14px 16px; margin: 0 auto 16px; max-width: 420px; text-align: left; }
.res-niveau-head { display: flex; justify-content: space-between; font-weight: 800; font-size: .88rem; margin-bottom: 8px; }
.res-niveau-rest { font-size: .78rem; color: var(--muted); margin-top: 6px; }
.res-levelup { font-weight: 900; color: var(--purple); margin-top: 8px; }
.res-guest { background: #FFF7E6; border: 2px solid #FDE68A; border-radius: var(--r); padding: 14px 16px; margin: 0 auto 16px; max-width: 460px; font-size: .9rem; color: #78350F; }
.res-guest strong { display: block; margin-bottom: 4px; }
.res-guest-btns { display: flex; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.res-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.result-loading { padding: 60px 0; color: var(--muted); }
.spinner { width: 36px; height: 36px; border: 4px solid var(--purple-l); border-top-color: var(--purple); border-radius: 50%; margin: 0 auto 12px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* confettis */
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.confetti i { position: absolute; top: -12px; left: calc(var(--i) * 4.2%); width: 9px; height: 14px; border-radius: 2px; background: hsl(calc(var(--i) * 37), 85%, 60%); animation: confetti 2.6s ease-in forwards; animation-delay: calc(var(--i) * .06s); }
@keyframes confetti { to { transform: translateY(560px) rotate(720deg); opacity: 0; } }

/* ============================
   ESPACE / DASHBOARD
   ============================ */
.espace-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r); padding: 16px 12px; text-align: center; box-shadow: var(--sh-xs); }
.stat-val { display: block; font-family: var(--head); font-size: 1.8rem; font-weight: 700; color: var(--purple); line-height: 1; }
.stat-unit { font-size: 1rem; }
.stat-lbl { display: block; font-size: .76rem; color: var(--muted); margin-top: 5px; font-weight: 700; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 30px 0 12px; }
.section-h h2 { font-size: 1.3rem; }
.section-h a { font-size: .85rem; font-weight: 800; text-decoration: none; }
.parent-panel { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r); padding: 20px 22px; margin-top: 30px; }
.parent-panel h2 { font-size: 1.15rem; margin-bottom: 8px; }
.parent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.parent-grid h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.parent-grid ul { list-style: none; display: grid; gap: 6px; }
.parent-grid li { display: flex; justify-content: space-between; font-size: .9rem; background: var(--bg); padding: 7px 10px; border-radius: var(--r-xs); }
.parent-tip { background: var(--purple-l); border-radius: var(--r-sm); padding: 12px 14px; margin-top: 14px; font-size: .92rem; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 920px) {
  .hero-layout { grid-template-columns: 1fr; gap: 40px; }
  .hero-text   { max-width: 100%; }
  .hero-demo   { display: none; }
  .hero-mascot { display: none; }
  .class-grid   { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .class-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .subject-grid, .units-grid { grid-template-columns: 1fr; }
  .steps-grid   { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .ft-grid      { grid-template-columns: 1fr 1fr; gap: 28px; }
  .print-teaser { grid-template-columns: 1fr; padding: 36px 28px; }
  .print-teaser-vis { display: none; }
  .burger { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 68px; right: 20px;
    flex-direction: column; background: var(--surface); border-radius: var(--r);
    padding: 10px; min-width: 200px; box-shadow: var(--sh-lg); z-index: 50;
    border: 1px solid #E8E2D9;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 10px 14px; border-radius: var(--r-sm); }
  .dur-grid { grid-template-columns: repeat(2, 1fr); }
  .espace-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .domaines-grid { grid-template-columns: repeat(2, 1fr); }
  .parent-grid { grid-template-columns: 1fr; }
  .player-card { grid-template-columns: auto 1fr; }
  .pc-stats { grid-column: 1 / -1; justify-content: space-around; border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px; }
}

@media (max-width: 560px) {
  .class-grid, .class-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .hero { padding: 52px 0 64px; }
  .hero-actions { flex-direction: column; align-items: stretch; text-align: center; }
  .hero-trust { justify-content: center; }
  .ft-grid { grid-template-columns: 1fr; gap: 28px; }
  .steps-grid { grid-template-columns: 1fr; gap: 20px; }
  .domaines-grid { grid-template-columns: 1fr; }
  .mission-box { grid-template-columns: auto 1fr; }
  .mission-box .btn { grid-column: 1 / -1; text-align: center; }
  .page-title-row { flex-direction: column; align-items: stretch; }
  .global-progress-widget { text-align: left; }

  /* session mobile : plein écran, actions collées en bas */
  .session { width: min(720px, 100% - 24px); padding-bottom: 110px; }
  .ses-step-lbl { display: none; }
  .ses-step { padding: 6px 9px; }
  .ses-step.is-active .ses-step-lbl { display: inline; }
  .scr-intro, .scr-ready { grid-template-columns: 1fr; text-align: center; }
  .intro-mascot img { width: 120px; margin: 0 auto; }
  .intro-card { padding: 22px 18px; }
  .intro-plan .plan-item { text-align: left; }
  .slide { padding: 20px 18px 22px; min-height: 0; }
  .slide-title { font-size: 1.3rem; }
  .slide-body { font-size: 1rem; }
  .ex-block { padding: 18px 16px; }
  .ex-consigne { font-size: 1.04rem; }
  .ses-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); background: rgba(253,250,244,.92); backdrop-filter: blur(10px); border-top: 1px solid var(--border); }
  .ses-actions .btn { flex: 1; text-align: center; }
  .res-card { padding: 40px 18px 22px; }
  .res-title { font-size: 1.6rem; }
}

/* ============================
   PRINT MEDIA
   ============================ */
@media print {
  .site-header, .site-footer, .flash, .no-print, .burger { display: none !important; }
  body { background: #fff; }
  .cahier-sheet { box-shadow: none; width: 100%; padding: 0; margin: 0; }
  a { color: inherit; text-decoration: none; }
  .choice-lbl { border: 1px solid #ccc !important; background: #fff !important; }
}
