/* Imlogo Tajvid — glass dizayn tizimi */
:root {
  --bg: #eef5f1;
  --bg-2: #e3efe9;
  --ink: #0d1f19;
  --ink-2: #4c6159;
  --ink-3: #7d918a;
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-line: rgba(255, 255, 255, .85);
  --hair: rgba(13, 31, 25, .08);
  --brand: #0e9f6e;
  --brand-2: #0891b2;
  --brand-ink: #ffffff;
  --brand-grad: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --brand-soft: rgba(16, 185, 129, .12);
  --gold: #f59e0b;
  --gold-grad: linear-gradient(135deg, #fcd34d, #f97316);
  --good: #10b981;
  --good-grad: linear-gradient(135deg, #34d399, #10b981);
  --bad: #f43f5e;
  --bad-grad: linear-gradient(135deg, #fb7185, #e11d48);
  --warn: #f59e0b;
  --shadow: 0 1px 1px rgba(13, 31, 25, .04), 0 8px 24px -6px rgba(13, 31, 25, .10), 0 24px 48px -24px rgba(13, 31, 25, .16);
  --shadow-lg: 0 30px 80px -30px rgba(6, 95, 70, .35);
  --inner: inset 0 1px 0 rgba(255, 255, 255, .9);
  --orb-1: rgba(16, 185, 129, .35);
  --orb-2: rgba(6, 182, 212, .28);
  --orb-3: rgba(251, 191, 36, .22);
  --r: 22px;
  --r-sm: 14px;
  --ar: "Scheherazade New", "Amiri", "Geeza Pro", "Noto Naskh Arabic", serif;
  --ui: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050d0b; --bg-2: #08140f; --ink: #ecf7f2; --ink-2: #9fb5ad; --ink-3: #6e837b;
    --glass: rgba(255, 255, 255, .055); --glass-strong: rgba(255, 255, 255, .09); --glass-line: rgba(255, 255, 255, .10);
    --hair: rgba(255, 255, 255, .08); --brand: #34d399; --brand-2: #22d3ee; --brand-ink: #03140f;
    --brand-soft: rgba(52, 211, 153, .12);
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 90px -30px rgba(16, 185, 129, .45);
    --inner: inset 0 1px 0 rgba(255, 255, 255, .07);
    --orb-1: rgba(16, 185, 129, .30); --orb-2: rgba(8, 145, 178, .26); --orb-3: rgba(245, 158, 11, .14);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #050d0b; --bg-2: #08140f; --ink: #ecf7f2; --ink-2: #9fb5ad; --ink-3: #6e837b;
  --glass: rgba(255, 255, 255, .055); --glass-strong: rgba(255, 255, 255, .09); --glass-line: rgba(255, 255, 255, .10);
  --hair: rgba(255, 255, 255, .08); --brand: #34d399; --brand-2: #22d3ee; --brand-ink: #03140f;
  --brand-soft: rgba(52, 211, 153, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 90px -30px rgba(16, 185, 129, .45);
  --inner: inset 0 1px 0 rgba(255, 255, 255, .07);
  --orb-1: rgba(16, 185, 129, .30); --orb-2: rgba(8, 145, 178, .26); --orb-3: rgba(245, 158, 11, .14);
  color-scheme: dark;
}

/* ---------- Asos ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.55;
  min-height: 100dvh; padding-bottom: calc(96px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
.ar { font-family: var(--ar); direction: rtl; unicode-bidi: isolate; }
::selection { background: var(--brand-soft); }

/* Fon: harakatlanuvchi yorug'lik sharlari + donadorlik */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg-2), transparent 60%), var(--bg); }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .9; will-change: transform; }
.o1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -16vmax; background: radial-gradient(circle, var(--orb-1), transparent 65%); animation: drift1 26s ease-in-out infinite alternate; }
.o2 { width: 40vmax; height: 40vmax; right: -14vmax; top: 18vh; background: radial-gradient(circle, var(--orb-2), transparent 65%); animation: drift2 32s ease-in-out infinite alternate; }
.o3 { width: 34vmax; height: 34vmax; left: 25vw; bottom: -18vmax; background: radial-gradient(circle, var(--orb-3), transparent 65%); animation: drift3 38s ease-in-out infinite alternate; }
.grain { position: absolute; inset: -50%; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes drift1 { to { transform: translate(8vw, 10vh) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-10vw, -6vh) scale(.92); } }
@keyframes drift3 { to { transform: translate(-6vw, -10vh) scale(1.1); } }

/* ---------- Glass ---------- */
.glass, .card {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow), var(--inner);
}
.card { padding: 20px; display: block; color: inherit; }
a.card:hover, a.glass:hover { text-decoration: none; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.flame { fill: url(#gGold); stroke: none; }
.ico.gold { fill: url(#gGold); stroke: none; }

/* ---------- Tipografiya ---------- */
h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.15; letter-spacing: -.02em; margin: 2px 0 0; font-weight: 800; }
h2 { font-size: 1.08rem; letter-spacing: -.01em; margin: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.lead { margin: -8px 0 18px; }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }
.err { color: var(--bad); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.center, .center { justify-content: center; }
.spacer { flex: 1; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.card-head h2 .ico { color: var(--brand); }

/* ---------- Tugmalar ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden;
  border: 1px solid var(--glass-line); background: var(--glass-strong); color: var(--ink); border-radius: 14px;
  padding: 10px 18px; font-weight: 650; cursor: pointer; text-decoration: none; min-height: 46px;
  box-shadow: var(--inner); transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, filter .2s;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow), var(--inner); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .86rem; border-radius: 11px; }
.btn.sm .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 10px 30px -10px rgba(16, 185, 129, .7), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary:hover { filter: brightness(1.06) saturate(1.1); box-shadow: 0 16px 40px -12px rgba(16, 185, 129, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.big { width: 100%; padding: 15px 20px; font-size: 1.05rem; border-radius: 16px; }
.btn.good { background: var(--good-grad); color: #fff; border-color: transparent; box-shadow: 0 12px 30px -12px rgba(16, 185, 129, .8), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.bad { background: var(--bad-grad); color: #fff; border-color: transparent; box-shadow: 0 12px 30px -12px rgba(225, 29, 72, .7), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; }
.btn.ghost:hover { background: var(--glass); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.google { background: var(--glass-strong); }
.shine::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg);
  animation: shine 4.5s var(--ease) infinite 1.2s; }
@keyframes shine { 0% { left: -60%; } 22%, 100% { left: 130%; } }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--ink-2); transition: all .2s var(--ease); }
.icon-btn:hover { color: var(--ink); transform: scale(1.06); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.sm .ico { width: 15px; height: 15px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 650;
  background: var(--brand-soft); color: var(--brand); }
.pill.gold { background: rgba(245, 158, 11, .14); color: var(--gold); }
.pill.gold .ico { fill: url(#gGold); stroke: none; width: 16px; height: 16px; }
.pill.warn { background: rgba(245, 158, 11, .14); color: var(--gold); }
kbd { font-family: var(--ui); font-size: .72rem; border: 1px solid var(--hair); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--glass-strong); }

/* ---------- Joylashuv: mobil ---------- */
.view { max-width: 760px; margin: 0 auto; padding: 14px 16px 24px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--hair);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.02rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 10px; box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .6); }
.brand b { font-weight: 800; }
.streak-pill { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--ink);
  padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); }
.streak-pill:hover { text-decoration: none; }
.streak-pill .ico { width: 18px; height: 18px; animation: flicker 2.4s ease-in-out infinite; }
.streak-pill.cold .ico, .cold .ico.flame { filter: grayscale(1); opacity: .45; animation: none; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08) rotate(-3deg); } 60% { transform: scale(.96) rotate(2deg); } }

.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px solid var(--glass-line);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .35), var(--inner);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 18px;
  font-size: .68rem; font-weight: 650; color: var(--ink-3); transition: color .2s, background .25s var(--ease); }
.tabbar a:hover { text-decoration: none; }
.tabbar a .ico { width: 22px; height: 22px; transition: transform .3s var(--spring); }
.tabbar a.active { color: var(--brand); background: var(--brand-soft); }
.tabbar a.active .ico { transform: translateY(-1px) scale(1.08); }
body.in-session .tabbar { transform: translateY(140%); }
.tabbar { transition: transform .35s var(--ease); }

/* ---------- Joylashuv: desktop sidebar ---------- */
.sidebar { display: none; }
@media (min-width: 960px) {
  body { padding: 0 0 0 296px; }
  .topbar, .tabbar { display: none; }
  .view { max-width: 1060px; padding: 34px 40px 60px; }
  .sidebar {
    position: fixed; top: 16px; bottom: 16px; left: 16px; width: 264px; z-index: 20;
    display: flex; flex-direction: column; gap: 14px; padding: 20px 14px;
    background: var(--glass); border: 1px solid var(--glass-line); border-radius: 28px;
    backdrop-filter: blur(26px) saturate(170%); -webkit-backdrop-filter: blur(26px) saturate(170%);
    box-shadow: var(--shadow), var(--inner);
  }
  .sidebar .brand { padding: 2px 8px 6px; font-size: 1.12rem; }
  .side-streak { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 14px; color: var(--ink); border-radius: 18px; }
  .side-streak:hover { text-decoration: none; }
  .side-streak .ico { width: 34px; height: 34px; grid-row: span 1; animation: flicker 2.4s ease-in-out infinite; }
  .side-streak b { font-size: 1.3rem; font-weight: 800; }
  .side-streak small { color: var(--ink-2); font-size: .8rem; }
  .side-bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--hair); overflow: hidden; margin-top: 6px; }
  .side-bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--gold-grad); transition: width .8s var(--ease); }
  .side-nav { display: grid; gap: 4px; margin-top: 4px; }
  .side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px;
    color: var(--ink-2); font-weight: 650; transition: color .2s, background .25s var(--ease), transform .2s var(--ease); }
  .side-nav a:hover { text-decoration: none; color: var(--ink); background: var(--glass); transform: translateX(2px); }
  .side-nav a.active { color: var(--ink); background: var(--glass-strong); box-shadow: var(--inner), 0 8px 20px -12px rgba(0, 0, 0, .3); }
  .side-nav a.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-grad); }
  .side-nav a.active .ico { color: var(--brand); }
  .side-cta { margin-top: auto; }
  .side-account { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; color: var(--ink); border: 1px solid transparent; }
  .side-account:hover { text-decoration: none; background: var(--glass); border-color: var(--glass-line); }
  .side-account span { display: grid; min-width: 0; }
  .side-account b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-account small { color: var(--ink-3); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.in-session .view { max-width: 820px; }
}

/* ---------- Sahifa animatsiyalari ---------- */
.view.enter > * { animation: rise .55s var(--ease) both; }
.view.enter > *:nth-child(2) { animation-delay: .05s; }
.view.enter > *:nth-child(3) { animation-delay: .1s; }
.view.enter > *:nth-child(4) { animation-delay: .15s; }
.view.enter > *:nth-child(5) { animation-delay: .2s; }
.view.enter > *:nth-child(n+6) { animation-delay: .25s; }
/* Element animatsiyalari faqat sahifaga kirganda (.enter) o'ynaydi — qayta chizishda emas. */
.view.enter .ring-val { animation: ringIn 1.2s var(--ease) both .15s; }
.view.enter .lcard { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.view.enter .letter-big { animation: pop .7s var(--spring) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Bosh sahifa ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 26px; position: relative; overflow: hidden; box-shadow: var(--shadow-lg), var(--inner); }
.hero::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px 200px at 0% 0%, var(--brand-soft), transparent 70%); }
.hero-text { position: relative; display: grid; gap: 10px; }
.hero-text p { margin: 0; }
.hero-sub a { font-weight: 650; }
.ring { width: 150px; height: 150px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--hair); stroke-width: 11; }
.ring-val { fill: none; stroke: url(#gBrand); stroke-width: 11; stroke-linecap: round; stroke-dashoffset: var(--off);
  filter: drop-shadow(0 4px 10px rgba(16, 185, 129, .45)); }
.ring-val.done { stroke: url(#gGold); filter: drop-shadow(0 4px 12px rgba(245, 158, 11, .5)); }
@keyframes ringIn { from { stroke-dashoffset: var(--full); } }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring .lbl b { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; }
.ring .lbl span { color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.streak-big { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; color: var(--ink-2); }
.streak-big b { font-size: 2.6rem; color: var(--ink); font-weight: 800; letter-spacing: -.03em; }
.streak-big .ico { width: 40px; height: 40px; animation: flicker 2.4s ease-in-out infinite; filter: drop-shadow(0 6px 12px rgba(249, 115, 22, .45)); }
.stats3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat { display: grid; gap: 2px; padding: 16px; color: var(--ink); transition: transform .25s var(--ease); }
.stat:hover { transform: translateY(-3px); text-decoration: none; }
.stat .ico { color: var(--brand); width: 22px; height: 22px; margin-bottom: 6px; }
.stat b { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; justify-content: start; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 15px; height: 15px; border-radius: 4px; background: var(--hair); display: block; transition: transform .2s; }
.heat i:hover { transform: scale(1.3); }
.heat i.l1 { background: rgba(16, 185, 129, .35); }
.heat i.l2 { background: rgba(16, 185, 129, .65); }
.heat i.l3 { background: var(--brand-grad); box-shadow: 0 0 10px rgba(16, 185, 129, .5); }
.heat i.today { outline: 2px solid var(--gold); outline-offset: 1px; }
.banner { display: flex; align-items: center; gap: 14px; margin-top: 16px; color: var(--ink); }
.banner > span:first-child { font-size: 1.6rem; }
.banner .ico { margin-left: auto; color: var(--ink-3); transition: transform .2s; }
.banner:hover .ico { transform: translateX(4px); }
section.card + section.card, .card + h2 { margin-top: 16px; }

/* ---------- Harflar ---------- */
.letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
.lcard {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1;
  color: var(--ink); background: var(--glass); border: 1px solid var(--glass-line); border-radius: 20px; overflow: hidden;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow), var(--inner);
  transition: transform .35s var(--spring), box-shadow .3s var(--ease), border-color .3s;
}
.lcard::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .3s;
  background: radial-gradient(120px 80px at 50% 0%, var(--brand-soft), transparent 70%); }
.lcard:hover { text-decoration: none; transform: translateY(-4px) scale(1.03); border-color: color-mix(in srgb, var(--brand) 50%, transparent); box-shadow: var(--shadow-lg), var(--inner); }
.lcard:hover::before { opacity: 1; }
.lcard .g { font-family: var(--ar); font-size: 2.9rem; line-height: 1.25; position: relative;
  background: linear-gradient(160deg, var(--ink) 30%, var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lcard .n { font-size: .74rem; font-weight: 650; color: var(--ink-2); position: relative; }
.lcard .badge { position: absolute; top: 7px; left: 10px; font-size: .66rem; font-weight: 700; color: var(--ink-3); }
.lcard .bar { position: absolute; left: 12px; right: 12px; bottom: 7px; height: 3px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.lcard .bar span { display: block; height: 100%; background: var(--good-grad); }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.rule-link { display: flex; align-items: center; gap: 12px; color: var(--ink); padding: 16px 18px; transition: transform .25s var(--ease); }
.rule-link:hover { transform: translateY(-2px); }
.rule-link .ar { font-size: 1.5rem; color: var(--brand); }
.lesson-head { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 12px; gap: 12px; }
h2 + .rules, .letters + h2 { margin-top: 14px; }
.letters + h2 { margin-top: 30px; }
.letter-hero { text-align: center; padding: 26px; position: relative; overflow: hidden; }
.letter-big { font-size: clamp(5rem, 14vw, 7.5rem); line-height: 1.3;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.letter-name { font-size: 1.05rem; }
.letter-name .ar { font-size: 1.4rem; color: var(--ink-2); margin: 0 4px; }
.letter-hero .ar[style] { color: var(--ink-2); }
@keyframes pop { from { opacity: 0; transform: scale(.6) rotate(-6deg); } to { opacity: 1; transform: none; } }

.words { display: flex; flex-wrap: wrap; gap: 8px; direction: rtl; }
.word {
  font-family: var(--ar); font-size: 2rem; line-height: 1.85; padding: 2px 16px; border-radius: 14px; cursor: pointer; position: relative;
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--ink); box-shadow: var(--inner);
  transition: transform .25s var(--spring), border-color .2s, background .2s;
}
.word:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.word.w-bad { border-color: rgba(244, 63, 94, .5); background: rgba(244, 63, 94, .1); }
.word.w-good { border-color: rgba(16, 185, 129, .45); }
.word.flagged::after { content: "⚑"; position: absolute; top: 2px; left: 6px; font-size: .7rem; color: var(--warn); font-family: var(--ui); }
.note { white-space: pre-line; }
details summary { cursor: pointer; }

/* ---------- Forma elementlari ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 650; font-size: .92rem; }
select, input[type="number"], input[type="time"], input[type="email"], input[type="password"], input[type="text"], input:not([type]), textarea {
  font: inherit; color: inherit; background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: 13px;
  padding: 11px 14px; min-height: 46px; width: 100%; box-shadow: var(--inner); transition: border-color .2s, box-shadow .2s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 1px solid var(--glass-line); background: var(--glass); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 650; min-height: 40px;
  transition: all .25s var(--spring); }
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(16, 185, 129, .7); }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; flex: none; position: relative; cursor: pointer;
  background: var(--hair); border: 1px solid var(--glass-line); transition: background .25s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .3s var(--spring); }
.toggle input:checked { background: var(--brand-grad); }
.toggle input:checked::after { transform: translateX(18px); }
.pool-preview { direction: rtl; font-family: var(--ar); font-size: 1.6rem; letter-spacing: .12em; color: var(--brand); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.settings-grid > .card + .card { margin-top: 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .82rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--hair); }

/* ---------- Profil ---------- */
.avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  background: var(--brand-grad); color: #fff; font-weight: 800; box-shadow: 0 0 0 2px var(--glass-line); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.guest { background: var(--glass-strong); color: var(--ink-3); }
.avatar.guest .ico { width: 55%; height: 55%; }
.avatar.xl { width: 76px; height: 76px; font-size: 1.9rem; box-shadow: 0 0 0 3px var(--glass-line), 0 12px 30px -10px rgba(16, 185, 129, .6); }
.acct-link { position: relative; display: inline-flex; border-radius: 50%; }
.acct-link.dirty::after, .dot { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.acct-link.dirty::after { position: absolute; top: 0; right: 0; border: 2px solid var(--bg); }
.dot.ok { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.busy { background: var(--brand-2); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.profile { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 22px; }
.profile-info { display: grid; gap: 2px; min-width: 0; }
.profile-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.sync-line { display: flex; align-items: center; gap: 6px; color: var(--ink-2); margin-top: 4px; }
.sync-line.err { color: var(--bad); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 26px; }
.auth-intro { display: grid; gap: 14px; align-content: start; }
.auth-intro h2 { font-size: 1.4rem; }
.auth-intro p { margin: 6px 0 0; }

/* ---------- Mashq ---------- */
.session { display: flex; flex-direction: column; min-height: calc(100dvh - 120px); max-width: 760px; margin: 0 auto; }
.session-top { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.counter { font-size: 1.1rem; font-weight: 800; min-width: 54px; text-align: right; }
.counter span { color: var(--ink-3); font-weight: 600; font-size: .9rem; }
.session-title { text-align: center; margin: 10px 0 0; min-height: 1.5em; }
.progress { height: 10px; background: var(--hair); border-radius: 10px; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 10px; background: var(--brand-grad); transition: width .5s var(--ease);
  box-shadow: 0 0 12px rgba(16, 185, 129, .6); position: relative; }
.flash {
  flex: 1; display: grid; place-items: center; margin: 16px 0; padding: 32px 14px; min-height: 300px; position: relative; overflow: hidden;
  border-radius: 30px; box-shadow: var(--shadow-lg), var(--inner); animation: cardIn .5s var(--spring) both;
}
.flash::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .9;
  background: radial-gradient(500px 220px at 50% 0%, var(--brand-soft), transparent 70%); }
.flash .w { position: relative; font-family: var(--ar); direction: rtl; font-size: clamp(68px, 17vw, 156px); line-height: 1.75; text-align: center; }
.flash .w.phrase { font-size: clamp(42px, 9vw, 88px); }
.flash .meta { position: absolute; bottom: 12px; left: 16px; right: 12px; display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--ink-3); }
.flash .pron { position: absolute; top: 12px; left: 0; right: 0; text-align: center; color: var(--ink-2); }
.flash .pron .ar { font-size: 1.5rem; }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.96); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.flash.anim-good { animation: goodOut .3s var(--ease) forwards; border-color: rgba(16, 185, 129, .7); box-shadow: 0 0 0 4px rgba(16, 185, 129, .25), 0 30px 80px -20px rgba(16, 185, 129, .6); }
.flash.anim-bad { animation: badOut .42s var(--ease) forwards; border-color: rgba(244, 63, 94, .7); box-shadow: 0 0 0 4px rgba(244, 63, 94, .22), 0 30px 80px -20px rgba(244, 63, 94, .5); }
@keyframes goodOut { 0% { transform: none; } 40% { transform: scale(1.03); } 100% { transform: translateX(40px) rotate(3deg) scale(.96); opacity: 0; } }
@keyframes badOut { 0%, 100% { transform: none; } 15% { transform: translateX(-12px); } 30% { transform: translateX(10px); } 45% { transform: translateX(-7px); } 60% { transform: translateX(4px); opacity: 1; }
  100% { transform: translateX(-30px) rotate(-3deg) scale(.96); opacity: 0; } }
.answer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer .btn { min-height: 66px; font-size: 1.1rem; border-radius: 20px; }
.answer .btn .ico { width: 24px; height: 24px; stroke-width: 2.6; }
.keys { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; min-height: 36px; }
@media (hover: none) { .hide-touch { display: none; } }

.result { max-width: 640px; margin: 10px auto 0; padding: 30px 22px; display: grid; gap: 14px; justify-items: center; }
.result > * { margin: 0; }
.result .btn.big { max-width: 420px; }
.result-emoji { font-size: 3rem; animation: pop .8s var(--spring) both .1s; }
.result-big { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-ring { width: 170px; height: 170px; }
.list-table { width: 100%; border-collapse: collapse; }
.list-table td { padding: 8px 6px; border-bottom: 1px solid var(--hair); }
.list-table tr:last-child td { border-bottom: 0; }
.list-table td.ar { font-size: 1.8rem; text-align: right; }

/* ---------- Toast va konfetti ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px) scale(.96);
  padding: 12px 18px; border-radius: 16px; opacity: 0; pointer-events: none; z-index: 40; max-width: calc(100% - 32px); font-weight: 600;
  background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink); border: 1px solid var(--glass-line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: var(--shadow-lg);
  transition: opacity .3s var(--ease), transform .4s var(--spring);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
@media (min-width: 960px) { .toast { bottom: 28px; left: calc(50% + 148px); } }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.fx i { position: absolute; top: 62%; width: 9px; height: 14px; border-radius: 2px; transform: scale(var(--s));
  animation: confetti var(--d) cubic-bezier(.15, .6, .35, 1) forwards; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0) scale(var(--s)); opacity: 1; }
  45% { transform: translate(calc(var(--dx) * .8), var(--dy)) rotate(calc(var(--r) * .5)) scale(var(--s)); opacity: 1; }
  100% { transform: translate(var(--dx), 50vh) rotate(var(--r)) scale(var(--s)); opacity: 0; }
}

dialog { border-radius: var(--r) !important; animation: cardIn .35s var(--spring); }
dialog::backdrop { background: rgba(3, 10, 8, .45); backdrop-filter: blur(6px); }

/* ---------- Kichik ekranlar ---------- */
@media (max-width: 720px) {
  .stats3 { grid-template-columns: repeat(2, 1fr); }
  .auth { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .auth-intro { grid-template-columns: auto 1fr; align-items: center; }
  .profile { grid-template-columns: auto 1fr; }
  .profile-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 18px; gap: 18px; }
  .hero-text { justify-items: center; }
  .streak-big { justify-content: center; }
  .ring { width: 136px; height: 136px; }
  .word { font-size: 1.7rem; }
  .letters { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
  .lcard .g { font-size: 2.5rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .flash { min-height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.stack > .btn:not(.big) { display: flex; width: 100%; }
.stack > .row .btn { width: auto; }
