/* LingoLeap – learner app styles */
:root {
  --green: #58cc02; --green-d: #58a700; --green-l: #d7ffb8;
  --blue: #1cb0f6; --blue-d: #1899d6; --blue-l: #ddf4ff;
  --red: #ff4b4b; --red-d: #ea2b2b; --red-l: #ffdfe0;
  --gold: #ffc800; --gold-d: #e5a400;
  --orange: #ff9600; --purple: #ce82ff; --purple-d: #a568cc;
  --bg: #ffffff; --bg-2: #f7f7f7; --text: #4b4b4b; --text-strong: #3c3c3c; --muted: #777777; --soft: #afafaf;
  --line: #e5e5e5; --line-2: #d0d0d0; --locked: #e5e5e5; --locked-d: #b7b7b7;
  --card: #ffffff; --overlay: rgba(0, 0, 0, .5);
  --radius: 16px; --sidebar: 256px; --rail: 368px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131f24; --bg-2: #1a2a31; --text: #dce6ec; --text-strong: #f1f7fb; --muted: #9fb1bb; --soft: #6b7f89;
    --line: #37464f; --line-2: #4a5c66; --locked: #37464f; --locked-d: #24323a; --card: #131f24;
    --green-l: #1f3a12; --blue-l: #13344a; --red-l: #3f1d1f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131f24; --bg-2: #1a2a31; --text: #dce6ec; --text-strong: #f1f7fb; --muted: #9fb1bb; --soft: #6b7f89;
  --line: #37464f; --line-2: #4a5c66; --locked: #37464f; --locked-d: #24323a; --card: #131f24;
  --green-l: #1f3a12; --blue-l: #13344a; --red-l: #3f1d1f; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif; font-weight: 700; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--blue); text-decoration: none; }
h1, h2, h3, h4 { color: var(--text-strong); margin: 0 0 .5em; font-weight: 900; line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  --c: var(--green); --cd: var(--green-d); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--c); color: var(--fg); box-shadow: 0 4px 0 var(--cd);
  font-weight: 800; font-size: 15px; letter-spacing: .8px; text-transform: uppercase; text-decoration: none;
  transition: filter .15s, transform .05s; user-select: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--cd); }
.btn:disabled, .btn.disabled { --c: var(--locked); --cd: var(--locked-d); --fg: var(--soft); cursor: default; filter: none; transform: none; box-shadow: 0 4px 0 var(--cd); }
.btn.block { width: 100%; }
.btn.blue { --c: var(--blue); --cd: var(--blue-d); }
.btn.red { --c: var(--red); --cd: var(--red-d); }
.btn.gold { --c: var(--gold); --cd: var(--gold-d); }
.btn.purple { --c: var(--purple); --cd: var(--purple-d); }
.btn.ghost { --c: var(--bg); --cd: var(--line); --fg: var(--blue); border: 2px solid var(--line); box-shadow: 0 2px 0 var(--line); }
.btn.ghost:active { box-shadow: none; transform: translateY(2px); }
.btn.white { --c: #fff; --cd: #d0d0d0; --fg: var(--green-d); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 13px; border-radius: 12px; }
.btn.link { background: none; box-shadow: none; color: var(--blue); padding: 0 8px; min-height: 36px; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 8px; border-radius: 12px; color: var(--soft); display: inline-flex; }
.icon-btn:hover { background: var(--bg-2); }

/* ---------- inputs ---------- */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin: 0 0 6px 4px; }
.input {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--bg-2); outline: none; font-weight: 700; font-size: 16px;
}
.input:focus { border-color: var(--blue); background: var(--bg); }
.form-error { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 4px 10px; }

/* ---------- boot / toast ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text-strong); color: var(--bg); padding: 12px 20px; border-radius: 14px; z-index: 200; transition: .25s; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- landing ---------- */
.land-top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 2px solid var(--line); }
.land-top .inner { max-width: 1000px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 900; font-size: 28px; letter-spacing: -1px; }
.logo svg { width: 38px; height: 38px; }
.hero { max-width: 1000px; margin: 0 auto; padding: 48px 16px 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero-art { display: grid; place-items: center; }
.hero-art svg { width: min(380px, 80vw); height: auto; }
.hero h1 { font-size: clamp(28px, 4.4vw, 40px); text-align: center; margin-bottom: 28px; }
.hero .cta { display: grid; gap: 14px; max-width: 340px; margin: 0 auto; }
.course-strip { border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.course-strip .inner { max-width: 1000px; margin: 0 auto; padding: 14px 16px; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.course-strip .chip { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); white-space: nowrap; text-transform: uppercase; font-size: 14px; letter-spacing: .6px; }
.course-strip .chip b { font-size: 22px; }
.feature { max-width: 1000px; margin: 0 auto; padding: 64px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.feature:nth-of-type(even) .feature-art { order: -1; }
.feature h2 { color: var(--green); font-size: clamp(28px, 4vw, 44px); }
.feature p { font-size: 18px; color: var(--muted); font-weight: 600; }
.feature-art { font-size: 120px; text-align: center; line-height: 1; filter: drop-shadow(0 8px 0 rgba(0,0,0,.08)); }
.band { background: var(--green); color: #fff; text-align: center; padding: 72px 16px; }
.band h2 { color: #fff; font-size: clamp(30px, 5vw, 52px); }
.land-foot { background: var(--green); color: #fff; padding: 32px 16px 48px; border-top: 2px solid rgba(255,255,255,.2); }
.land-foot .inner { max-width: 1000px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
.land-foot a { color: #fff; opacity: .9; }

/* ---------- onboarding / auth ---------- */
.flow { min-height: 100vh; display: flex; flex-direction: column; }
.flow-top { display: flex; align-items: center; gap: 12px; padding: 16px; max-width: 1000px; width: 100%; margin: 0 auto; }
.flow-body { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 8px 16px 120px; }
.flow-body h1 { text-align: center; font-size: clamp(22px, 3.4vw, 32px); margin: 8px 0 28px; }
.grade-tabs { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 24px; }
.pill { border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; padding: 10px 18px; background: var(--bg); cursor: pointer; font-weight: 800; color: var(--muted); }
.pill.on { border-color: var(--blue); background: var(--blue-l); color: var(--blue); }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.course-card {
  border: 2px solid var(--line); border-bottom-width: 4px; border-radius: var(--radius); padding: 22px 14px 18px; background: var(--card);
  display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; text-align: center; transition: background .15s;
}
.course-card:hover { background: var(--bg-2); }
.course-card.on { border-color: var(--blue); background: var(--blue-l); }
.course-card .flag { width: 82px; height: 64px; border-radius: 14px; display: grid; place-items: center; font-size: 40px; }
.course-card h3 { margin: 4px 0 0; font-size: 17px; }
.course-card small { color: var(--muted); }
.goal-list { display: grid; gap: 12px; max-width: 480px; margin: 0 auto; }
.goal { display: flex; justify-content: space-between; padding: 18px 20px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; cursor: pointer; background: var(--bg); }
.goal.on { border-color: var(--blue); background: var(--blue-l); color: var(--blue); }
.flow-foot { position: fixed; left: 0; right: 0; bottom: 0; border-top: 2px solid var(--line); background: var(--bg); padding: 16px 16px calc(16px + var(--safe-b)); }
.flow-foot .inner { max-width: 1000px; margin: 0 auto; display: flex; justify-content: flex-end; }
.flow-foot .btn { min-width: 160px; }
.auth { max-width: 380px; margin: 24px auto; }
.auth h1 { margin-bottom: 24px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--soft); margin: 18px 0; font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.speech { display: flex; align-items: center; gap: 16px; justify-content: center; margin-bottom: 24px; }
.speech svg { width: 110px; height: 110px; flex: none; }
.bubble { position: relative; border: 2px solid var(--line); border-radius: 16px; padding: 14px 18px; font-size: 17px; color: var(--text-strong); background: var(--bg); }
.bubble::before { content: ""; position: absolute; left: -10px; top: 50%; width: 16px; height: 16px; background: var(--bg); border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateY(-50%) rotate(45deg); }

/* ---------- app shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: var(--sidebar); flex: none; border-right: 2px solid var(--line);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; background: var(--bg); z-index: 10;
}
.sidebar .logo { padding: 0 16px 24px; font-size: 30px; }
.nav-item {
  display: flex; align-items: center; gap: 18px; padding: 10px 16px; border-radius: 14px; border: 2px solid transparent;
  color: var(--muted); font-weight: 800; letter-spacing: .8px; text-transform: uppercase; font-size: 15px;
}
.nav-item .ni { width: 34px; height: 34px; display: grid; place-items: center; font-size: 26px; flex: none; }
.nav-item:hover { background: var(--bg-2); }
.nav-item.on { border-color: #84d8ff; background: var(--blue-l); color: var(--blue); }
.sidebar .spacer { flex: 1; }
.main { flex: 1; min-width: 0; display: flex; justify-content: center; gap: 48px; padding: 24px 24px 48px; }
.content { width: 100%; max-width: 600px; min-width: 0; }
.rail { width: var(--rail); flex: none; position: sticky; top: 24px; align-self: flex-start; display: flex; flex-direction: column; gap: 20px; }
.statbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stat { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; font-weight: 800; font-size: 17px; color: var(--soft); cursor: pointer; background: none; border: 0; }
.stat:hover { background: var(--bg-2); }
.stat .si { font-size: 22px; line-height: 1; }
.stat.streak.on { color: var(--orange); }
.stat.gems { color: var(--blue); }
.stat.hearts { color: var(--red); }
.stat.flag .si { font-size: 26px; }
.card { border: 2px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--card); }
.card h3 { font-size: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.mobile-top, .bottom-nav { display: none; }

/* ---------- learn path ---------- */
.unit { margin-bottom: 40px; }
.unit-banner {
  position: sticky; top: 16px; z-index: 5; border-radius: var(--radius); padding: 16px 20px; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: 0 4px 0 rgba(0,0,0,.18);
}
.unit-banner small { display: block; opacity: .85; text-transform: uppercase; letter-spacing: .8px; font-weight: 800; font-size: 13px; }
.unit-banner h2 { color: #fff; margin: 2px 0 0; font-size: 22px; }
.unit-banner .guide { border: 2px solid rgba(0,0,0,.18); border-radius: 14px; padding: 10px 14px; color: #fff; background: rgba(255,255,255,.08); cursor: pointer; text-transform: uppercase; font-weight: 800; font-size: 13px; letter-spacing: .6px; white-space: nowrap; }
.path { position: relative; display: flex; flex-direction: column; align-items: center; padding: 72px 0 8px; gap: 34px; }
.node-wrap { position: relative; }
.node-wrap.open { z-index: 20; }
.node {
  --c: var(--green); --cd: var(--green-d);
  width: 72px; height: 66px; border-radius: 50%; border: 0; cursor: pointer; position: relative;
  background: var(--c); box-shadow: 0 7px 0 var(--cd); color: #fff; font-size: 30px; display: grid; place-items: center;
  transition: transform .05s;
}
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--cd); }
.node.locked { --c: var(--locked); --cd: var(--locked-d); color: var(--soft); }
.node.done { --c: var(--gold); --cd: var(--gold-d); }
.node.current::after {
  content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 7px solid var(--line); z-index: -1;
}
.node-wrap .start-tip {
  position: absolute; bottom: calc(100% + 18px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--bg); border: 2px solid var(--line); color: var(--c, var(--green)); padding: 8px 14px; border-radius: 12px;
  text-transform: uppercase; font-weight: 900; letter-spacing: .6px; animation: bob 1.2s ease-in-out infinite; z-index: 2; font-size: 15px;
}
.node-wrap .start-tip::after { content: ""; position: absolute; left: 50%; top: 100%; width: 12px; height: 12px; background: var(--bg); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translate(-50%, -6px) rotate(45deg); }
@keyframes bob { 50% { transform: translate(-50%, -6px); } }
.chest { font-size: 54px; line-height: 1; filter: grayscale(1) opacity(.6); }
.chest.open { filter: none; }
.path-mascot { position: absolute; top: 90px; width: 130px; pointer-events: none; }
.pop {
  position: absolute; top: calc(100% + 18px); left: 50%; transform: translateX(-50%); width: 300px; max-width: calc(100vw - 40px);
  background: var(--c, var(--green)); color: #fff; border-radius: 16px; padding: 16px; z-index: 30; box-shadow: 0 6px 18px rgba(0,0,0,.15);
}
.pop::before { content: ""; position: absolute; left: 50%; top: -8px; width: 16px; height: 16px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.pop.locked { background: var(--bg-2); color: var(--muted); border: 2px solid var(--line); }
.pop h4 { color: inherit; font-size: 18px; margin: 0 0 4px; }
.pop p { margin: 0 0 14px; opacity: .92; font-weight: 700; }
.pop .btn { width: 100%; }

/* ---------- rail widgets ---------- */
.quest-row { display: flex; gap: 14px; align-items: center; padding: 10px 0; }
.quest-row + .quest-row { border-top: 2px solid var(--line); }
.quest-row .qi { font-size: 30px; width: 40px; text-align: center; }
.quest-row h4 { margin: 0 0 8px; font-size: 16px; }
.bar { position: relative; height: 16px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: var(--gold); border-radius: inherit; transition: width .5s; }
.bar > i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); }
.bar > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.bar.green > i { background: var(--green); }
.promo { display: flex; gap: 14px; align-items: center; }
.promo .big { font-size: 44px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.foot-links a { color: var(--soft); }

/* ---------- pages ---------- */
.page-head { text-align: center; margin: 8px 0 28px; }
.page-head .emoji { font-size: 72px; line-height: 1.1; }
.page-head p { color: var(--muted); margin: 0; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 14px; }
.lb-row.me { background: var(--blue-l); }
.lb-row .rank { width: 30px; text-align: center; font-weight: 900; color: var(--muted); }
.lb-row .rank.r1 { color: var(--gold-d); } .lb-row .rank.r2 { color: #9aa5ab; } .lb-row .rank.r3 { color: #c87533; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px; flex: none; }
.avatar.xl { width: 120px; height: 120px; font-size: 52px; border: 4px solid var(--bg); box-shadow: 0 0 0 2px var(--line); }
.lb-row .name { flex: 1; color: var(--text-strong); }
.zone { text-align: center; font-size: 13px; color: var(--green); text-transform: uppercase; letter-spacing: .6px; padding: 8px 0; }
.shop-item { display: flex; gap: 16px; align-items: center; padding: 18px 0; border-top: 2px solid var(--line); }
.shop-item .big { font-size: 52px; width: 70px; text-align: center; }
.shop-item h3 { margin: 0 0 4px; font-size: 18px; }
.shop-item p { margin: 0; color: var(--muted); font-weight: 600; }
.profile-top { display: flex; gap: 24px; align-items: center; padding-bottom: 24px; border-bottom: 2px solid var(--line); margin-bottom: 24px; }
.profile-top h1 { margin: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stat-card { border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; gap: 12px; align-items: center; }
.stat-card .si { font-size: 26px; }
.stat-card b { display: block; font-size: 20px; color: var(--text-strong); }
.stat-card small { color: var(--muted); }
.ach { display: flex; gap: 16px; align-items: center; padding: 16px 0; }
.ach + .ach { border-top: 2px solid var(--line); }
.ach .badge { width: 64px; height: 72px; border-radius: 14px; display: grid; place-items: center; font-size: 34px; flex: none; color: #fff; }
.ach.locked .badge { filter: grayscale(1); opacity: .45; }
.section-title { font-size: 22px; margin: 32px 0 14px; }
.setting { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 2px solid var(--line); gap: 12px; }
.switch { position: relative; width: 54px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: .2s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::before { transform: translateX(22px); }
.empty { text-align: center; padding: 40px 12px; color: var(--muted); }
.empty .big { font-size: 64px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: var(--overlay); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--bg); border-radius: 20px; padding: 28px 24px 24px; width: 100%; max-width: 420px; text-align: center; animation: pop .2s; max-height: 90vh; overflow: auto; }
.modal .big { font-size: 72px; line-height: 1.1; margin-bottom: 8px; }
.modal p { color: var(--muted); }
.modal .actions { display: grid; gap: 12px; margin-top: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }

/* ---------- lesson player ---------- */
.lesson { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.lesson-top { width: 100%; max-width: 1000px; margin: 0 auto; padding: 20px 16px 8px; display: flex; align-items: center; gap: 16px; }
.lesson-top .bar { flex: 1; height: 16px; }
.lesson-top .bar > i { background: var(--green); }
.hearts-pill { display: inline-flex; gap: 6px; align-items: center; color: var(--red); font-weight: 900; font-size: 18px; }
.lesson-body { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 24px 16px 200px; display: flex; flex-direction: column; }
.q-kicker { color: var(--purple); text-transform: uppercase; font-weight: 900; font-size: 14px; letter-spacing: .6px; margin-bottom: 6px; }
.q-title { font-size: clamp(22px, 3.6vw, 32px); margin-bottom: 24px; }
.q-prompt { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.q-prompt svg { width: 96px; height: 96px; flex: none; }
.options { display: grid; gap: 12px; }
.options.two { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 60px; border-radius: 14px; cursor: pointer; text-align: left;
  border: 2px solid var(--line); border-bottom-width: 4px; background: var(--bg); font-weight: 700; font-size: 18px; color: var(--text-strong);
}
.opt:hover { background: var(--bg-2); }
.opt .key { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; color: var(--soft); }
.opt.on { border-color: #84d8ff; background: var(--blue-l); color: var(--blue); }
.opt.on .key { border-color: #84d8ff; color: var(--blue); }
.opt.right { border-color: #a5ed6e; background: var(--green-l); color: var(--green-d); }
.opt.wrong { border-color: #ffb2b2; background: var(--red-l); color: var(--red-d); }
.opt.big { flex-direction: column; justify-content: center; min-height: 140px; font-size: 22px; text-align: center; }
.opt.big .em { font-size: 44px; }
.opt:disabled { cursor: default; }
.answer-line { min-height: 64px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; margin-bottom: 8px; }
.answer-line + .answer-line { margin-bottom: 32px; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 10px 14px; background: var(--bg); cursor: pointer;
  font-weight: 700; font-size: 18px; color: var(--text-strong);
}
.chip.used { background: var(--line); color: transparent; border-color: var(--line); cursor: default; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match .col { display: grid; gap: 12px; align-content: start; }
.match .opt { justify-content: center; text-align: center; }
.match .opt.gone { opacity: .35; border-color: var(--line); background: var(--bg); color: var(--soft); cursor: default; }
.match .opt.shake { animation: shake .35s; border-color: #ffb2b2; background: var(--red-l); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.fill-input { font-size: 20px; min-height: 64px; }
.lesson-foot { position: fixed; left: 0; right: 0; bottom: 0; border-top: 2px solid var(--line); background: var(--bg); padding: 20px 16px calc(20px + var(--safe-b)); z-index: 20; }
.lesson-foot .inner { max-width: 1000px; margin: 0 auto; display: flex; gap: 16px; align-items: center; justify-content: space-between; }
.lesson-foot .btn { min-width: 150px; }
.lesson-foot.right { background: var(--green-l); border-top-color: transparent; }
.lesson-foot.wrong { background: var(--red-l); border-top-color: transparent; }
.verdict { display: flex; gap: 14px; align-items: center; }
.verdict .vi { width: 64px; height: 64px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 34px; flex: none; }
.verdict h3 { margin: 0 0 2px; font-size: 22px; }
.right .verdict h3, .right .verdict p { color: var(--green-d); }
.wrong .verdict h3, .wrong .verdict p { color: var(--red-d); }
.verdict p { margin: 0; font-weight: 700; }
.done-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px 160px; }
.done-screen h1 { color: var(--gold-d); font-size: clamp(26px, 4vw, 34px); }
.done-screen svg.mascot { width: 180px; height: 180px; }
.tiles { display: flex; gap: 14px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }
.tile { width: 132px; border-radius: 16px; border: 2px solid var(--c); background: var(--c); overflow: hidden; }
.tile small { display: block; color: #fff; text-transform: uppercase; font-weight: 900; font-size: 12px; letter-spacing: .6px; padding: 4px; }
.tile b { display: flex; justify-content: center; align-items: center; gap: 6px; background: var(--bg); color: var(--c); border-radius: 14px; padding: 14px 6px; font-size: 22px; }
.streak-big { font-size: 140px; line-height: 1; animation: pop .4s; }
.streak-num { font-size: 72px; color: var(--orange); font-weight: 900; line-height: 1; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1159px) {
  .rail { display: none; }
  .main { padding-top: 0; }
  .mobile-top {
    display: flex; position: sticky; top: 0; z-index: 15; background: var(--bg); border-bottom: 2px solid var(--line);
    justify-content: space-between; align-items: center; padding: 8px 12px; margin: 0 -24px 16px;
  }
  .unit-banner { top: 72px; }
}
@media (max-width: 1023px) {
  :root { --sidebar: 88px; }
  .sidebar { padding: 24px 12px; align-items: center; }
  .sidebar .logo span, .nav-item .nl { display: none; }
  .sidebar .logo { padding: 0 0 24px; }
  .nav-item { padding: 10px; }
}
@media (max-width: 767px) {
  .sidebar { display: none; }
  .main { padding: 0 16px calc(96px + var(--safe-b)); }
  .mobile-top { margin: 0 -16px 16px; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--bg); border-top: 2px solid var(--line);
    justify-content: space-around; padding: 6px 4px calc(6px + var(--safe-b));
  }
  .bottom-nav .nav-item { padding: 6px; border-radius: 12px; }
  .bottom-nav .nl { display: none; }
  .unit-banner { top: 72px; }
  .hero { grid-template-columns: 1fr; padding-top: 24px; gap: 16px; }
  .feature { grid-template-columns: 1fr; text-align: center; padding: 40px 16px; gap: 16px; }
  .feature:nth-of-type(even) .feature-art { order: 0; }
  .feature-art { font-size: 90px; }
  .options.two { grid-template-columns: 1fr; }
  .opt.big { min-height: 100px; }
  .lesson-foot .inner { flex-direction: column; align-items: stretch; }
  .lesson-foot .btn { width: 100%; }
  .lesson-foot .skip { display: none; }
  .profile-top { flex-direction: column-reverse; text-align: center; }
  .stats-grid { gap: 10px; }
  .flow-foot .btn { width: 100%; }
  .q-prompt svg { width: 72px; height: 72px; }
  .tiles { gap: 8px; }
  .tile { width: 104px; }
  .tile b { font-size: 18px; padding: 12px 4px; }
  .path-mascot { display: none; }
}
@media (max-width: 380px) {
  .course-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .match .opt { font-size: 15px; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
