/* ============================================================
   گولینگو — Design system
   نام متغیرها ثابت است و هر «تم» مقدارشان را عوض می‌کند:
   --turq = رنگ اصلی · --lapis = رنگ دوم (صدا) · --saffron = پاداش · --pom = خطا · --plum = انرژی · --ok = جواب درست
   رنگ‌های روشنِ کمکی (-l) با color-mix از روی پس‌زمینه ساخته می‌شوند تا در حالت تیره هم درست باشند.
   ============================================================ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Variable.woff2') format('woff2-variations'),
       url('../assets/fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

/* تم پیش‌فرض «یوزی»: بنفش شاد + زرد آفتابی + آبی آسمانی */
:root {
  --turq: #7B5CFA;   --turq-d: #5B3FD6;
  --lapis: #2F9BFF;  --lapis-d: #1878D6;
  --saffron: #FFC233; --saffron-d: #E09E00;
  --pom: #FF5A6E;    --pom-d: #D93A50;
  --plum: #F058C8;
  --ok: #1FC28A;     --ok-d: #12996B;
  --desk: #F1EDFF;
  --hero-a: #9A7BFF; --hero-b: #6A45F0;

  --bg: #FFFFFF;
  --bg-2: #F7F6FB;
  --card: #FFFFFF;
  --line: #E8E6F0;
  --line-2: #D8D5E4;
  --ink: #221F33;
  --ink-2: #565270;
  --ink-3: #8F8BA6;

  --r-s: 10px;
  --r: 16px;
  --r-l: 22px;
  --shadow: 0 14px 44px rgba(60, 40, 140, .16);
  --font: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
  --font-en: 'Segoe UI', 'Vazirmatn', system-ui, -apple-system, Roboto, sans-serif;
}
:root {
  --turq-l: color-mix(in srgb, var(--turq) 14%, var(--bg));
  --lapis-l: color-mix(in srgb, var(--lapis) 14%, var(--bg));
  --saffron-l: color-mix(in srgb, var(--saffron) 20%, var(--bg));
  --pom-l: color-mix(in srgb, var(--pom) 14%, var(--bg));
  --plum-l: color-mix(in srgb, var(--plum) 14%, var(--bg));
  --ok-l: color-mix(in srgb, var(--ok) 16%, var(--bg));
}

/* ---------- تم‌های رنگی (از پروفایل انتخاب می‌شوند) ---------- */
:root[data-skin="firuze"] { --turq: #0FB5AE; --turq-d: #0A8F89; --lapis: #3B5BDB; --lapis-d: #2C46B3; --saffron: #FFB020; --saffron-d: #E0920A; --pom: #E5484D; --pom-d: #C1363B; --plum: #9B5DE5; --desk: #E6F6F5; --hero-a: #19C9C1; --hero-b: #0A8F89; }
:root[data-skin="anar"]   { --turq: #E8475F; --turq-d: #BF2E45; --lapis: #7B5CFA; --lapis-d: #5B3FD6; --saffron: #FFB547; --saffron-d: #E39314; --pom: #D6336C; --pom-d: #A61E4D; --plum: #FF8FAB; --desk: #FFEFF2; --hero-a: #FF6B81; --hero-b: #C9304A; }
:root[data-skin="ocean"]  { --turq: #1E88E5; --turq-d: #1565C0; --lapis: #00ACC1; --lapis-d: #00838F; --saffron: #FFCA28; --saffron-d: #E0A800; --pom: #F4511E; --pom-d: #BF360C; --plum: #7E57C2; --desk: #E8F3FD; --hero-a: #42A5F5; --hero-b: #1565C0; }
:root[data-skin="jungle"] { --turq: #2E9E5B; --turq-d: #207A44; --lapis: #F08C00; --lapis-d: #C46F00; --saffron: #FAB005; --saffron-d: #D99400; --pom: #E03131; --pom-d: #B02525; --plum: #20A4A4; --desk: #EBF6EE; --hero-a: #4CC37A; --hero-b: #1F7A43; }
:root[data-skin="candy"]  { --turq: #FF5FA8; --turq-d: #E03A88; --lapis: #8C6CFF; --lapis-d: #6B4BE0; --saffron: #FFD43B; --saffron-d: #F0B400; --pom: #FF6B6B; --pom-d: #E04848; --plum: #4DD4C6; --ok: #2BCB8A; --desk: #FFEEF7; --hero-a: #FF8CC6; --hero-b: #B66BFF; }
:root[data-skin="sunset"] { --turq: #FF7A45; --turq-d: #E0582A; --lapis: #7B5CFA; --lapis-d: #5B3FD6; --saffron: #FFC233; --saffron-d: #E09E00; --pom: #E5484D; --pom-d: #C1363B; --plum: #F06595; --desk: #FFF2EA; --hero-a: #FF9A5C; --hero-b: #E8475F; }
/* تم گیمر: همیشه تیره، نئونی */
:root[data-skin="gamer"] {
  --turq: #00E0A4; --turq-d: #00A87A; --lapis: #B14BFF; --lapis-d: #8A2BE2; --saffron: #FFE14D; --saffron-d: #D9B800;
  --pom: #FF3D71; --pom-d: #C9184A; --plum: #4DD0FF; --ok: #00E0A4; --ok-d: #00A87A;
  --bg: #0E0B1C; --bg-2: #161229; --card: #17132C; --line: #2A2448; --line-2: #3A3260;
  --ink: #F1EEFF; --ink-2: #C3BCE6; --ink-3: #8C84B5; --desk: #07050F; --hero-a: #2A1B5C; --hero-b: #0E0B1C;
  --shadow: 0 0 40px rgba(177, 75, 255, .25);
}

/* ---------- حالت تیره ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-skin="gamer"]) {
    --bg: #141221; --bg-2: #1B1830; --card: #1D1A33; --line: #2D2948; --line-2: #3A3559;
    --ink: #EFEDFA; --ink-2: #BDB8D9; --ink-3: #8781A8; --desk: #0C0A16;
  }
}
:root[data-theme="dark"]:not([data-skin="gamer"]) {
  --bg: #141221; --bg-2: #1B1830; --card: #1D1A33; --line: #2D2948; --line-2: #3A3559;
  --ink: #EFEDFA; --ink-2: #BDB8D9; --ink-3: #8781A8; --desk: #0C0A16;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--desk);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  overflow: hidden;
}
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; }
input, textarea { font-family: inherit; font-size: inherit; color: var(--ink); }
a { color: var(--lapis); }
.en { font-family: var(--font-en); direction: ltr; unicode-bidi: isolate; }
.en-block { font-family: var(--font-en); direction: ltr; text-align: left; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }
.fa-num { font-feature-settings: "ss01"; }

/* ---------- stage (desktop frame) ---------- */
#stage {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 48px;
}
.desk-side { display: none; }
#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 900px) {
  #stage { padding: 24px 0; align-items: center; }
  #app { height: min(880px, calc(100vh - 48px)); border-radius: 32px; box-shadow: var(--shadow); border: 1px solid var(--line); }
  .desk-side { display: flex; align-items: center; width: 300px; }
  .desk-brand p { font-size: 20px; font-weight: 700; color: var(--ink-2); margin: 12px 0 20px; }
  .desk-brand ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; }
  .desk-brand li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-weight: 600; color: var(--ink-2); }
  .desk-link { font-weight: 700; text-decoration: none; color: var(--turq-d); }
}

/* ---------- screen scaffolding ---------- */
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; animation: fadeIn .25s ease; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px; scrollbar-width: thin; }
.pad { padding: 16px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--turq) 45%, transparent); } 50% { box-shadow: 0 0 0 12px transparent; } }

/* ---------- buttons (chunky 3D) ---------- */
.btn {
  --c: var(--turq); --cd: var(--turq-d); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--r);
  background: var(--c); color: var(--fg);
  font-weight: 800; font-size: 16px; letter-spacing: .2px;
  padding: 13px 20px; min-height: 50px;
  box-shadow: 0 4px 0 var(--cd);
  transition: transform .06s, box-shadow .06s, filter .15s;
  user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--cd); }
.btn[disabled] { --c: var(--line); --cd: var(--line-2); --fg: var(--ink-3); cursor: not-allowed; filter: none; }
.btn.block { width: 100%; }
.btn.saffron { --c: var(--saffron); --cd: var(--saffron-d); --fg: #3A2A00; }
.btn.lapis { --c: var(--lapis); --cd: var(--lapis-d); }
.btn.pom { --c: var(--pom); --cd: var(--pom-d); }
.btn.ghost { --c: var(--card); --cd: var(--line-2); --fg: var(--ink-2); border: 2px solid var(--line-2); box-shadow: 0 3px 0 var(--line-2); }
.btn.ghost.turq { --fg: var(--turq-d); }
.btn.flat { background: none; box-shadow: none; color: var(--turq-d); min-height: 40px; padding: 8px 12px; }
.btn.flat:active { transform: none; }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: 14px; border-radius: 12px; box-shadow: 0 3px 0 var(--cd); }
.icon-btn {
  border: none; background: none; width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-3);
}
.icon-btn:hover { background: var(--bg-2); }
.icon-btn svg { width: 24px; height: 24px; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 10px 14px; border-bottom: 2px solid var(--line); background: var(--bg);
  min-height: 60px;
}
.stat { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 15px; padding: 6px 8px; border-radius: 12px; border: none; background: none; }
.stat:hover { background: var(--bg-2); }
.stat .ico { font-size: 20px; line-height: 1; }
.stat.streak { color: var(--saffron-d); }
.stat.streak.off { color: var(--ink-3); filter: grayscale(1); }
.stat.gems { color: var(--lapis); }
.stat.energy { color: var(--plum); }
.level-chip { font-weight: 900; font-size: 13px; background: var(--turq-l); color: var(--turq-d); border-radius: 10px; padding: 4px 10px; font-family: var(--font-en); }

/* ---------- tab bar ---------- */
.tabbar {
  display: flex; justify-content: space-around; border-top: 2px solid var(--line);
  background: var(--bg); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 2px solid transparent; background: none; border-radius: 14px; padding: 6px 0 4px;
  font-size: 11px; font-weight: 700; color: var(--ink-3);
}
.tab .ti { font-size: 24px; line-height: 1; filter: grayscale(.7); opacity: .8; }
.tab.on { color: var(--turq-d); background: var(--turq-l); border-color: color-mix(in srgb, var(--turq) 35%, transparent); }
.tab.on .ti { filter: none; opacity: 1; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r-l); padding: 16px; }
.card + .card { margin-top: 12px; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.section-title { font-size: 18px; font-weight: 900; margin: 22px 0 10px; display: flex; align-items: center; justify-content: space-between; }
.section-title:first-child { margin-top: 4px; }
.tile {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: right;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r-l);
  padding: 14px; box-shadow: 0 3px 0 var(--line); margin-bottom: 12px; transition: transform .06s;
}
.tile:active { transform: translateY(3px); box-shadow: none; }
.tile .tile-ico { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.tile .tile-t { font-weight: 800; font-size: 16px; }
.tile .tile-s { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.tile .tile-badge { margin-inline-start: auto; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px; background: var(--pom); color: #fff; white-space: nowrap; }
.tile .tile-badge.soft { background: var(--bg-2); color: var(--ink-3); }
.bg-turq { background: var(--turq-l); } .bg-saffron { background: var(--saffron-l); } .bg-lapis { background: var(--lapis-l); }
.bg-pom { background: var(--pom-l); } .bg-plum { background: var(--plum-l); }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--bg-2); color: var(--ink-2); }
.pill.turq { background: var(--turq-l); color: var(--turq-d); }
.pill.saffron { background: var(--saffron-l); color: var(--saffron-d); }
.pill.lapis { background: var(--lapis-l); color: var(--lapis); }
.pill.pom { background: var(--pom-l); color: var(--pom); }

/* ---------- progress ---------- */
.bar { height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; position: relative; }
.bar > i { display: block; height: 100%; background: var(--turq); border-radius: 99px; transition: width .4s cubic-bezier(.2,.8,.2,1); position: relative; }
.bar > i::after { content: ''; position: absolute; top: 3px; inset-inline: 8px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.35); }
.bar.saffron > i { background: var(--saffron); }
.bar.lapis > i { background: var(--lapis); }
.bar.thin { height: 8px; } .bar.thin > i::after { display: none; }

.rings { display: flex; gap: 10px; justify-content: space-between; }
.ring { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.ring svg { width: 64px; height: 64px; }
.ring .rl { font-size: 11px; font-weight: 700; color: var(--ink-2); text-align: center; line-height: 1.3; }
.ring .rv { font-size: 11px; color: var(--ink-3); }

/* ---------- onboarding ---------- */
.welcome { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 8px; }
.welcome .mascot-big { width: 190px; animation: bob 3s ease-in-out infinite; }
.welcome h1 { font-size: 34px; font-weight: 900; margin: 6px 0 0; color: var(--turq-d); }
.welcome p { color: var(--ink-2); font-size: 17px; margin: 0 0 8px; font-weight: 600; }
.bottom-actions { padding: 16px; display: grid; gap: 12px; border-top: 2px solid var(--line); }
.bottom-actions.noline { border-top: none; }
.speech {
  display: flex; align-items: flex-end; gap: 10px; margin: 8px 0 18px;
}
.speech .mascot-sm { width: 84px; flex-shrink: 0; }
.bubble {
  position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 18px;
  padding: 12px 14px; font-weight: 700; font-size: 16px;
}
.bubble::after { content: ''; position: absolute; bottom: 14px; right: -9px; width: 14px; height: 14px; background: var(--card); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(-45deg); }
.choice-list { display: grid; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r);
  padding: 13px 14px; font-weight: 700; box-shadow: 0 3px 0 var(--line); transition: transform .06s;
}
.choice:active { transform: translateY(3px); box-shadow: none; }
.choice .ce { font-size: 26px; width: 36px; text-align: center; }
.choice .cs { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.choice.sel { border-color: var(--turq); background: var(--turq-l); box-shadow: 0 3px 0 var(--turq); color: var(--turq-d); }
.choice.right { border-color: var(--ok); background: var(--ok-l); box-shadow: 0 3px 0 var(--ok); }
.choice.wrong { border-color: var(--pom); background: var(--pom-l); box-shadow: 0 3px 0 var(--pom); animation: shake .3s; }
.choice.dis { opacity: .45; pointer-events: none; }
.choice .kbd { margin-inline-start: auto; font-size: 11px; color: var(--ink-3); border: 2px solid var(--line); border-radius: 8px; padding: 0 6px; font-family: var(--font-en); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 14px;
  font-weight: 800; box-shadow: 0 3px 0 var(--line); min-width: 54px;
}
.chip.sel { border-color: var(--turq); color: var(--turq-d); background: var(--turq-l); box-shadow: 0 3px 0 var(--turq); }
.chip[disabled] { opacity: .5; cursor: not-allowed; }
.goal-row { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 2px dashed var(--line); }
.goal-row:last-child { border-bottom: none; }
.goal-row .gl { font-weight: 800; display: flex; align-items: center; gap: 8px; }

/* ---------- exercise / lesson ---------- */
.lesson-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px; }
.lesson-head .bar { flex: 1; }
.lesson-body { flex: 1; overflow-y: auto; padding: 10px 18px 20px; display: flex; flex-direction: column; }
.ex-title { font-size: 21px; font-weight: 900; margin: 6px 0 16px; line-height: 1.5; }
.ex-type { font-size: 12px; font-weight: 800; color: var(--plum); letter-spacing: .3px; display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.prompt-card { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.prompt-card .bubble { flex: 1; }
.play-big {
  width: 110px; height: 110px; border-radius: 28px; border: none; background: var(--lapis); color: #fff;
  box-shadow: 0 6px 0 var(--lapis-d); display: inline-flex; align-items: center; justify-content: center;
}
.play-big svg { width: 54px; height: 54px; }
.play-big:active { transform: translateY(6px); box-shadow: none; }
.play-sm {
  width: 64px; height: 64px; border-radius: 20px; border: none; background: var(--lapis-l); color: var(--lapis);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--lapis) 35%, transparent); display: inline-flex; align-items: center; justify-content: center; font-size: 26px;
}
.play-sm:active { transform: translateY(4px); box-shadow: none; }
.play-row { display: flex; justify-content: center; align-items: flex-end; gap: 16px; margin: 6px 0 22px; }
.speak-btn { border: none; background: none; color: var(--lapis); padding: 2px 6px; border-radius: 8px; font-size: 18px; vertical-align: middle; }
.speak-btn:hover { background: var(--lapis-l); }
.answer-box {
  width: 100%; min-height: 120px; resize: none; border: 2px solid var(--line); border-radius: var(--r);
  background: var(--bg-2); padding: 14px; font-size: 18px; outline: none; font-family: var(--font-en);
  direction: ltr; text-align: left;
}
.answer-box:focus { border-color: var(--turq); background: var(--card); }
.answer-box.rtl { direction: rtl; text-align: right; font-family: var(--font); }
.text-input { width: 100%; border: 2px solid var(--line); border-radius: var(--r); background: var(--bg-2); padding: 12px 14px; outline: none; }
.text-input:focus { border-color: var(--turq); background: var(--card); }

.word-card { text-align: center; padding: 20px 16px; border: 2px solid var(--line); border-radius: var(--r-l); box-shadow: 0 4px 0 var(--line); margin: 6px 0 16px; }
.word-card .emoji { font-size: 64px; line-height: 1.1; }
.word-card .w { font-size: 36px; font-weight: 800; font-family: var(--font-en); direction: ltr; margin-top: 6px; }
.word-card .m { font-size: 22px; font-weight: 800; color: var(--turq-d); }
.word-card .ex { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); }
.word-card .ex .en-block { text-align: center; font-size: 17px; }

.bank-answer { min-height: 108px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; padding: 6px 0 12px; direction: ltr; background: repeating-linear-gradient(transparent 0 52px, var(--line) 52px 54px); }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 18px; direction: ltr; }
.wtile {
  border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 7px 13px;
  font-family: var(--font-en); font-size: 17px; font-weight: 600; box-shadow: 0 3px 0 var(--line); transition: transform .08s;
}
.wtile:active { transform: translateY(3px); box-shadow: none; }
.wtile.used { background: var(--line); color: transparent; box-shadow: none; pointer-events: none; }
.wtile.bad { border-color: var(--pom); background: var(--pom-l); color: var(--pom); }
.wtile.good { border-color: var(--ok); background: var(--ok-l); color: var(--ok-d); }

.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-col { display: grid; gap: 10px; }
.mtile {
  border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 8px;
  font-weight: 700; box-shadow: 0 3px 0 var(--line); min-height: 54px; transition: all .12s;
}
.mtile.en { font-family: var(--font-en); }
.mtile.sel { border-color: var(--lapis); background: var(--lapis-l); color: var(--lapis); box-shadow: 0 3px 0 var(--lapis); }
.mtile.ok { border-color: var(--ok); background: var(--ok-l); color: var(--ok-d); opacity: .5; pointer-events: none; box-shadow: none; }
.mtile.no { border-color: var(--pom); background: var(--pom-l); animation: shake .3s; }

.sentence-tap { display: flex; flex-wrap: wrap; gap: 8px; direction: ltr; justify-content: center; margin: 14px 0; }
.letters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; direction: ltr; }
.letter { width: 48px; height: 52px; font-size: 22px; font-weight: 800; font-family: var(--font-en); border: 2px solid var(--line); background: var(--card); border-radius: 12px; box-shadow: 0 3px 0 var(--line); }
.letter.used { visibility: hidden; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; direction: ltr; margin: 10px 0 22px; min-height: 56px; }
.slot { width: 44px; height: 52px; border-bottom: 3px solid var(--line-2); font-size: 24px; font-weight: 800; font-family: var(--font-en); display: flex; align-items: center; justify-content: center; }

.mic-btn {
  width: 96px; height: 96px; border-radius: 50%; border: none; background: var(--turq); color: #fff;
  box-shadow: 0 6px 0 var(--turq-d); display: inline-flex; align-items: center; justify-content: center;
}
.mic-btn svg { width: 44px; height: 44px; }
.mic-btn.rec { background: var(--pom); box-shadow: 0 6px 0 var(--pom-d); animation: pulse 1.2s infinite; }
.mic-btn:active { transform: translateY(6px); box-shadow: none; }
.heard { min-height: 30px; text-align: center; font-family: var(--font-en); direction: ltr; color: var(--ink-2); margin-top: 14px; font-size: 18px; }

/* feedback sheet */
.lesson-foot { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); background: var(--bg); transition: background .2s; }
.lesson-foot.ok { background: var(--ok-l); border-top-color: transparent; }
.lesson-foot.bad { background: var(--pom-l); border-top-color: transparent; }
.fb { display: none; margin-bottom: 12px; animation: fadeIn .2s; }
.lesson-foot.ok .fb, .lesson-foot.bad .fb { display: block; }
.fb-h { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 900; }
.lesson-foot.ok .fb-h { color: var(--ok-d); }
.lesson-foot.bad .fb-h { color: var(--pom); }
.fb-h .fb-ico { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
.fb-body { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.fb-body .en-block { font-weight: 700; color: var(--ink); font-size: 16px; }
.fb-tip { margin-top: 8px; background: rgba(255,255,255,.6); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
:root[data-theme="dark"] .fb-tip { background: rgba(0,0,0,.2); }
.foot-row { display: flex; gap: 10px; }
.foot-row .btn { flex: 1; }

.diff { direction: ltr; text-align: left; font-family: var(--font-en); font-size: 18px; line-height: 2; }
.diff span { padding: 1px 4px; border-radius: 6px; margin-right: 2px; }
.diff .d-ok { background: var(--ok-l); color: var(--ok-d); }
.diff .d-near { background: var(--saffron-l); color: var(--saffron-d); }
.diff .d-bad { background: var(--pom-l); color: var(--pom); text-decoration: line-through; }
.diff .d-miss { background: var(--pom-l); color: var(--pom); border: 2px dashed var(--pom); }
.diff .d-extra { color: var(--ink-3); text-decoration: line-through; }
.err-list { display: grid; gap: 8px; margin-top: 10px; }
.err-item { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.err-item b { color: var(--pom); }

/* ---------- path (home) ---------- */
.unit-head {
  border-radius: var(--r-l); padding: 16px; color: #fff; margin: 4px 0 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 4px 0 rgba(0,0,0,.18);
}
.unit-head h2 { margin: 0; font-size: 19px; font-weight: 900; }
.unit-head p { margin: 2px 0 0; font-size: 13px; opacity: .92; }
.unit-head .lvl { font-family: var(--font-en); font-weight: 900; background: rgba(255,255,255,.25); border-radius: 10px; padding: 2px 10px; font-size: 13px; }
.path { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 8px 0 26px; }
.node-wrap { position: relative; }
.node {
  position: relative; width: 74px; height: 70px; border-radius: 50%; border: none;
  background: var(--c, var(--turq)); color: #fff; box-shadow: 0 7px 0 var(--cd, var(--turq-d));
  display: flex; align-items: center; justify-content: center; font-size: 30px; transition: transform .08s;
}
.node:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--cd, var(--turq-d)); }
.node.locked { --c: var(--line); --cd: var(--line-2); color: var(--ink-3); filter: grayscale(1); }
.node.done { --c: var(--saffron); --cd: var(--saffron-d); }
.node.current { animation: pulse 1.8s infinite; }
.node-label { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; color: var(--ink-3); }
.node-start {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--card); border: 2px solid var(--line); color: var(--turq-d); font-weight: 900; font-size: 13px;
  border-radius: 12px; padding: 3px 12px; animation: bob 2s infinite; z-index: 2;
}
.node-start::after { content: ''; position: absolute; bottom: -7px; left: 50%; margin-left: -6px; width: 10px; height: 10px; background: var(--card); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }

.nudge { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-l); background: var(--lapis-l); border: 2px solid color-mix(in srgb, var(--lapis) 25%, transparent); margin-bottom: 14px; width: 100%; text-align: right; }
.nudge .av { width: 48px; height: 48px; flex-shrink: 0; }
.nudge b { display: block; font-size: 15px; color: var(--ink); }
.nudge span { font-size: 13px; color: var(--ink-2); }

/* ---------- chat ---------- */
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 2px solid var(--line); }
.chat-head .av { width: 44px; height: 44px; }
.chat-head .ch-n { font-weight: 900; }
.chat-head .ch-s { font-size: 12px; color: var(--ink-3); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 16px; animation: fadeIn .25s; }
.msg.bot { align-self: flex-end; background: var(--bg-2); border: 2px solid var(--line); border-top-right-radius: 6px; }
.msg.me { align-self: flex-start; background: var(--turq); color: #fff; border-top-left-radius: 6px; }
.msg .en-block { font-size: 16px; }
.msg .tr { font-size: 13px; color: var(--ink-3); margin-top: 4px; border-top: 1px dashed var(--line-2); padding-top: 4px; }
.msg.me .tr { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.4); }
.msg .msg-tools { display: flex; gap: 4px; margin-top: 4px; }
.msg-tools button { border: none; background: none; font-size: 12px; color: var(--lapis); font-weight: 700; padding: 2px 6px; border-radius: 6px; }
.msg-tools button:hover { background: var(--lapis-l); }
.coach {
  margin: 0 12px 8px; border-radius: 16px; background: var(--saffron-l); border: 2px solid color-mix(in srgb, var(--saffron-d) 30%, transparent);
  padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; animation: fadeIn .25s;
}
.coach .mascot-xs { width: 40px; flex-shrink: 0; }
.coach b { color: var(--saffron-d); }
.chat-input { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); align-items: center; }
.chat-input input { flex: 1; direction: ltr; text-align: left; font-family: var(--font-en); }
.round-btn { width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--turq); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 3px 0 var(--turq-d); }
.round-btn svg { width: 22px; height: 22px; }
.round-btn.ghost { background: var(--bg-2); color: var(--ink-2); box-shadow: 0 3px 0 var(--line-2); }
.round-btn.rec { background: var(--pom); box-shadow: 0 3px 0 var(--pom-d); animation: pulse 1.2s infinite; }
.chat-tools { display: flex; gap: 8px; padding: 0 12px 8px; overflow-x: auto; }
.chat-tools .btn { white-space: nowrap; }
.char-card { display: flex; gap: 14px; align-items: center; }
.char-card .av { width: 70px; height: 70px; flex-shrink: 0; }

/* ---------- league ---------- */
.league-hero { text-align: center; padding: 8px 0 14px; }
.gem-row { display: flex; justify-content: center; gap: 10px; margin-bottom: 8px; }
.gem { width: 44px; height: 50px; opacity: .35; filter: grayscale(.6); }
.gem.on { opacity: 1; filter: none; transform: scale(1.25); }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; }
.lb-row.me { background: var(--turq-l); border: 2px solid var(--turq); }
.lb-rank { width: 28px; text-align: center; font-weight: 900; color: var(--ink-3); }
.lb-row.top .lb-rank { color: var(--turq-d); }
.lb-av { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; flex-shrink: 0; }
.lb-name { flex: 1; font-weight: 700; }
.lb-xp { font-weight: 800; color: var(--ink-2); font-size: 14px; }
.zone { text-align: center; font-size: 12px; font-weight: 900; padding: 6px; border-radius: 10px; margin: 6px 0; }
.zone.up { color: var(--ok-d); background: var(--ok-l); }
.zone.down { color: var(--pom); background: var(--pom-l); }

/* ---------- profile ---------- */
.prof-head { display: flex; gap: 14px; align-items: center; padding-bottom: 14px; border-bottom: 2px solid var(--line); }
.prof-av { width: 78px; height: 78px; border-radius: 50%; background: var(--turq-l); display: flex; align-items: center; justify-content: center; overflow: hidden; border: 3px solid var(--turq); }
.prof-av svg { width: 70px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-box { border: 2px solid var(--line); border-radius: 16px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.stat-box .sb-i { font-size: 24px; }
.stat-box .sb-v { font-weight: 900; font-size: 18px; line-height: 1.2; }
.stat-box .sb-l { font-size: 12px; color: var(--ink-3); }
.skill-row { display: grid; grid-template-columns: 74px 1fr 38px; align-items: center; gap: 10px; margin: 10px 0; font-size: 14px; font-weight: 700; }
.skill-row .lv { font-family: var(--font-en); font-weight: 900; color: var(--turq-d); font-size: 13px; text-align: left; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.week .wd { font-size: 12px; color: var(--ink-3); font-weight: 700; }
.week .wdot { width: 34px; height: 34px; margin: 4px auto 0; border-radius: 50%; background: var(--bg-2); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.week .wdot.on { background: var(--saffron); border-color: var(--saffron-d); }
.week .wdot.today { border-color: var(--turq); border-width: 3px; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { text-align: center; padding: 10px 6px; border: 2px solid var(--line); border-radius: 16px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.badge .bi { font-size: 32px; display: block; }
.badge.off { filter: grayscale(1); opacity: .45; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 2px solid var(--line); }
.setting:last-child { border-bottom: none; }
.switch { position: relative; width: 52px; height: 30px; border-radius: 99px; background: var(--line-2); border: none; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--turq); }
.switch.on::after { transform: translateX(-22px); }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; padding: 5px 10px; border-radius: 9px; font-size: 13px; font-weight: 800; color: var(--ink-3); }
.seg button.on { background: var(--card); color: var(--turq-d); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

/* ---------- result / finish ---------- */
.finish { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 6px; }
.finish .mascot-big { width: 170px; animation: pop .5s ease; }
.finish h1 { font-size: 28px; font-weight: 900; margin: 6px 0; color: var(--saffron-d); }
.res-boxes { display: flex; gap: 10px; width: 100%; margin-top: 16px; }
.res-box { flex: 1; border: 2px solid var(--c); border-radius: 16px; overflow: hidden; animation: pop .5s ease backwards; }
.res-box .rb-h { background: var(--c); color: #fff; font-size: 12px; font-weight: 900; padding: 4px; }
.res-box .rb-v { font-size: 22px; font-weight: 900; padding: 10px 4px; color: var(--c); }
.res-box:nth-child(2) { animation-delay: .1s; } .res-box:nth-child(3) { animation-delay: .2s; }
.cefr-big { font-family: var(--font-en); font-size: 64px; font-weight: 900; color: var(--turq-d); line-height: 1; }
.score-dial { position: relative; width: 180px; height: 180px; margin: 4px auto; }
.score-dial svg { width: 100%; height: 100%; }
.score-dial .sd-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* ---------- overlay / modal / toast ---------- */
#overlay { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.modal-back { position: absolute; inset: 0; background: rgba(10, 30, 32, .45); display: flex; align-items: flex-end; justify-content: center; pointer-events: auto; animation: fadeIn .2s; }
.modal {
  width: 100%; max-width: 480px; background: var(--bg); border-radius: 28px 28px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto; animation: slideUp .25s cubic-bezier(.2,.8,.2,1);
}
@media (min-width: 900px) { .modal-back { align-items: center; } .modal { border-radius: 28px; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h2 { margin: 0 0 6px; font-size: 22px; font-weight: 900; text-align: center; }
.modal p { text-align: center; color: var(--ink-2); margin: 0 0 16px; }
.modal .m-ill { display: flex; justify-content: center; margin-bottom: 6px; }
.modal .m-actions { display: grid; gap: 10px; }
.toast {
  position: absolute; top: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 14px; font-weight: 800; font-size: 14px; animation: fadeIn .2s; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow);
}
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* timer pill for games */
.timer { font-family: var(--font-en); font-weight: 900; color: var(--pom); min-width: 48px; text-align: center; }
.score-pill { font-weight: 900; color: var(--saffron-d); }

/* helpers */
.list-plain { margin: 0; padding-inline-start: 18px; color: var(--ink-2); }
.list-plain li { margin: 4px 0; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.note { font-size: 13px; color: var(--ink-3); background: var(--bg-2); border-radius: 12px; padding: 10px 12px; }
.sub-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
hr.sep { border: none; border-top: 2px solid var(--line); margin: 16px 0; }
.empty { text-align: center; color: var(--ink-3); padding: 30px 10px; }
.empty .mascot-sm { width: 100px; margin: 0 auto 8px; display: block; }
.vid-frame { aspect-ratio: 16/9; border-radius: 16px; background: linear-gradient(135deg, #1A2E44, #0B3B3A); display: flex; align-items: center; justify-content: center; color: #fff; position: relative; overflow: hidden; margin-bottom: 14px; }
.vid-frame .scene { font-size: 70px; }
.vid-frame .sub { position: absolute; bottom: 10px; left: 10px; right: 10px; text-align: center; background: rgba(0,0,0,.6); border-radius: 8px; padding: 4px 8px; font-family: var(--font-en); direction: ltr; font-size: 15px; }
.seg-list { display: grid; gap: 6px; }
.seg-item { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); font-size: 14px; }
.seg-item.cur { border-color: var(--lapis); background: var(--lapis-l); }
.seg-item .sc { margin-inline-start: auto; font-weight: 900; font-family: var(--font-en); }

/* mascot sizes */
.mascot-big { width: 180px; }
.mascot-sm { width: 110px; }
.mascot-xs { width: 44px; flex-shrink: 0; }
.speech .mascot-xs { width: 52px; }
.m-ill .mascot-sm { width: 120px; }
.empty .mascot-sm { width: 100px; }
.chat-head .av, .nudge .av { display: block; }

/* ---------- اندازهٔ متن (برای کودکان و سالمندان بزرگ‌تر) ---------- */
:root[data-text="lg"] body { font-size: 17.5px; }
:root[data-text="xl"] body { font-size: 19px; }
:root[data-text="lg"] .ex-title { font-size: 23px; }
:root[data-text="xl"] .ex-title { font-size: 25px; }
:root[data-text="lg"] .btn { font-size: 17.5px; min-height: 54px; }
:root[data-text="xl"] .btn { font-size: 19px; min-height: 58px; }
:root[data-text="lg"] .choice, :root[data-text="lg"] .mtile, :root[data-text="lg"] .wtile, :root[data-text="lg"] .bubble { font-size: 17.5px; }
:root[data-text="xl"] .choice, :root[data-text="xl"] .mtile, :root[data-text="xl"] .wtile, :root[data-text="xl"] .bubble { font-size: 19.5px; }
:root[data-text="xl"] .choice { padding: 16px; }
:root[data-text="lg"] .tile .tile-t { font-size: 17.5px; } :root[data-text="xl"] .tile .tile-t { font-size: 19px; }
:root[data-text="lg"] .tile .tile-s, :root[data-text="lg"] .small { font-size: 14.5px; }
:root[data-text="xl"] .tile .tile-s, :root[data-text="xl"] .small, :root[data-text="xl"] .note { font-size: 16px; }
:root[data-text="xl"] .tab { font-size: 13px; } :root[data-text="xl"] .tab .ti { font-size: 27px; }
:root[data-text="lg"] .answer-box, :root[data-text="lg"] .msg { font-size: 18px; }
:root[data-text="xl"] .answer-box, :root[data-text="xl"] .msg, :root[data-text="xl"] .msg .en-block { font-size: 20px; }
:root[data-text="xl"] .diff { font-size: 20px; }
:root[data-age="kid"] .word-card .emoji { font-size: 88px; }
:root[data-age="kid"] .btn, :root[data-age="kid"] .choice, :root[data-age="kid"] .card, :root[data-age="kid"] .tile { border-radius: 24px; }

/* ---------- قهرمان صفحه با گرادیان تم ---------- */
.hero-card { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff; border-radius: var(--r-l); padding: 18px; position: relative; overflow: hidden; }
.hero-card::after { content: ''; position: absolute; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.12); top: -60px; left: -40px; }
.hero-card .btn { --c: #fff; --cd: rgba(0,0,0,.18); --fg: var(--turq-d); }

/* ---------- تم‌ها در پروفایل ---------- */
.skins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.skin { border: 3px solid var(--line); border-radius: 16px; padding: 6px; background: var(--card); text-align: center; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.skin .sw3 { height: 38px; border-radius: 10px; display: flex; overflow: hidden; margin-bottom: 4px; }
.skin .sw3 i { flex: 1; }
.skin.on { border-color: var(--turq); box-shadow: 0 0 0 3px var(--turq-l); }

/* ---------- بازی بادکنک (کودکان) ---------- */
.balloons { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 8px 10px; }
.balloon { position: relative; border: none; background: none; height: 150px; animation: bob 2.6s ease-in-out infinite; }
.balloon:nth-child(2) { animation-delay: .4s; } .balloon:nth-child(3) { animation-delay: .9s; } .balloon:nth-child(4) { animation-delay: 1.3s; }
.balloon .bb { width: 104px; height: 122px; margin: 0 auto; border-radius: 50% 50% 48% 48%; display: flex; align-items: center; justify-content: center; font-size: 50px;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.75) 0 10%, transparent 12%), var(--bc); box-shadow: inset -10px -14px 0 rgba(0,0,0,.12); }
.balloon::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 2px; height: 28px; background: var(--ink-3); }
.balloon.pop .bb { animation: popb .35s forwards; }
.balloon.miss .bb { animation: shake .3s; }
@keyframes popb { 50% { transform: scale(1.3); opacity: .8; } 100% { transform: scale(0); opacity: 0; } }

/* ---------- نبرد با غول ---------- */
.arena { background: linear-gradient(180deg, var(--hero-a), var(--hero-b)); border-radius: 22px; padding: 14px; color: #fff; margin-bottom: 14px; text-align: center; position: relative; overflow: hidden; }
.arena .boss { font-size: 76px; line-height: 1.1; display: inline-block; transition: transform .1s; }
.arena .boss.hit { animation: shake .35s; filter: brightness(2); }
.arena .hp { height: 14px; border-radius: 99px; background: rgba(0,0,0,.3); overflow: hidden; margin: 8px 20px 4px; }
.arena .hp i { display: block; height: 100%; background: linear-gradient(90deg, #FF3D71, #FFB020); transition: width .4s; }
.arena .hearts { font-size: 20px; letter-spacing: 2px; }
.arena .dmg { position: absolute; top: 30%; left: 50%; font-weight: 900; font-size: 28px; color: #FFE14D; animation: fadeIn .2s, fall 1s linear reverse; pointer-events: none; }

/* ---------- اسپیکینگ ---------- */
.speak-q { font-size: 20px; font-weight: 800; text-align: center; margin: 8px 0 16px; }
.wave { display: flex; gap: 4px; justify-content: center; align-items: center; height: 40px; margin: 12px 0; }
.wave i { width: 5px; border-radius: 4px; background: var(--turq); height: 8px; transition: height .1s; }
.wave.on i { animation: wv 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s } .wave i:nth-child(3) { animation-delay: .2s } .wave i:nth-child(4) { animation-delay: .3s } .wave i:nth-child(5) { animation-delay: .4s } .wave i:nth-child(6) { animation-delay: .5s } .wave i:nth-child(7) { animation-delay: .6s }
@keyframes wv { 0%,100% { height: 8px } 50% { height: 36px } }
.pair-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.install-card { display: flex; align-items: center; gap: 12px; }

/* نشانگر «در حال نوشتن» در گفت‌وگو */
.typing .dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); animation: tdot 1s infinite; }
.typing .dots i:nth-child(2) { animation-delay: .15s } .typing .dots i:nth-child(3) { animation-delay: .3s }
@keyframes tdot { 0%, 100% { opacity: .3; transform: translateY(0) } 50% { opacity: 1; transform: translateY(-4px) } }
.tabbar .tab { min-width: 0; }
.tab { font-size: 10.5px; }
.chat-tools { flex-wrap: wrap; overflow: visible; }
:root[data-skin="gamer"], :root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }

/* زبان هدف راست‌به‌چپ (عربی): متن تمرین‌ها راست‌چین */
:root[data-target-dir="rtl"] .en, :root[data-target-dir="rtl"] .en-block, :root[data-target-dir="rtl"] .answer-box,
:root[data-target-dir="rtl"] .bank, :root[data-target-dir="rtl"] .bank-answer, :root[data-target-dir="rtl"] .diff,
:root[data-target-dir="rtl"] .sentence-tap, :root[data-target-dir="rtl"] .wtile, :root[data-target-dir="rtl"] .mtile.en,
:root[data-target-dir="rtl"] .word-card .w, :root[data-target-dir="rtl"] .chat-input input, :root[data-target-dir="rtl"] .choice.en {
  direction: rtl; text-align: right; font-family: var(--font);
}
:root[data-target-dir="rtl"] .word-card .w, :root[data-target-dir="rtl"] .word-card .ex .en-block { text-align: center; }
button.level-chip { font-family: var(--font-en); }

/* ---------- آواتار سه‌بعدی ---------- */
.avatar-screen { background: radial-gradient(120% 70% at 50% 25%, var(--turq-l), var(--bg) 70%); }
.av-stage { position: relative; height: 42vh; min-height: 240px; max-height: 380px; margin: 0 12px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--hero-a) 35%, var(--bg)), color-mix(in srgb, var(--hero-b) 18%, var(--bg)) 70%); }
.av-stage canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.av-status { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.45); color: #fff; padding: 5px 14px; border-radius: 99px; font-size: 13px; font-weight: 800; white-space: nowrap; z-index: 2; }
.av-2d { display: flex; justify-content: center; align-items: center; height: 100%; }
.av-2d svg { height: 82%; animation: bob 3s ease-in-out infinite; }
.av-sub { margin: 10px 16px 4px; min-height: 52px; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 10px 14px; font-size: 16px; }
.av-you { margin: 4px 16px; min-height: 22px; color: var(--ink-2); font-size: 15px; text-align: center; }
.av-controls { display: flex; justify-content: center; align-items: center; gap: 22px; padding: 10px 0 8px; }
.av-controls .round-btn { width: 56px; height: 56px; font-size: 22px; }
.pill.ok-pill, .ok-pill { background: var(--ok-l); color: var(--ok-d); }
button.pill { border: none; cursor: pointer; }

/* ============================================================
   نسخهٔ وب دسکتاپ: تمام‌صفحه، منوی کناری + ستون وسط + ستون اطلاعات
   ============================================================ */
.side-nav, .side-rail { display: none; }
.shell-main { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.main-col { width: 100%; }
@media (min-width: 1024px) {
  body { background: var(--bg); }
  #stage { padding: 0; gap: 0; align-items: stretch; }
  #app { max-width: none; height: 100%; border-radius: 0; box-shadow: none; border: none; }
  /* صفحه‌های تمام‌صفحه (درس، آزمون، تماس): محتوا در وسط، رنگ نوار بازخورد تا لبه‌ها */
  .screen:not(.shell):not(.landing) > * { padding-inline: max(16px, calc((100% - 760px) / 2)); }
  .screen:not(.shell):not(.landing) > .av-stage, .screen:not(.shell):not(.landing) > .av-sub, .screen:not(.shell):not(.landing) > .seg { margin-inline: max(16px, calc((100% - 760px) / 2)); padding-inline: 0; }
  .screen.shell { flex-direction: row; }
  .shell .topbar, .shell .tabbar { display: none; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; width: 250px; flex-shrink: 0; padding: 22px 14px; border-inline-end: 2px solid var(--line); overflow-y: auto; }
  .side-logo { display: block; padding: 4px 12px 22px; text-decoration: none; }
  .side-item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 14px; border: 2px solid transparent; text-decoration: none; color: var(--ink-2); font-weight: 800; font-size: 15px; }
  .side-item:hover { background: var(--bg-2); }
  .side-item.on { color: var(--lapis); background: var(--lapis-l); border-color: color-mix(in srgb, var(--lapis) 45%, transparent); }
  .side-item .si { width: 34px; text-align: center; font-size: 26px; line-height: 1; }
  .si-av svg { width: 34px; display: block; }
  .shell-main { align-items: stretch; }
  .shell .scroll { padding: 26px 32px; }
  .main-col { max-width: 620px; margin: 0 auto; }
  .side-rail { display: flex; flex-direction: column; gap: 18px; width: 370px; flex-shrink: 0; padding: 22px 26px; overflow-y: auto; }
  .rail-stats { display: flex; justify-content: space-between; align-items: center; }
  .rail-card { border: 2px solid var(--line); border-radius: 18px; padding: 16px 18px; background: var(--card); }
  .rail-card .rc-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .rail-card .rc-h a { font-size: 13px; font-weight: 800; color: var(--lapis); text-decoration: none; }
  .rail-card .gem { width: 44px; height: 50px; }
  .rail-card.promo { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff; border: none; }
  .rail-card.promo .btn { --c: #fff; --cd: rgba(0,0,0,.18); --fg: var(--turq-d); }
  .rail-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: 12px; font-weight: 700; }
  .rail-foot a { color: var(--ink-3); text-decoration: none; }
  .modal-back { align-items: center; }
}
@media (min-width: 1024px) and (max-width: 1240px) {
  .side-rail { display: none; }
}

/* ============================================================
   صفحهٔ اول (لندینگ)
   ============================================================ */
.screen.landing { overflow-y: auto; display: block; }
.ld-head { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 2px solid var(--line); }
.ld-wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.ld-head .ld-wrap { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.ld-lang { border: none; background: none; font-weight: 800; color: var(--ink-3); font-size: 13px; cursor: pointer; }
.ld-hero { display: flex; align-items: center; gap: 40px; padding: 48px 0 40px; }
.ld-art { position: relative; flex: 1; min-height: 360px; }
.ld-art .float { position: absolute; animation: bob 3.2s ease-in-out infinite; filter: drop-shadow(0 10px 18px rgba(40,20,100,.18)); }
.ld-art .f-yuzi { width: 230px; left: 50%; top: 50%; transform: translate(-50%, -50%); animation: none; }
.ld-art .f-yuzi svg { animation: bob 3s ease-in-out infinite; }
.ld-art .f-av { width: 92px; }
.ld-art .f-b { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 6px 12px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.ld-copy { flex: 1; text-align: center; }
.ld-copy h1 { font-size: 34px; line-height: 1.5; font-weight: 900; margin: 0 0 26px; color: var(--ink); }
.ld-copy .btn { width: 100%; max-width: 340px; margin-bottom: 12px; }
.ld-langs { border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.ld-langs .ld-wrap { display: flex; align-items: center; gap: 8px; height: 76px; }
.ld-langs .lst { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.ld-langs .lst::-webkit-scrollbar { display: none; }
.ld-langs .lg { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; font-weight: 800; color: var(--ink-3); white-space: nowrap; border: none; background: none; cursor: pointer; font-size: 14px; }
.ld-langs .lg:hover { background: var(--bg-2); color: var(--ink); }
.ld-langs .lg .fl { font-size: 26px; }
.ld-langs .arr { border: none; background: none; font-size: 22px; color: var(--ink-3); cursor: pointer; }
.ld-sec { display: flex; align-items: center; gap: 48px; padding: 70px 0; }
.ld-sec.rev { flex-direction: row-reverse; }
.ld-sec .tx { flex: 1; }
.ld-sec h2 { font-size: 40px; font-weight: 900; color: var(--turq); margin: 0 0 14px; line-height: 1.4; }
.ld-sec p { font-size: 17px; line-height: 2; color: var(--ink-2); margin: 0; }
.ld-sec .il { flex: 1; display: flex; justify-content: center; }
.ld-ill { position: relative; width: 320px; height: 280px; border-radius: 40px; background: radial-gradient(circle at 50% 45%, var(--turq-l), transparent 70%); display: flex; align-items: center; justify-content: center; }
.ld-ill .big { font-size: 120px; filter: drop-shadow(0 12px 18px rgba(0,0,0,.15)); }
.ld-ill .chip-f { position: absolute; background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 6px 12px; font-weight: 800; font-size: 14px; box-shadow: 0 6px 18px rgba(40,20,100,.1); animation: bob 3s ease-in-out infinite; }
.ld-band { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff; }
.ld-band .ld-wrap { display: flex; align-items: center; gap: 40px; padding: 60px 20px; }
.ld-band h2 { font-size: 36px; font-weight: 900; margin: 0 0 12px; }
.ld-band p { opacity: .92; line-height: 2; margin: 0 0 20px; }
.ld-band .btn { --c: #fff; --cd: rgba(0,0,0,.2); --fg: var(--turq-d); }
.ld-stores { display: flex; gap: 12px; flex-wrap: wrap; }
.ld-store { display: inline-flex; align-items: center; gap: 10px; background: #111; color: #fff; border-radius: 14px; padding: 10px 16px; font-weight: 800; text-decoration: none; border: none; cursor: pointer; }
.ld-store small { display: block; font-size: 10px; opacity: .7; font-weight: 600; }
.ld-ages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.ld-age { border: 2px solid var(--line); border-radius: 18px; padding: 16px 10px; text-align: center; background: var(--card); }
.ld-age .ai { font-size: 40px; }
.ld-age b { display: block; margin-top: 4px; }
.ld-age span { font-size: 12px; color: var(--ink-3); }
.ld-final { text-align: center; padding: 80px 20px; background: radial-gradient(circle at 50% 100%, var(--turq-l), transparent 70%); }
.ld-final h2 { font-size: 40px; font-weight: 900; margin: 0 0 24px; }
.ld-final .btn { min-width: 280px; }
.ld-foot { background: var(--turq-d); color: #fff; padding: 40px 0; }
.ld-foot .cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.ld-foot h4 { margin: 0 0 10px; font-size: 16px; }
.ld-foot a { display: block; color: rgba(255,255,255,.85); text-decoration: none; font-size: 14px; margin: 6px 0; }
.ld-foot .copy { text-align: center; opacity: .7; font-size: 12px; margin-top: 26px; }
@media (max-width: 860px) {
  .ld-hero, .ld-sec, .ld-sec.rev, .ld-band .ld-wrap { flex-direction: column; text-align: center; gap: 20px; }
  .ld-hero { padding-top: 24px; }
  .ld-art { width: 100%; min-height: 300px; }
  .ld-copy h1 { font-size: 26px; }
  .ld-sec { padding: 40px 0; }
  .ld-sec h2, .ld-final h2 { font-size: 28px; }
  .ld-ages { grid-template-columns: repeat(2, 1fr); }
  .ld-foot .cols { grid-template-columns: repeat(2, 1fr); }
  .ld-stores { justify-content: center; }
}

/* پرچم‌ها */
svg.flag { width: 1.45em; height: auto; vertical-align: -0.22em; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.1); flex-shrink: 0; }
.ld-langs .lg svg.flag { width: 34px; }
.choice .ce svg.flag { width: 34px; vertical-align: middle; }
.level-chip svg.flag, .rail-stats svg.flag { width: 26px; }

/* ---------- نوار تب پایین و منوی کناری با آیکون‌های رنگی ---------- */
.tabbar { gap: 4px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); box-shadow: 0 -6px 20px rgba(40, 20, 100, .06); }
.tab { gap: 3px; padding: 6px 0 5px; border-radius: 16px; border: 2px solid transparent; font-size: 11px; font-weight: 800; color: var(--ink-3); transition: background .15s, color .15s, border-color .15s; }
.tab .ti { filter: none; opacity: 1; font-size: 0; height: 32px; display: flex; align-items: center; justify-content: center; }
.tab .nav-ico { width: 30px; height: 30px; transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.tab:hover .nav-ico { transform: translateY(-2px); }
.tab:active .nav-ico { transform: scale(.88); }
.tab.on { color: var(--turq-d); background: var(--turq-l); border-color: color-mix(in srgb, var(--turq) 40%, transparent); }
.tab.on .nav-ico { transform: scale(1.12) translateY(-1px); animation: tabpop .35s ease; }
@keyframes tabpop { 0% { transform: scale(.85); } 60% { transform: scale(1.22); } 100% { transform: scale(1.12) translateY(-1px); } }
.side-item .si { font-size: 0; display: flex; align-items: center; justify-content: center; }
.side-item .nav-ico { width: 32px; height: 32px; }
.side-item.on { color: var(--turq-d); background: var(--turq-l); border-color: color-mix(in srgb, var(--turq) 45%, transparent); }

/* ============================================================
   صفحهٔ درس (طراحی جدید)
   ============================================================ */
.lesson-screen .lesson-head { gap: 12px; padding: 18px 14px 8px; }
.lh-bar { position: relative; }
.lh-combo { position: absolute; top: -17px; right: 8px; font-size: 11px; font-weight: 900; color: var(--saffron-d); letter-spacing: .3px; animation: fadeIn .2s; }
.bar.combo > i { background: linear-gradient(90deg, #FF9F1C, #FFC233); box-shadow: 0 0 12px rgba(255, 170, 30, .55); }
.en-badge { display: inline-flex; align-items: center; gap: 2px; font-weight: 900; font-size: 15px; color: var(--plum); background: var(--plum-l); padding: 4px 10px; border-radius: 12px; white-space: nowrap; }
.lesson-screen .ex-title { font-size: 23px; font-weight: 900; margin: 6px 0 18px; }
.prev-mis { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 900; color: var(--saffron-d); margin-bottom: 4px; }

/* شخصیت + حباب */
.cprompt { display: flex; align-items: flex-end; gap: 10px; margin: 0 0 18px; min-height: 130px; }
.cp-char { width: 116px; flex-shrink: 0; }
.cp-char svg { width: 100%; display: block; }
.cp-bubble { position: relative; flex: 1; border: 2px solid var(--line-2); border-radius: 18px; padding: 12px 14px; font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 34px; background: var(--card); }
.cp-bubble::after { content: ''; position: absolute; bottom: 14px; right: -10px; width: 16px; height: 16px; background: var(--card); border-right: 2px solid var(--line-2); border-bottom: 2px solid var(--line-2); transform: rotate(-45deg); }
.cp-bubble.en-block { direction: ltr; }
.cp-bubble.en-block::after { right: -10px; }
.cp-say { border: none; background: none; color: var(--lapis); width: 34px; height: 34px; flex-shrink: 0; padding: 0; cursor: pointer; }
.cp-say svg { width: 30px; height: 30px; }
.hw { position: relative; border-bottom: 2px dotted var(--ink-3); cursor: pointer; padding-bottom: 1px; }
.hw:hover { border-bottom-color: var(--lapis); color: var(--lapis); }
.hw-pop { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-family: var(--font); font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 10px; white-space: nowrap; z-index: 5; direction: rtl; animation: fadeIn .15s; }
.hw-pop::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--ink); }

/* تصویر درست */
.word-chip { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 6px 12px; margin-bottom: 14px; font-size: 18px; font-weight: 700; color: var(--lapis); cursor: pointer; }
.word-chip svg { width: 24px; height: 24px; }
.word-chip .en { border-bottom: 2px dotted currentColor; }
.img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.img-card { position: relative; border: 2px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 4px 0 var(--line); padding: 18px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: transform .06s; }
.img-card:active { transform: translateY(3px); box-shadow: none; }
.img-card .ic-e { font-size: 64px; line-height: 1.1; }
.img-card .ic-l { font-weight: 800; font-size: 15px; }
.img-card .kbd { position: absolute; top: 8px; left: 8px; font-size: 11px; color: var(--ink-3); border: 2px solid var(--line); border-radius: 7px; padding: 0 5px; font-family: var(--font-en); }
.img-card.sel { border-color: var(--lapis); background: var(--lapis-l); box-shadow: 0 4px 0 var(--lapis); }
.img-card.right { border-color: var(--ok); background: var(--ok-l); box-shadow: 0 4px 0 var(--ok); }
.img-card.wrong { border-color: var(--pom); background: var(--pom-l); box-shadow: 0 4px 0 var(--pom); animation: shake .3s; }
.img-card.dis { pointer-events: none; }

/* چه می‌شنوی؟ */
.hear-row { display: flex; justify-content: center; margin: 4px 0 22px; }
.hear-big, .hear-slow { border: none; background: var(--lapis); color: #fff; box-shadow: 0 5px 0 var(--lapis-d); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.hear-big { width: 120px; height: 96px; border-radius: 0 22px 22px 0; }
.hear-big svg { width: 50px; height: 50px; }
.hear-slow { width: 84px; height: 96px; border-radius: 22px 0 0 22px; font-size: 34px; background: color-mix(in srgb, var(--lapis) 80%, #fff); border-right: 2px solid rgba(255,255,255,.35); }
.hear-big:active, .hear-slow:active { transform: translateY(5px); box-shadow: none; }

/* گفت‌وگو */
.dlg-you { display: flex; align-items: flex-end; justify-content: flex-start; gap: 10px; margin: -6px 0 16px; direction: ltr; }
.dlg-blank { flex: 1; max-width: 220px; border: 2px dashed var(--line-2); border-radius: 16px; padding: 12px; text-align: center; color: var(--ink-3); font-weight: 800; }
.dlg-me { width: 62px; }
.dlg-me svg { width: 100%; display: block; }

/* صحبت */
.speak-wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; border: 2px solid var(--line); background: var(--card); color: var(--lapis); border-radius: 18px; padding: 18px; font-weight: 900; font-size: 16px; box-shadow: 0 4px 0 var(--line); cursor: pointer; margin-top: 6px; }
.speak-wide svg { width: 30px; height: 30px; }
.speak-wide.rec { border-color: var(--pom); color: var(--pom); background: var(--pom-l); box-shadow: 0 4px 0 var(--pom); animation: pulse 1.2s infinite; }

/* انتخاب‌ها */
.lesson-screen .choice { justify-content: center; text-align: center; min-height: 54px; position: relative; }
.lesson-screen .choice .kbd { position: absolute; right: 10px; margin: 0; }
.lesson-screen .choice.en .kbd { right: auto; left: 10px; }

/* بنر بازخورد */
.lesson-foot.almost { background: var(--saffron-l); border-top-color: transparent; }
.lesson-foot.almost .fb { display: block; }
.lesson-foot.almost .fb-h { color: var(--saffron-d); }
.lesson-foot.ok .fb-ico { color: var(--ok); }
.lesson-foot.bad .fb-ico { color: var(--pom); }
.fb-h .fb-ico { font-weight: 900; }
.btn.okb { --c: var(--ok); --cd: var(--ok-d); }
.explain-btn { margin-top: 10px; }
.lesson-foot.ok .explain-btn { --c: transparent; --fg: var(--ok-d); border-color: color-mix(in srgb, var(--ok) 55%, transparent); box-shadow: 0 3px 0 color-mix(in srgb, var(--ok) 55%, transparent); }
.lesson-foot.bad .explain-btn { --c: transparent; --fg: var(--pom); border-color: color-mix(in srgb, var(--pom) 50%, transparent); box-shadow: 0 3px 0 color-mix(in srgb, var(--pom) 50%, transparent); }
.exp-words { display: flex; flex-wrap: wrap; gap: 8px; direction: ltr; }
.exp-words .ew { border: 2px solid var(--line); border-radius: 12px; padding: 6px 10px; text-align: center; background: var(--card); }
.exp-words .ew .en { display: block; font-weight: 800; }
.exp-words .ew small { color: var(--ink-3); font-size: 12px; direction: rtl; display: block; }

/* جشن کمبو */
.combo-pop { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, color-mix(in srgb, var(--saffron) 35%, var(--bg)) 0%, var(--bg) 70%); animation: fadeIn .2s; }
.combo-pop .cp-in { text-align: center; animation: pop .5s ease; }
.combo-pop .cp-t { font-size: 36px; font-weight: 900; color: var(--saffron-d); margin-top: 6px; }
.combo-pop .cp-s { font-weight: 800; color: var(--ink-2); }
.screen { position: relative; }
.lesson-loading .ll-t { font-size: 22px; font-weight: 900; color: var(--turq-d); margin-top: 10px; }
.fa-bank .wtile { font-family: var(--font); }
.bank.fa-bank, .bank-answer.fa-bank { direction: rtl; }

/* ---------- ورود مرحله‌به‌مرحله ---------- */
.ob .lesson-head { padding: 16px 14px 6px; }
.ob-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; }
.ob-hm { width: 92px; flex-shrink: 0; }
.ob-hm svg { width: 100%; display: block; }
.ob-head .bubble { flex: 1; font-size: 17px; }
.ob-big { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 40px 0 10px; }
.ob-big .bubble { font-size: 19px; text-align: center; max-width: 320px; }
.ob-big .bubble::after { bottom: -9px; right: 50%; margin-right: -7px; transform: rotate(45deg); }
.ob-m { width: 180px; animation: bob 3s ease-in-out infinite; }
.ob-m svg { width: 100%; display: block; }
.ob-sub { font-size: 13px; font-weight: 900; color: var(--ink-3); margin-bottom: 8px; }
.ob-list { display: grid; gap: 10px; }
.ob-opt { display: flex; align-items: center; gap: 14px; width: 100%; text-align: right; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--line); cursor: pointer; transition: transform .06s; }
.ob-opt:active { transform: translateY(3px); box-shadow: none; }
.ob-opt .oi { width: 36px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.ob-opt .oi svg.flag { width: 36px; }
.ob-opt .ot { flex: 1; display: flex; flex-direction: column; }
.ob-opt .ot small { font-weight: 600; font-size: 12px; }
.ob-opt.sel { border-color: var(--lapis); background: var(--lapis-l); box-shadow: 0 3px 0 var(--lapis); color: var(--lapis); }
.ob-opt.dis { opacity: .5; pointer-events: none; }
.ob-opt.check .ck { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; flex-shrink: 0; }
.ob-opt.check.sel .ck { background: var(--lapis); border-color: var(--lapis); }
.ob-opt.row-opt { justify-content: space-between; }
.ob-opt.row-opt .ot { flex: none; }
.ob-opt.big-opt { padding: 18px 14px; }
.ob-phone { margin: 10px auto; max-width: 300px; border: 3px solid var(--line-2); border-radius: 30px; padding: 40px 14px 120px; background: linear-gradient(180deg, var(--lapis-l), var(--bg-2)); }
.ob-phone .op-n { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 16px; padding: 10px 12px; box-shadow: 0 6px 18px rgba(0,0,0,.12); animation: slideUp .6s ease; }
.streak-art { display: flex; align-items: flex-end; gap: 4px; width: auto; }
.streak-art .cal { width: 90px; height: 100px; border-radius: 16px; background: #fff; box-shadow: 0 6px 0 #E5E5E5; overflow: hidden; border: 3px solid #FF9F1C; transform: rotate(-6deg); }
.streak-art .cal-h { height: 26px; background: linear-gradient(90deg, #FF7A45, #FFB020); }
.streak-art .cal-n { font-size: 44px; font-weight: 900; text-align: center; color: #E5484D; line-height: 70px; }

/* ---------- مسیر ---------- */
.unit-head .uh-k { font-size: 11px; font-weight: 900; opacity: .85; letter-spacing: .3px; margin-bottom: 2px; }
.unit-head .uh-book { border: none; background: rgba(255,255,255,.22); border-radius: 14px; width: 48px; height: 48px; font-size: 24px; cursor: pointer; flex-shrink: 0; border-bottom: 3px solid rgba(0,0,0,.15); }
.unit-head.is-locked { color: var(--ink-2); box-shadow: 0 4px 0 var(--line); }
.jump-btn { --c: var(--card); --cd: var(--line-2); --fg: var(--turq-d); border: 2px solid var(--line-2); margin: -4px 0 6px; }
.node.chest { border-radius: 22px; --c: #FFC233; --cd: #E09E00; }
.node.chest.locked { --c: var(--line); --cd: var(--line-2); }
.path-char { position: absolute; top: -10px; width: 110px; pointer-events: none; animation: bob 3.4s ease-in-out infinite; }
.path-char svg { width: 100%; display: block; border-radius: 50%; }
.path-fab { position: absolute; bottom: 86px; left: 18px; width: 52px; height: 52px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--lapis); font-size: 22px; font-weight: 900; box-shadow: 0 4px 0 var(--line); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 5; }
.path-fab.show { opacity: 1; pointer-events: auto; }
@media (min-width: 1024px) { .path-fab { bottom: 24px; } }
.guide .kv { align-items: center; }
.g-sent { padding: 6px 0; border-bottom: 1px dashed var(--line); }

/* ---------- پروفایل ---------- */
.pf-band { position: relative; height: 170px; border-radius: var(--r-l); display: flex; align-items: flex-end; justify-content: center; margin-bottom: 0; }
.pf-av { position: relative; width: 150px; margin-bottom: -30px; display: block; }
.pf-av svg { width: 100%; display: block; border-radius: 50%; border: 5px solid var(--bg); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.pf-edit { position: absolute; bottom: 10px; left: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.pf-gear { position: absolute; top: 10px; left: 12px; font-size: 22px; text-decoration: none; background: rgba(255,255,255,.6); border-radius: 12px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.pf-info { padding: 40px 4px 14px; border-bottom: 2px solid var(--line); }
.pf-info h2 { margin: 0; font-size: 24px; }
.pf-meta { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.pf-meta b { color: var(--ink); }

/* ---------- ساخت آواتار ---------- */
.ae-preview { height: 230px; display: flex; align-items: center; justify-content: center; margin: 0 14px; border-radius: 22px; }
.ae-face { width: 200px; }
.ae-face svg { width: 100%; display: block; }
.ae-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 12px 14px 6px; border-bottom: 2px solid var(--line); scrollbar-width: none; }
.ae-tabs button { flex-shrink: 0; border: 2px solid transparent; background: none; border-radius: 12px; padding: 6px 10px; font-weight: 800; font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.ae-tabs button span { font-size: 22px; }
.ae-tabs button.on { color: var(--lapis); border-color: var(--lapis); background: var(--lapis-l); }
.ae-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ae-grid.color { grid-template-columns: repeat(5, 1fr); }
.ae-opt { border: 2px solid var(--line); border-radius: 18px; background: var(--card); padding: 8px; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.ae-opt svg { width: 100%; display: block; border-radius: 50%; }
.ae-opt.sel, .ae-sw.sel { border-color: var(--lapis); box-shadow: 0 3px 0 var(--lapis); }
.ae-sw { aspect-ratio: 1; border-radius: 16px; border: 3px solid var(--line); cursor: pointer; font-weight: 900; color: var(--ink-3); }

/* ---------- حساب ---------- */
.acc-form { display: grid; gap: 14px; }
.acc-form label { display: grid; gap: 6px; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.acc-form .pw { position: relative; display: block; }
.acc-form .pw button { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); border: none; background: none; font-size: 18px; cursor: pointer; }
.acc-err { color: var(--pom); font-weight: 800; font-size: 14px; }

/* ---------- تنظیمات ---------- */
.set-h { font-size: 15px; font-weight: 900; margin: 20px 0 8px; }
.set-card { border: 2px solid var(--line); border-radius: 18px; padding: 2px 14px; background: var(--card); }
.set-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 2px solid var(--line); font-weight: 700; color: var(--ink); text-decoration: none; flex-wrap: wrap; }
.set-item:last-child { border-bottom: none; }
.set-foot { text-align: center; font-size: 12px; color: var(--ink-3); margin: 20px 0; line-height: 2; }
.set-foot a { color: var(--ink-3); }

/* ---------- ماموریت‌ها و فروشگاه ---------- */
.q-hero { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #9A7BFF, #6A45F0); color: #fff; border-radius: var(--r-l); padding: 18px; }
.q-hero .q-t { font-size: 24px; font-weight: 900; }
.q-hero .q-s { opacity: .92; font-size: 14px; }
.q-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 2px solid var(--line); }
.q-row:last-child { border-bottom: none; }
.q-ic { font-size: 28px; }
.q-bar { position: relative; margin-top: 6px; }
.q-bar .bar { height: 18px; }
.q-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; color: var(--ink-2); }
.q-chest { font-size: 32px; border: none; background: none; filter: grayscale(.6); opacity: .7; }
.q-chest.ready { filter: none; opacity: 1; cursor: pointer; animation: bob 1.4s ease-in-out infinite; }
.q-chest.open { filter: none; opacity: .5; }
.q-month { display: flex; align-items: center; gap: 12px; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 2px solid var(--line); }
.shop-item:last-child { border-bottom: none; }
.shop-item .si-ic { font-size: 40px; width: 56px; text-align: center; }
.shop-promo { margin-bottom: 6px; }
.btn.quit-flat { color: var(--pom); }

.word-card .tr-sm { color: var(--ink-3); font-size: 15px; font-weight: 700; margin: -2px 0 4px; }

/* ===== انتخاب زبان (۳۰ زبان، جست‌وجو، حجم بسته) ===== */
.lang-q { width: 100%; margin-bottom: 10px; }
.lang-list { max-height: min(56vh, 460px); overflow-y: auto; padding: 2px 2px 6px; overscroll-behavior: contain; }
.lang-list .choice { padding-block: 10px; }
.lang-list .choice.dis { opacity: .5; pointer-events: none; }
.lang-list .choice.loading { opacity: .7; }
.lang-meta { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.lang-meta .kb { font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--bg-2, rgba(0,0,0,.05)); border-radius: 99px; padding: 2px 8px; direction: ltr; }
.lang-meta .kb.ok { color: var(--ok); }
.lang-note { font-size: 12px; margin: 10px 2px 0; }

/* ===== ورود / ثبت‌نام و کد دعوت ===== */
.auth .auth-box { max-width: 440px; margin: 0 auto; padding-bottom: 24px; }
.auth-hero { text-align: center; margin: 4px 0 16px; }
.auth-hero .auth-m { width: 96px; margin: 0 auto 6px; animation: bob 2.6s ease-in-out infinite; }
.auth-hero h1 { font-size: 24px; margin: 4px 0 6px; color: var(--ink); }
.auth-hero p { color: var(--ink-3); margin: 0; font-size: 14px; line-height: 1.8; }
@keyframes bob { 50% { transform: translateY(-6px); } }
.auth-tabs { display: flex; margin: 14px 0 16px; }
.auth-tabs button { flex: 1; }
.auth-row2 { display: grid; grid-template-columns: 1fr 96px; gap: 10px; }
.fld { display: grid; gap: 6px; }
.fld .fl { font-weight: 800; font-size: 14px; color: var(--ink-2); }
.fld .fi { position: relative; display: block; }
.fld .fi > i { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-weight: 900; color: var(--ink-3); pointer-events: none; font-size: 16px; }
.fld .fi > .text-input { width: 100%; padding-inline-start: 40px; }
.fld .fi.pw > .text-input { padding-inline-end: 44px; }
.fld .fi.pw > button { position: absolute; inset-inline-end: 6px; left: auto; top: 50%; transform: translateY(-50%); border: none; background: none; font-size: 18px; cursor: pointer; padding: 6px; }
.fld.bad .text-input { border-color: var(--pom) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pom) 18%, transparent); }
.fld .hint { font-size: 12px; color: var(--ink-3); min-height: 1em; }
.fld .hint.ok { color: var(--ok); font-weight: 700; }
.fld .hint.no { color: var(--pom); font-weight: 700; }
.pw-meter { display: flex; gap: 5px; align-items: center; }
.pw-meter i { flex: 1; height: 5px; border-radius: 9px; background: var(--line); transition: background .25s; }
.pw-meter b { font-size: 12px; min-width: 44px; text-align: end; color: var(--ink-3); }
.pw-meter[data-s="1"] i:nth-child(-n+1) { background: var(--pom); }
.pw-meter[data-s="2"] i:nth-child(-n+2) { background: #FFB020; }
.pw-meter[data-s="3"] i { background: var(--ok); }
.ref-fld { border: 2px dashed var(--line); border-radius: 16px; padding: 4px 12px; transition: border-color .2s, background .2s; }
.ref-fld.open { border-color: color-mix(in srgb, var(--turq) 55%, var(--line)); background: color-mix(in srgb, var(--turq) 6%, transparent); padding-bottom: 12px; }
.ref-toggle { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: none; padding: 10px 0; font: inherit; font-weight: 800; color: var(--ink); cursor: pointer; text-align: start; }
.ref-toggle .chev { margin-inline-start: auto; transition: transform .2s; color: var(--ink-3); }
.ref-fld.open .chev { transform: rotate(180deg); }
.ref-body { display: none; gap: 6px; }
.ref-fld.open .ref-body { display: grid; }
.ref-body .text-input { letter-spacing: 2px; font-weight: 800; text-transform: uppercase; }
.ref-banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 18px; margin-bottom: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, #FFC233 30%, var(--card)), color-mix(in srgb, var(--turq) 18%, var(--card)));
  border: 2px solid color-mix(in srgb, #FFC233 60%, transparent); animation: pop-in .4s ease; }
.ref-banner .rb-gift { font-size: 34px; animation: bob 2s ease-in-out infinite; }
.ref-banner b { display: block; color: var(--ink); }
.ref-banner span { font-size: 13px; color: var(--ink-2); }
.ld-ref { margin: 12px 0 0; }
@keyframes pop-in { from { transform: scale(.94); opacity: 0; } }
.acc-err[hidden] { display: none; }
.acc-err { background: color-mix(in srgb, var(--pom) 12%, transparent); border-radius: 12px; padding: 10px 12px; }
.auth-submit.loading { opacity: .75; }
.auth-switch { text-align: center; margin: 16px 0 8px; color: var(--ink-2); }
.auth-switch a { color: var(--turq); font-weight: 900; }
.invite-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; text-decoration: none; color: var(--ink);
  background: linear-gradient(135deg, color-mix(in srgb, #FFC233 22%, var(--card)), var(--card)); border: 2px solid color-mix(in srgb, #FFC233 45%, var(--line)); }
.invite-card .ic-g { font-size: 32px; }
.invite-card b { display: block; }
.invite-card span:not(.ic-g):not(.muted) { font-size: 12.5px; color: var(--ink-3); }
.inv-hero { text-align: center; margin: 6px 0 16px; }
.inv-hero .inv-gift { font-size: 70px; animation: bob 2.4s ease-in-out infinite; }
.inv-hero h1 { font-size: 22px; color: var(--ink); margin: 6px 0; }
.inv-hero p { color: var(--ink-3); margin: 0; }
.inv-code { display: grid; justify-items: center; gap: 6px; padding: 16px; border-radius: 20px; border: 2px dashed color-mix(in srgb, var(--turq) 60%, var(--line)); background: color-mix(in srgb, var(--turq) 7%, var(--card)); }
.inv-code small { color: var(--ink-3); font-weight: 700; }
.inv-code b { font-size: 34px; letter-spacing: 6px; color: var(--turq); direction: ltr; }
.inv-link { display: flex; gap: 8px; align-items: center; margin: 10px 0; padding: 8px 8px 8px 12px; border-radius: 14px; background: var(--bg-2, rgba(0,0,0,.05)); }
.inv-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ink-2); }
.inv-share { display: grid; gap: 10px; margin-bottom: 14px; }
.inv-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.inv-apps a { text-align: center; padding: 10px 4px; border-radius: 14px; border: 2px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 800; font-size: 14px; }
.inv-prog { display: grid; gap: 8px; margin-bottom: 14px; }
.inv-steps { display: grid; gap: 10px; margin-bottom: 16px; }
.inv-steps > div { display: grid; grid-template-columns: 36px 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--card); border: 2px solid var(--line); }
.inv-steps span { grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--turq); color: #fff; font-weight: 900; }
.inv-steps small { color: var(--ink-3); }
