:root {
  --brand: #ff6b3d; --brand-dark: #e0501f; --brand-soft: #fff0ea;
  --ink: #1d2140; --ink-2: #4a4f6a; --muted: #8a8fa6; --line: #e6e7ef; --bg: #ffffff; --bg-2: #f5f6fa;
  --good: #22b46b; --good-dark: #17924f; --good-soft: #e6f8ee;
  --bad: #f0453a; --bad-dark: #c92f25; --bad-soft: #fdeceb;
  --warn: #f5a524; --warn-dark: #c98210; --warn-soft: #fff5e2;
  --blue: #3c7cf0; --blue-dark: #2a5fc4; --blue-soft: #eaf1fe;
  --locked: #e3e4ec; --locked-dark: #c7c9d6;
  --radius: 18px; --shadow: 0 4px 0;
}
:root[data-theme="dark"] {
  --ink: #eef0fa; --ink-2: #c3c6da; --muted: #8b90aa; --line: #2c3150; --bg: #141729; --bg-2: #1c2038;
  --brand-soft: #3a2418; --good-soft: #15352a; --bad-soft: #3a1d1d; --warn-soft: #3a2d14; --blue-soft: #1a2747;
  --locked: #2a2e48; --locked-dark: #22253c;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eef0fa; --ink-2: #c3c6da; --muted: #8b90aa; --line: #2c3150; --bg: #141729; --bg-2: #1c2038;
    --brand-soft: #3a2418; --good-soft: #15352a; --bad-soft: #3a1d1d; --warn-soft: #3a2d14; --blue-soft: #1a2747;
    --locked: #2a2e48; --locked-dark: #22253c;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 600 17px/1.45 "Nunito", -apple-system, system-ui, sans-serif;
       overscroll-behavior: none; }
button { font: inherit; color: inherit; }
a { color: var(--blue); }
.app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.fill { flex: 1; }
.center { display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; }
.pad { padding: 20px 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 900; margin: 8px 0; }
h2 { font-size: 22px; font-weight: 900; margin: 6px 0 10px; }
h3 { font-size: 18px; font-weight: 800; margin: 0 0 4px; }
.spinner { width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%;
           animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* chunky buttons */
.btn { display: block; width: 100%; border: 0; border-radius: 16px; padding: 14px 18px; font-weight: 900; font-size: 16px;
       letter-spacing: .04em; text-transform: uppercase; cursor: pointer; background: var(--brand); color: #fff;
       box-shadow: var(--shadow) var(--brand-dark); transition: transform .05s, box-shadow .05s; text-align: center;
       text-decoration: none; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--brand-dark); }
.btn.good { background: var(--good); box-shadow: var(--shadow) var(--good-dark); }
.btn.bad { background: var(--bad); box-shadow: var(--shadow) var(--bad-dark); }
.btn.warn { background: var(--warn); box-shadow: var(--shadow) var(--warn-dark); }
.btn.blue { background: var(--blue); box-shadow: var(--shadow) var(--blue-dark); }
.btn.ghost { background: var(--bg); color: var(--blue); border: 2px solid var(--line); box-shadow: var(--shadow) var(--line); }
.btn.plain { background: transparent; color: var(--blue); box-shadow: none; }
.btn:disabled { background: var(--locked); color: var(--muted); box-shadow: var(--shadow) var(--locked-dark); cursor: default; }
.btn + .btn { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.spread { justify-content: space-between; }

/* option cards */
.opt { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; margin: 10px 0; border-radius: 16px;
       border: 2px solid var(--line); box-shadow: var(--shadow) var(--line); background: var(--bg); cursor: pointer;
       text-align: left; font-weight: 800; }
.opt .sub { display: block; font-weight: 600; font-size: 14px; color: var(--muted); }
.opt.sel { border-color: var(--blue); background: var(--blue-soft); box-shadow: var(--shadow) var(--blue); }
.opt.right { border-color: var(--good); background: var(--good-soft); box-shadow: var(--shadow) var(--good); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: var(--shadow) var(--bad); }
.opt:disabled { cursor: default; opacity: .6; }
.opt .emoji { font-size: 26px; width: 36px; text-align: center; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 14px;
          padding: 12px 16px; border-bottom: 2px solid var(--line); }
.stat { display: flex; align-items: center; gap: 6px; font-weight: 900; }
.stat.fire { color: var(--brand); } .stat.xp { color: var(--warn-dark); }
.stat.off { color: var(--muted); filter: grayscale(1); }
.ring { --p: 0; width: 34px; height: 34px; border-radius: 50%;
        background: conic-gradient(var(--warn) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; }
.ring::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); }

/* bottom nav */
.nav { position: sticky; bottom: 0; background: var(--bg); border-top: 2px solid var(--line); display: flex;
       padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.nav a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 800;
         padding: 6px 0; border-radius: 12px; }
.nav a .i { display: block; font-size: 22px; line-height: 1.2; }
.nav a.on { color: var(--brand); background: var(--brand-soft); }

/* path */
.unit { margin: 18px 16px 6px; padding: 16px; border-radius: var(--radius); background: var(--brand); color: #fff; }
.unit h2 { margin: 0; color: #fff; }
.unit p { margin: 4px 0 0; opacity: .92; font-size: 15px; }
.path { padding: 8px 0 40px; display: flex; flex-direction: column; align-items: center; }
.node { position: relative; display: flex; flex-direction: column; align-items: center; margin: 10px 0; width: 180px; }
.node .bubble { width: 78px; height: 72px; border-radius: 50%; border: 0; cursor: pointer; font-size: 26px; font-weight: 900;
                color: #fff; background: var(--brand); box-shadow: 0 7px 0 var(--brand-dark); position: relative; }
.node .bubble:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--brand-dark); }
.node.done .bubble { background: var(--warn); box-shadow: 0 7px 0 var(--warn-dark); }
.node.locked .bubble { background: var(--locked); color: var(--muted); box-shadow: 0 7px 0 var(--locked-dark); cursor: default; }
.node .label { margin-top: 12px; font-weight: 800; font-size: 15px; text-align: center; }
.node .dots { display: flex; gap: 4px; margin-top: 4px; }
.node .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.node .dots i.on { background: var(--warn); }
.node .tag { position: absolute; top: -10px; right: 22px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 900;
             padding: 2px 8px; border-radius: 99px; letter-spacing: .03em; }
.node.current .bubble::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 4px solid var(--brand-soft); }
.node.locked.current .bubble::after { display: none; }

/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 30, .45); z-index: 20; display: flex; align-items: flex-end;
         justify-content: center; animation: fade .15s; }
.sheet { width: 100%; max-width: 560px; background: var(--bg); border-radius: 22px 22px 0 0; padding: 22px 16px
         calc(22px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* lesson */
.lesson { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.lhead { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.x { background: none; border: 0; font-size: 26px; color: var(--muted); cursor: pointer; padding: 0 4px; line-height: 1; }
.bar { flex: 1; height: 16px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > div { height: 100%; background: var(--good); border-radius: 99px; transition: width .3s;
             box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), inset 0 4px 0 rgba(255,255,255,.25); }
.lbody { flex: 1; padding: 10px 16px 20px; }
.prompt { font-size: 22px; font-weight: 900; margin: 6px 0 18px; }
.lfoot { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); }
.lfoot.good { background: var(--good-soft); border-color: transparent; }
.lfoot.bad { background: var(--bad-soft); border-color: transparent; }
.lfoot.warn { background: var(--warn-soft); border-color: transparent; }
.lfoot .verdict { font-size: 21px; font-weight: 900; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.lfoot.good .verdict { color: var(--good-dark); } .lfoot.bad .verdict { color: var(--bad-dark); }
.lfoot.warn .verdict { color: var(--warn-dark); }
.lfoot .note { margin: 0 0 12px; font-size: 15px; color: var(--ink-2); }

.speaker { width: 96px; height: 96px; border-radius: 24px; border: 0; background: var(--blue); color: #fff; font-size: 40px;
           box-shadow: 0 6px 0 var(--blue-dark); cursor: pointer; }
.speaker:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--blue-dark); }
.speaker.sm { width: 56px; height: 56px; font-size: 24px; border-radius: 16px; box-shadow: 0 4px 0 var(--blue-dark); }
.speaker.playing { animation: pulse 0.8s infinite; }
@keyframes pulse { 50% { filter: brightness(1.15); } }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.pairs .opt { justify-content: center; font-size: 22px; padding: 22px 10px; margin: 0; }

.target { font-size: 34px; font-weight: 900; text-align: center; margin: 12px 0 4px; letter-spacing: .01em; }
.target.sentence { font-size: 24px; line-height: 1.4; text-align: left; }
.target .w { border-radius: 8px; padding: 0 3px; }
.target .w.great { color: var(--good-dark); } .target .w.good { color: var(--good-dark); }
.target .w.close { color: var(--warn-dark); background: var(--warn-soft); }
.target .w.off { color: var(--bad-dark); background: var(--bad-soft); }
.target u { text-decoration-thickness: 3px; text-underline-offset: 5px; text-decoration-color: var(--brand); }
.mic { width: 104px; height: 104px; border-radius: 50%; border: 0; cursor: pointer; background: var(--brand); color: #fff;
       font-size: 42px; box-shadow: 0 7px 0 var(--brand-dark); position: relative; }
.mic.rec { background: var(--bad); box-shadow: 0 7px 0 var(--bad-dark); }
.mic.rec::before { content: ""; position: absolute; inset: calc(-6px - var(--lvl, 0) * 18px); border-radius: 50%;
                   border: 4px solid var(--bad); opacity: .35; transition: inset .06s; }
.mic:disabled { background: var(--locked); box-shadow: 0 7px 0 var(--locked-dark); }
.micwrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 30px 0 10px; }
.phones { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.ph { padding: 4px 10px; border-radius: 99px; font-size: 14px; font-weight: 800; background: var(--bg-2); color: var(--ink-2); }
.ph.good { background: var(--good-soft); color: var(--good-dark); }
.ph.close { background: var(--warn-soft); color: var(--warn-dark); }
.ph.off { background: var(--bad-soft); color: var(--bad-dark); }
.ph.t { outline: 2px solid currentColor; }
.score { display: flex; align-items: center; gap: 10px; }
.stars { font-size: 20px; letter-spacing: 2px; }
.mini { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.chip { border: 2px solid var(--line); background: var(--bg); border-radius: 99px; padding: 6px 12px; font-weight: 800; font-size: 14px;
        cursor: pointer; color: var(--blue); }
.learncard { background: var(--bg-2); border-radius: var(--radius); padding: 16px; margin: 10px 0; }
.learncard ol { margin: 8px 0 0; padding-left: 22px; } .learncard li { margin: 4px 0; }
.examples { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.examples button { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line);
                   background: var(--bg); font-weight: 900; cursor: pointer; box-shadow: 0 3px 0 var(--line); }

/* cards & lists */
.card { border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; background: var(--bg); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 2px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.meter { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; flex: 1; }
.meter > div { height: 100%; background: var(--good); border-radius: 99px; }
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--locked-dark); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff;
                       border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::before { transform: translateX(22px); }
.field { display: block; margin: 12px 0; }
.field input, .field select { width: 100%; font: inherit; padding: 13px 14px; border-radius: 14px; border: 2px solid var(--line);
                              background: var(--bg-2); color: var(--ink); }
.err { color: var(--bad); font-size: 15px; min-height: 1em; }
.week { display: flex; gap: 8px; align-items: flex-end; height: 110px; margin-top: 10px; }
.week div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.week b { width: 100%; border-radius: 8px 8px 4px 4px; background: var(--warn); min-height: 4px; }
.week b.zero { background: var(--line); }
.big { font-size: 56px; line-height: 1; }
.hero { font-size: 72px; line-height: 1; margin: 10px 0; }
.logo { width: 96px; height: 96px; }
.steps-bar { display: flex; gap: 6px; padding: 14px 16px 0; }
.steps-bar i { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.steps-bar i.on { background: var(--brand); }
.legal { font-weight: 500; font-size: 15px; } .legal h1 { font-size: 24px; } .legal h2 { font-size: 18px; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--bg);
         padding: 10px 16px; border-radius: 12px; font-size: 15px; z-index: 50; animation: up .2s; max-width: 90vw; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; width: 100%; height: 100%; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pop { animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.08); } }
.list select { font: inherit; font-weight: 800; color: var(--ink); background: var(--bg-2); border: 2px solid var(--line);
               border-radius: 12px; padding: 6px 10px; }

.legal .draft { background: var(--warn-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
