:root {
  --bg: #0e1014; --panel: #171a21; --panel2: #1f232c; --line: #2b303b;
  --text: #e9ebef; --muted: #98a0ad;
  --accent: #3d8bfd; --accent2: #2a6fd6;
  --ok: #3fb950; --okbg: #10241a; --bad: #f2564b; --badbg: #2a1414;
  --gold: #e5b53a; --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background-color: var(--bg);
  background-image: linear-gradient(#ffffff07 1px, transparent 1px), linear-gradient(90deg, #ffffff07 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: #ffffff14; padding: .05em .35em; border-radius: 5px; }
.muted { color: var(--muted); }

/* Barre du haut */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: #0e1014e8; backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: .02em; display: flex; align-items: center; gap: 9px; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; }
.stats { display: flex; gap: 16px; font-weight: 700; }

/* Accueil */
.home { padding: 16px 16px 40px; }
.home h2 { margin: 14px 0 6px; }
.review { width: 100%; padding: 14px 16px; border-radius: var(--r); border: 1px solid #f2564b55; background: var(--badbg);
  text-align: left; font-weight: 700; display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.review b { background: var(--bad); color: #fff; border-radius: 99px; padding: 0 10px; }
.unit { margin-bottom: 28px; }
.unit header { border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.unit .uh { background: linear-gradient(90deg, var(--uc), transparent 85%); padding: 10px 16px; }
.unit small { font-weight: 800; letter-spacing: .12em; font-size: 11px; opacity: .85; }
.unit h2 { margin: 0; font-size: 20px; }
.unit p { margin: 0; padding: 10px 16px 12px; color: var(--muted); font-size: 14px; }
.path { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 0 4px; }
.lnode { display: flex; flex-direction: column; align-items: center; gap: 7px; background: none; border: 0; transform: translateX(var(--off)); }
.lnode .ic { width: 72px; height: 68px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: #fff;
  background: var(--uc); box-shadow: 0 6px 0 color-mix(in srgb, var(--uc) 50%, #000); transition: transform .1s, box-shadow .1s; }
.lnode:active:not(:disabled) .ic { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--uc) 50%, #000); }
.lnode .lt { font-size: 13px; font-weight: 600; color: var(--muted); max-width: 150px; text-align: center; }
.lnode.done .ic { background: var(--gold); box-shadow: 0 6px 0 #9c7a1f; color: #3b2a00; }
.lnode.locked .ic { background: #2a2e37; box-shadow: 0 6px 0 #1b1e25; font-size: 20px; }
.lnode.current .ic { outline: 4px solid #ffffff22; outline-offset: 6px; animation: pulse 1.6s infinite; }
.lnode.current .lt { color: var(--text); }
@keyframes pulse { 50% { outline-color: #ffffff5a; } }
.foot-links { text-align: center; color: var(--muted); font-size: 13px; margin-top: 12px; }

/* Leçon */
.lesson { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.lbar { display: flex; align-items: center; gap: 12px; padding: 16px; }
.x { background: none; border: 0; font-size: 22px; color: var(--muted); padding: 4px 8px; }
.prog { flex: 1; height: 14px; border-radius: 99px; background: var(--panel2); overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .35s; }
.qwrap { flex: 1; padding: 8px 16px 24px; }
.kind { margin: 0 0 4px; color: var(--accent); font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.q { margin: 0 0 20px; font-size: 21px; line-height: 1.3; }
.body.locked { pointer-events: none; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt, .chip, .mt { background: var(--panel); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 13px 14px; text-align: left; }
.opt.sel, .mt.sel { border-color: var(--accent); background: #3d8bfd18; }
.right { border-color: var(--ok) !important; background: var(--okbg) !important; }
.wrong { border-color: var(--bad) !important; background: var(--badbg) !important; }

/* Graphe Blueprint */
.graph { display: flex; align-items: center; flex-wrap: wrap; row-gap: 12px; padding: 18px 12px; border-radius: var(--r);
  background: #13161c; border: 1px solid var(--line); margin-bottom: 18px; }
.node { min-width: 118px; border-radius: 8px; background: #1c1f26; border: 1px solid #000; box-shadow: 0 2px 8px #0008; overflow: hidden; font-size: 13px; }
.nh { padding: 6px 10px; font-weight: 700; background: linear-gradient(90deg, var(--nc), #0000); }
.k-event { --nc: #b3261e; } .k-func { --nc: #2f6fd6; } .k-pure { --nc: #2e9e5b; } .k-flow { --nc: #6b6f78; }
.np { padding: 4px 10px 6px; color: #c9ced6; font-size: 12px; }
.node.slot { border: 2px dashed var(--accent); background: #3d8bfd14; }
.node.slot .nh { background: none; color: var(--accent); }
.wire { width: 22px; height: 3px; background: #fff; flex: none; border-radius: 2px; }
.opt.nodeopt { font-family: ui-monospace, Consolas, monospace; font-size: 15px; }

/* Trouve le problème */
.code { background: #13161c; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.ln { display: flex; gap: 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 13px 14px; }
.ln:last-child { border-bottom: 0; }
.ln .no { color: #5c6370; min-width: 16px; }
.ln.sel { background: #3d8bfd22; box-shadow: inset 4px 0 var(--accent); }
.ln.right { box-shadow: inset 4px 0 var(--ok); }
.ln.wrong { box-shadow: inset 4px 0 var(--bad); }

/* Remets dans l'ordre */
.slots { min-height: 120px; border-bottom: 2px dashed var(--line); padding-bottom: 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.chip { display: flex; gap: 10px; align-items: center; width: 100%; padding: 11px 12px; }
.chip b { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; }
.pool { display: flex; flex-direction: column; gap: 8px; }
.pool .chip:disabled { opacity: .22; }
.hint { color: var(--muted); text-align: center; margin: auto; font-size: 14px; }

/* Associe */
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match > div { display: flex; flex-direction: column; gap: 10px; }
.mt { min-height: 66px; font-size: 14px; text-align: center; }
.mt.right { opacity: .5; }

/* Pied de leçon */
.foot { position: sticky; bottom: 0; padding: 16px; border-top: 1px solid var(--line); background: var(--bg); }
.foot.ok { background: var(--okbg); border-color: #3fb95055; }
.foot.bad { background: var(--badbg); border-color: #f2564b55; }
.fb { max-height: 42vh; overflow: auto; }
.fb:empty { display: none; }
.fb strong { display: block; font-size: 19px; margin-bottom: 4px; }
.foot.ok .fb strong { color: var(--ok); }
.foot.bad .fb strong { color: var(--bad); }
.fb p { margin: 0 0 8px; color: #d5d9e0; font-size: 15px; }
.fb .sol { margin: 4px 0 8px; padding-left: 22px; font-size: 15px; }
.fb .link { margin-bottom: 12px; }
.btn { width: 100%; padding: 14px; border-radius: 12px; border: 0; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--panel2); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent2); }
.btn.primary:disabled { background: #2a2e37; color: #6b7280; box-shadow: none; }
.foot.ok .btn.primary { background: var(--ok); box-shadow: 0 4px 0 #2a8a3b; }
.foot.bad .btn.primary { background: var(--bad); box-shadow: 0 4px 0 #b13a31; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 0; font-size: 13px; }

/* Fin de leçon */
.end { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 16px; gap: 6px; }
.end .big { font-size: 64px; }
.end h2 { margin: 0; }
.cards { display: flex; gap: 10px; margin: 20px 0 28px; flex-wrap: wrap; justify-content: center; }
.card { border: 2px solid var(--line); border-radius: 14px; padding: 10px 16px; min-width: 96px; background: var(--panel); }
.card small { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.card b { font-size: 22px; }

/* Premium */
.pro { background: linear-gradient(135deg, var(--gold), #c98a12); color: #2b1d00; border: 0; border-radius: 8px; padding: 3px 10px; font-weight: 800; font-size: 12px; white-space: nowrap; cursor: pointer; }
.pro.on { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.gift { margin-top: 16px; text-align: left; }
.gift summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.gift .row { margin-top: 8px; }
.lnode.prem .ic { color: var(--gold); }
.prem { text-align: center; padding: 18px 0; }
.prem .big { font-size: 54px; color: var(--gold); }
.prem ul { text-align: left; display: inline-block; margin: 10px 0 6px; padding-left: 20px; }
.prem li { margin: 6px 0; }
.price { font-size: 20px; font-weight: 800; margin: 12px 0 18px; }
.plans { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin: 0 auto; }
.btn.plan { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; }
.btn.plan small { font-weight: 700; letter-spacing: 0; text-transform: none; font-size: 15px; opacity: .9; }
.field.nocaps { text-transform: none; }
.row .field + .btn { width: auto; flex: none; padding-inline: 18px; }

/* Cours : fiches, mini-projet, bibliothèque, sauvegarde */
.dots { flex: 1; display: flex; gap: 6px; }
.dots i { flex: 1; height: 8px; border-radius: 99px; background: var(--panel2); }
.dots i.on { background: var(--accent); }
.learn-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; animation: rise .25s ease-out; }
.card-title { margin: 0 0 8px; font-size: 20px; }
.card-text { margin: 0 0 12px; font-size: 17px; line-height: 1.55; color: #dfe3ea; }
.learn-card .graph { margin: 10px 0 12px; }
.foot .row .btn { flex: 1; }
.quick { display: flex; gap: 10px; margin: -6px 0 18px; }
.quick .btn { flex: 1; text-transform: none; letter-spacing: 0; font-weight: 700; }
.lnode.project .ic { border-radius: 16px; }
.lnode.project.open .ic { background: var(--gold); color: #2b1d00; box-shadow: 0 6px 0 #9c7a1f; }
.proj h2 { margin: 4px 0 8px; }
.steps { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.step .box { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; font-weight: 800; }
.step.on { border-color: #3fb95066; background: var(--okbg); }
.step.on .box { background: var(--ok); border-color: var(--ok); color: #06210f; }
.lib-unit { margin: 22px 0 8px; font-size: 15px; color: var(--muted); }
.lib { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; padding: 4px 14px; }
.lib summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
.lib-card { border-top: 1px solid var(--line); padding: 12px 0; }
.lib-card .card-text { font-size: 15px; }
.save-code { font-size: 24px; letter-spacing: .08em; margin-bottom: 10px; }
a.opt-row { color: var(--text); text-decoration: none; }
.stage { margin: 26px 0 14px; padding-left: 12px; border-left: 3px solid var(--gold); }
.stage small { display: block; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; color: var(--gold); }
.stage p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.milestone { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; margin: 6px 0 30px; padding: 16px 18px;
  border-radius: var(--r); border: 2px dashed var(--line); background: var(--panel); }
.milestone small { display: block; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: 11px; color: var(--muted); }
.milestone b { font-size: 16px; }
.ms-ic { font-size: 30px; }
.milestone.open { border: 2px solid var(--gold); background: linear-gradient(90deg, #e5b53a22, var(--panel)); animation: pulse 1.6s infinite; }
.milestone.open small { color: var(--gold); }
.milestone.done { border-style: solid; border-color: #3fb95066; }
.milestone.locked { opacity: .6; }
.opt-row.discord span:first-child { display: flex; flex-direction: column; }
.opt-row.discord small { color: var(--muted); font-size: 13px; }
.tr-box { padding: 4px 16px 16px; }
#trin { font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: .12em; }
.tr-box h3 { margin: 14px 0 2px; font-size: 16px; }
.trcode { font-family: ui-monospace, Consolas, monospace; font-size: 38px; font-weight: 800; letter-spacing: .14em; text-align: center;
  margin: 8px 0 2px; color: var(--gold); animation: pop .4s ease-out; }
.small { font-size: 12px; }

/* Langue, options, confidentialité */
.brand { background: none; border: 0; padding: 0; font-size: 16px; white-space: nowrap; }
.stats { white-space: nowrap; }
@media (max-width: 420px) { .brand { font-size: 14px; } .stats { gap: 11px; font-size: 14px; } }
.gear { background: none; border: 0; color: var(--muted); font-size: 19px; padding: 0 2px; line-height: 1; }
.logo-big { color: var(--accent); }
.langs { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 300px; margin-top: 22px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); margin: 14px 0; overflow: hidden; }
.opt-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 14px 16px;
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; font-size: 16px; }
.opt-row:last-child { border-bottom: 0; }
.opt-row.nav span:last-child { color: var(--muted); font-size: 20px; }
.opt-row.danger span:first-child { color: var(--bad); }
.switch { min-width: 64px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); font-weight: 700; font-size: 13px; }
.switch.on { background: var(--ok); border-color: var(--ok); color: #06210f; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: none; padding: 7px 12px; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 700; }
.fbl { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 12px; }
.fbl .link { margin: 0; }
.src { color: var(--accent); font-size: 13px; text-decoration: none; }
.src:hover { text-decoration: underline; }
a.btn { display: block; text-align: center; text-decoration: none; }
.field { flex: 1; min-width: 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: inherit; text-transform: uppercase; }
.prose p { color: #d5d9e0; max-width: 65ch; }
.prose a { color: var(--accent); }
.sel { user-select: all; }

/* Sensations : petites animations qui accompagnent les sons */
.confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.combo { display: inline-block; margin-left: 10px; padding: 1px 10px; border-radius: 99px; background: #e5b53a26; color: var(--gold);
  font-size: 14px; vertical-align: middle; animation: pop .35s ease-out; }
.opt.right, .ln.right, .chip.right, .mt.right { animation: pop .3s ease-out; }
.opt.wrong, .ln.wrong, .chip.wrong, .mt.wrong { animation: shake .3s; }
.foot.ok .fb, .foot.bad .fb { animation: rise .22s ease-out; }
.prog i.bump { animation: glow .5s ease-out; }
.big.pop { animation: pop .5s ease-out; }
.card.flame { border-color: var(--gold); animation: pop .5s .9s ease-out both; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glow { 0% { box-shadow: 0 0 0 #3fb950; } 40% { box-shadow: 0 0 14px #3fb950cc; } 100% { box-shadow: 0 0 0 #3fb95000; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Progression : grades, objectif du jour, étoiles, badges */
.xpbtn { background: none; border: 0; font-weight: 700; padding: 0; }
.bar { height: 10px; border-radius: 99px; background: var(--panel2); overflow: hidden; margin: 6px 0 10px; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #8ab8ff); transition: width .5s; }
.bar.goal i { background: linear-gradient(90deg, var(--gold), #ffd66b); }
.dash { display: block; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 6px; margin-bottom: 18px; }
.dash-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rank { font-weight: 800; }
.stars { display: block; color: var(--gold); font-size: 13px; letter-spacing: 2px; }
.big-stars { font-size: 28px; letter-spacing: 6px; animation: pop .5s .2s ease-out both; }
.extras { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: -10px 0 14px; }
.chip-ok { background: var(--okbg); color: var(--ok); border: 1px solid #3fb95055; border-radius: 99px; padding: 3px 12px; font-size: 13px; font-weight: 700; }
.promo { background: linear-gradient(90deg, #e5b53a33, #e5b53a11); border: 1px solid var(--gold); color: var(--gold); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 14px; font-weight: 700; animation: pop .6s 1.1s ease-out both; }
.promo b { color: var(--text); }
.end-rank { width: 100%; max-width: 340px; margin-bottom: 14px; text-align: left; }
.newbadges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-bottom: 20px; }
.newbadges small { width: 100%; color: var(--muted); font-weight: 800; letter-spacing: .1em; font-size: 11px; text-transform: uppercase; }
.badge-chip { background: var(--panel2); border: 1px solid var(--gold); border-radius: 99px; padding: 4px 12px; font-weight: 700; font-size: 14px; animation: pop .5s 1.3s ease-out both; }
.prof-head { text-align: center; margin: 8px 0 6px; }
.prof-head h2 { margin: 0 0 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 20px; }
.stats-grid .card { min-width: 0; padding: 10px 8px; text-align: center; }
.stats-grid .card b { font-size: 18px; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 22px; }
.badge { background: var(--panel); border: 1px solid var(--gold); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.badge span { font-size: 24px; }
.badge small { color: var(--muted); font-size: 12px; }
.badge.off { border-color: var(--line); opacity: .45; filter: grayscale(1); }
.ranklist { list-style: none; padding: 0; margin: 0 0 30px; display: flex; flex-direction: column; gap: 6px; }
.ranklist li { display: flex; justify-content: space-between; padding: 9px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.ranklist li.past { color: var(--text); }
.ranklist li.now { border-color: var(--accent); color: var(--text); font-weight: 800; background: #3d8bfd18; }

/* Retours testeurs */
.rep { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.rep small { color: var(--muted); }
.rep p { margin: 4px 0; }
.rep em { color: var(--muted); font-size: 13px; }
.modal { position: fixed; inset: 0; z-index: 20; background: #000a; display: grid; place-items: end center; padding: 16px; }
.sheet { width: 100%; max-width: 528px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.sheet h3 { margin: 0 0 4px; }
.sheet textarea { width: 100%; margin: 12px 0; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; resize: vertical; }
.row { display: flex; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; background: var(--panel2); border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 99px; font-weight: 600; animation: fade 2.2s forwards; }
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* Mascotte */
.mascot { display: block; }
.mascot .eyes { transform-origin: 60px 66px; animation: blink 4.5s infinite; }
.m-big { width: 120px; height: 112px; margin: 0 auto 8px; }
.m-small { width: 40px; height: 38px; flex: none; }
.fb-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.fb-head strong { margin: 0 !important; }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* Rétention : gels, test de niveau, défi du jour, accueil */
.frz { margin-left: 6px; font-size: 13px; color: #9fd3ff; }
.place-card { display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--accent); border-radius: var(--r); padding: 14px; margin-bottom: 18px; }
.place-card p { margin: 4px 0 10px; }
.share-grid { font-size: 30px; letter-spacing: 4px; margin: 8px 0 0; }
.pitch { list-style: none; padding: 0; margin: 14px 0 6px; text-align: left; display: inline-block; }
.pitch li { margin: 6px 0; }
.founder { color: var(--gold); font-weight: 700; font-size: 14px; margin: 12px 0 0; }
.prof-head .btn { width: auto; display: inline-block; padding-inline: 18px; margin-top: 6px; }

/* Téléphone : le logo seul laisse la place au bouton Premium et aux réglages. */
@media (max-width: 560px) { .brand .bt { display: none; } }

/* Pop-up Premium */
.upsell { text-align: center; }
.upsell ul { text-align: left; margin: 12px auto; padding-left: 20px; max-width: 360px; line-height: 1.6; }
.upsell .price { font-weight: 800; margin: 8px 0 2px; }
.upsell .row { margin-top: 14px; justify-content: center; }
.upsell .mascot { display: block; margin: 0 auto 6px; }

/* La mascotte parle : question, réponse, fiches, accueil */
.say { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.m-say { width: 54px; height: 50px; flex: none; animation: bob 3.2s ease-in-out infinite; }
.bubble { position: relative; flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.bubble::before { content: ''; position: absolute; left: -7px; top: 18px; width: 12px; height: 12px; background: var(--panel);
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.bubble .q { margin: 0; }
.bubble p:last-child { margin-bottom: 0; }
.fb .say { margin-bottom: 6px; }
.say-mini .bubble { font-weight: 700; font-size: 14px; padding: 8px 12px; }
.say-mini .m-say { width: 42px; height: 39px; }
.say-mini .bubble::before { top: 12px; }
.greet .bubble { font-size: 15px; }
.say.hop .m-say { animation: hop .5s ease-out, bob 3.2s .5s ease-in-out infinite; }
.say.droop .m-say { animation: droop .6s ease-out; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes hop { 0% { transform: translateY(0); } 40% { transform: translateY(-12px) rotate(-6deg); } 100% { transform: translateY(0); } }
@keyframes droop { 0% { transform: translateY(0); } 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .m-say, .say.hop .m-say, .say.droop .m-say { animation: none; } }

/* La mascotte cligne des yeux et regarde autour d'elle, même avec « réduire les animations » (mouvement minuscule, sans déplacement). */
.mascot .pupils { animation: look 9s ease-in-out infinite; }
@keyframes look { 0%, 38%, 100% { transform: translate(0, 0); } 42%, 54% { transform: translate(-3px, 0); } 58%, 70% { transform: translate(3px, 1px); } 74% { transform: translate(0, 0); } }
@media (prefers-reduced-motion: reduce) {
  .mascot .eyes { animation: blink 4.5s infinite !important; }
  .mascot .pupils { animation: look 9s ease-in-out infinite !important; }
}

/* Texte de présentation affiché le temps que l'app démarre (lu par Google). */
.seo { max-width: 640px; margin: 0 auto; padding: 32px 16px; color: var(--muted); }
.seo h1 { color: var(--text); font-size: 24px; }
.seo h2 { color: var(--text); font-size: 18px; margin-top: 24px; }

/* Case des conditions de vente avant l'achat */
.prem .agree { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 13px; line-height: 1.45; color: var(--muted);
  max-width: 360px; margin: 8px auto 18px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.agree input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.agree .link { font-size: 13px; padding: 0; margin-left: 4px; }
.agree:has(input:not(:checked)) + .locked-buy .plan { opacity: .5; }

/* Tous les écrans : encoches d'iPhone (viewport-fit=cover), pas de zoom auto du texte, petits téléphones. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#app { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
body { padding-top: env(safe-area-inset-top, 0px); }
.foot { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.home { padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
textarea, input { font-size: 16px; } /* en dessous, Safari iPhone zoome au toucher */
@media (max-width: 360px) {
  .home { padding-left: 12px; padding-right: 12px; }
  .qwrap { padding-left: 12px; padding-right: 12px; }
  .q { font-size: 18px; }
  .m-say { width: 42px; height: 39px; }
  .bubble { padding: 8px 11px; }
  .stats { gap: 8px; }
}
/* Téléphone à l'horizontale : peu de hauteur, la mascotte et les marges se font plus petites. */
@media (max-height: 480px) and (orientation: landscape) {
  .m-say { width: 40px; height: 37px; }
  .q { font-size: 18px; margin-bottom: 12px; }
  .fb { max-height: none; }
  .foot { position: static; } /* le panneau du bas ne cache plus les réponses : la page défile */
  .m-big { width: 90px; height: 84px; }
}
/* Grand écran (tablette à plat, ordinateur) : colonne un peu plus large et texte un peu plus grand. */
@media (min-width: 900px) { #app { max-width: 640px; } body { font-size: 17px; } }

/* Bienvenue dans Premium : fenêtre centrée, bien visible */
.modal.center { place-items: center; }
.welcome { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 18px 60px #000a; animation: rise .3s ease-out; }
.welcome h3 { font-size: 24px; color: var(--gold); margin-top: 6px; }
.welcome .btn.primary { width: 100%; margin-top: 12px; }

/* Flocon de l'accueil : cliquable, ouvre l'explication des gels de série */
.frz { cursor: pointer; background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: inherit; }
.big-frz { font-size: 34px; font-weight: 800; margin-bottom: 4px; }
/* Très petit téléphone : le bouton Premium garde seulement le diamant, pour laisser la place aux compteurs. */
/* Petit écran : le zigzag des leçons est resserré pour ne jamais sortir de l'écran. */
@media (max-width: 400px) { .lnode { transform: translateX(calc(var(--off) * .55)); } .lnode .lt { max-width: 130px; } }
/* Ligne Discord des options : la flèche reste à droite, le texte prend la place restante. */
.opt-row.discord { flex-wrap: nowrap; }
.opt-row.discord span:first-child { flex: 1; min-width: 0; }
.lib.unread summary { opacity: .75; }

/* Bibliothèque : recherche et favoris */
.lib-tools { display: flex; gap: 8px; margin: 12px 0 6px; }
.lib-tools .field { flex: 1; min-width: 0; }
.lib-tools .btn { flex: none; width: auto; padding-left: 14px; padding-right: 14px; }
.lib-card, .learn-card { position: relative; }
.lib-card .card-title, .learn-card .card-title { padding-right: 40px; }
.fav { position: absolute; top: 8px; right: 0; width: 36px; height: 36px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.learn-card .fav { top: 10px; right: 10px; }
.fav.on { color: var(--gold); }
.lib-from { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; padding-right: 40px; }
#libres .lib-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
#libres .lib-card .fav { top: 6px; right: 6px; }

/* Pages-guides publiques (learnblueprints.com/guides/…) : lisibles par Google, même style que l'app. */
.guide { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.guide h1 { font-size: 28px; line-height: 1.25; margin: 8px 0 12px; }
.guide h2 { font-size: 21px; margin-top: 28px; }
.guide h3 { font-size: 17px; margin: 18px 0 4px; }
.guide ol, .guide ul { padding-left: 22px; line-height: 1.6; }
.guide a { color: var(--accent); }
.guide-cta { margin: 32px 0 12px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); text-align: center; }
.guide-cta .btn { display: inline-block; width: auto; text-decoration: none; color: #fff; margin-top: 6px; }

/* Barre du haut : compteurs alignés sur la même ligne, texte Premium selon la place (voir fitTop). */
.stats { align-items: center; }
.stats > * { display: inline-flex; align-items: center; gap: 5px; line-height: 1; }
.top.tight1 .pro .pl { display: none; }
.top.tight2 .pro .pt { display: none; }

/* Bouton Retour : bien visible, en haut de chaque page */
.back { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; margin: 2px 0 14px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.back:hover { border-color: var(--accent); }
