/* Papote — style. Couleurs à nous : bleu Papote, jaune, rouge, vert sapin. */
:root {
  --blue: #2463EB;
  --blue-d: #1A4FC4;
  --blue-l: #EAF0FF;
  --yellow: #FFC531;
  --yellow-d: #E0A400;
  --orange: #FF8A3D;
  --red: #E5484D;
  --red-d: #C2363B;
  --red-l: #FFE7E7;
  --green: #12A37F;
  --green-d: #0B8466;
  --green-l: #DDF6EC;
  --bg: #FFFBF5;
  --card: #FFFFFF;
  --ink: #1F2433;
  --muted: #6B7080;
  --line: #ECE6DB;
  --line-2: #DED6C8;
  --radius: 18px;
  --shadow: 0 8px 24px -12px rgba(31, 36, 51, .25);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
svg { display: block; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.muted { color: var(--muted); }
.boot { display: grid; place-items: center; height: 100dvh; color: var(--muted); }
kbd { font-family: inherit; }

/* ---------- Boutons ---------- */
.btn {
  border: 0; border-radius: 16px; padding: 14px 22px; min-height: 52px;
  font-weight: 800; font-size: 16px; letter-spacing: .02em; text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s ease, filter .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--blue); color: #fff; box-shadow: 0 10px 20px -10px var(--blue); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.primary:disabled { background: #E4E0D8; color: #A9A397; box-shadow: none; cursor: default; }
.btn.ghost { background: transparent; color: var(--muted); border: 2px solid var(--line-2); }
.btn.ghost:hover { background: #F6F1E8; }
.btn.ghost.danger { color: var(--red); border-color: #F3C9CA; }
.btn.ok { background: var(--green); color: #fff; box-shadow: 0 10px 20px -10px var(--green); }
.btn.bad { background: var(--red); color: #fff; box-shadow: 0 10px 20px -10px var(--red); }
.btn.locked-btn { background: #EEE9E0; color: #A9A397; width: 100%; }
.icon-btn { background: none; border: 0; padding: 8px; color: #A9A397; border-radius: 12px; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:hover { background: #F2ECE2; color: var(--muted); }
.linkbtn { background: none; border: 0; color: var(--blue); font-weight: 700; padding: 10px; margin: 6px auto 0; display: block; }

/* ---------- Structure générale ---------- */
.shell { min-height: 100dvh; }
.side {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around; align-items: center;
  background: rgba(255, 251, 245, .96); backdrop-filter: blur(8px);
  border-top: 2px solid var(--line);
  padding: 6px 8px calc(6px + var(--safe-b));
}
.side .logo { display: none; }
.nav-i {
  background: none; border: 2px solid transparent; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 18px; font-size: 12px; font-weight: 800; color: var(--muted);
}
.nav-i svg { width: 26px; height: 26px; }
.nav-i.active { color: var(--blue); background: var(--blue-l); border-color: #CFDBFF; }
.main { padding-bottom: calc(84px + var(--safe-b)); }
.rail { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: rgba(255, 251, 245, .94); backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.lang-btn {
  display: flex; align-items: center; gap: 8px; background: none; border: 0;
  padding: 6px 8px; border-radius: 12px; font-weight: 800; color: var(--muted);
}
.lang-btn:hover { background: #F2ECE2; }
.flag { width: 32px; height: 22px; border-radius: 5px; box-shadow: 0 0 0 2px rgba(0,0,0,.06); }
.lang-btn .flag { width: 30px; height: 20px; }
.pills { display: flex; gap: 6px; }
.pill { display: flex; align-items: center; gap: 4px; font-weight: 800; padding: 6px 10px; border-radius: 12px; color: #B8B2A6; }
.pill svg { width: 24px; height: 24px; }
.pill.streak svg { color: #CFC8BC; }
.pill.streak.on { color: var(--orange); }
.pill.streak.on svg { color: var(--orange); }
.pill.seeds { color: var(--yellow-d); }
.pill.seeds svg { color: var(--yellow); }

.content { max-width: 620px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); }

/* ---------- Chemin ---------- */
.unit { margin-bottom: 28px; }
.unit-head {
  position: sticky; top: calc(64px + var(--safe-t)); z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--u); color: #fff; border-radius: var(--radius);
  padding: 14px 16px; box-shadow: 0 10px 24px -14px var(--u);
}
.unit-head small { font-weight: 800; letter-spacing: .08em; opacity: .85; font-size: 13px; }
.unit-head h2 { font-size: 22px; margin-top: 2px; }
.guide-btn {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: rgba(255,255,255,.16); color: #fff; border: 2px solid rgba(255,255,255,.35);
  border-radius: 14px; padding: 10px 14px; font-weight: 800; text-transform: uppercase; font-size: 14px;
}
.guide-btn svg { width: 20px; height: 20px; }
.guide-btn:hover { background: rgba(255,255,255,.26); }

.path { position: relative; display: flex; flex-direction: column; align-items: center; padding: 34px 0 10px; }
.node-wrap { position: relative; transform: translateX(var(--x)); margin: 14px 0; display: flex; flex-direction: column; align-items: center; }
.node {
  position: relative; width: 78px; height: 72px; border: 0; padding: 0; border-radius: 50%;
  background: transparent; display: grid; place-items: center;
}
.node-face {
  width: 70px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: var(--u); color: #fff;
  box-shadow: inset 0 -6px 0 rgba(0,0,0,.16), 0 10px 18px -10px var(--u);
  transition: transform .12s ease;
}
.node-face svg { width: 34px; height: 34px; }
.node:active .node-face { transform: translateY(3px) scale(.97); }
.node.done .node-face { background: var(--yellow); color: #7A5600; box-shadow: inset 0 -6px 0 rgba(0,0,0,.12), 0 10px 18px -10px var(--yellow-d); }
.node.locked .node-face { background: #E9E4DB; color: #B8B1A4; box-shadow: inset 0 -6px 0 rgba(0,0,0,.07); }
.node.current .node-face { animation: breathe 2.4s ease-in-out infinite; }
.node.t-chest.current .node-face, .node.t-chest.done .node-face { background: #F5A524; color: #fff; }
.node.t-review.current .node-face { background: var(--u); }
.ring { position: absolute; inset: -14px; width: 106px; height: 100px; pointer-events: none; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #E9E4DB; stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--u); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.node.current { margin-top: 10px; }
.node-wrap:has(.start-tag) { margin-top: 52px; } /* place pour l'étiquette COMMENCER */
.start-tag {
  position: absolute; top: -46px; white-space: nowrap;
  background: #fff; color: var(--u); border: 2px solid var(--line); font-weight: 900; font-size: 14px; letter-spacing: .04em;
  padding: 8px 14px; border-radius: 12px; animation: bob 1.6s ease-in-out infinite; box-shadow: var(--shadow);
}
.start-tag::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 12px; height: 12px; background: #fff;
  border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateX(-50%) rotate(45deg);
}
.path-deco { position: absolute; top: 46%; left: 50%; transform: translate(calc(-50% + var(--x)), -50%); width: 120px; pointer-events: none; }
.path-deco .parrot { width: 100%; height: auto; }

.pop {
  position: relative; z-index: 12; width: min(320px, 92%); margin: 4px auto 8px;
  background: var(--u); color: #fff; border-radius: var(--radius); padding: 16px;
  box-shadow: 0 16px 30px -18px var(--u); animation: popIn .16s ease-out;
}
.pop.locked { background: #F4F0E9; color: var(--muted); border: 2px solid var(--line); }
.pop h3 { font-size: 18px; }
.pop p { margin: 4px 0 12px; opacity: .9; }
.pop .btn { width: 100%; }
.pop .btn.primary { background: #fff; color: var(--u); box-shadow: 0 6px 0 -2px rgba(0,0,0,.08); }
.pop .btn.ghost { color: #fff; border-color: rgba(255,255,255,.5); }
.path-end { text-align: center; color: var(--muted); padding: 10px 20px 40px; }
.path-end .parrot { width: 90px; height: auto; margin: 0 auto 6px; }

/* ---------- Écrans posés (modales) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(20, 24, 36, .45);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px; padding-bottom: calc(16px + var(--safe-b));
  animation: fade .15s ease-out;
}
.modal-card {
  width: min(520px, 100%); max-height: 86dvh; overflow: auto; background: var(--card);
  border-radius: 24px; padding: 22px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); animation: up .2s ease-out;
}
.modal-card h2 { font-size: 22px; margin-bottom: 6px; }
.modal-card h3 { margin: 18px 0 8px; font-size: 17px; }
.modal-card p { margin: 6px 0; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.modal-actions .btn { width: 100%; }
.modal-parrot { width: 110px; height: auto; margin: 0 auto 8px; }
.modal-card:has(.modal-parrot) { text-align: center; }

.guide-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.guide-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 14px; }
.guide-list b { display: block; font-size: 18px; }
.guide-list span { color: var(--muted); font-size: 15px; }
.guide-rule { background: #F8F4EC; border-radius: 14px; padding: 12px 14px; margin-top: 8px; }
.guide-rule p { margin: 4px 0 0; font-size: 15px; }

.lang-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lang-i {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px;
  background: #fff; border: 2px solid var(--line); font-weight: 800; font-size: 17px; text-align: left;
}
.lang-i span { flex: 1; }
.lang-i svg:last-child:not(.flag) { width: 22px; height: 22px; color: var(--blue); }
.lang-i.on { border-color: var(--blue); background: var(--blue-l); }
.lang-i:disabled { opacity: .6; cursor: default; }
.lang-i em { font-style: normal; font-size: 13px; color: var(--muted); font-weight: 700; }

/* ---------- Profil ---------- */
.profile h3 { margin: 22px 0 10px; }
.prof-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 18px; }
.prof-parrot { width: 86px; height: auto; flex-shrink: 0; }
.prof-head h1 { font-size: 26px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-c { padding: 14px; display: grid; grid-template-columns: 30px 1fr; column-gap: 10px; align-items: center; }
.stat-c svg { width: 28px; height: 28px; grid-row: span 2; }
.stat-c b { font-size: 22px; }
.stat-c span { color: var(--muted); font-size: 14px; line-height: 1.2; }
.stat-c.or svg { color: var(--orange); }
.stat-c.blue svg { color: var(--blue); }
.stat-c.green svg { color: var(--green); }
.setting { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-weight: 700; margin-bottom: 14px; }
.sw { appearance: none; width: 52px; height: 30px; border-radius: 30px; background: #DDD6CA; position: relative; cursor: pointer; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.sw:checked { background: var(--green); }
.sw:checked::after { transform: translateX(22px); }
.wipe { width: 100%; }

/* ---------- Leçon ---------- */
.lesson { display: flex; flex-direction: column; height: 100dvh; }
.l-top { width: 100%; max-width: 720px; margin: 0 auto; }
.l-top { display: flex; align-items: center; gap: 12px; padding: calc(14px + var(--safe-t)) 16px 6px; position: relative; }
.l-bar { flex: 1; height: 18px; background: #ECE6DB; border-radius: 20px; overflow: hidden; position: relative; }
.l-fill {
  height: 100%; width: 3%; border-radius: 20px; background: var(--blue);
  transition: width .45s cubic-bezier(.3,1.4,.5,1), background .4s ease; position: relative;
}
.l-fill::after { content: ""; position: absolute; left: 10px; right: 10px; top: 4px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); }
.l-bar.hot .l-fill { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.l-combo { position: absolute; left: 62px; top: calc(100% - 8px); font-weight: 900; font-size: 13px; letter-spacing: .06em; color: var(--orange); }
.l-combo.bump { animation: comboPop .5s ease-out; }
.l-body { flex: 1; overflow-y: auto; padding: 18px 16px 24px; -webkit-overflow-scrolling: touch; }
.ex { max-width: 600px; margin: 0 auto; }
.ex.in { animation: slideIn .28s ease-out; }
.ex.locked .choice, .ex.locked .pic, .ex.locked .tile, .ex.locked .pair, .ex.locked .mode-toggle, .ex.locked .acc, .ex.locked .cant { pointer-events: none; }
.ex.locked textarea, .ex.locked input { pointer-events: none; }
.ex-title { font-size: 24px; font-weight: 800; margin: 4px 0 18px; }
.badge {
  display: block; width: max-content; font-size: 12px; font-weight: 900; letter-spacing: .08em;
  padding: 4px 8px; border-radius: 8px; margin-bottom: 8px;
}
.badge.new { color: #7A40D9; background: #F0E8FF; }
.badge.hard { color: #fff; background: var(--red); }
.badge.again { color: var(--orange); background: #FFF0E6; }
.badge.rule { color: var(--blue); background: var(--blue-l); }

.q-line { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 22px; }
.mini-parrot { width: 76px; height: auto; flex-shrink: 0; }
.bubble {
  position: relative; background: #fff; border: 2px solid var(--line); border-radius: 18px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 19px;
}
.q-line .bubble::before {
  content: ""; position: absolute; left: -9px; bottom: 18px; width: 14px; height: 14px; background: #fff;
  border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg);
}
.q-text { line-height: 1.6; }
.tok { position: relative; }
.tok.hint { border-bottom: 2px dashed #C7C0B3; cursor: pointer; }
.tok.hint.show::after {
  content: attr(data-hint); position: absolute; left: 50%; top: calc(100% + 10px); transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 15px; font-weight: 600; padding: 6px 10px; border-radius: 10px;
  white-space: nowrap; z-index: 5; box-shadow: var(--shadow);
}
.spk { background: var(--blue); color: #fff; border: 0; border-radius: 12px; width: 40px; height: 40px; display: grid; place-items: center; flex-shrink: 0; }
.spk svg { width: 22px; height: 22px; }
.spk:active { transform: scale(.94); }
.listen-btns { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 6px 0 26px; }
.spk.big { width: 110px; height: 110px; border-radius: 28px; box-shadow: 0 14px 26px -14px var(--blue); }
.spk.big svg { width: 54px; height: 54px; }
.spk.slow { width: 64px; height: 64px; border-radius: 20px; background: var(--blue-l); color: var(--blue); }
.spk.slow svg { width: 36px; height: 36px; }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choices.row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.choice, .pic, .pair, .tile {
  background: #fff; border: 2px solid var(--line-2); border-radius: 16px; font-weight: 600;
  box-shadow: 0 3px 0 var(--line); transition: background .12s, border-color .12s, transform .08s;
}
.choice:active, .pic:active, .pair:active, .tile:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; font-size: 18px; min-height: 58px; }
.choices.row .choice { padding: 12px 18px; }
.choice kbd, .pic kbd, .pair kbd {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2);
  font-size: 13px; color: #A9A397; font-weight: 800;
}
.sel { border-color: var(--blue) !important; background: var(--blue-l) !important; color: var(--blue-d); box-shadow: 0 3px 0 #C2D3FF !important; }
.sel kbd { border-color: #A9C1FF; color: var(--blue); }
.right { border-color: var(--green) !important; background: var(--green-l) !important; color: var(--green-d); }
.wrong { border-color: var(--red) !important; background: var(--red-l) !important; color: var(--red-d); }

.pics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pic { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px 8px 16px; min-height: 160px; position: relative; }
.pic-e { font-size: 64px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pic-t { font-size: 17px; font-weight: 700; }
.pic kbd { position: absolute; top: 8px; right: 8px; min-width: 22px; height: 22px; font-size: 12px; }

.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pcol { display: flex; flex-direction: column; gap: 10px; }
.pair { display: flex; align-items: center; gap: 10px; padding: 14px 12px; font-size: 17px; min-height: 60px; text-align: left; }
.pair.match { border-color: var(--green); background: var(--green-l); color: var(--green-d); }
.pair.done { opacity: .35; pointer-events: none; box-shadow: none; }
.pair.nope { border-color: var(--red); background: var(--red-l); animation: shake .35s; }

.zone { margin-top: 4px; }
.built {
  min-height: 112px; padding: 8px 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 51px, var(--line) 51px 53px);
  margin-bottom: 18px;
}
.bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tile { padding: 10px 14px; font-size: 18px; min-height: 46px; }
.tile.used { background: #ECE6DB; color: transparent; border-color: #ECE6DB; box-shadow: none; pointer-events: none; }
.tile.in { animation: popIn .14s ease-out; }
.typed {
  width: 100%; border: 2px solid var(--line-2); border-radius: 16px; background: #fff; padding: 14px; resize: none;
  font: inherit; font-size: 18px; color: var(--ink); outline: none; min-height: 120px;
}
.typed:focus, .blank-in:focus { border-color: var(--blue); }
.accents { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.acc { min-width: 42px; height: 42px; border: 2px solid var(--line-2); border-radius: 12px; background: #fff; font-size: 18px; font-weight: 700; }
.acc:active { background: var(--blue-l); }
.mode-toggle {
  display: flex; align-items: center; gap: 8px; margin: 18px auto 0; background: none; border: 0;
  color: var(--muted); font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-radius: 12px;
}
.mode-toggle svg { width: 22px; height: 22px; }
.mode-toggle:hover { background: #F2ECE2; }

.bubble.miss { font-size: 20px; }
.blank, .blank-in {
  display: inline-block; min-width: 80px; border: 0; border-bottom: 3px solid var(--line-2); margin: 0 4px;
  padding: 0 4px; font: inherit; font-weight: 700; color: var(--blue); background: transparent; text-align: center; outline: none; border-radius: 0;
}
.blank-in { font-size: 20px; }
.blank.filled { border-color: var(--blue); }
.hint-line { color: var(--muted); margin: -8px 0 18px 86px; font-size: 16px; }
.ctx-line { color: var(--muted); margin: -8px 0 14px; font-style: italic; }

.chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.chat-row { display: flex; align-items: flex-end; gap: 10px; }
.chat-row.me { justify-content: flex-end; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: #FFE3C2; color: #A2561A; display: grid; place-items: center; font-weight: 900; font-size: 22px; flex-shrink: 0; }
.bubble .who { width: 100%; font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.me-b { background: var(--blue-l); border-color: #CFDBFF; min-width: 120px; min-height: 52px; color: var(--blue-d); font-weight: 700; }
.chat-row.me .mini-parrot { width: 56px; }

.rule-card { background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 20px; }
.rule-text { font-size: 18px; margin: 0 0 14px; }
.rule-text b { color: var(--blue-d); }
.examples { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.examples li { display: flex; align-items: center; gap: 12px; background: #F8F4EC; padding: 10px 12px; border-radius: 14px; }
.eg-t { font-weight: 800; font-size: 19px; }
.eg-f { color: var(--muted); font-size: 15px; }
mark { background: #FFE69C; color: inherit; padding: 0 3px; border-radius: 5px; }

.mascot-pause { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 6vh; }
.bubble.big { font-size: 22px; font-weight: 800; padding: 18px 22px; max-width: 420px; text-align: center; justify-content: center; }
.pause-parrot { width: 180px; height: auto; animation: hop 1.2s ease-in-out infinite; }

/* Pied de leçon et bandeaux */
.l-foot { border-top: 2px solid var(--line); background: var(--bg); padding: 14px 16px calc(14px + var(--safe-b)); transition: background .2s; }
.l-foot-in { max-width: 600px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.l-foot .l-check { min-width: 150px; }
.l-foot.ok { background: var(--green-l); border-top-color: transparent; animation: up .18s ease-out; }
.l-foot.bad { background: var(--red-l); border-top-color: transparent; animation: up .18s ease-out; }
.fb { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; }
.fb-ico { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex-shrink: 0; }
.fb-ico svg { width: 30px; height: 30px; }
.ok .fb-ico { color: var(--green); }
.bad .fb-ico { color: var(--red); }
.fb-txt strong { font-size: 22px; display: block; }
.ok .fb-txt { color: var(--green-d); }
.bad .fb-txt { color: var(--red-d); }
.fb-txt p { margin: 2px 0 0; font-size: 16px; }
.l-foot.ok .btn, .l-foot.bad .btn { flex: 1 1 160px; }

/* Fin de leçon */
.end { min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: calc(20px + var(--safe-t)) 20px calc(18px + var(--safe-b)); }
.end-in { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.end-parrot { width: 170px; height: auto; animation: hop 1.4s ease-in-out infinite; }
.end h1 { font-size: 30px; color: var(--yellow-d); margin-top: 8px; }
.end-sub { color: var(--muted); margin: 0 0 10px; }
.end-cards { display: flex; gap: 12px; width: 100%; max-width: 380px; }
.stat { flex: 1; border-radius: 18px; border: 2px solid; overflow: hidden; animation: popIn .3s ease-out both; }
.stat.prec { animation-delay: .12s; }
.stat-h { font-size: 13px; font-weight: 900; letter-spacing: .06em; color: #fff; padding: 6px; }
.stat-v { background: #fff; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 6px; font-size: 26px; font-weight: 900; }
.stat-v svg { width: 26px; height: 26px; }
.stat.xp { border-color: var(--yellow); }
.stat.xp .stat-h { background: var(--yellow); color: #6E4E00; }
.stat.xp .stat-v { color: var(--yellow-d); }
.stat.prec { border-color: var(--green); }
.stat.prec .stat-h { background: var(--green); }
.stat.prec .stat-v { color: var(--green); }
.end-actions { display: flex; gap: 12px; justify-content: space-between; }
.end-actions .btn { flex: 1; }
.review-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.rv { display: flex; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 2px solid; }
.rv.ok { border-color: #B9EAD7; background: #F3FCF8; }
.rv.bad { border-color: #F5C6C7; background: #FFF6F6; }
.rv-ico { width: 26px; flex-shrink: 0; }
.rv.ok .rv-ico { color: var(--green); }
.rv.bad .rv-ico { color: var(--red); }
.rv-q { font-weight: 700; }
.rv-a, .rv-c { font-size: 15px; color: var(--muted); }

.big-flame { width: 140px; color: var(--orange); animation: flame 1.6s ease-in-out infinite; }
.big-flame svg { width: 100%; height: auto; }
.streak-num { font-size: 72px; font-weight: 900; color: var(--orange); line-height: 1; }
.streak-end h1 { color: var(--orange); margin-top: 0; }
.week { display: flex; gap: 8px; margin: 18px 0 8px; padding: 14px; border: 2px solid var(--line); border-radius: 18px; background: #fff; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; color: var(--muted); font-size: 14px; }
.wd i { width: 32px; height: 32px; border-radius: 50%; background: #EEE8DE; display: grid; place-items: center; color: #fff; }
.wd i svg { width: 18px; height: 18px; }
.wd.on i { background: var(--orange); }
.wd.today span { color: var(--orange); }

.side-card { padding: 16px; margin-bottom: 14px; }
.sc-row { display: flex; gap: 12px; align-items: center; }
.sc-row svg { width: 40px; height: 40px; color: var(--orange); flex-shrink: 0; }
.sc-row p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.side-card h3 { font-size: 17px; margin-bottom: 10px; }
.goal { height: 16px; background: #ECE6DB; border-radius: 16px; overflow: hidden; }
.goal-fill { height: 100%; background: var(--yellow); border-radius: 16px; }
.side-card p.muted { margin: 6px 0 0; font-size: 15px; }

/* ---------- Animations ---------- */
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@keyframes popIn { from { transform: scale(.85); opacity: .5; } to { transform: scale(1); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(26px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes comboPop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes flame { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.06) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Grand écran (PC) ---------- */
@media (min-width: 900px) {
  .side {
    top: 0; right: auto; bottom: 0; width: 240px; flex-direction: column; justify-content: flex-start; align-items: stretch;
    gap: 6px; border-top: 0; border-right: 2px solid var(--line); padding: 22px 14px;
  }
  .side .logo { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; font-weight: 900; font-size: 30px; color: var(--blue); letter-spacing: -.02em; }
  .logo-parrot { width: 46px; height: auto; }
  .nav-i { flex-direction: row; gap: 14px; font-size: 15px; padding: 12px 14px; text-transform: uppercase; letter-spacing: .04em; }
  .main { margin-left: 240px; margin-right: 340px; padding-bottom: 40px; }
  .topbar { justify-content: space-between; }
  .rail { display: block; position: fixed; top: 0; right: 0; width: 340px; padding: 24px 24px; }
  .unit-head { top: 72px; }
  .content { padding: 22px 28px; }
  .modal { align-items: center; }
  .ex-title { font-size: 30px; }
  .pics { gap: 14px; }
  .l-top { padding-top: 26px; }
}
@media (max-width: 380px) {
  .pic-e { font-size: 54px; }
  .pic { min-height: 150px; }
  .ex-title { font-size: 21px; }
  .choice { font-size: 17px; }
}
