:root {
  --bg: #fbf6ee;
  --card: #ffffff;
  --ink: #1d2733;
  --muted: #6b7280;
  --line: #e9e1d4;
  --pri: #0f766e;
  --pri-d: #0b5650;
  --pri-soft: #d6f0ec;
  --acc: #f59e0b;
  --acc-d: #c27c06;
  --good: #15803d;
  --good-bg: #dcfce7;
  --good-d: #116b33;
  --bad: #c2410c;
  --bad-bg: #ffedd5;
  --bad-d: #9a3412;
  --sel: #e0f2fe;
  --sel-line: #0284c7;
  --shadow: 0 2px 0 rgba(0,0,0,.06), 0 6px 18px rgba(60,40,10,.06);
  --r: 20px;
  --font: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ur: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Geeza Pro", "Noto Naskh Arabic", serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161a; --card: #1c2228; --ink: #f2f4f6; --muted: #9aa4ae; --line: #2c343c;
    --pri: #14b8a6; --pri-d: #0d8a7c; --pri-soft: #11332f;
    --good: #4ade80; --good-bg: #133a22; --good-d: #22863f;
    --bad: #fb923c; --bad-bg: #3d2410; --bad-d: #b45309;
    --sel: #0c2a3d; --sel-line: #38bdf8;
    --shadow: 0 2px 0 rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 19px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
.ur { font-family: var(--ur); direction: rtl; line-height: 2.1; unicode-bidi: plaintext; }
.muted { color: var(--muted); }
.hide { display: none !important; }

#app { min-height: 100%; }
.screen { min-height: 100vh; min-height: 100dvh; padding: calc(var(--safe-t) + 12px) 16px calc(var(--safe-b) + 104px); max-width: 640px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 12px 18px; border-radius: 18px;
  font-weight: 800; font-size: 20px; letter-spacing: .2px;
  background: var(--card); color: var(--ink); border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--line); transition: transform .06s, box-shadow .06s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.btn.primary { background: var(--pri); color: #fff; border-color: var(--pri); box-shadow: 0 4px 0 var(--pri-d); }
.btn.primary:active { box-shadow: 0 1px 0 var(--pri-d); }
.btn.good { background: var(--good-d); border-color: var(--good-d); color: #fff; box-shadow: 0 4px 0 #0b4d24; }
.btn.badb { background: var(--bad-d); border-color: var(--bad-d); color: #fff; box-shadow: 0 4px 0 #6b2509; }
.btn.accent { background: var(--acc); border-color: var(--acc); color: #3a2500; box-shadow: 0 4px 0 var(--acc-d); }
.btn:disabled { opacity: .45; transform: none; box-shadow: 0 4px 0 var(--line); }
.btn.primary:disabled { background: var(--line); border-color: var(--line); color: var(--muted); box-shadow: 0 4px 0 var(--line); }
.btn .ur { font-size: 17px; font-weight: 600; line-height: 1.7; }
.btn.small { min-height: 46px; font-size: 17px; width: auto; padding: 8px 14px; border-radius: 14px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }
.link { color: var(--pri); font-weight: 700; padding: 10px; }

.spk {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; font-size: 24px; flex: none;
  background: var(--pri-soft); color: var(--pri); border: 2px solid transparent;
}
.spk:active { transform: scale(.94); }
.spk.big { width: 96px; height: 96px; font-size: 44px; background: var(--pri); color: #fff; box-shadow: 0 5px 0 var(--pri-d); }
.spk.slow { background: transparent; border-color: var(--line); font-size: 22px; }
.spk.playing { animation: pulse 1s infinite; }

/* ---------- Top bar & home ---------- */
.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.chip { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 2px solid var(--line); font-weight: 800; font-size: 17px; }
.chip.fire b { color: #ea580c; } .chip.star b { color: var(--acc-d); }
.topbar .spacer { flex: 1; }

.hero { background: linear-gradient(135deg, var(--pri), #0e7490); color: #fff; border-radius: 26px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 18px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero .greet { font-size: 24px; font-weight: 900; }
.hero .ur { font-size: 19px; opacity: .95; }
.goal { display: flex; align-items: center; gap: 14px; margin: 10px 0 16px; }
.ring { width: 74px; height: 74px; flex: none; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 15px; text-align: center; line-height: 1.1; }
.goal-txt b { font-size: 18px; display: block; } .goal-txt .ur { font-size: 15px; line-height: 1.9; display: block; }
.hero .btn.accent { position: relative; z-index: 1; }

.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.wotd { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.wotd .em { font-size: 46px; }
.wotd .k { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.wotd .w { font-size: 24px; font-weight: 900; }
.wotd .ur { font-size: 17px; }
.wotd .grow { flex: 1; min-width: 0; }

.install { background: #fff7e6; border: 2px dashed var(--acc); border-radius: var(--r); padding: 14px; margin-bottom: 16px; color: #3a2500; }
@media (prefers-color-scheme: dark) { .install { background: #2a2110; color: #ffe8b3; } }
.install h3 { margin: 0 0 4px; font-size: 18px; }
.install .ur { font-size: 16px; }
.install .x { float: right; font-size: 22px; padding: 0 4px; }

/* Units & path */
.unit { margin-bottom: 26px; }
.unit-head { display: flex; align-items: center; gap: 12px; background: var(--uc); color: #fff; padding: 14px 16px; border-radius: 22px; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.unit-head .ue { font-size: 38px; }
.unit-head h2 { margin: 0; font-size: 21px; line-height: 1.2; }
.unit-head .ur { font-size: 17px; line-height: 1.8; }
.unit-head .grow { flex: 1; min-width: 0; }
.unit-head .cnt { font-weight: 900; font-size: 15px; background: rgba(255,255,255,.22); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.unit-goal { font-size: 15px; color: var(--muted); margin: 8px 6px 0; text-align: center; }
.unit-goal .ur { display: block; font-size: 15px; line-height: 1.8; }
.path { display: flex; flex-direction: column; align-items: center; padding: 14px 0 4px; }
.stop { display: flex; flex-direction: column; align-items: center; margin: 6px 0; transform: translateX(var(--x, 0)); }
.node {
  width: 78px; height: 78px; border-radius: 50%; font-size: 34px; position: relative;
  background: var(--uc); color: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.22);
  display: grid; place-items: center; transition: transform .06s;
}
.node:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.22); }
.node.locked { background: var(--line); color: var(--muted); box-shadow: 0 6px 0 rgba(0,0,0,.08); filter: grayscale(1); }
.node.current { outline: 5px solid color-mix(in srgb, var(--uc) 35%, transparent); outline-offset: 4px; animation: bob 1.8s ease-in-out infinite; }
.node .stars { position: absolute; bottom: -12px; left: 50%; transform: translateX(-50%); font-size: 14px; white-space: nowrap; letter-spacing: -2px; filter: drop-shadow(0 1px 0 rgba(0,0,0,.25)); }
.stop .nl { margin-top: 14px; font-size: 15px; font-weight: 800; text-align: center; max-width: 160px; line-height: 1.2; }
.stop .nl .ur { font-size: 14px; font-weight: 500; line-height: 1.8; display: block; }
.stop .start-tag { position: absolute; top: -40px; left: 50%; transform: translateX(-50%); background: var(--card); color: var(--uc); border: 2px solid var(--line); font-weight: 900; font-size: 14px; padding: 4px 10px; border-radius: 12px; white-space: nowrap; animation: bob 1.8s ease-in-out infinite; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 2px solid var(--line); padding: 6px 4px calc(var(--safe-b) + 6px);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-radius: 14px; color: var(--muted); font-weight: 800; font-size: 13px; max-width: 120px; }
.tab .ti { font-size: 27px; line-height: 1.1; }
.tab .ur { font-size: 12px; line-height: 1.6; font-weight: 500; }
.tab.on { color: var(--pri); background: var(--pri-soft); }

/* ---------- Sheet / modal ---------- */
#overlay:empty { display: none; }
.backdrop { position: fixed; inset: 0; background: rgba(10,14,18,.5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.sheet { background: var(--card); width: 100%; max-width: 640px; border-radius: 28px 28px 0 0; padding: 22px 18px calc(var(--safe-b) + 18px); animation: up .22s ease-out; max-height: 92vh; overflow: auto; }
.sheet h2 { margin: 0; font-size: 26px; }
.sheet .ur.t { font-size: 20px; }
.sheet .preview { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; }
.pill { padding: 6px 12px; border-radius: 999px; background: var(--bg); border: 2px solid var(--line); font-weight: 700; font-size: 16px; }
.sheet .btn + .btn { margin-top: 10px; }

.showcard { position: fixed; inset: 0; z-index: 60; background: #fff; color: #111; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 16px) 22px calc(var(--safe-b) + 18px); animation: fade .15s; }
.showcard .big { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.showcard .en { font-size: clamp(34px, 9vw, 60px); font-weight: 900; line-height: 1.15; }
.showcard .ur { font-size: 24px; color: #555; }
.showcard .tip { color: #666; font-size: 16px; }

/* ---------- Lesson ---------- */
.lesson { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; padding: calc(var(--safe-t) + 10px) 16px 0; }
.ltop { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; }
.ltop .x { font-size: 28px; color: var(--muted); width: 44px; height: 44px; }
.bar { flex: 1; height: 18px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #16a34a); border-radius: 999px; transition: width .35s ease; position: relative; }
.bar i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 4px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); }
.combo { font-weight: 900; color: #ea580c; min-width: 46px; text-align: right; font-size: 18px; }
.combo.pop { animation: pop .4s; }
.lbody { flex: 1; display: flex; flex-direction: column; padding-bottom: 20px; }
.kicker { font-weight: 900; font-size: 15px; color: var(--pri); text-transform: uppercase; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kicker .ur { font-size: 16px; text-transform: none; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.qtitle { font-size: 24px; font-weight: 900; margin: 2px 0 14px; line-height: 1.25; }
.qtitle .ur { display: block; font-size: 19px; font-weight: 600; color: var(--muted); }

.learn { text-align: center; padding: 22px 16px; margin-top: 6px; }
.learn .emo { font-size: 92px; line-height: 1.1; }
.learn .emo.num { font-size: 84px; font-weight: 900; color: var(--pri); font-family: var(--font); }
.learn .en { font-size: 40px; font-weight: 900; margin: 6px 0; line-height: 1.15; }
.learn .en.phrase { font-size: 30px; }
.learn .w { display: inline-block; padding: 0 3px; border-radius: 8px; }
.learn .w:active { background: var(--pri-soft); }
.learn .means { font-size: 26px; margin-top: 4px; }
.learn .pron { margin-top: 6px; font-size: 16px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; background: var(--bg); padding: 2px 14px; border-radius: 999px; }
.learn .pron .ur { font-size: 20px; color: var(--ink); }
.audio-row { display: flex; justify-content: center; gap: 14px; margin: 14px 0 4px; }
.tapnote { font-size: 14px; color: var(--muted); margin-top: 6px; }

.prompt { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.prompt .bubble { flex: 1; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 12px 16px; font-size: 22px; font-weight: 800; }
.prompt .bubble .ur { font-size: 24px; font-weight: 600; }
.prompt .bubble .em { font-size: 40px; margin-left: 6px; }
.center-audio { display: flex; justify-content: center; gap: 16px; align-items: center; margin: 8px 0 22px; }

.opts { display: grid; gap: 12px; }
.opt {
  min-height: 62px; padding: 12px 16px; border-radius: 18px; text-align: left;
  background: var(--card); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line);
  font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 12px;
}
.opt .em { font-size: 30px; }
.opt.ur-opt { justify-content: flex-end; text-align: right; font-size: 22px; font-weight: 500; }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.opt.sel { background: var(--sel); border-color: var(--sel-line); box-shadow: 0 4px 0 var(--sel-line); }
.opt.right { background: var(--good-bg); border-color: var(--good); box-shadow: 0 4px 0 var(--good); }
.opt.wrong { background: var(--bad-bg); border-color: var(--bad); box-shadow: 0 4px 0 var(--bad); }
.opts.pics { grid-template-columns: 1fr 1fr; }
.opts.pics .opt { flex-direction: column; justify-content: center; min-height: 120px; font-size: 64px; }
.opts.pics .opt .lab { font-size: 15px; color: var(--muted); font-weight: 700; }

/* Build sentence */
.answer-zone { min-height: 128px; border-bottom: 2px solid var(--line); padding: 8px 0 12px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px; margin-bottom: 20px;
  background-image: repeating-linear-gradient(transparent, transparent 62px, var(--line) 62px, var(--line) 64px); }
.bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tile { padding: 10px 16px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); font-size: 21px; font-weight: 700; min-height: 52px; }
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.tile.used { color: transparent; background: var(--line); box-shadow: none; pointer-events: none; }

/* Typing */
.typebox { width: 100%; min-height: 120px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); padding: 14px 16px; font-size: 22px; font-weight: 600; resize: none; outline: none; }
.typebox:focus { border-color: var(--sel-line); }
.hintline { margin-top: 10px; font-size: 18px; color: var(--muted); letter-spacing: 1px; font-family: ui-monospace, Menlo, monospace; }

/* Speak */
.speak-card { text-align: center; padding: 20px 14px; }
.speak-card .en { font-size: 30px; font-weight: 900; line-height: 1.2; }
.speak-card .ur { font-size: 20px; color: var(--muted); }
.mic { width: 120px; height: 120px; border-radius: 50%; font-size: 54px; margin: 22px auto 10px; display: grid; place-items: center; background: var(--acc); color: #3a2500; box-shadow: 0 6px 0 var(--acc-d); }
.mic:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--acc-d); }
.mic.on { background: #ef4444; color: #fff; box-shadow: 0 0 0 0 rgba(239,68,68,.6); animation: ring 1.2s infinite; }
.mic-label { font-weight: 800; font-size: 18px; text-align: center; }
.mic-label .ur { display: block; font-size: 16px; font-weight: 500; color: var(--muted); }
.heard { margin-top: 14px; font-size: 22px; font-weight: 800; text-align: center; line-height: 1.5; }
.heard .ok { color: var(--good); } .heard .miss { color: var(--bad); text-decoration: underline wavy; text-underline-offset: 5px; }
.heard small { display: block; font-size: 15px; color: var(--muted); font-weight: 600; }
.selfcheck { margin-top: 14px; display: grid; gap: 10px; }

/* Dialogue */
.chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 20px; font-size: 20px; font-weight: 700; animation: up .25s ease-out; position: relative; }
.msg .who { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; opacity: .7; display: flex; align-items: center; gap: 6px; }
.msg.them { align-self: flex-start; background: var(--card); border: 2px solid var(--line); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--pri); color: #fff; border-bottom-right-radius: 6px; }
.msg .tr { font-size: 17px; font-weight: 500; margin-top: 2px; }
.msg .trbtn { font-size: 14px; color: var(--pri); font-weight: 800; margin-top: 4px; padding: 2px 0; }
.msg .replay { font-size: 18px; margin-left: auto; }
.avatar { font-size: 20px; }
.reply-hint { background: var(--bg); border: 2px dashed var(--line); border-radius: 16px; padding: 8px 14px; margin-bottom: 12px; font-size: 15px; color: var(--muted); }
.reply-hint .ur { font-size: 20px; color: var(--ink); display: block; }
.shake { animation: shake .4s; }

/* Shop game */
.cart { display: flex; gap: 10px; align-items: center; min-height: 70px; padding: 10px 14px; border-radius: 18px; background: var(--card); border: 2px dashed var(--line); margin-bottom: 16px; font-size: 40px; }
.cart .lab { font-size: 15px; color: var(--muted); font-weight: 800; margin-right: auto; }
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 14px; border-radius: 22px; background: linear-gradient(#c08a52 0 6px, transparent 6px) 0 50%/100% 50%, color-mix(in srgb, #e0b07a 30%, var(--card)); }
.shelf .opt { flex-direction: column; justify-content: center; font-size: 20px; font-weight: 700; min-height: 84px; padding: 6px; gap: 2px; }
.shelf .opt .lab { font-size: 17px; color: var(--muted); }
.shelf .opt .lab .ur { font-size: 17px; font-weight: 400; line-height: 1.6; }
.cart .ci { font-size: 18px; display: inline-block; background: var(--card); border-radius: 10px; padding: 2px 8px; margin: 2px; font-weight: 700; }
.gapline { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.shelf .opt .lab { font-size: 14px; color: var(--muted); }

/* Price game */
.tags { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tag { min-height: 96px; font-size: 32px; font-weight: 900; border-radius: 16px 16px 16px 16px; background: #fffbea; color: #1d2733; border: 3px solid #f2c94c; box-shadow: 0 4px 0 #d9a91f; position: relative; }
.tag::before { content: ""; position: absolute; top: 10px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--bg); border: 2px solid #d9a91f; }
.tag.sel { background: var(--sel); border-color: var(--sel-line); box-shadow: 0 4px 0 var(--sel-line); }
.tag.right { background: var(--good-bg); border-color: var(--good); }
.tag.wrong { background: var(--bad-bg); border-color: var(--bad); }

/* Footer & feedback */
.lfoot { position: sticky; bottom: 0; margin: 0 -16px; padding: 14px 16px calc(var(--safe-b) + 16px); background: var(--bg); border-top: 2px solid var(--line); }
.lfoot.good { background: var(--good-bg); border-color: transparent; }
.lfoot.bad { background: var(--bad-bg); border-color: transparent; }
.fb { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; animation: up .2s ease-out; }
.fb .ic { font-size: 40px; line-height: 1; }
.fb h3 { margin: 0; font-size: 23px; }
.lfoot.good h3 { color: var(--good); } .lfoot.bad h3 { color: var(--bad); }
.fb .ur.h { font-size: 18px; line-height: 1.8; }
.fb .ans { font-size: 19px; font-weight: 700; margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb .ans .ur { font-size: 18px; font-weight: 500; width: 100%; }
.fb .grow { flex: 1; min-width: 0; }
.fb .spk { width: 44px; height: 44px; font-size: 20px; }
.skip { display: block; margin: 10px auto 0; color: var(--muted); font-weight: 700; font-size: 16px; padding: 6px; }
.skip .ur { font-size: 15px; }

/* ---------- Result ---------- */
.result { text-align: center; padding-top: 30px; }
.result .trophy { font-size: 96px; animation: pop .6s; }
.result h1 { margin: 8px 0 0; font-size: 34px; }
.result .ur.t { font-size: 24px; color: var(--muted); }
.bigstars { font-size: 54px; margin: 10px 0 16px; letter-spacing: 6px; }
.bigstars span { display: inline-block; animation: pop .5s backwards; }
.bigstars span:nth-child(2) { animation-delay: .25s; } .bigstars span:nth-child(3) { animation-delay: .5s; }
.bigstars .off { filter: grayscale(1); opacity: .3; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 18px; }
.stat { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px 6px; }
.stat b { display: block; font-size: 26px; }
.stat span { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; }
.reward { display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 10px; animation: up .3s backwards; }
.reward .em { font-size: 40px; }
.reward .ur { font-size: 16px; }

/* ---------- Practice ---------- */
h1.page { font-size: 30px; margin: 6px 0 0; }
.page-ur { font-size: 20px; color: var(--muted); margin-bottom: 14px; }
.plist { display: grid; gap: 12px; }
.pcard { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 16px; }
.pcard .em { font-size: 40px; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--bg); flex: none; }
.pcard .grow { flex: 1; min-width: 0; }
.pcard b { font-size: 20px; display: block; }
.pcard .ur { font-size: 16px; color: var(--muted); }
.pcard .badge { background: #ef4444; color: #fff; font-weight: 900; border-radius: 999px; padding: 2px 10px; font-size: 15px; }
.pcard:active { transform: translateY(2px); }

/* ---------- Phrasebook ---------- */
.search { width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-size: 19px; margin-bottom: 16px; outline: none; }
.group h3 { margin: 18px 4px 8px; font-size: 18px; display: flex; gap: 8px; align-items: baseline; }
.group h3 .ur { font-size: 17px; color: var(--muted); font-weight: 500; }
.phr { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; margin-bottom: 8px; }
.phr .grow { flex: 1; min-width: 0; }
.phr .e { font-weight: 800; font-size: 19px; }
.phr .ur { font-size: 17px; color: var(--muted); }
.phr .spk { width: 46px; height: 46px; font-size: 20px; }
.phr .show { width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--line); font-size: 20px; flex: none; }
.infocard { background: linear-gradient(135deg, #1e3a8a, #0e7490); color: #fff; border: 0; }
.infocard .ur { color: #e0f2fe; }

/* ---------- Me ---------- */
.prof { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.prof .av { width: 72px; height: 72px; border-radius: 50%; background: var(--pri-soft); display: grid; place-items: center; font-size: 40px; flex: none; }
.prof h2 { margin: 0; font-size: 26px; }
.lvlbar { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 6px; }
.lvlbar i { display: block; height: 100%; background: var(--acc); border-radius: 999px; }
.grid4 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.grid4 .stat { text-align: left; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.grid4 .stat .em { font-size: 30px; }
.grid4 .stat b { font-size: 24px; }
.sec-title { font-size: 20px; font-weight: 900; margin: 22px 4px 10px; display: flex; gap: 8px; align-items: baseline; }
.sec-title .ur { font-size: 17px; font-weight: 500; color: var(--muted); }
.garden { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 14px; border-radius: 22px; background: linear-gradient(#bfe6a8, #8fcf73); }
@media (prefers-color-scheme: dark) { .garden { background: linear-gradient(#24402a, #1a3320); } }
.garden span { aspect-ratio: 1; display: grid; place-items: center; font-size: 30px; border-radius: 12px; background: rgba(120,72,30,.18); }
.garden span.new { animation: pop .6s; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bdg { text-align: center; padding: 12px 6px; }
.bdg .em { font-size: 38px; }
.bdg .n { font-size: 13px; font-weight: 800; line-height: 1.2; }
.bdg .ur { font-size: 13px; color: var(--muted); line-height: 1.8; }
.bdg.off .em { filter: grayscale(1); opacity: .3; }
.bdg.off { opacity: .7; }
.setting { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 2px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting .grow { flex: 1; min-width: 0; }
.setting b { display: block; font-size: 18px; }
.setting .ur { font-size: 15px; color: var(--muted); }
.settings { padding: 0; }
.switch { position: relative; width: 58px; height: 34px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 26px; height: 26px; left: 4px; top: 4px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--pri); }
.switch input:checked + span::before { transform: translateX(24px); }
input[type=range] { width: 100%; accent-color: var(--pri); height: 30px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 800; margin-bottom: 4px; }
.field > span .ur { font-weight: 500; color: var(--muted); font-size: 16px; display: block; line-height: 1.8; }
.field input, .field select, .field textarea { width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-size: 19px; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--sel-line); }

/* ---------- Onboarding ---------- */
.onb { min-height: 100vh; min-height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 24px) 20px calc(var(--safe-b) + 22px); }
.onb .top { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.onb .logo { font-size: 84px; text-align: center; }
.onb h1 { font-size: 34px; text-align: center; margin: 6px 0 0; line-height: 1.2; }
.onb .ur.t { text-align: center; font-size: 26px; }
.onb p { text-align: center; color: var(--muted); font-size: 18px; }
.onb p.ur { font-size: 19px; }
.dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--pri); width: 26px; border-radius: 6px; }
.goalopt { display: flex; align-items: center; gap: 12px; text-align: left; }
.goalopt .em { font-size: 34px; }
.goalopt .grow { flex: 1; }
.goalopt .ur { font-size: 16px; font-weight: 500; }
.features { display: grid; gap: 10px; margin: 18px 0; }
.feature { display: flex; gap: 12px; align-items: center; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; }
.feature .em { font-size: 30px; }
.feature b { display: block; font-size: 17px; }
.feature .ur { font-size: 16px; color: var(--muted); }

/* ---------- Confetti & toasts ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
.toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); animation: up .25s; max-width: 92vw; text-align: center; }

@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.55); } 100% { box-shadow: 0 0 0 26px rgba(239,68,68,0); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
