/* ClicksLettres — « L'archipel des sons ». Palette : une famille de sons = une couleur. */
:root {
  --ink: #23264a; --ink-soft: #5b6187; --paper: #ffffff; --sky1: #fff6ec; --sky2: #eaf3ff; --sky3: #f6edff;
  --line: rgba(35, 38, 74, .09); --shadow: 0 10px 30px -12px rgba(35, 38, 74, .28); --shadow-lg: 0 24px 60px -20px rgba(35, 38, 74, .38);
  --ok: #12b886; --ko: #fa5252; --gold: #ffc53d; --radius: 22px;
  --f-voyelles-1: #ff6b6b; --f-voyelles-2: #ffa94d;
  --f-nasales-1: #9b5de5;  --f-nasales-2: #f15bb5;
  --f-composes-1: #0ca678; --f-composes-2: #63e6be;
  --f-consonnes-1: #3a86ff; --f-consonnes-2: #4cc9f0;
  --c1: #ff6b6b; --c2: #ffa94d; /* couleur courante (remplacée par la famille) */
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #eef0ff; --ink-soft: #b4b9dc; --paper: #20233f; --sky1: #141631; --sky2: #171a3a; --sky3: #1d1838;
  --line: rgba(255, 255, 255, .1); --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eef0ff; --ink-soft: #b4b9dc; --paper: #20233f; --sky1: #141631; --sky2: #171a3a; --sky3: #1d1838;
    --line: rgba(255, 255, 255, .1); --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
.fam-voyelles  { --c1: var(--f-voyelles-1);  --c2: var(--f-voyelles-2); }
.fam-nasales   { --c1: var(--f-nasales-1);   --c2: var(--f-nasales-2); }
.fam-composes  { --c1: var(--f-composes-1);  --c2: var(--f-composes-2); }
.fam-consonnes { --c1: var(--f-consonnes-1); --c2: var(--f-consonnes-2); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: "Nunito", system-ui, sans-serif; color: var(--ink);
  background: linear-gradient(160deg, var(--sky1), var(--sky2) 45%, var(--sky3)); background-attachment: fixed;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--c1); outline-offset: 3px; border-radius: 12px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Décor : bulles floues animées ---------- */
.blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; animation: drift 22s ease-in-out infinite alternate; }
.blobs i:nth-child(1) { width: 380px; height: 380px; background: var(--f-voyelles-2); top: -120px; left: -80px; }
.blobs i:nth-child(2) { width: 320px; height: 320px; background: var(--f-nasales-2); top: 30%; right: -120px; animation-delay: -6s; }
.blobs i:nth-child(3) { width: 360px; height: 360px; background: var(--f-composes-2); bottom: -140px; left: 20%; animation-delay: -12s; }
.blobs i:nth-child(4) { width: 260px; height: 260px; background: var(--f-consonnes-2); top: 55%; left: -100px; animation-delay: -3s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15); } }

/* ---------- Barre du haut (verre dépoli) ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 10px clamp(12px, 3vw, 28px); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  background: color-mix(in srgb, var(--paper) 72%, transparent); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; min-width: 0; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font: 700 22px "Fredoka", sans-serif; color: #fff;
  background: conic-gradient(from 210deg, var(--f-voyelles-1), var(--f-nasales-1), var(--f-composes-1), var(--f-consonnes-1), var(--f-voyelles-1));
  box-shadow: 0 6px 16px -6px rgba(155, 93, 229, .7); flex: none;
}
.brand-txt { font: 700 clamp(18px, 2.4vw, 22px) "Fredoka", sans-serif; letter-spacing: .3px; white-space: nowrap; }
.brand-txt small { display: block; font: 600 12px "Nunito", sans-serif; color: var(--ink-soft); letter-spacing: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 800;
  background: var(--paper); box-shadow: var(--shadow); white-space: nowrap; text-decoration: none; color: inherit;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s;
}
.chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.chip:active { transform: scale(.95); }
.chip.stars { background: linear-gradient(135deg, #fff3c4, #ffd666); color: #7a4b00; }
.chip .ico { font-size: 18px; line-height: 1; }
@media (max-width: 560px) { .chip .lbl { display: none; } .brand-txt small { display: none; } }

/* ---------- Carte : en-tête héros ---------- */
.wrap { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 32px) 60px; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: clamp(24px, 5vw, 56px) 0 18px; }
.hero h1 { margin: 0; font: 700 clamp(32px, 6vw, 58px)/1.02 "Fredoka", sans-serif; letter-spacing: -.5px; }
.hero h1 .grad {
  background: linear-gradient(90deg, var(--f-voyelles-1), var(--f-nasales-1), var(--f-composes-1), var(--f-consonnes-1), var(--f-voyelles-1));
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 9s linear infinite;
}
@keyframes shine { to { background-position: 300% 0; } }
.hero p { margin: 12px 0 0; font-size: clamp(16px, 2.2vw, 19px); color: var(--ink-soft); max-width: 560px; }
.hero-cta { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px; border-radius: 18px;
  font: 700 19px "Fredoka", sans-serif; color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 12px 26px -10px var(--c1), inset 0 -4px 0 rgba(0, 0, 0, .14); transition: transform .22s cubic-bezier(.3, 1.6, .5, 1), box-shadow .22s, filter .2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-3px) scale(1.02); filter: saturate(1.15); }
.btn:active { transform: translateY(1px) scale(.97); box-shadow: 0 6px 14px -8px var(--c1), inset 0 -2px 0 rgba(0, 0, 0, .14); }
.btn:disabled { filter: grayscale(.8); opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: var(--shadow), inset 0 -4px 0 var(--line); }
.btn.big { min-height: 68px; font-size: 22px; padding: 0 34px; border-radius: 22px; }
.ring { --p: 0; width: clamp(120px, 18vw, 170px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), color-mix(in srgb, var(--ink) 10%, transparent) 0); box-shadow: var(--shadow-lg);
  transition: --p 1s; }
.ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--paper); }
.ring div { position: relative; text-align: center; }
.ring b { display: block; font: 700 clamp(28px, 4vw, 40px) "Fredoka", sans-serif; }
.ring span { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
@media (max-width: 640px) { .hero { grid-template-columns: 1fr; } .ring { justify-self: start; width: 120px; } }

/* ---------- Régions et chemin d'îles ---------- */
.region { margin-top: 34px; border-radius: 32px; padding: 22px clamp(14px, 3vw, 28px) 28px; position: relative;
  background: color-mix(in srgb, var(--paper) 70%, transparent); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.region::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.reg-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.reg-ico { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 20px -10px var(--c1); }
.reg-head h2 { margin: 0; font: 700 clamp(22px, 3vw, 28px) "Fredoka", sans-serif; }
.reg-head p { margin: 2px 0 0; color: var(--ink-soft); font-weight: 600; }
.reg-head .chip { margin-left: auto; }
.path { position: relative; margin-top: 10px; }
.path svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.path svg path { fill: none; stroke: color-mix(in srgb, var(--c1) 45%, transparent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 16;
  animation: march 1.6s linear infinite; }
@keyframes march { to { stroke-dashoffset: -18; } }
.isle {
  position: absolute; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, #fff9, transparent 42%), linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: 0 14px 22px -12px var(--c1), inset 0 -7px 0 rgba(0, 0, 0, .14), 0 0 0 6px color-mix(in srgb, var(--paper) 80%, transparent);
  color: #fff; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), box-shadow .25s; animation: pop-in .55s cubic-bezier(.3, 1.6, .5, 1) backwards;
  animation-delay: calc(var(--i) * 45ms);
}
.isle:hover { transform: translateY(-6px) scale(1.07) rotate(-3deg); box-shadow: 0 22px 30px -14px var(--c1), inset 0 -7px 0 rgba(0, 0, 0, .14), 0 0 0 8px color-mix(in srgb, var(--c2) 35%, transparent); }
.isle:active { transform: scale(.94); }
.isle .g { font: 700 34px/1 "Andika", "Fredoka", sans-serif; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.isle .g.long { font-size: 26px; }
.isle .st { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font-size: 15px; letter-spacing: -1px; white-space: nowrap;
  background: var(--paper); padding: 2px 8px; border-radius: 999px; box-shadow: var(--shadow); color: #d6d9ea; }
.isle .st b { color: var(--gold); font-weight: 400; }
.isle.done::after { content: "✓"; position: absolute; top: -4px; right: -4px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok); color: #fff; font-weight: 900; font-size: 16px; box-shadow: 0 4px 10px -4px var(--ok); }
.isle.next { animation: pop-in .55s cubic-bezier(.3, 1.6, .5, 1) backwards, halo 1.8s ease-in-out infinite; animation-delay: calc(var(--i) * 45ms), 0s; }
@keyframes halo { 50% { box-shadow: 0 14px 22px -12px var(--c1), inset 0 -7px 0 rgba(0, 0, 0, .14), 0 0 0 14px color-mix(in srgb, var(--c2) 40%, transparent); } }
.owl-pin { position: absolute; z-index: 2; pointer-events: none; transform: translate(-50%, -100%); animation: bob 2.2s ease-in-out infinite; }
.owl-pin span { display: block; font-size: 40px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); text-align: center; }
.owl-pin em { display: block; font: 700 13px "Fredoka", sans-serif; font-style: normal; background: var(--ink); color: var(--paper); border-radius: 10px; padding: 3px 9px; white-space: nowrap; margin-bottom: 2px; }
@keyframes bob { 50% { transform: translate(-50%, calc(-100% - 8px)); } }
@keyframes pop-in { from { opacity: 0; transform: scale(.3) translateY(20px); } }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .9, .3, 1); }
.reveal.in { opacity: 1; transform: none; }

.parents { margin-top: 34px; border-radius: 24px; padding: 4px 22px; background: color-mix(in srgb, var(--paper) 70%, transparent); border: 1px solid var(--line); }
.parents summary { cursor: pointer; padding: 16px 0; font: 700 18px "Fredoka", sans-serif; list-style: none; display: flex; align-items: center; gap: 10px; }
.parents summary::after { content: "▾"; margin-left: auto; transition: transform .25s; }
.parents[open] summary::after { transform: rotate(180deg); }
.parents ol, .parents p { color: var(--ink-soft); line-height: 1.6; }
.credits { font-size: 13px; color: var(--ink-soft); text-align: center; margin-top: 26px; }
.credits a { color: inherit; }

/* ---------- Leçon (plein écran) ---------- */
.lesson { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; overflow: hidden;
  background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--c2) 28%, transparent), transparent), linear-gradient(160deg, var(--sky1), var(--sky2));
  animation: lesson-in .45s cubic-bezier(.2, .9, .3, 1); }
@keyframes lesson-in { from { opacity: 0; transform: scale(.97) translateY(18px); } }
.lesson.out { animation: lesson-out .3s ease forwards; }
@keyframes lesson-out { to { opacity: 0; transform: scale(.98) translateY(14px); } }
.l-top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top, 0px)) clamp(12px, 3vw, 26px) 10px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: color-mix(in srgb, var(--paper) 65%, transparent); border-bottom: 1px solid var(--line); }
.l-badge { min-width: 58px; height: 58px; padding: 0 12px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  font: 700 30px/1 "Andika", "Fredoka", sans-serif; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 18px -10px var(--c1); }
.steps { display: flex; gap: 6px; margin: 0 auto; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.step { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 999px; font-weight: 800; color: var(--ink-soft); transition: all .3s; }
.step .si { font-size: 20px; }
.step.on { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; box-shadow: 0 8px 16px -8px var(--c1); }
.step.ok:not(.on) { color: var(--ok); }
.step.ok:not(.on) .sl::after { content: " ✓"; }
@media (max-width: 860px) { .step .sl { display: none; } .step { padding: 0 11px; } }
.l-stars { display: flex; gap: 2px; font-size: 24px; }
.l-stars span { filter: grayscale(1) opacity(.3); transition: filter .4s, transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.l-stars span.on { filter: none; transform: scale(1.15); }
.l-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: clamp(14px, 3vw, 30px) clamp(14px, 4vw, 40px) 40px; }
.stage { max-width: 960px; margin: 0 auto; animation: stage-in .45s cubic-bezier(.2, .9, .3, 1); }
@keyframes stage-in { from { opacity: 0; transform: translateX(24px); } }
.l-foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px clamp(12px, 3vw, 26px) calc(12px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--paper) 65%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.l-foot .btn { min-width: 150px; }
.btn.pulse { animation: cta 1.6s ease-in-out infinite; }
@keyframes cta { 50% { box-shadow: 0 12px 26px -10px var(--c1), inset 0 -4px 0 rgba(0, 0, 0, .14), 0 0 0 10px color-mix(in srgb, var(--c2) 30%, transparent); } }

/* Nour la chouette */
.nour { display: flex; align-items: flex-end; gap: 10px; margin: 0 auto 18px; max-width: 760px; }
.nour .owl { font-size: 48px; line-height: 1; animation: owl 3s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .15)); flex: none; }
@keyframes owl { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-4px); } }
.nour .bubble { position: relative; background: var(--paper); border-radius: 20px 20px 20px 6px; padding: 12px 18px; font-weight: 700; font-size: 18px; box-shadow: var(--shadow);
  animation: pop-in .5s cubic-bezier(.3, 1.6, .5, 1) backwards .1s; }
.nour .bubble mark, .word mark { background: none; color: var(--c1); font-weight: 900; }

/* Découvrir */
.big-g { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.big-letter { position: relative; font: 700 clamp(120px, 24vw, 210px)/1 "Andika", "Fredoka", sans-serif; letter-spacing: 2px;
  background: linear-gradient(160deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 12px 18px color-mix(in srgb, var(--c1) 40%, transparent)); animation: letter-in .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes letter-in { from { opacity: 0; transform: scale(.2) rotate(-12deg); } }
.big-letter.wiggle { animation: wiggle .5s ease; }
@keyframes wiggle { 25% { transform: rotate(-6deg) scale(1.06); } 75% { transform: rotate(6deg) scale(1.06); } }
.play {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 14px 24px -12px var(--c1), inset 0 -5px 0 rgba(0, 0, 0, .15);
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); position: relative;
}
.play:hover { transform: scale(1.08); }
.play:active { transform: scale(.94); }
.play.sm { width: 56px; height: 56px; font-size: 24px; }
.play.playing::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 4px solid var(--c2); animation: ripple 1s ease-out infinite; }
@keyframes ripple { from { opacity: .9; transform: scale(.9); } to { opacity: 0; transform: scale(1.35); } }
.ecr { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; color: var(--ink-soft); font-weight: 700; }
.ecr button { font: 700 26px "Andika", sans-serif; padding: 6px 18px; border-radius: 14px; background: var(--paper); box-shadow: var(--shadow); color: var(--c1);
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.ecr button:hover { transform: translateY(-3px) rotate(-3deg); }
.words { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: clamp(10px, 2vw, 18px); margin-top: 28px; }
.wcard {
  position: relative; border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); padding: 16px 10px 14px; text-align: center;
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), box-shadow .25s; animation: pop-in .5s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(var(--i) * 90ms + 200ms);
  border: 3px solid transparent;
}
.wcard:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.wcard:active { transform: scale(.96); }
.wcard.heard { border-color: color-mix(in srgb, var(--c1) 50%, transparent); }
.wcard.heard::after { content: "👂"; position: absolute; top: 8px; right: 10px; font-size: 18px; animation: pop-in .4s cubic-bezier(.3, 1.6, .5, 1); }
.wcard.pop { animation: card-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes card-pop { 40% { transform: scale(1.1) rotate(-2deg); } }
.pic { font-size: clamp(54px, 9vw, 72px); line-height: 1.15; height: 1.2em; display: grid; place-items: center; }
.pic.txt { font: 700 30px "Andika", sans-serif; color: #fff; width: 84px; height: 84px; margin: 0 auto; border-radius: 22px;
  background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .14); }
.word { font: 700 24px "Andika", sans-serif; margin-top: 8px; letter-spacing: .5px; }

/* Écouter / Le bon mot */
.quiz { text-align: center; }
.qprog { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.qprog i { width: 14px; height: 14px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 14%, transparent); transition: all .3s; }
.qprog i.cur { background: var(--c1); transform: scale(1.3); }
.qprog i.ok { background: var(--ok); }
.qprog i.ko { background: var(--ko); }
.qcard { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 44px; border-radius: 28px; background: var(--paper);
  box-shadow: var(--shadow-lg); animation: pop-in .5s cubic-bezier(.3, 1.6, .5, 1); }
.qcard .pic { font-size: clamp(90px, 16vw, 130px); }
.answers { display: flex; gap: clamp(12px, 3vw, 24px); justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.ans { min-width: min(260px, 42vw); min-height: 92px; border-radius: 24px; font: 700 22px "Fredoka", sans-serif; color: #fff; padding: 10px 20px;
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), filter .2s; }
.ans .e { font-size: 36px; }
.ans.yes { background: linear-gradient(135deg, #12b886, #69db7c); box-shadow: 0 14px 24px -12px #12b886, inset 0 -5px 0 rgba(0, 0, 0, .15); }
.ans.no { background: linear-gradient(135deg, #ff6b6b, #ffa8a8); box-shadow: 0 14px 24px -12px #ff6b6b, inset 0 -5px 0 rgba(0, 0, 0, .15); }
.ans:hover { transform: translateY(-4px) scale(1.03); }
.ans:active { transform: scale(.95); }
.ans:disabled { filter: grayscale(.6) opacity(.6); transform: none; }
.shake { animation: shake .5s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.boing { animation: boing .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes boing { 30% { transform: scale(1.15) rotate(-3deg); } 60% { transform: scale(.95) rotate(2deg); } }
.feedback { min-height: 36px; margin-top: 16px; font: 700 22px "Fredoka", sans-serif; }
.feedback.ok { color: var(--ok); } .feedback.ko { color: var(--ko); }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2.5vw, 22px); max-width: 720px; margin: 24px auto 0; }
.choice { position: relative; border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); padding: 20px 8px 16px; border: 4px solid transparent;
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), border-color .2s; animation: pop-in .5s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(var(--i) * 110ms); }
.choice:hover { transform: translateY(-6px) rotate(-1deg); }
.choice .pic { font-size: clamp(60px, 11vw, 92px); }
.choice .word { font-size: clamp(18px, 3vw, 24px); }
.choice.good { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--paper)); }
.choice.bad { border-color: var(--ko); }
.choice .ear { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--c1) 16%, transparent); font-size: 18px; display: grid; place-items: center; }

/* Tracer / Colorier */
.board { position: relative; margin: 0 auto; max-width: 820px; border-radius: 30px; background: var(--paper); box-shadow: var(--shadow-lg); overflow: hidden;
  background-image: linear-gradient(transparent 49.4%, color-mix(in srgb, var(--c1) 18%, transparent) 49.5% 50.5%, transparent 50.6%); }
.board canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 16px; }
.meter { flex: 1 1 220px; max-width: 340px; height: 18px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--c1), var(--c2)); transition: width .5s cubic-bezier(.2, .9, .3, 1); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sw { width: 46px; height: 46px; border-radius: 50%; box-shadow: var(--shadow), inset 0 -4px 0 rgba(0, 0, 0, .15); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); border: 4px solid var(--paper); }
.sw:hover { transform: scale(1.1); }
.sw.on { transform: scale(1.18); outline: 3px solid var(--ink); outline-offset: 1px; }
.sw.rainbow { background: conic-gradient(#ff6b6b, #ffd43b, #69db7c, #4dabf7, #9775fa, #f783ac, #ff6b6b); }
.sw.stars { background: radial-gradient(circle, #fff3bf 20%, #fcc419 60%); display: grid; place-items: center; font-size: 20px; }
.sparkle { position: absolute; pointer-events: none; font-size: 28px; animation: spark .9s ease-out forwards; }
@keyframes spark { from { opacity: 1; transform: translate(-50%, -50%) scale(.4); } to { opacity: 0; transform: translate(-50%, -160%) scale(1.4) rotate(40deg); } }

/* Ballons */
.sky-game { position: relative; height: min(62vh, 520px); border-radius: 30px; overflow: hidden; box-shadow: var(--shadow-lg);
  background: linear-gradient(180deg, #a5d8ff, #e7f5ff 70%, #d3f9d8); }
:root[data-theme="dark"] .sky-game { background: linear-gradient(180deg, #1c2f5a, #24365e 70%, #20402f); }
.balloon { position: absolute; bottom: -150px; width: 96px; height: 150px; will-change: transform; cursor: pointer; }
.balloon .bi { position: relative; display: grid; place-items: center; width: 96px; height: 116px; padding-bottom: 12px;
  font: 700 30px/1 "Andika", sans-serif; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .7), transparent 34%), var(--bc); box-shadow: inset -8px -10px 0 rgba(0, 0, 0, .12);
  transition: transform .28s ease-out, opacity .28s ease-out; }
.balloon .bi::before { content: ""; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); border: 7px solid transparent; border-bottom-color: var(--bc); }
.balloon::after { content: ""; position: absolute; top: 120px; left: 48px; width: 2px; height: 30px; background: rgba(0, 0, 0, .25); }
.balloon.popped .bi { transform: scale(1.7); opacity: 0; }
.balloon.popped::after { opacity: 0; }
.balloon.miss .bi { animation: shake .4s ease; }
.hud { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; z-index: 3; pointer-events: none; }
.hud span { background: color-mix(in srgb, var(--paper) 85%, transparent); border-radius: 999px; padding: 6px 14px; font: 700 18px "Fredoka", sans-serif; box-shadow: var(--shadow); }
.center-card { text-align: center; padding: 30px 16px; }
.center-card h3 { font: 700 clamp(26px, 4vw, 34px) "Fredoka", sans-serif; margin: 6px 0; }
.center-card p { color: var(--ink-soft); font-weight: 600; font-size: 18px; }

/* Fin de leçon */
.finale { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: rgba(20, 22, 50, .55); backdrop-filter: blur(6px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.finale-card { width: min(520px, 100%); border-radius: 34px; background: var(--paper); box-shadow: var(--shadow-lg); padding: 30px 24px 24px; text-align: center; animation: pop-in .6s cubic-bezier(.3, 1.6, .5, 1); }
.finale-card .big-stars { font-size: 64px; display: flex; justify-content: center; gap: 8px; margin: 10px 0; }
.finale-card .big-stars span { animation: star-in .6s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(var(--i) * 260ms + 300ms); }
.finale-card .big-stars span.off { filter: grayscale(1) opacity(.25); }
@keyframes star-in { from { opacity: 0; transform: scale(0) rotate(-180deg); } }
.finale-card h2 { font: 700 34px "Fredoka", sans-serif; margin: 0; }
.finale-card .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
canvas.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
.isle .em { position: absolute; top: -12px; left: -10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 21px;
  background: var(--paper); box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.isle:hover .em { transform: rotate(-12deg) scale(1.15); }
.isle .em:empty { display: none; }
.board.plain { background-image: none; }
@media (max-width: 640px) {
  .l-top { flex-wrap: wrap; gap: 8px; }
  .l-top .chip .lbl { display: none; }
  .l-badge { min-width: 46px; height: 46px; font-size: 24px; border-radius: 14px; }
  .l-stars { margin-left: auto; font-size: 20px; }
  .steps { order: 3; flex: 1 1 100%; margin: 0; justify-content: space-between; }
  .step { flex: 1; justify-content: center; padding: 0; height: 40px; }
  .l-foot .btn { min-width: 0; flex: 1; }
  .nour .owl { font-size: 38px; }
  .nour .bubble { font-size: 16px; }
  .choices { gap: 8px; }
  .choice { padding: 14px 4px 10px; border-radius: 20px; }
  .ans { min-width: 0; flex: 1 1 140px; font-size: 18px; min-height: 76px; }
}
@media (max-width: 640px) { .choice .ear { width: 32px; height: 32px; font-size: 15px; top: 5px; right: 5px; } }
