/* ==========================================================================
   LinguaKid-AI — charte graphique « Jardin de mots » (v2)
   Surcouche de Bootstrap 5 : jetons de design, composants et trois ambiances
   (site & espace parents · espace enfant · écran de jeu en mode focus).
   ========================================================================== */

@font-face {
  font-family: "Nunito";
  src: url("../vendor/nunito/nunito-latin.166202cc391c.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  src: url("../vendor/nunito/nunito-latin-ext.ffdc8b0c86fb.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Jetons ---------- */
:root {
  --paper: #FBF7EE;
  --surface: #FFFFFF;
  --surface-2: #F7F2E7;
  --line: #ECE4D4;
  --line-strong: #DCCFB7;

  --ink: #1E2B26;
  --ink-2: #4E5A54;
  --ink-3: #7D867F;

  --leaf-50: #ECF6F0;
  --leaf-100: #D5ECDF;
  --leaf-300: #7FC2A2;
  --leaf-400: #2E8F76;
  --leaf: #1F6F5C;
  --leaf-700: #145243;
  --leaf-800: #0F3F33;

  --sun-50: #FFF6DE;
  --sun-100: #FFEBB8;
  --sun: #FFC857;
  --sun-600: #E9A92A;
  --sun-800: #7A5300;

  --coral-50: #FFEEE8;
  --coral-100: #FFD9CC;
  --coral: #FF7A59;
  --coral-600: #E4593A;
  --coral-800: #9A3519;

  --sky-50: #EAF6FD;
  --sky-100: #D2ECFA;
  --sky: #9FD3F2;
  --sky-600: #2F86B8;
  --sky-800: #17577D;

  --violet-50: #F2EDFC;
  --violet: #8B6FD1;
  --violet-700: #5B3FA0;

  --soil: #7A5C3E;
  --soil-light: #C9A876;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(30, 43, 38, .06);
  --shadow-sm: 0 1px 2px rgba(30, 43, 38, .06), 0 2px 6px -2px rgba(30, 43, 38, .08);
  --shadow-md: 0 2px 4px rgba(30, 43, 38, .04), 0 10px 24px -8px rgba(30, 43, 38, .14);
  --shadow-lg: 0 24px 48px -16px rgba(30, 43, 38, .28);

  --font: "Nunito", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  --tap: 48px;
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  /* Alignement des variables Bootstrap */
  --bs-body-bg: var(--paper);
  --bs-body-color: var(--ink);
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.55;
  --bs-primary: #1F6F5C;
  --bs-primary-rgb: 31, 111, 92;
  --bs-link-color: #1F6F5C;
  --bs-link-color-rgb: 31, 111, 92;
  --bs-link-hover-color: #145243;
  --bs-link-hover-color-rgb: 20, 82, 67;
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--ink-2);
  --bs-focus-ring-color: rgba(31, 111, 92, .28);
  --bs-border-radius: var(--r-md);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5 { color: var(--ink); font-weight: 850; letter-spacing: -.015em; }
.display-title { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 900; line-height: 1.08; letter-spacing: -.03em; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 850; color: var(--leaf); }
.lead { color: var(--ink-2); font-weight: 500; }
.text-soft { color: var(--ink-2) !important; }
.text-faint { color: var(--ink-3) !important; }
.text-leaf { color: var(--leaf) !important; }
.fw-black { font-weight: 900 !important; }
.emoji { font-family: var(--emoji); font-weight: 400; line-height: 1; }
a { text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--sun-600); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--sun-100); }
.no-js .js-only { display: none !important; }
.d-contents { display: contents; }
.min-w-0 { min-width: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 2000; transition: top .15s; }
.skip-link:focus { top: 12px; }

/* ---------- Navigation (site & parents) ---------- */
.lk-navbar {
  background: rgba(251, 247, 238, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-block: .55rem;
}
.lk-navbar .nav-link { font-weight: 750; color: var(--ink-2); border-radius: var(--r-sm); padding: .5rem .8rem !important; }
.lk-navbar .nav-link:hover, .lk-navbar .nav-link.active { color: var(--leaf-700); background: var(--leaf-50); }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 auto; }
.brand-name { font-weight: 900; font-size: 1.15rem; color: var(--ink); line-height: 1.05; letter-spacing: -.02em; }
.brand-name b { color: var(--leaf); font-weight: 900; }
.brand-sub { font-size: .72rem; color: var(--ink-3); font-weight: 700; }
.dropdown-menu { border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: .4rem; }
.dropdown-item { border-radius: var(--r-sm); font-weight: 650; padding: .5rem .75rem; }
.dropdown-item:active { background: var(--leaf); }
.parent-badge {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 800;
  color: var(--violet-700); background: var(--violet-50); border-radius: var(--r-pill); padding: .2rem .6rem;
}

/* ---------- Boutons ---------- */
.btn { font-weight: 800; border-radius: var(--r-md); letter-spacing: .005em; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1.05rem; border-radius: var(--r-lg); }
.btn-primary {
  --bs-btn-bg: var(--leaf); --bs-btn-border-color: var(--leaf); --bs-btn-hover-bg: var(--leaf-700);
  --bs-btn-hover-border-color: var(--leaf-700); --bs-btn-active-bg: var(--leaf-800); --bs-btn-active-border-color: var(--leaf-800);
  --bs-btn-disabled-bg: var(--leaf); --bs-btn-disabled-border-color: var(--leaf);
}
.btn-outline-primary {
  --bs-btn-color: var(--leaf); --bs-btn-border-color: var(--leaf-300); --bs-btn-hover-bg: var(--leaf);
  --bs-btn-hover-border-color: var(--leaf); --bs-btn-active-bg: var(--leaf-700);
}
.btn-ghost { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); box-shadow: var(--shadow-xs); }
.btn-ghost:hover { border-color: var(--leaf-300); color: var(--leaf-700); background: var(--leaf-50); }
.btn-quiet { background: transparent; border: 0; color: var(--ink-2); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-icon { width: 42px; height: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); }

/* Boutons « 3D » de l'espace enfant : grands, tactiles, avec un relief qui s'enfonce. */
.btn-chunky {
  --c-bg: var(--leaf); --c-edge: var(--leaf-800); --c-fg: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 56px; padding: .85rem 1.6rem; border: 0; border-radius: var(--r-lg);
  background: var(--c-bg); color: var(--c-fg); font-weight: 900; font-size: 1.12rem; letter-spacing: .01em;
  box-shadow: 0 5px 0 var(--c-edge); transform: translateY(0);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s; text-decoration: none; cursor: pointer;
}
.btn-chunky:hover { filter: brightness(1.06); color: var(--c-fg); }
.btn-chunky:active, .btn-chunky.is-pressed { transform: translateY(4px); box-shadow: 0 1px 0 var(--c-edge); }
.btn-chunky:disabled { filter: grayscale(.6) opacity(.55); cursor: not-allowed; transform: none; }
.btn-chunky.sun { --c-bg: var(--sun); --c-edge: var(--sun-600); --c-fg: #4A3300; }
.btn-chunky.coral { --c-bg: var(--coral); --c-edge: var(--coral-600); --c-fg: #fff; }
.btn-chunky.sky { --c-bg: var(--sky-600); --c-edge: var(--sky-800); --c-fg: #fff; }
.btn-chunky.white { --c-bg: #fff; --c-edge: var(--line-strong); --c-fg: var(--ink); }
.btn-chunky.xl { min-height: 72px; font-size: 1.35rem; padding: 1rem 2.2rem; border-radius: var(--r-xl); }
.btn-chunky.sm { min-height: 44px; font-size: .95rem; padding: .55rem 1.1rem; border-radius: var(--r-md); box-shadow: 0 4px 0 var(--c-edge); }
.btn-chunky.block { width: 100%; }

/* ---------- Cartes ---------- */
.card-lk {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.25rem; box-shadow: var(--shadow-sm);
}
@media (min-width: 768px) { .card-lk { padding: 1.6rem; } }
.card-lk.tight { padding: 1rem 1.15rem; }
.card-lk.flush { padding: 0; overflow: hidden; }
.card-hover { transition: transform .18s var(--ease-spring), box-shadow .18s ease, border-color .18s; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.card-title-row h2, .card-title-row h3 { margin: 0; font-size: 1.08rem; }
.section-title { font-size: 1.15rem; font-weight: 900; margin: 0 0 .9rem; display: flex; align-items: center; gap: .5rem; }
.section-title .count { font-size: .8rem; color: var(--ink-3); font-weight: 800; }

/* ---------- Formulaires ---------- */
.form-control, .form-select {
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md); padding: .7rem .9rem; font-weight: 600;
  background-color: var(--surface);
}
.form-control:focus, .form-select:focus { border-color: var(--leaf-400); box-shadow: 0 0 0 4px rgba(31, 111, 92, .14); }
.form-control-lg { font-size: 1.15rem; padding: .85rem 1rem; border-radius: var(--r-lg); }
.form-label, .legend-label { font-weight: 800; font-size: .88rem; color: var(--ink); margin-bottom: .45rem; }
.form-text { color: var(--ink-3); font-weight: 600; font-size: .8rem; }
.invalid-feedback { font-weight: 700; }
.form-check-input:checked { background-color: var(--leaf); border-color: var(--leaf); }

/* Choix illustrés (radios masqués + étiquettes cliquables) */
.choice-input { position: absolute; opacity: 0; pointer-events: none; }
.choice-input:focus-visible + .choice-tile { outline: 3px solid var(--sun-600); outline-offset: 2px; }
.choice-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  width: 100%; height: 100%; margin: 0; padding: .9rem .75rem; text-align: center; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg); font-weight: 800; color: var(--ink);
  transition: border-color .15s, background .15s, transform .15s var(--ease-spring), box-shadow .15s;
}
.choice-tile:hover { border-color: var(--leaf-300); transform: translateY(-2px); }
.choice-input:checked + .choice-tile {
  border-color: var(--leaf); background: var(--leaf-50); box-shadow: 0 0 0 3px rgba(31, 111, 92, .15);
}
.choice-tile .check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--leaf); color: #fff; display: none; align-items: center; justify-content: center; font-size: .75rem;
}
.choice-wrap { position: relative; height: 100%; }
.choice-input:checked + .choice-tile .check { display: inline-flex; }
.age-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; }
@media (min-width: 576px) { .age-grid { grid-template-columns: repeat(10, 1fr); } }
.age-grid .choice-tile { padding: .7rem 0; font-size: 1.25rem; font-weight: 900; border-radius: var(--r-md); }
.age-grid .choice-tile small { font-size: .62rem; color: var(--ink-3); font-weight: 800; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
@media (min-width: 576px) { .avatar-grid { grid-template-columns: repeat(6, 1fr); } }
.avatar-grid .choice-tile { padding: .6rem .3rem; font-size: .72rem; color: var(--ink-2); }
.avatar-grid .choice-tile .avatar { margin-bottom: .15rem; }

/* Assistant pas à pas */
.stepper { display: flex; gap: .4rem; margin: 0 0 1.5rem; padding: 0; list-style: none; counter-reset: step; }
.stepper li {
  flex: 1; display: flex; flex-direction: column; gap: .35rem; font-size: .74rem; font-weight: 800; color: var(--ink-3);
}
.stepper li::before { content: ""; display: block; height: 6px; border-radius: var(--r-pill); background: var(--line); transition: background .25s; }
.stepper li.is-done::before, .stepper li.is-current::before { background: var(--leaf); }
.stepper li.is-current { color: var(--leaf-700); }
.wizard-step { animation: fadeUp .3s ease both; }
.js .wizard-step[hidden] { display: none !important; }
.wizard-step-title { font-size: 1.35rem; font-weight: 900; margin-bottom: .25rem; }

/* ---------- Pastilles & puces ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); font-size: .86rem; font-weight: 850; color: var(--ink);
  box-shadow: var(--shadow-xs); white-space: nowrap;
}
.pill .emoji { font-size: 1rem; }
.pill.gold { background: var(--sun-50); border-color: var(--sun-100); color: var(--sun-800); }
.pill.streak { background: var(--coral-50); border-color: var(--coral-100); color: var(--coral-800); }
.pill.bloom { background: var(--leaf-50); border-color: var(--leaf-100); color: var(--leaf-700); }
.pill.level { background: var(--sky-50); border-color: var(--sky-100); color: var(--sky-800); }
.pill.bump { animation: bump .5s var(--ease-spring); }
.tag {
  display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: var(--r-pill);
  font-size: .74rem; font-weight: 800; background: var(--surface-2); color: var(--ink-2);
}
.tag.leaf { background: var(--leaf-50); color: var(--leaf-700); }
.tag.sun { background: var(--sun-50); color: var(--sun-800); }
.tag.coral { background: var(--coral-50); color: var(--coral-800); }
.tag.sky { background: var(--sky-50); color: var(--sky-800); }
.tag.violet { background: var(--violet-50); color: var(--violet-700); }
.stage-chip { font-size: .72rem; font-weight: 850; padding: .22rem .6rem; border-radius: var(--r-pill); white-space: nowrap; display: inline-flex; gap: .3rem; align-items: center; }
.stage-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.stage-0 { background: #F3EFE6; color: #7A6F5C; }
.stage-1 { background: var(--sun-50); color: var(--sun-800); }
.stage-2 { background: var(--leaf-50); color: var(--leaf); }
.stage-3 { background: #DCF0E4; color: var(--leaf-800); }

/* ---------- Avatars ---------- */
.avatar {
  --size: 48px;
  width: var(--size); height: var(--size); flex: 0 0 auto; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--avatar-bg, var(--leaf-50)); font-family: var(--emoji); font-size: calc(var(--size) * .56); line-height: 1;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .06), 0 0 0 3px #fff, var(--shadow-sm);
}
.avatar-sm { --size: 36px; }
.avatar-lg { --size: 72px; }
.avatar-xl { --size: 104px; }

/* ---------- Illustrations de vocabulaire ---------- */
.icon-badge {
  --size: 52px;
  width: var(--size); height: var(--size); border-radius: calc(var(--size) * .26); flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; position: relative;
}
.icon-badge svg { width: 74%; height: 74%; }
.icon-badge .icon-emoji { font-family: var(--emoji); font-size: calc(var(--size) * .58); line-height: 1; }
.icon-badge.lvl1 { background: var(--leaf-50); }
.icon-badge.lvl2 { background: var(--sun-50); }
.icon-badge.lvl3 { background: var(--coral-50); }
.icon-badge-xs { --size: 30px; }
.icon-badge-sm { --size: 38px; }
.icon-badge-md { --size: 52px; }
.icon-badge-lg { --size: 76px; }
.icon-badge-xl { --size: 148px; }
@media (max-width: 575.98px) { .icon-badge-xl { --size: 124px; } }

/* ---------- Mascotte ---------- */
.mascot-row { display: flex; align-items: flex-end; gap: .75rem; }
.mascot { width: 58px; height: 58px; flex: 0 0 auto; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .1)); }
.mascot-lg { width: 120px; height: 120px; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .08)); }
.mascot.bob, .mascot-lg.bob { animation: bob 3.2s ease-in-out infinite; }
.bubble {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 18px 6px;
  padding: .7rem 1rem; font-size: .96rem; font-weight: 750; color: var(--ink); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: .5rem;
}
.speak-btn {
  border: 0; background: var(--sky-50); color: var(--sky-800); width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; cursor: pointer;
  transition: background .15s, transform .1s;
}
.speak-btn:hover { background: var(--sky-100); }
.speak-btn:active { transform: scale(.94); }
.speak-btn.sm { width: 28px; height: 28px; font-size: .85rem; }
.speak-btn.pulsing, .sound-btn.pulsing { animation: ring 1.1s ease-out infinite; }

/* ---------- Messages ---------- */
.flash-stack { display: grid; gap: .5rem; }
.flash {
  display: flex; align-items: flex-start; gap: .7rem; padding: .8rem 1rem; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); border-left-width: 5px; font-weight: 700; box-shadow: var(--shadow-sm);
  animation: fadeUp .3s ease both;
}
.flash .btn-close { margin-left: auto; font-size: .7rem; }
.flash-success { border-left-color: var(--leaf); }
.flash-info { border-left-color: var(--sky-600); }
.flash-warning { border-left-color: var(--sun-600); }
.flash-danger { border-left-color: var(--coral-600); }

/* ---------- Pied de page ---------- */
.lk-footer { font-size: .82rem; color: var(--ink-3); border-top: 1px solid var(--line); background: var(--surface-2); }
.lk-footer a { color: var(--ink-2); font-weight: 700; text-decoration: none; }
.lk-footer a:hover { color: var(--leaf); }

/* ==========================================================================
   Site public
   ========================================================================== */
.hero { padding: 2.5rem 0 3rem; position: relative; }
@media (min-width: 992px) { .hero { padding: 4.5rem 0 4rem; } }
.hero-blob {
  position: absolute; inset: -10% -20% auto auto; width: 620px; height: 620px; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgba(255, 200, 87, .35), transparent 70%);
}
.hero-demo { position: relative; }
.hero-demo .card-lk { box-shadow: var(--shadow-lg); border-radius: var(--r-xl); }
.hero-float {
  position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: .45rem .85rem; font-weight: 850; font-size: .85rem; box-shadow: var(--shadow-md); display: flex; gap: .4rem; align-items: center;
}
.hero-float.f1 { top: -18px; right: 8%; animation: bob 4s ease-in-out infinite; }
.hero-float.f2 { bottom: -16px; left: -12px; animation: bob 4.6s ease-in-out infinite .6s; }
.trust-row { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; color: var(--ink-2); font-weight: 700; font-size: .88rem; }
.trust-row i { color: var(--leaf); }
.feature-icon {
  width: 48px; height: 48px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.35rem; margin-bottom: .8rem;
}
.bg-leaf-soft { background: var(--leaf-50); color: var(--leaf-700); }
.bg-sun-soft { background: var(--sun-50); color: var(--sun-800); }
.bg-coral-soft { background: var(--coral-50); color: var(--coral-800); }
.bg-sky-soft { background: var(--sky-50); color: var(--sky-800); }
.bg-violet-soft { background: var(--violet-50); color: var(--violet-700); }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--leaf); color: #fff; font-weight: 900;
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 0 var(--leaf-800);
}
.type-chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: .9rem; box-shadow: var(--shadow-xs);
}
.theme-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.cta-band {
  background: linear-gradient(135deg, var(--leaf) 0%, var(--leaf-700) 100%); color: #fff; border-radius: var(--r-xl);
  padding: 2.2rem; position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%;
  background: rgba(255, 200, 87, .25);
}
.formula { font-family: "Cambria Math", Georgia, serif; font-size: 1.25rem; background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: .6rem 1rem; display: inline-block; }

/* Pages d'authentification */
.auth-shell { max-width: 460px; margin: 0 auto; }
.auth-card { border-radius: var(--r-xl); box-shadow: var(--shadow-md); }

/* ==========================================================================
   Espace parents
   ========================================================================== */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.breadcrumb-lk { font-size: .82rem; font-weight: 750; color: var(--ink-3); margin-bottom: .35rem; }
.breadcrumb-lk a { color: var(--ink-2); text-decoration: none; }
.breadcrumb-lk a:hover { color: var(--leaf); }

.learner-card { display: flex; flex-direction: column; height: 100%; }
.learner-card .meta { font-size: .84rem; color: var(--ink-3); font-weight: 700; }
.learner-card-new {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; min-height: 240px;
  border: 2px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--ink-2); font-weight: 850; text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.learner-card-new:hover { border-color: var(--leaf-300); background: var(--leaf-50); color: var(--leaf-700); }
.learner-card-new .plus { width: 56px; height: 56px; border-radius: 50%; background: var(--leaf-50); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--leaf); }
.mini-meter { display: flex; height: 8px; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-2); }
.mini-meter i { display: block; height: 100%; }
.mini-meter .m-bloom { background: var(--leaf); }
.mini-meter .m-sprout { background: var(--leaf-300); }

.profile-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem; }
.profile-hero .info { flex: 1 1 260px; min-width: 0; }
.profile-hero h1 { margin: 0 0 .2rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.meta-row { display: flex; flex-wrap: wrap; gap: .4rem; }

.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem 1.1rem; height: 100%; box-shadow: var(--shadow-xs); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.kpi-label { font-size: .8rem; font-weight: 800; color: var(--ink-2); }
.kpi-icon { width: 34px; height: 34px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.kpi-value { font-size: 1.75rem; font-weight: 900; line-height: 1.1; letter-spacing: -.02em; }
.kpi-value small { font-size: .9rem; color: var(--ink-3); font-weight: 800; }
.kpi-hint { font-size: .76rem; color: var(--ink-3); font-weight: 700; margin-top: .25rem; }
.progress-thin { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.progress-thin > i { display: block; height: 100%; border-radius: inherit; background: var(--leaf); transition: width .6s ease; }
.progress-thin.sun > i { background: var(--sun-600); }
.progress-thin .target { position: relative; }

.bar-chart { display: grid; grid-template-columns: repeat(14, 1fr); align-items: end; gap: 6px; height: 170px; padding-top: 18px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bar {
  width: 100%; max-width: 28px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--leaf-400), var(--leaf));
  position: relative; min-height: 4px; transition: height .6s ease;
}
.bar.empty { background: var(--surface-2); }
.bar.today { background: linear-gradient(180deg, var(--sun), var(--sun-600)); }
.bar .bar-tip {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 850;
  color: var(--ink-2); white-space: nowrap;
}
.bar-label { font-size: .64rem; font-weight: 800; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 575.98px) { .bar-chart { gap: 3px; } .bar-label { font-size: .55rem; } .bar .bar-tip { display: none; } }

.theme-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .75rem; align-items: center; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.theme-row:last-child { border-bottom: 0; }
.theme-row .name { font-weight: 800; font-size: .92rem; display: flex; align-items: center; gap: .45rem; min-width: 0; }
.theme-row .name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-row .val { font-weight: 850; font-size: .82rem; color: var(--ink-2); text-align: right; }
.theme-row .progress-thin { grid-column: 1 / -1; }
.theme-row.weak .val { color: var(--coral-800); }

.tip-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.tip-list li { display: flex; gap: .6rem; align-items: flex-start; font-weight: 650; font-size: .92rem; background: var(--surface-2); border-radius: var(--r-md); padding: .7rem .85rem; }
.tip-list li i { color: var(--leaf); margin-top: .1rem; }

.table-lk { --bs-table-bg: transparent; font-size: .9rem; margin: 0; }
.table-lk th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 850; border-bottom: 1px solid var(--line) !important; white-space: nowrap; padding: .6rem .5rem; }
.table-lk td { vertical-align: middle; padding: .6rem .5rem; border-color: var(--line); }
.table-lk tbody tr:hover { background: var(--surface-2); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.filter-chip {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-pill); padding: .35rem .8rem;
  font-weight: 800; font-size: .8rem; color: var(--ink-2); cursor: pointer;
}
.filter-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.recall-meter { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; font-size: .82rem; }
.recall-meter .progress-thin { width: 56px; height: 6px; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .75rem; }
.medal { text-align: center; }
.medal-disc {
  --pct: 0;
  width: 64px; height: 64px; margin: 0 auto .4rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--emoji); font-size: 1.9rem; background: radial-gradient(circle at 35% 30%, #fff8e0, var(--sun) 75%);
  box-shadow: 0 4px 0 var(--sun-600), inset 0 -4px 0 rgba(0, 0, 0, .06);
}
.medal.locked .medal-disc {
  background: conic-gradient(var(--leaf-300) calc(var(--pct) * 1%), var(--surface-2) 0);
  box-shadow: none; position: relative;
}
.medal.locked .medal-disc::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.medal.locked .medal-disc span { position: relative; filter: grayscale(1); opacity: .45; }
.medal-name { font-size: .74rem; font-weight: 850; line-height: 1.2; }
.medal-sub { font-size: .66rem; font-weight: 700; color: var(--ink-3); }

/* ==========================================================================
   Espace enfant
   ========================================================================== */
body.kid {
  --bs-body-font-size: 1.05rem;
  background:
    radial-gradient(1200px 500px at 15% -10%, #FFF3CF 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #DDF0FB 0%, transparent 55%),
    var(--paper);
}
.kid-topbar {
  position: sticky; top: 0; z-index: 1020; padding: .6rem 0;
  background: rgba(251, 247, 238, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(220, 207, 183, .6);
}
.kid-topbar .inner { display: flex; align-items: center; gap: .6rem; }
.kid-id { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); min-width: 0; }
.kid-id .name { font-weight: 900; font-size: 1.1rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kid-id .sub { font-size: .74rem; font-weight: 800; color: var(--ink-3); }
.kid-stats { display: flex; gap: .4rem; margin-left: auto; }
@media (max-width: 575.98px) { .kid-stats .pill.level, .kid-stats .pill.bloom { display: none; } .kid-id .sub { display: none; } }
.tool-btn {
  width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; color: var(--ink-2);
  box-shadow: var(--shadow-xs); cursor: pointer; flex: 0 0 auto; text-decoration: none; transition: background .15s, color .15s;
}
.tool-btn:hover { background: var(--surface-2); color: var(--ink); }
.tool-btn.parent { color: var(--violet-700); }

.kid-hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 1.5rem;
  background: linear-gradient(160deg, #E9F6EE 0%, #D6EEDF 55%, #C6E6D3 100%); border: 1px solid #CDE6D7;
}
@media (min-width: 768px) { .kid-hero { padding: 2.2rem 2.4rem; } }
.kid-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 900; margin-bottom: .35rem; }
.kid-hero .hills { position: absolute; left: 0; right: 0; bottom: 0; height: 70px; pointer-events: none; }
.kid-hero .content { position: relative; z-index: 1; }
.resume-card {
  display: flex; align-items: center; gap: .9rem; padding: .9rem 1rem; border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .78); border: 1px solid rgba(255, 255, 255, .9); max-width: 460px;
}
.placement-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: var(--r-lg);
  background: var(--violet-50); border: 1px solid #E1D7F6;
}
.placement-banner .emoji { font-size: 2rem; }

.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
@media (min-width: 576px) { .theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .theme-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .theme-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.theme-card {
  --accent: var(--leaf);
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: 0 4px 0 var(--line-strong); transition: transform .18s var(--ease-spring), box-shadow .18s;
}
.theme-card:hover { transform: translateY(-4px); box-shadow: 0 8px 0 var(--line-strong); color: var(--ink); }
.theme-card:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line-strong); }
.theme-card .art {
  height: 92px; display: flex; align-items: center; justify-content: center; font-family: var(--emoji); font-size: 2.8rem;
  background: color-mix(in srgb, var(--accent) 16%, #fff);
  background-image: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .7) 0 18px, transparent 19px);
}
.theme-card .body { padding: .7rem .8rem .85rem; }
.theme-card .title { font-weight: 900; font-size: .95rem; line-height: 1.2; }
.theme-card .sub { font-size: .74rem; font-weight: 800; color: var(--ink-3); margin: .15rem 0 .5rem; }
.theme-card .progress-thin > i { background: var(--accent); }
.theme-card .stars { position: absolute; top: 8px; right: 8px; font-size: .8rem; letter-spacing: -1px; }
.theme-card .stars .off { filter: grayscale(1); opacity: .3; }
.theme-card.weak::after {
  content: "À revoir"; position: absolute; top: 8px; left: 8px; font-size: .62rem; font-weight: 900; text-transform: uppercase;
  letter-spacing: .05em; background: var(--coral); color: #fff; padding: .15rem .45rem; border-radius: var(--r-pill);
}
.theme-card.mix .art { background: conic-gradient(from 45deg, #FFE7A8, #FFD3C4, #D8ECFB, #DDF1E4, #FFE7A8); }

.garden-scene {
  position: relative; border-radius: var(--r-xl); overflow: hidden; border: 1px solid #D6E7DC;
  background: linear-gradient(180deg, #E4F4FB 0%, #EEF8F1 62%, #8BBF6A 62%, #7AAE5C 70%, var(--soil-light) 70%, var(--soil) 100%);
}
.garden-scene > .sun { position: absolute; top: 14px; right: 22px; width: 46px; height: 46px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 10px rgba(255, 200, 87, .25); }
.garden-plants { position: relative; display: flex; align-items: flex-end; gap: .25rem; overflow-x: auto; padding: 2.4rem 1rem .4rem; min-height: 170px; scrollbar-width: thin; }
.garden-plant { flex: 0 0 64px; text-align: center; }
.garden-plant svg { width: 56px; height: 56px; display: block; margin: 0 auto; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .18)); }
.garden-plant .lbl {
  font-size: .64rem; font-weight: 850; color: #fff; background: rgba(60, 40, 20, .35); border-radius: var(--r-pill);
  padding: .1rem .4rem; margin-top: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.garden-legend { position: absolute; left: 1rem; top: .8rem; display: flex; gap: .35rem; flex-wrap: wrap; z-index: 1; }
.garden-empty { position: relative; padding: 2.5rem 1rem 3.5rem; text-align: center; font-weight: 800; color: var(--leaf-800); }

.word-tile {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .35rem; padding: 1rem .6rem .8rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); height: 100%; box-shadow: var(--shadow-xs);
}
.word-tile .w-target { font-weight: 900; font-size: 1.05rem; line-height: 1.15; }
.word-tile .w-source { font-weight: 700; font-size: .8rem; color: var(--ink-3); }
.word-tile .plant-mini svg { width: 26px; height: 26px; }

/* ==========================================================================
   Écran de jeu (mode focus)
   ========================================================================== */
body.play { background: linear-gradient(180deg, #FFFBF2 0%, var(--paper) 100%); }
.play-top {
  position: sticky; top: 0; z-index: 1020; background: rgba(255, 251, 242, .92); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.play-top .inner { display: flex; align-items: center; gap: .9rem; padding: .8rem 0; }
.play-progress { flex: 1; height: 16px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; position: relative; }
.play-progress > i {
  display: block; height: 100%; border-radius: inherit; min-width: 16px;
  background: linear-gradient(90deg, var(--leaf-400), var(--leaf)); transition: width .5s var(--ease-spring);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .1);
}
.play-progress > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .35); }
.play-progress.placement > i { background: linear-gradient(90deg, #A891E2, var(--violet)); }
.play-count { font-weight: 900; font-size: .9rem; color: var(--ink-2); white-space: nowrap; }
.play-main { padding: 1rem 0 9rem; }
.play-stage { max-width: 760px; margin: 0 auto; }
.exercise-head { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.type-badge {
  display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: var(--r-pill);
  font-weight: 850; font-size: .82rem; background: var(--leaf-50); color: var(--leaf-700);
}
.level-badge { font-weight: 850; font-size: .78rem; color: var(--coral-800); background: var(--coral-50); border-radius: var(--r-pill); padding: .3rem .7rem; }
.prompt {
  display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; text-align: center;
  font-size: clamp(1.3rem, 3.4vw, 1.75rem); font-weight: 900; line-height: 1.25; margin: .4rem 0 1.4rem; color: var(--ink);
}
.prompt .quoted { color: var(--leaf); }
.prompt .blank {
  display: inline-block; min-width: 90px; border-bottom: 4px dotted var(--coral); color: var(--coral); margin: 0 .2rem;
}
.prompt-sub { text-align: center; color: var(--ink-2); font-weight: 700; margin: -.8rem 0 1.2rem; }
.figure { display: flex; justify-content: center; margin: .2rem 0 1.3rem; }
.figure .icon-badge { box-shadow: 0 6px 0 rgba(0, 0, 0, .06); animation: popIn .45s var(--ease-spring) both; }
.story-card {
  max-width: 600px; margin: 0 auto 1.2rem; background: #FFF8E6; border: 2px dashed #F1D9A0; border-radius: var(--r-lg);
  padding: 1rem 1.2rem; font-size: 1.15rem; font-weight: 750; line-height: 1.55; display: flex; gap: .8rem; align-items: flex-start;
}
.story-card .emoji { font-size: 1.8rem; }
.sound-btn {
  display: flex; align-items: center; justify-content: center; margin: 0 auto .5rem; width: 112px; height: 112px;
  border-radius: 50%; border: 0; background: var(--sky-600); color: #fff; font-size: 2.6rem; cursor: pointer;
  box-shadow: 0 7px 0 var(--sky-800); transition: transform .08s, box-shadow .08s;
}
.sound-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--sky-800); }
.sound-btn.sm { width: 76px; height: 76px; font-size: 1.8rem; box-shadow: 0 5px 0 var(--sky-800); }
.sound-hint { text-align: center; font-size: .84rem; color: var(--ink-3); font-weight: 750; margin-bottom: 1.2rem; }
.sound-row { display: flex; justify-content: center; align-items: center; gap: .8rem; margin-bottom: .4rem; }
.slow-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r-pill); font-weight: 800; font-size: .82rem; padding: .4rem .8rem; color: var(--ink-2); }

.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.options.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.options.cols-1 { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
@media (max-width: 420px) { .options.cols-3:not(.images) { grid-template-columns: 1fr; } }
.opt {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; min-height: 76px; padding: .9rem .8rem; border-radius: var(--r-lg);
  background: var(--surface); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line);
  font-weight: 850; font-size: 1.2rem; color: var(--ink); cursor: pointer; text-align: center;
  transition: transform .1s, box-shadow .1s, border-color .15s, background .15s;
}
.opt:hover:not(:disabled) { border-color: var(--leaf-300); box-shadow: 0 5px 0 var(--leaf-100); }
.opt:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.opt:disabled { cursor: default; }
.opt .key {
  position: absolute; top: 8px; left: 10px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line);
  font-size: .7rem; font-weight: 900; color: var(--ink-3); display: none; align-items: center; justify-content: center;
}
@media (hover: hover) and (pointer: fine) { .opt .key { display: inline-flex; } }
.options.images .opt { min-height: 140px; padding: 1rem; }
.options.images .opt .icon-badge { --size: 96px; }
@media (max-width: 575.98px) { .options.images .opt { min-height: 116px; } .options.images .opt .icon-badge { --size: 76px; } }
.opt.selected { border-color: var(--sky-600); background: var(--sky-50); box-shadow: 0 5px 0 var(--sky-100); }
.opt.correct { border-color: var(--leaf); background: var(--leaf-50); color: var(--leaf-800); box-shadow: 0 5px 0 var(--leaf-300); animation: tada .5s var(--ease-spring); }
.opt.wrong { border-color: var(--coral); background: var(--coral-50); color: var(--coral-800); box-shadow: 0 5px 0 var(--coral-100); animation: shake .4s; }
.opt.dim { opacity: .45; }
.opt.correct .key, .opt.wrong .key { display: none; }
.play-secondary { display: flex; justify-content: center; gap: .5rem; margin-top: 1.4rem; }

/* Lettres */
.letter-slots { display: flex; justify-content: center; gap: .45rem; flex-wrap: wrap; margin: 0 0 1.4rem; }
.letter-slot {
  width: 52px; height: 60px; border-radius: var(--r-md); border: 2px dashed var(--line-strong); background: var(--surface);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 900; text-transform: uppercase; color: var(--ink);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.letter-slot.filled { border-style: solid; border-color: var(--sky-600); background: var(--sky-50); animation: popIn .25s var(--ease-spring); }
.letter-slot.ok { border-color: var(--leaf); background: var(--leaf-50); color: var(--leaf-800); }
.letter-slot.ko { border-color: var(--coral); background: var(--coral-50); color: var(--coral-800); animation: shake .4s; }
.letter-bank { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.letter-tile {
  width: 56px; height: 62px; border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 5px 0 var(--line-strong); font-size: 1.6rem; font-weight: 900; text-transform: uppercase; color: var(--ink); cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.letter-tile:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--line-strong); }
.letter-tile:disabled { visibility: hidden; }
@media (max-width: 420px) { .letter-slot { width: 40px; height: 50px; font-size: 1.3rem; } .letter-tile { width: 46px; height: 54px; font-size: 1.35rem; } }
.attempts { text-align: center; font-weight: 800; font-size: .85rem; color: var(--ink-3); margin-top: 1rem; }
.attempts .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); margin: 0 2px; }
.attempts .dot.used { background: var(--coral); }

/* Memory */
.memory-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; max-width: 620px; margin: 0 auto; }
.memory-grid.n6 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 470px; }
@media (max-width: 480px) { .memory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .memory-grid.n6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mem-card { aspect-ratio: 1 / 1; perspective: 800px; border: 0; background: none; padding: 0; cursor: pointer; }
.mem-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s var(--ease-spring); }
.mem-card.up .mem-inner, .mem-card.matched .mem-inner { transform: rotateY(180deg); }
.mem-face {
  position: absolute; inset: 0; border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; padding: .4rem; text-align: center;
}
.mem-back {
  background: var(--leaf); box-shadow: 0 5px 0 var(--leaf-800); color: rgba(255, 255, 255, .85); font-size: 1.8rem;
  background-image: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .18) 0 12px, transparent 13px), radial-gradient(circle at 70% 70%, rgba(255, 255, 255, .12) 0 16px, transparent 17px);
}
.mem-front { transform: rotateY(180deg); background: var(--surface); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line); font-weight: 900; font-size: 1.05rem; word-break: break-word; }
.mem-front .icon-badge { --size: 70%; aspect-ratio: 1; height: auto; }
.mem-card.matched .mem-front { border-color: var(--leaf); background: var(--leaf-50); color: var(--leaf-800); box-shadow: 0 5px 0 var(--leaf-300); }
.mem-card.miss .mem-front { border-color: var(--coral); animation: shake .4s; }

/* Association */
.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 620px; margin: 0 auto; }
.match-col { display: grid; gap: .7rem; align-content: start; }
.match-item {
  min-height: 72px; border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--surface); box-shadow: 0 5px 0 var(--line);
  display: flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 900; font-size: 1.1rem; cursor: pointer; color: var(--ink);
  transition: transform .08s, box-shadow .08s, border-color .15s, background .15s;
}
.match-item .icon-badge { --size: 54px; }
.match-item.selected { border-color: var(--sky-600); background: var(--sky-50); box-shadow: 0 5px 0 var(--sky-100); }
.match-item.done { border-color: var(--leaf); background: var(--leaf-50); color: var(--leaf-800); box-shadow: 0 2px 0 var(--leaf-300); opacity: .75; cursor: default; }
.match-item.miss { border-color: var(--coral); animation: shake .4s; }
.match-item .pair-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }

/* Tri */
.sort-pool { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; min-height: 96px; margin-bottom: 1.2rem; }
.sort-chip {
  border: 2px solid var(--line); background: var(--surface); box-shadow: 0 5px 0 var(--line); border-radius: var(--r-lg);
  padding: .5rem .7rem; display: flex; flex-direction: column; align-items: center; gap: .25rem; cursor: pointer; font-weight: 850; font-size: .9rem; color: var(--ink);
  transition: transform .12s var(--ease-spring), border-color .15s;
}
.sort-chip .icon-badge { --size: 60px; }
.sort-chip.selected { border-color: var(--sky-600); background: var(--sky-50); transform: translateY(-4px) scale(1.04); }
.sort-baskets { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.basket {
  border: 2px dashed var(--line-strong); border-radius: var(--r-xl); background: var(--surface-2); min-height: 150px; padding: .8rem;
  display: flex; flex-direction: column; align-items: center; gap: .5rem; cursor: pointer; transition: border-color .15s, background .15s;
  font-weight: 900; color: var(--ink);
}
.basket .b-head { display: flex; align-items: center; gap: .4rem; font-size: 1rem; }
.basket .b-head .emoji { font-size: 1.5rem; }
.basket .b-items { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; }
.basket .b-items .icon-badge { --size: 44px; animation: popIn .3s var(--ease-spring); }
.basket.ready { border-color: var(--sky-600); background: var(--sky-50); }
.basket .b-items .icon-badge.ok { box-shadow: 0 0 0 3px var(--leaf); }
.basket .b-items .icon-badge.ko { box-shadow: 0 0 0 3px var(--coral); }

/* Prononciation */
.speak-zone { display: flex; flex-direction: column; align-items: center; gap: .9rem; }
.speak-word { font-size: clamp(1.8rem, 5vw, 2.6rem); font-weight: 900; color: var(--leaf-700); letter-spacing: -.01em; }
.mic-btn {
  width: 104px; height: 104px; border-radius: 50%; border: 0; background: var(--coral); color: #fff; font-size: 2.4rem; cursor: pointer;
  box-shadow: 0 7px 0 var(--coral-600); transition: transform .08s, box-shadow .08s;
}
.mic-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--coral-600); }
.mic-btn.listening { animation: ringCoral 1s ease-out infinite; }
.self-check { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.mic-status { font-weight: 800; color: var(--ink-2); min-height: 1.5em; text-align: center; }

/* Panneau de retour (bas d'écran) */
.feedback-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1040; transform: translateY(110%);
  transition: transform .35s var(--ease-spring); padding: 1.1rem 0 calc(1.1rem + env(safe-area-inset-bottom));
  border-top: 2px solid transparent; background: var(--surface);
}
.feedback-sheet.show { transform: translateY(0); }
.feedback-sheet.is-correct { background: #E5F5EA; border-top-color: #BFE3CB; }
.feedback-sheet.is-wrong { background: #FFECE5; border-top-color: #FFCBBB; }
.feedback-sheet .inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.feedback-sheet .fb-icon {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
  background: #fff; flex: 0 0 auto; box-shadow: var(--shadow-sm);
}
.feedback-sheet .fb-text { flex: 1 1 240px; min-width: 0; }
.feedback-sheet .fb-title { font-size: 1.35rem; font-weight: 900; line-height: 1.2; }
.feedback-sheet.is-correct .fb-title { color: var(--leaf-800); }
.feedback-sheet.is-wrong .fb-title { color: var(--coral-800); }
.feedback-sheet .fb-detail { font-weight: 750; color: var(--ink-2); font-size: .95rem; }
.feedback-sheet .fb-answer { display: inline-flex; align-items: center; gap: .5rem; margin-top: .35rem; font-weight: 900; background: #fff; border-radius: var(--r-pill); padding: .25rem .4rem .25rem .3rem; }
.feedback-sheet .fb-answer .icon-badge { --size: 34px; }
.feedback-sheet .fb-points { font-weight: 900; color: var(--sun-800); background: var(--sun-50); border-radius: var(--r-pill); padding: .2rem .6rem; font-size: .85rem; margin-left: .4rem; }
@media (max-width: 575.98px) { .feedback-sheet .btn-chunky { width: 100%; } }
.play-error { text-align: center; color: var(--coral-800); font-weight: 800; min-height: 1.4em; margin-top: 1rem; }

/* Dialogues */
.lk-dialog {
  border: 0; border-radius: var(--r-xl); padding: 0; width: min(92vw, 420px); box-shadow: var(--shadow-lg); background: var(--surface); color: var(--ink);
}
.lk-dialog::backdrop { background: rgba(30, 43, 38, .5); backdrop-filter: blur(2px); }
.lk-dialog[open] { animation: popIn .35s var(--ease-spring); }
.lk-dialog .d-body { padding: 1.8rem 1.6rem 1.4rem; text-align: center; }
.lk-dialog .big { font-size: 3.4rem; font-family: var(--emoji); line-height: 1; margin-bottom: .6rem; }
.lk-dialog h2 { font-size: 1.4rem; font-weight: 900; }
.badge-burst {
  width: 120px; height: 120px; margin: 0 auto .8rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--emoji); font-size: 3.6rem; background: radial-gradient(circle at 35% 30%, #fff8e0, var(--sun) 75%);
  box-shadow: 0 6px 0 var(--sun-600), 0 0 0 10px rgba(255, 200, 87, .25); animation: wiggle 1.4s ease-in-out infinite;
}

/* Bilan */
.summary-hero { text-align: center; padding: 1.5rem 1rem 1rem; }
.star-row { display: flex; justify-content: center; gap: .6rem; margin: .4rem 0 1rem; }
.star-row .star { font-family: var(--emoji); font-size: 3.4rem; line-height: 1; animation: starIn .6s var(--ease-spring) both; }
.star-row .star:nth-child(2) { animation-delay: .15s; font-size: 4.2rem; margin-top: -.6rem; }
.star-row .star:nth-child(3) { animation-delay: .3s; }
.star-row .star.off { filter: grayscale(1); opacity: .25; }
.stat-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; max-width: 560px; margin: 0 auto; }
.stat-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .9rem .6rem; text-align: center; box-shadow: var(--shadow-xs); }
.stat-box .v { font-size: 1.6rem; font-weight: 900; line-height: 1.1; }
.stat-box .l { font-size: .74rem; font-weight: 800; color: var(--ink-3); }
.word-chip-grid { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.word-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .75rem .3rem .3rem; border-radius: var(--r-pill); background: var(--surface); border: 1.5px solid var(--line); font-weight: 850; }
.word-chip .icon-badge { --size: 34px; }
.word-chip.ok { border-color: var(--leaf-100); background: var(--leaf-50); }
.word-chip.ko { border-color: var(--coral-100); background: var(--coral-50); }
details.parents-details > summary { cursor: pointer; font-weight: 850; color: var(--ink-2); list-style: none; display: inline-flex; align-items: center; gap: .4rem; }
details.parents-details > summary::-webkit-details-marker { display: none; }
details.parents-details[open] > summary i { transform: rotate(90deg); }
details.parents-details > summary i { transition: transform .2s; }

/* Niveaux (onboarding & test) */
.level-card {
  display: block; height: 100%; margin: 0; border: 2px solid var(--line); border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  background: var(--surface); transition: transform .15s var(--ease-spring), border-color .15s, box-shadow .15s;
}
.level-card:hover { transform: translateY(-2px); border-color: var(--leaf-300); }
.choice-input:checked + .level-card { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(31, 111, 92, .15); }
.choice-input:focus-visible + .level-card { outline: 3px solid var(--sun-600); outline-offset: 2px; }
.level-scene { width: 100%; height: auto; aspect-ratio: 22 / 11; display: block; }
.level-body { padding: .8rem 1rem 1rem; display: block; }
.level-title { font-weight: 900; font-size: 1rem; display: flex; align-items: center; gap: .4rem; }
.level-desc { font-size: .82rem; color: var(--ink-2); font-weight: 650; margin: .25rem 0 .6rem; line-height: 1.4; display: block; }
.level-preview { display: flex; gap: .3rem; }
.level-preview .icon-badge { --size: 30px; }
.level-card .level-check { display: none; margin-left: auto; color: var(--leaf); }
.choice-input:checked + .level-card .level-check { display: inline; }
.mode-card { display: flex; gap: .9rem; align-items: flex-start; text-align: left; padding: 1rem 1.1rem; }
.mode-card .emoji { font-size: 1.9rem; }
.mode-card .t { font-weight: 900; font-size: 1rem; display: block; }
.mode-card .d { font-weight: 650; font-size: .84rem; color: var(--ink-2); display: block; }
.mode-card .rec { font-size: .66rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--violet-700); background: var(--violet-50); padding: .12rem .45rem; border-radius: var(--r-pill); }
.level-result { display: inline-flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1rem 1.6rem; border-radius: var(--r-xl); background: var(--surface); border: 2px solid var(--leaf-100); box-shadow: var(--shadow-md); }
.level-result .emoji { font-size: 3rem; }
.level-result .name { font-size: 1.5rem; font-weight: 900; color: var(--leaf-700); }
.level-ladder { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; }
.level-ladder span { padding: .35rem .8rem; border-radius: var(--r-pill); font-weight: 850; font-size: .82rem; background: var(--surface-2); color: var(--ink-3); }
.level-ladder span.on { background: var(--leaf); color: #fff; }

/* Contrôle parental */
.gate-card { max-width: 420px; margin: 2rem auto; text-align: center; }
.gate-lock { width: 84px; height: 84px; margin: 0 auto 1rem; border-radius: 50%; background: var(--violet-50); color: var(--violet-700); display: flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.pin-input { text-align: center; font-size: 1.6rem !important; letter-spacing: .5em; font-weight: 900 !important; }

/* Certificat */
.certificate {
  position: relative; max-width: 860px; margin: 0 auto; background: #FFFDF7; border-radius: 18px; padding: 3rem 2rem;
  text-align: center; box-shadow: var(--shadow-lg); border: 1px solid #EFE3C4;
}
.certificate::before { content: ""; position: absolute; inset: 14px; border: 3px double #E2C477; border-radius: 12px; pointer-events: none; }
.certificate .seal {
  width: 96px; height: 96px; margin: 0 auto 1rem; border-radius: 50%; font-family: var(--emoji); font-size: 2.8rem; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #fff8e0, var(--sun) 75%); box-shadow: 0 5px 0 var(--sun-600);
}
.certificate .kicker { letter-spacing: .3em; text-transform: uppercase; font-weight: 900; font-size: .78rem; color: var(--sun-800); }
.certificate h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; margin: .4rem 0 1rem; }
.certificate .who { font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; color: var(--leaf-700); border-bottom: 2px solid #EADCB6; display: inline-block; padding: 0 1.5rem .3rem; margin: .3rem 0 1rem; }
.certificate .facts { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; margin: 1.4rem 0; }
.certificate .facts .v { font-size: 1.8rem; font-weight: 900; color: var(--ink); }
.certificate .facts .l { font-size: .75rem; font-weight: 800; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.certificate .sign { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: 2rem; font-size: .82rem; color: var(--ink-2); font-weight: 700; }
.certificate .sign .line { border-top: 1.5px solid var(--line-strong); padding-top: .3rem; min-width: 160px; }

/* Confettis */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 1100; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(.85); } 100% { opacity: 1; transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes tada { 0% { transform: scale(1); } 40% { transform: scale(1.06) rotate(-1deg); } 70% { transform: scale(1.02) rotate(1deg); } 100% { transform: scale(1); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes starIn { 0% { opacity: 0; transform: scale(.2) rotate(-30deg); } 100% { opacity: 1; transform: none; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(47, 134, 184, .45); } 100% { box-shadow: 0 0 0 18px rgba(47, 134, 184, 0); } }
@keyframes ringCoral { 0% { box-shadow: 0 7px 0 var(--coral-600), 0 0 0 0 rgba(255, 122, 89, .5); } 100% { box-shadow: 0 7px 0 var(--coral-600), 0 0 0 22px rgba(255, 122, 89, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Impression (rapport parents, certificat) ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; }
  .lk-navbar, .kid-topbar, .lk-footer, .no-print, .btn, .flash-stack, .filter-bar { display: none !important; }
  .card-lk, .kpi { box-shadow: none !important; break-inside: avoid; }
  main { padding: 0 !important; }
  .certificate { box-shadow: none; border: 0; }
  a { text-decoration: none; color: inherit; }
}

/* Drapeaux SVG (remplacent les emoji-drapeaux, absents sous Windows) */
.flag { display: inline-block; width: auto; aspect-ratio: 3 / 2; vertical-align: -.12em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
/* Un message d'erreur masqué reste masqué, même avec .d-block */
[data-error-for][hidden] { display: none !important; }
@media (max-width: 575.98px) {
  .kid-topbar .kid-id .name { max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .kid-topbar .kid-id .sub { white-space: nowrap; }
}
