/*
 * app.css — dasturning butun ko'rinishi.
 *
 * Asosiy g'oya: o'rganish o'yinga o'xshasin. Shuning uchun tugmalar
 * qalin va "bosiladigan" (pastida soya bor — barmoq bosganda tushadi),
 * ranglar yorqin, har kartochkada rasm bor.
 *
 * Telefon birinchi o'rinda: o'rganuvchi ko'pincha yo'lda, bitta qo'l
 * bilan ishlatadi — shuning uchun muhim tugmalar katta va pastda.
 */

/* ------------------------------- Shrift ---------------------------------
 * Nunito — yumaloq va iliq shrift. Fayllari loyiha ichida, shuning uchun
 * internet sekin bo'lsa ham sahifa to'g'ri ko'rinadi.
 */

@font-face{font-family:'Nunito';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/nunito-cyrillic-400.woff2) format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Nunito';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/nunito-latin-400.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Nunito';font-style:normal;font-weight:600;font-display:swap;src:url(fonts/nunito-cyrillic-600.woff2) format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Nunito';font-style:normal;font-weight:600;font-display:swap;src:url(fonts/nunito-latin-600.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Nunito';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/nunito-cyrillic-700.woff2) format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Nunito';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/nunito-latin-700.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}
@font-face{font-family:'Nunito';font-style:normal;font-weight:800;font-display:swap;src:url(fonts/nunito-cyrillic-800.woff2) format('woff2');unicode-range:U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;}
@font-face{font-family:'Nunito';font-style:normal;font-weight:800;font-display:swap;src:url(fonts/nunito-latin-800.woff2) format('woff2');unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;}

/* ------------------------------- Ranglar -------------------------------- */

:root {
  --bg: #f1f5fc;
  --card: #ffffff;
  --ink: #15202f;
  --muted: #68788f;
  --line: #dfe6f2;
  --line-strong: #cdd8ea;

  --brand: #2f6bff;
  --brand-dark: #1f4fd1;
  --brand-soft: #e7eeff;
  --violet: #7a44ff;

  --ok: #16a765;
  --ok-dark: #0f8450;
  --ok-soft: #e4f7ed;
  --bad: #ef4444;
  --bad-dark: #c32f2f;
  --bad-soft: #fdeceb;
  --warn: #b26a00;
  --gold: #ffb020;

  --radius: 20px;
  --tabs-h: 66px;
  --shadow: 0 6px 20px rgba(18, 38, 74, .07);
  --shadow-lift: 0 14px 34px rgba(18, 38, 74, .13);
  /* "bosiladigan" tugma uchun qalin pastki chiziq */
  --press: 4px;
}

/*
 * Qorong'i rejim ikki yo'l bilan yoqiladi:
 *   1) odam tugmani bossa — <html data-theme="dark"> qo'yiladi;
 *   2) tugmaga tegilmagan bo'lsa — telefon sozlamasiga qarab o'zi.
 * Shuning uchun ranglar ikki marta yoziladi.
 */

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #0c111c;
    --card: #151d2b;
    --ink: #e9eff8;
    --muted: #93a3ba;
    --line: #253147;
    --line-strong: #2d3a50;
    --brand: #5b8cff;
    --brand-dark: #3b6ae0;
    --brand-soft: #1a2541;
    --ok: #30c285;
    --ok-dark: #1d9e68;
    --ok-soft: #112c22;
    --bad: #ff6b63;
    --bad-dark: #d14b44;
    --bad-soft: #341d1c;
    --warn: #e0a44a;
    --shadow: 0 6px 20px rgba(0, 0, 0, .3);
    --shadow-lift: 0 14px 34px rgba(0, 0, 0, .45);
  }
}

html[data-theme="dark"] {
    --bg: #0c111c;
    --card: #151d2b;
    --ink: #e9eff8;
    --muted: #93a3ba;
    --line: #253147;
    --line-strong: #2d3a50;
    --brand: #5b8cff;
    --brand-dark: #3b6ae0;
    --brand-soft: #1a2541;
    --ok: #30c285;
    --ok-dark: #1d9e68;
    --ok-soft: #112c22;
    --bad: #ff6b63;
    --bad-dark: #d14b44;
    --bad-soft: #341d1c;
    --warn: #e0a44a;
    --shadow: 0 6px 20px rgba(0, 0, 0, .3);
    --shadow-lift: 0 14px 34px rgba(0, 0, 0, .45);
}

/* Rejim almashganda rang keskin sakramasin */
body, .card, .top, .tabs, .btn, .opt, .chip, .m-item, .stat, .quick, .theme, .mode {
  transition: background-color .25s, color .25s, border-color .25s;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 Nunito, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 10px);
  -webkit-font-smoothing: antialiased;
}

/* Orqa fonda yumshoq rangli yoyinlar — oq sahifa "quruq" ko'rinmasin. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(420px 320px at 12% -5%, rgba(47, 107, 255, .16), transparent 70%),
    radial-gradient(380px 300px at 95% 8%, rgba(122, 68, 255, .13), transparent 70%);
}

html[data-theme="dark"] body::before { opacity: .55; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) body::before { opacity: .55; } }

/* -------------------------------- Tepa ---------------------------------- */

.top {
  position: sticky; top: 0; z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
@supports (backdrop-filter: blur(1px)) {
  .top { background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: saturate(140%) blur(12px); }
}
.top-in { display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; padding: 11px 16px; }
.logo {
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, var(--brand), var(--violet));
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .5px;
  box-shadow: 0 4px 12px rgba(47, 107, 255, .35);
}
.top-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top-text b { font-size: 16px; font-weight: 800; }
.top-text small { color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* Ketma-ket kunlar — alanga belgisi bilan */
.streak {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  border: 2px solid var(--line); background: var(--card); color: var(--gold);
  border-radius: 999px; padding: 6px 12px 6px 10px;
  font: 800 14px Nunito, sans-serif; cursor: pointer;
}
.streak span { color: var(--ink); }

/* Yorug'/qorong'i rejim tugmasi — tepada, ketma-ketlik yonida */
.theme-btn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: grid; place-items: center; cursor: pointer;
  border: 2px solid var(--line); background: var(--card); color: var(--muted);
  transition: color .2s, border-color .2s, transform .2s;
}
.theme-btn:active { transform: scale(.92); }
.theme-btn.on { color: var(--gold); border-color: var(--gold); }

/* -------------------------------- Asos ---------------------------------- */

main { max-width: 760px; margin: 0 auto; padding: 16px; }

h2 { font-size: 19px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.2px; }
.sub { color: var(--muted); font-size: 13.5px; font-weight: 600; margin: 0 0 16px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}

/* ---------------------------- Rasm blokchasi ---------------------------- */

.illus { position: relative; border-radius: 18px; overflow: hidden; margin-bottom: 14px; }
.illus svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.illus-ic {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .25));
}

.tile {
  width: 42px; height: 42px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 3px 9px rgba(18, 38, 74, .2);
}

.ico { display: block; flex: none; }

/* --------------------------- Progress doirasi --------------------------- */

.ring { position: relative; flex: none; display: inline-block; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring circle { transition: stroke-dashoffset .5s cubic-bezier(.3, 1, .4, 1); }
/* Foiz doiraning aynan o'rtasida tursin: tik markaz bo'yicha tekislanadi,
   "%" belgisi esa raqamdan biroz kichikroq va yuqoriroq. */
.ring b {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; gap: 1px;
  font-size: 12.5px; font-weight: 800; line-height: 1;
}
.ring b i { font-style: normal; font-size: .7em; opacity: .6; transform: translateY(-.18em); }

/* -------------------------------- Talisman ------------------------------ */

.bird { display: block; }
/* Yengil nafas olish harakati — qush "tirik" tuyuladi */
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
.bird-float { animation: float 3.2s ease-in-out infinite; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0 } 60% { transform: scale(1.08) } 100% { transform: scale(1); opacity: 1 } }
.bird-pop { animation: pop .5s cubic-bezier(.2, 1.4, .5, 1) both; }
@media (prefers-reduced-motion: reduce) { .bird-float, .bird-pop { animation: none } }

/* -------------------------------- Tugmalar ------------------------------ */

/*
 * Tugma "bosiladigan" ko'rinishda: pastida qalin quyuq chiziq bor,
 * barmoq bosganda tugma pastga tushadi va chiziq yo'qoladi. Bu odamga
 * bosilganini aniq bildiradi — telefonda bu juda muhim.
 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 16px; padding: 15px 18px;
  font: 800 15.5px Nunito, sans-serif; cursor: pointer; letter-spacing: .1px;
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:active { transform: translateY(var(--press)); box-shadow: none !important; }

.btn-main { background: var(--brand); color: #fff; width: 100%; box-shadow: 0 var(--press) 0 var(--brand-dark); }
.btn-ok { background: var(--ok); color: #fff; box-shadow: 0 var(--press) 0 var(--ok-dark); }
.btn-again { background: var(--card); color: var(--bad); border: 2px solid var(--line-strong); box-shadow: 0 var(--press) 0 var(--line-strong); }
.btn-ghost { background: var(--card); color: var(--ink); border: 2px solid var(--line-strong); box-shadow: 0 var(--press) 0 var(--line-strong); }
.btn-light { background: rgba(255, 255, 255, .96); color: var(--brand-dark); width: 100%; box-shadow: 0 var(--press) 0 rgba(10, 30, 80, .3); }
.btn:disabled { opacity: .45; box-shadow: none; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.back { background: none; border: 0; color: var(--brand); font: 800 14px Nunito, sans-serif; cursor: pointer; padding: 0 0 10px; }

/* --------------------------- Bugungi dars (hero) ------------------------ */

.today {
  position: relative; overflow: hidden; border: 0; padding: 18px;
  background: linear-gradient(135deg, #2f6bff 0%, #6b4bff 52%, #9b5de5 100%);
  color: #fff; box-shadow: var(--shadow-lift);
}
/* Fonda yumshoq doiralar — tekis rang o'rniga jonli fon */
.today::before, .today::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .13);
}
.today::before { width: 190px; height: 190px; right: -62px; top: -82px; }
.today::after { width: 120px; height: 120px; right: 34px; bottom: -74px; }

.today-in { position: relative; z-index: 1; display: flex; gap: 10px; align-items: flex-start; }
.today-txt { flex: 1; min-width: 0; }
.today-bird { flex: none; margin: -6px -6px -10px 0; }

.today-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.today-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font: 800 11px Nunito, sans-serif; text-transform: uppercase; letter-spacing: .6px;
  background: rgba(255, 255, 255, .22); padding: 5px 11px; border-radius: 999px;
}
.today-count { font: 800 13px Nunito, sans-serif; opacity: .95; }
.today b { font-size: 20px; font-weight: 800; display: block; line-height: 1.25; }
.today p { margin: 6px 0 13px; opacity: .93; font-size: 13.5px; font-weight: 600; }

.bar { height: 11px; border-radius: 999px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.bar i { display: block; height: 100%; background: #fff; border-radius: 999px; transition: width .5s cubic-bezier(.3, 1, .4, 1); }
.today .bar { margin-bottom: 13px; }

/* ------------------------------ Statistika ------------------------------ */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 14px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 13px 8px; text-align: center; box-shadow: var(--shadow);
}
.stat .s-ic { display: grid; place-items: center; margin: 0 auto 4px; }
.stat b { display: block; font-size: 21px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 11px; font-weight: 700; color: var(--muted); }
.stat.s-fire .s-ic { color: var(--gold); }
.stat.s-word .s-ic { color: var(--brand); }
.stat.s-ok .s-ic { color: var(--ok); }

.prog { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.prog-txt b { display: block; font-size: 15.5px; font-weight: 800; }
.prog-txt small { color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* --------------------------- Tezkor o'tish ------------------------------ */

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px;
  color: inherit; font: inherit; cursor: pointer;
  box-shadow: 0 var(--press) 0 var(--line), var(--shadow);
  transition: transform .08s, box-shadow .08s;
}
.quick:active { transform: translateY(var(--press)); box-shadow: var(--shadow); }
.quick .tile { width: 36px; height: 36px; border-radius: 12px; margin-bottom: 9px; }
.quick b { font-size: 14.5px; font-weight: 800; }
.quick small { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ------------------------------- Mavzular ------------------------------- */
/*
 * Mavzular zinapoya ko'rinishida: ustma-ust turgan kartochkalar ingichka
 * chiziq bilan bog'langan — odam qaysi mavzudan boshlashini va qanchasi
 * qolganini ko'radi.
 */

.themes { display: grid; gap: 11px; position: relative; }
.theme {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 12px 14px; cursor: pointer; color: inherit; font: inherit;
  box-shadow: 0 var(--press) 0 var(--line), var(--shadow);
  transition: transform .08s, box-shadow .08s;
}
.theme:active { transform: translateY(var(--press)); box-shadow: var(--shadow); }
/* Kartochkalarni bog'laydigan ingichka chiziq */
.theme::before {
  content: ""; position: absolute; left: 25px; top: -12px; width: 3px; height: 12px;
  background: var(--line-strong); border-radius: 2px;
}
.theme:first-child::before { display: none; }

.theme .nm { flex: 1; min-width: 0; }
.theme .nm b { display: block; font-size: 15px; font-weight: 800; }
.theme .nm small { color: var(--muted); font-size: 12px; font-weight: 600; }
/* Tugagan mavzuda yashil halqa */
.theme.full .tile { box-shadow: 0 0 0 3px var(--ok-soft), 0 3px 9px rgba(18, 38, 74, .2); }

.grp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.grp-head b { font-size: 15.5px; font-weight: 800; display: block; }
.grp-head small { color: var(--muted); font-size: 12px; font-weight: 600; }
.grp-title { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; }

/* ------------------------------ Kartochka ------------------------------- */

.word-card { text-align: center; }
.topic-chip {
  display: inline-block; font: 800 11px Nunito, sans-serif; letter-spacing: .6px;
  color: var(--brand); background: var(--brand-soft);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 9px; text-transform: uppercase;
}
.ru-big { font-size: 31px; font-weight: 800; line-height: 1.2; letter-spacing: -.5px; }
.tr-line { color: var(--muted); font-size: 14.5px; font-weight: 600; margin-top: 4px; }
.uz-line { font-size: 18.5px; color: var(--ok); font-weight: 800; margin-top: 6px; }

.ex-box {
  margin-top: 14px; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: var(--bg); border-left: 4px solid var(--brand);
}
.ex-ru { font-size: 15.5px; font-weight: 700; }
.ex-uz { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 3px; }

.note-box {
  margin-top: 12px; padding: 10px 13px; border-radius: 13px; text-align: left;
  background: var(--bad-soft); color: var(--bad); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}

.flash {
  min-height: 250px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; cursor: pointer; user-select: none; gap: 8px;
}
.flash .illus { width: 100%; }
.flash .ru { font-size: 33px; font-weight: 800; line-height: 1.2; letter-spacing: -.5px; }
.flash .tr { color: var(--muted); font-size: 15px; font-weight: 600; }
.flash .uz { font-size: 21px; color: var(--ok); font-weight: 800; }
.flash .hint { color: var(--muted); font-size: 13px; font-weight: 600; }
.flash .ex-box { width: 100%; }

/* Ovoz tugmasi */
.sound {
  display: grid; place-items: center; flex: none;
  border: 2px solid var(--line-strong); background: var(--card); color: var(--brand);
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  box-shadow: 0 3px 0 var(--line-strong); transition: transform .08s, box-shadow .08s;
}
.sound:active { transform: translateY(3px); box-shadow: none; }
.big-sound { width: 70px; height: 70px; }

/* ---------------------------- Progress qatori --------------------------- */

.progress-line {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font: 800 12.5px Nunito, sans-serif; color: var(--muted);
}
.progress-line .bar { flex: 1; background: var(--line); height: 11px; }
.progress-line .bar i { background: linear-gradient(90deg, var(--brand), var(--violet)); }

/* -------------------------------- Mashq --------------------------------- */

.q { font-size: 14.5px; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.q-word { font-size: 29px; font-weight: 800; margin-bottom: 18px; text-align: center; letter-spacing: -.5px; }

.opts { display: grid; gap: 10px; }
.opt {
  text-align: left; padding: 14px 16px; border-radius: 16px; font: 700 16px Nunito, sans-serif;
  cursor: pointer; background: var(--card); border: 2px solid var(--line-strong); color: inherit;
  box-shadow: 0 var(--press) 0 var(--line-strong);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.opt:active { transform: translateY(var(--press)); box-shadow: none; }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-dark); box-shadow: 0 var(--press) 0 var(--ok); }
.opt.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-dark); box-shadow: 0 var(--press) 0 var(--bad); }
.opt:disabled { cursor: default; }

.inp {
  width: 100%; padding: 15px; border-radius: 16px; border: 2px solid var(--line-strong);
  background: var(--card); color: var(--ink); font: 700 19px Nunito, sans-serif; text-align: center;
}
.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.verdict { text-align: center; font-weight: 800; margin: 12px 0; min-height: 24px; font-size: 15px; }
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }

/* Mashq turlari */
.modes { display: grid; gap: 10px; margin-bottom: 16px; }
.mode {
  display: flex; gap: 12px; align-items: center; text-align: left; padding: 13px 14px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer;
  box-shadow: 0 var(--press) 0 var(--line), var(--shadow);
  transition: transform .08s, box-shadow .08s;
}
.mode:active { transform: translateY(var(--press)); box-shadow: var(--shadow); }
.mode b { display: block; font-size: 15px; font-weight: 800; }
.mode small { color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* ------------------------------- Iboralar ------------------------------- */

.phrase { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.phrase:last-child { border-bottom: 0; }
.phrase .txt { flex: 1; min-width: 0; }
.phrase .ru { font-size: 16px; font-weight: 800; }
.phrase .uz { color: var(--muted); font-size: 14px; font-weight: 600; margin-top: 3px; }
.phrase .sound { width: 38px; height: 38px; }

/* ------------------------------ Birikmalar ------------------------------ */

.coll { padding: 13px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.coll:last-child { border-bottom: 0; }
.coll .txt { flex: 1; min-width: 0; }
.coll .ru { font-size: 16px; font-weight: 800; }
.coll .uz { font-size: 14px; color: var(--ok); font-weight: 700; margin-top: 2px; }
.coll .mini { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 4px; line-height: 1.45; }
.coll .mini.warn { color: var(--warn); font-weight: 700; }
.coll .sound { width: 38px; height: 38px; }

/* ------------------------------- Qoidalar ------------------------------- */

.g-modes { display: grid; gap: 10px; }
.g-mode {
  position: relative; overflow: hidden;
  display: flex; gap: 12px; align-items: center; text-align: left; padding: 15px 16px;
  border-radius: 18px; border: 0; cursor: pointer; font: inherit; color: #fff;
  transition: transform .08s, box-shadow .08s;
}
.g-mode.a { background: linear-gradient(135deg, #2f6bff, #7a44ff); box-shadow: 0 var(--press) 0 #1f4fd1, var(--shadow); }
.g-mode.b { background: linear-gradient(135deg, #0f9b72, #35c49a); box-shadow: 0 var(--press) 0 #0a7557, var(--shadow); }
.g-mode:active { transform: translateY(var(--press)); box-shadow: var(--shadow); }
.g-mode::after {
  content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); right: -34px; top: -50px;
}
.g-mode .tile { background: rgba(255, 255, 255, .22) !important; box-shadow: none; position: relative; z-index: 1; }
.g-mode b { display: block; font-size: 15.5px; font-weight: 800; }
.g-mode small { opacity: .93; font-size: 12.5px; font-weight: 600; }
.g-mode > div { position: relative; z-index: 1; }

.g-group {
  font: 800 11.5px Nunito, sans-serif; letter-spacing: .8px; text-transform: uppercase;
  color: var(--muted); margin: 20px 0 7px; padding-left: 4px;
}

.acc { border-bottom: 1px solid var(--line); }
.acc:last-child { border-bottom: 0; }
.acc summary {
  cursor: pointer; font: 800 15.5px Nunito, sans-serif; padding: 14px 0;
  list-style: none; display: flex; gap: 11px; align-items: center;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::before {
  content: ""; width: 7px; height: 7px; flex: none; margin-left: 4px;
  border-right: 2.4px solid var(--brand); border-bottom: 2.4px solid var(--brand);
  transform: rotate(-45deg); transition: transform .2s;
}
.acc[open] summary::before { transform: rotate(45deg); }
.acc .short { color: var(--muted); font-size: 13.5px; font-weight: 600; margin: 0 0 10px; }
.acc ul { margin: 0 0 14px; padding-left: 20px; }
.acc li { margin-bottom: 6px; font-size: 14.5px; }
.acc li b { color: var(--brand); }
.acc .ex { margin: 0 0 14px; }
.acc .ex div { padding: 9px 12px; border-radius: 12px; background: var(--bg); margin-bottom: 6px; }
.acc .ex b { color: var(--ink); font-size: 14.5px; font-weight: 800; }
.acc .ex small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; margin-top: 2px; }

/* ------------------------ Gapni to'ldirish mashqi ----------------------- */

/* Vaziyat belgisi: katta emoji rangli doira ichida — gapni o'qishdan
   oldin odam nima haqda gap ketayotganini ko'z bilan tushunadi. */
.motif {
  margin: 0 auto 13px; border-radius: 28px; flex: none;
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px rgba(18, 38, 74, .22);
}
/* Gapni to'ldirish ekranida belgi o'rtada turadi */
.card > .motif { display: grid; }

.sentence { font-size: 22px; line-height: 1.65; font-weight: 700; margin-bottom: 18px; }
.gap {
  display: inline-block; min-width: 92px; text-align: center;
  border-bottom: 3px dashed var(--brand); color: var(--brand);
  padding: 0 7px; vertical-align: baseline; font-weight: 800;
}
.gap.filled { border-bottom-style: solid; }
.gap.ok { color: var(--ok); border-color: var(--ok); }
.gap.bad { color: var(--bad); border-color: var(--bad); text-decoration: line-through; }
.sentence .uzline { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 7px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  flex: 1 1 28%; min-width: 94px; padding: 14px 10px; border-radius: 16px;
  border: 2px solid var(--line-strong); background: var(--card); color: inherit;
  font: 800 17px Nunito, sans-serif; cursor: pointer;
  box-shadow: 0 var(--press) 0 var(--line-strong);
  transition: transform .08s, box-shadow .08s;
}
.chip:active { transform: translateY(var(--press)); box-shadow: none; }
.chip.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-dark); box-shadow: 0 var(--press) 0 var(--ok); }
.chip.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad-dark); box-shadow: 0 var(--press) 0 var(--bad); }
.chip:disabled { cursor: default; }

/* Izoh — mashqning eng qimmatli qismi: nega shunday ekani. */
.why {
  margin-top: 14px; padding: 13px 15px; border-radius: 16px;
  background: var(--ok-soft); border-left: 5px solid var(--ok);
  font-size: 14px; line-height: 1.55; font-weight: 600;
  animation: slide .3s ease both;
}
@keyframes slide { from { opacity: 0; transform: translateY(8px) } }
.why.bad { background: var(--bad-soft); border-left-color: var(--bad); }
.why b { display: block; margin-bottom: 4px; font-weight: 800; }
.why .uztr { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
/* Izoh yonidagi kichik qush — xato bo'lsa ham do'stona tuyuladi */
.why-row { display: flex; gap: 10px; align-items: flex-start; }
.why-row .bird { flex: none; margin: -6px -4px -8px -2px; }

/* ------------------------------- Juftlash ------------------------------- */

.match-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.match-head .motif { margin: 0; border-radius: 19px; }
.match-head b { font-size: 16px; font-weight: 800; }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.m-item {
  padding: 13px 10px; border-radius: 15px; border: 2px solid var(--line-strong);
  background: var(--card); color: inherit; font: 700 14.5px Nunito, sans-serif;
  cursor: pointer; text-align: center; min-height: 56px;
  box-shadow: 0 3px 0 var(--line-strong);
  transition: transform .1s, box-shadow .1s, opacity .25s;
}
.m-item:active { transform: translateY(3px); box-shadow: none; }
.m-item.sel { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 800; box-shadow: 0 3px 0 var(--brand); }
.m-item.done { border-color: var(--ok); background: var(--ok-soft); color: var(--ok-dark); opacity: .5; pointer-events: none; box-shadow: none; }
.m-item.wrong { animation: shake .3s; border-color: var(--bad); background: var(--bad-soft); }
@keyframes shake {
  0%, 100% { transform: translateX(0) }
  25% { transform: translateX(-6px) }
  75% { transform: translateX(6px) }
}

/* ------------------------------ Yakun ekrani ---------------------------- */

.done { text-align: center; padding: 6px 10px 24px; }
.done .big { display: grid; place-items: center; }
.done b { display: block; font-size: 22px; font-weight: 800; margin: 6px 0 4px; }
.done p { color: var(--muted); margin: 0 auto 18px; font-size: 14px; font-weight: 600; max-width: 330px; }
/* Natija yulduzlari: uchtadan nechtasi yonganini ko'rsatadi */
.sstars { display: flex; justify-content: center; gap: 7px; margin: 8px 0 2px; color: var(--line-strong); }
.sstars .on { color: var(--gold); }

.done .btn { width: 100%; max-width: 330px; }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-weight: 600; }

/* ----------------------------- Pastki menyu ----------------------------- */

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
@supports (backdrop-filter: blur(1px)) {
  .tabs { background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: saturate(140%) blur(12px); }
}
/*
 * Menyu tugmalari: har biri o'z rangida. Tanlanmagan holatda rang
 * biroz so'ngan, tanlanganda esa to'liq yonadi va orqasida rangli
 * yostiqcha paydo bo'ladi — qaysi bo'limdaligi darhol ko'rinadi.
 */
.tabs button {
  border: 0; background: none; font: inherit; cursor: pointer;
  color: color-mix(in srgb, var(--tab) 55%, var(--muted));
  padding: 8px 2px 9px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tabs i {
  display: grid; place-items: center; font-style: normal;
  width: 50px; height: 32px; border-radius: 999px;
  transition: background .2s, color .2s, transform .2s;
}
.tabs button.on i { transform: translateY(-1px); }
.tabs span { font: 700 10.5px Nunito, sans-serif; }
.tabs button.on { color: var(--tab); }
.tabs button.on i {
  background: color-mix(in srgb, var(--tab) 16%, transparent);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--tab) 30%, transparent);
}
.tabs button.on span { font-weight: 800; }

/* Qorong'i rejimda ranglar biroz yorqinroq bo'lsin */
html[data-theme="dark"] .tabs button { color: color-mix(in srgb, var(--tab) 62%, var(--muted)); }
html[data-theme="dark"] .tabs button.on { color: color-mix(in srgb, var(--tab) 72%, #fff); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .tabs button { color: color-mix(in srgb, var(--tab) 62%, var(--muted)); }
  html:not([data-theme]) .tabs button.on { color: color-mix(in srgb, var(--tab) 72%, #fff); }
}

/* ------------------------------ Katta ekran ----------------------------- */

@media (min-width: 680px) {
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .ru-big { font-size: 36px; }
}

/* Talisman harakatlari: bosh sahifada yengil suzadi, yakun ekranida
   "paydo bo'ladi" — sahifa jonli tuyuladi. */
.today-bird .bird { animation: float 3.4s ease-in-out infinite; }
.done .big .bird { animation: pop .5s cubic-bezier(.2, 1.4, .5, 1) both; }
.why-row .bird { flex: none; }
@media (prefers-reduced-motion: reduce) {
  .today-bird .bird, .done .big .bird { animation: none }
}

/* ------------------------------ Darajalar ------------------------------
 * Uchta tugma: A1, A2, B1. Har birining o'z rangi bor va tanlangani
 * to'liq bo'yaladi — odam qaysi darajada turganini adashtirmaydi.
 */

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.lvl {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 12px 6px 11px; border-radius: 18px; cursor: pointer; font: inherit;
  background: var(--card); border: 2px solid var(--line);
  color: var(--muted); box-shadow: 0 var(--press) 0 var(--line);
  transition: transform .08s, box-shadow .08s, background .2s, color .2s, border-color .2s;
}
.lvl:active { transform: translateY(var(--press)); box-shadow: none; }
.lvl b { font-size: 19px; font-weight: 800; color: var(--lv); line-height: 1.1; }
.lvl span { font-size: 12px; font-weight: 700; }
.lvl small { font-size: 10.5px; font-weight: 600; opacity: .8; }

.lvl.on {
  background: var(--lv); border-color: var(--lv); color: #fff;
  box-shadow: 0 var(--press) 0 color-mix(in srgb, var(--lv) 70%, #000);
}
.lvl.on b { color: #fff; }
.lvl.on small { opacity: .85; }

/* Tanlangan daraja haqida qisqa izoh */
.lvl-note {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border-radius: 16px;
  background: color-mix(in srgb, var(--lv) 10%, transparent);
  border-left: 4px solid var(--lv);
  color: var(--ink);
}
.lvl-note .ico { color: var(--lv); }
.lvl-note b { display: block; font-size: 14px; font-weight: 800; }
.lvl-note small { color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* ------------------- Birikmalar: kategoriya va ichki sahifa -------------- */
/*
 * Avval hamma birikma bitta sahifada turardi. Endi kategoriya tanlanadi va
 * alohida sahifa ochiladi: tepada "orqaga", so'ng guruh sarlavhasi,
 * pastda esa qo'shni kategoriyaga o'tish tugmalari.
 */

.theme .chev { color: var(--muted); display: grid; place-items: center; flex: none; }

.back {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 12px;
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  color: var(--brand); font: 800 13.5px Nunito, sans-serif;
}
.ico.flip { transform: rotate(180deg); }

.grp-hero {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.grp-hero b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.grp-hero small { color: var(--muted); font-size: 12.5px; font-weight: 600; }

.coll-nav { display: flex; gap: 10px; margin-top: 14px; }
.coll-nav .btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; padding: 11px 10px; min-width: 0;
}
.coll-nav .btn .ico { flex: none; }
.coll-nav span:empty { flex: 1; }

/* Dumaloq tugmalardagi belgi aynan o'rtada tursin: ovoz belgisining
   og'irligi chapda bo'lgani uchun uni bir oz o'ngga suramiz. */
.sound .ico { transform: translateX(1.5px); }
.big-sound .ico { transform: translateX(2.5px); }
.theme-btn .ico, .streak .ico { display: block; }
