:root{
  --green:#58cc02; --green-dark:#58a700; --green-bg:#d7ffb8;
  --blue:#1cb0f6; --blue-dark:#1899d6;
  --red:#ff4b4b; --red-dark:#ea2b2b; --red-bg:#ffdfe0;
  --gold:#ffc800;
  --ink:#3c3c3c; --muted:#afafaf; --muted2:#777;
  --line:#e5e5e5; --line2:#d4d4d4; --bg:#fff;
  --radius:16px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0;height:100%}
body{
  font-family:'Nunito',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  color:var(--ink);background:var(--bg);
  font-weight:700;-webkit-font-smoothing:antialiased;
  overscroll-behavior:none;
}
#app{max-width:480px;margin:0 auto;min-height:100%;display:flex;flex-direction:column;position:relative}
button{font-family:inherit;font-weight:800;cursor:pointer;border:none;background:none;color:inherit}

/* boutons 3D Duolingo */
.btn{
  display:flex;align-items:center;justify-content:center;gap:8px;
  width:100%;padding:14px;border-radius:var(--radius);
  background:var(--green);color:#fff;font-size:17px;text-transform:uppercase;letter-spacing:.4px;
  box-shadow:0 4px 0 var(--green-dark);transition:transform .04s, box-shadow .04s, filter .15s;
}
.btn:active{transform:translateY(4px);box-shadow:0 0 0 var(--green-dark)}
.btn.blue{background:var(--blue);box-shadow:0 4px 0 var(--blue-dark)}
.btn.red{background:var(--red);box-shadow:0 4px 0 var(--red-dark)}
.btn.ghost{background:#fff;color:var(--blue);border:2px solid var(--line2);box-shadow:0 4px 0 var(--line2)}
.btn[disabled]{background:#e5e5e5;color:#afafaf;box-shadow:0 4px 0 #d4d4d4;cursor:default}

/* ---------- LOGIN ---------- */
.login{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:24px}
.login h1{font-size:34px;margin:0}
.login input{width:100%;max-width:280px;padding:14px;border:2px solid var(--line2);border-radius:14px;font-size:18px;text-align:center;font-weight:800}

/* ---------- HOME ---------- */
.topbar{position:sticky;top:0;background:#fff;z-index:5;display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:2px solid var(--line)}
.stat{display:flex;align-items:center;gap:6px;font-size:18px;font-weight:900}
.stat.fire{color:var(--gold)} .stat.xp{color:var(--green)}
.ring{--p:0;width:34px;height:34px;border-radius:50%;
  background:conic-gradient(var(--green) calc(var(--p)*1%), #eee 0);
  display:grid;place-items:center}
.ring span{width:26px;height:26px;border-radius:50%;background:#fff;display:grid;place-items:center;font-size:12px;color:var(--green)}
.home{padding:10px 18px 90px}
.unit{margin-top:26px}
.unit-h{display:flex;align-items:center;gap:10px;background:var(--green);color:#fff;padding:14px 16px;border-radius:14px;box-shadow:0 3px 0 var(--green-dark);margin-bottom:8px}
.unit-h .e{font-size:22px} .unit-h .t{font-size:16px;text-transform:uppercase;letter-spacing:.3px}
.unit-h .sub{font-size:12px;opacity:.85;font-weight:700;text-transform:none;letter-spacing:0}
.path{display:flex;flex-direction:column;align-items:center;gap:14px;padding:14px 0}
.node{width:74px;height:70px;border-radius:50%;display:grid;place-items:center;font-size:30px;
  background:var(--green);box-shadow:0 6px 0 var(--green-dark);color:#fff;position:relative;transition:transform .05s}
.node:active{transform:translateY(3px)}
.node.locked{background:#e5e5e5;box-shadow:0 6px 0 #d4d4d4;color:#bbb}
.node.done{background:var(--gold);box-shadow:0 6px 0 #e0a900}
.node.review{background:var(--blue);box-shadow:0 6px 0 var(--blue-dark)}
.node .lbl{position:absolute;bottom:-22px;font-size:11px;color:var(--muted2);white-space:nowrap;text-transform:none}
.node-wrap{display:flex;flex-direction:column;align-items:center;margin-bottom:14px}
.start-pop{position:absolute;top:-40px;background:#fff;border:2px solid var(--line);border-radius:12px;padding:6px 12px;font-size:12px;color:var(--green);box-shadow:0 3px 0 var(--line);animation:bob 1.2s ease-in-out infinite}
@keyframes bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}

/* ---------- LESSON ---------- */
.lesson{flex:1;display:flex;flex-direction:column;min-height:100vh}
.lhead{display:flex;align-items:center;gap:14px;padding:14px 18px}
.lhead .x{font-size:24px;color:var(--muted);font-weight:900}
.lhead .back{font-size:30px;color:var(--blue);font-weight:900;line-height:1;width:24px}
.node-wrap{transition:transform .2s}
.stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:8px}
.scard{border:2px solid var(--line);border-bottom-width:4px;border-radius:16px;padding:18px 12px;text-align:center}
.scard .si{font-size:30px}
.scard .sv{font-size:30px;font-weight:900;margin-top:4px}
.scard .sk{font-size:13px;color:var(--muted2);margin-top:2px}
.bar{flex:1;height:16px;background:#e5e5e5;border-radius:10px;overflow:hidden}
.bar>i{display:block;height:100%;background:var(--green);border-radius:10px;transition:width .3s}
.lbody{flex:1;padding:8px 22px;display:flex;flex-direction:column}
.prompt{font-size:22px;margin:18px 0 6px}
.q-hu{font-size:30px;font-weight:900;margin:8px 0 2px}
.phon{color:var(--blue);font-size:16px;font-weight:800}
.fr-mean{color:var(--muted2);font-size:18px;margin-top:6px}
.lit{color:var(--muted);font-size:13px;font-weight:700;margin-top:4px}

/* carte d'intro */
.intro{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px}
.intro .big{font-size:40px;font-weight:900}
.speaker{display:inline-grid;place-items:center;width:64px;height:64px;border-radius:50%;background:var(--blue);color:#fff;font-size:28px;box-shadow:0 4px 0 var(--blue-dark);margin:14px auto}
.speaker.sm{width:40px;height:40px;font-size:18px;box-shadow:0 3px 0 var(--blue-dark)}
.speaker:active{transform:translateY(3px);box-shadow:0 1px 0 var(--blue-dark)}
.tip{background:#f7f7f7;border-radius:12px;padding:10px 14px;color:var(--muted2);font-size:14px;margin-top:14px}

/* options */
.opts{display:flex;flex-direction:column;gap:12px;margin-top:18px}
.opt{display:flex;align-items:center;gap:12px;padding:16px;border:2px solid var(--line);border-bottom-width:4px;border-radius:14px;font-size:18px;text-align:left;background:#fff;transition:.05s}
.opt:active{transform:translateY(2px)}
.opt.sel{border-color:var(--blue);background:#ddf4ff;color:var(--blue-dark)}
.opt.good{border-color:var(--green);background:var(--green-bg);color:#3a7d00}
.opt.bad{border-color:var(--red);background:var(--red-bg);color:var(--red-dark)}
.opt .num{width:26px;height:26px;border:2px solid var(--line2);border-radius:7px;display:grid;place-items:center;font-size:13px;color:var(--muted2);flex:none}

/* word bank (build) */
.answer-line{min-height:64px;border-bottom:2px solid var(--line);display:flex;flex-wrap:wrap;gap:8px;padding:10px 0;align-content:flex-start}
.bank{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px;min-height:60px}
.tile{padding:10px 14px;border:2px solid var(--line);border-bottom-width:4px;border-radius:12px;background:#fff;font-size:17px}
.tile:active{transform:translateY(2px)}
.tile.used{opacity:.25;pointer-events:none}

/* feedback */
.foot{position:sticky;bottom:0;padding:16px 22px 22px;background:#fff;display:flex;gap:12px}
.foot .btn{flex:1}
.cont-hint{font-size:13px;color:var(--muted2);margin-top:8px;font-weight:800}
.sheet{position:fixed;left:0;right:0;bottom:0;max-width:480px;margin:0 auto;padding:18px 22px 24px;border-radius:18px 18px 0 0;transform:translateY(110%);transition:transform .25s;cursor:pointer}
.sheet.show{transform:translateY(0)}
.sheet.ok{background:var(--green-bg)} .sheet.no{background:var(--red-bg)}
.sheet h3{margin:0 0 4px;font-size:20px} .sheet.ok h3{color:#3a7d00} .sheet.no h3{color:var(--red-dark)}
.sheet .corr{font-size:15px;color:var(--ink);font-weight:800}

/* fin de leçon */
.done-screen{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;text-align:center;padding:24px}
.done-screen .trophy{font-size:80px}
.badges{display:flex;gap:14px;margin:10px 0}
.badge{border:3px solid var(--gold);border-radius:14px;padding:10px 16px;min-width:110px}
.badge .k{font-size:12px;color:var(--gold);text-transform:uppercase}
.badge .v{font-size:24px;font-weight:900}
.badge.blue{border-color:var(--blue)} .badge.blue .k{color:var(--blue)}
