/* Шрифтовете са на сайта (без Google Fonts) – по-бързо, без проследяване, работят и без интернет. Лиценз: fonts/OFL.txt */
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-cyrillic.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-latin.woff2') format('woff2'); font-weight: 200 800; font-display: swap; 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: 'Manrope'; src: url('../fonts/manrope-latin-ext.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/cormorant-cyrillic.woff2') format('woff2'); font-weight: 300 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; src: url('../fonts/cormorant-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; 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: 'Hafs'; src: url('../fonts/UthmanicHafs.woff2') format('woff2'); font-display: block; }

:root {
  --bg: #f7f1e3; --bg-2: #efe6d2; --surface: #fffaf0; --surface-2: #f4ecda; --line: #e2d5b8;
  --text: #1d2a25; --muted: #6c6a5c; --accent: #0f5c4a; --accent-2: #0b4538; --accent-soft: #dcebe3;
  --gold: #b48a2c; --gold-soft: #f1e2b8; --gold-ink: #7c5a14; --hl: #f6e7b5;
  --ok: #2e7d4f; --ok-soft: #dff3e6; --bad: #b3372b; --bad-soft: #f8dcd8;
  --shadow: 0 1px 2px rgba(60, 45, 10, .06), 0 8px 28px -12px rgba(60, 45, 10, .22);
  --ar: 40px; --radius: 18px; --rail: 0px; --tab: calc(64px + env(safe-area-inset-bottom));
  --ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif; --serif: 'Cormorant Garamond', Georgia, serif;
  color-scheme: light;
}
:root[data-theme="sepia"] {
  --bg: #f1e4c8; --bg-2: #e8d7b3; --surface: #f8edd4; --surface-2: #efe0bf; --line: #d9c39a;
  --text: #3b2c17; --muted: #6e5a3b; --accent: #7a4b16; --accent-2: #5c370f; --accent-soft: #ead3ae;
  --gold: #9a6b1e; --gold-soft: #ecd29f; --gold-ink: #6c4a10; --hl: #f1d894;
}
:root[data-theme="dark"], :root:not([data-theme]).dark-auto {
  --bg: #07130f; --bg-2: #0b1d18; --surface: #0f2620; --surface-2: #143029; --line: #214139;
  --text: #ece6d6; --muted: #9aa99f; --accent: #5cc3a0; --accent-2: #86d8bb; --accent-soft: #143a31;
  --gold: #dcb45a; --gold-soft: #3a3120; --gold-ink: #dcb45a; --hl: #2c3a22;
  --ok: #6fd39a; --ok-soft: #173a2a; --bad: #f08a7c; --bad-soft: #4a1f1a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #07130f; --bg-2: #0b1d18; --surface: #0f2620; --surface-2: #143029; --line: #214139;
    --text: #ece6d6; --muted: #9aa99f; --accent: #5cc3a0; --accent-2: #86d8bb; --accent-soft: #143a31;
    --gold: #dcb45a; --gold-soft: #3a3120; --gold-ink: #dcb45a; --hl: #2c3a22;
    --ok: #6fd39a; --ok-soft: #173a2a; --bad: #f08a7c; --bad-soft: #4a1f1a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
*, *::before, *::after { font-feature-settings: 'locl' 0 !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--ui);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  background-image: radial-gradient(1200px 500px at 50% -200px, var(--bg-2), transparent 70%); background-attachment: fixed; min-height: 100dvh;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.ar, [lang="ar"] { font-family: 'Hafs', serif; direction: rtl; }

/* ---------- каркас ---------- */
main { padding: 0 16px calc(var(--tab) + 24px); max-width: 860px; margin: 0 auto; outline: none; }
.rail { display: none; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; height: var(--tab); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.tabbar a.on { color: var(--accent); }
.tabbar a.on .ic { stroke-width: 2.2; }
@media (min-width: 900px) {
  :root { --rail: 248px; --tab: 0px; }
  .tabbar { display: none; }
  .rail { display: flex; flex-direction: column; gap: 22px; position: fixed; inset: 0 auto 0 0; width: var(--rail); padding: 26px 18px; background: var(--surface); border-right: 1px solid var(--line); z-index: 20; }
  main { margin-left: calc(var(--rail) + max(0px, (100vw - var(--rail) - 860px) / 2)); padding: 0 40px 60px; }
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; color: var(--gold); display: grid; place-items: center; }
.brand-mark svg { width: 44px; height: 44px; }
.brand b { display: block; font: 700 21px/1.1 var(--serif); }
.brand small { display: block; font: 17px/1.3 'Hafs', serif; color: var(--gold); }
.rail-nav { display: grid; gap: 4px; }
.rail-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.rail-nav a:hover { background: var(--surface-2); color: var(--text); }
.rail-nav a.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- общи ---------- */
.topbar {
  position: sticky; top: 0; z-index: 15; margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex; align-items: center; gap: 8px; min-height: 58px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
@media (min-width: 900px) { .topbar { margin: 0 -40px; padding: 14px 40px; } }
.topbar h1 { font: 700 21px/1.2 var(--serif); margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h1 small { font: 500 13px var(--ui); color: var(--muted); margin-left: 6px; }
.ib { width: 42px; height: 42px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--text); transition: background .15s, transform .1s; flex: none; }
.ib:hover { background: var(--surface-2); }
.ib:active { transform: scale(.94); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.chip .ic { width: 17px; height: 17px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 14px; background: var(--accent); color: var(--surface); font-weight: 700; transition: transform .1s, filter .2s; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost.on { border-color: var(--accent); color: var(--accent); } /* бутон „Чуй“, докато звучи */
.btn.gold { background: var(--gold); color: #fff; }
.btn.done { background: var(--ok); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn .ic { width: 20px; height: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.sub { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin: 22px 0 8px; }
h2.h { font: 700 24px/1.2 var(--serif); margin: 26px 0 10px; }
h3.h { font: 700 19px/1.25 var(--serif); margin: 18px 0 8px; }
.p { margin: 0 0 12px; line-height: 1.6; }
.note { font-size: 13.5px; color: var(--muted); line-height: 1.55; padding: 14px 16px; margin: 14px 0; }
.note b { color: var(--text); }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--gold-soft); color: var(--gold-ink); vertical-align: middle; }
.badge.farz { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; line-height: 1.5; }
.list li::before { content: '•'; color: var(--gold); font-weight: 700; flex: none; }
.list.num { counter-reset: n; }
.list.num li::before { counter-increment: n; content: counter(n); width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 13px; }
.list li b { display: block; }
.list li small { color: var(--muted); display: block; font-size: 13.5px; }
.list.bad li::before { content: '✕'; color: var(--bad); }
.list.good li::before { content: '✓'; color: var(--ok); }

/* ---------- начало ---------- */
.hero { padding: calc(22px + env(safe-area-inset-top)) 0 8px; }
.hero-title { font: 700 clamp(30px, 7vw, 42px)/1.05 var(--serif); margin: 0; }
.hero-title span { display: block; font: 400 clamp(24px, 5.5vw, 32px)/1.6 'Hafs', serif; color: var(--gold); margin-top: 2px; }
.hero p { color: var(--muted); margin: 8px 0 0; max-width: 56ch; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stat { padding: 14px 12px; text-align: center; }
.stat b { display: block; font: 700 26px/1 var(--serif); color: var(--accent); }
.stat small { color: var(--muted); font-size: 12px; }
.continue { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px; }
.continue .ic-wrap { width: 44px; height: 44px; border-radius: 12px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.continue div { flex: 1; min-width: 0; }
.continue small { color: var(--muted); font-size: 12.5px; display: block; }
.continue b { font-weight: 700; }
.modules { display: grid; gap: 10px; }
@media (min-width: 620px) { .modules { grid-template-columns: 1fr 1fr; } }
.mod { display: flex; align-items: center; gap: 14px; padding: 14px; transition: border-color .2s, transform .15s; }
.mod:hover { border-color: var(--gold); }
.mod:active { transform: scale(.99); }
.mod .ic-wrap { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.mod .ic-wrap .ic { width: 26px; height: 26px; }
.mod .mid { flex: 1; min-width: 0; }
.mod b { display: block; font: 700 17px var(--ui); }
.mod small { color: var(--muted); font-size: 12.5px; display: block; }
.bar { height: 6px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .4s; }
.mod .pct { font-size: 12.5px; font-weight: 700; color: var(--accent); flex: none; }

/* ---------- модул ---------- */
.lessons { display: grid; gap: 8px; }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.lrow:hover { border-color: var(--gold); }
.lrow .n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 13px; color: var(--muted); flex: none; }
.lrow.done .n { background: var(--ok-soft); color: var(--ok); }
.lrow .mid { flex: 1; min-width: 0; }
.lrow b { display: block; font-weight: 600; }
.lrow small { color: var(--muted); font-size: 12.5px; }

/* ---------- урок ---------- */
.lesson-foot { display: flex; gap: 10px; margin: 30px 0 10px; flex-wrap: wrap; }
.lesson-foot .btn { flex: 1; min-width: 120px; }
.letters { display: grid; gap: 12px; }
.letter { padding: 16px; display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
.letter .big { font: 400 64px/1.2 'Hafs', serif; text-align: center; color: var(--accent); background: var(--surface-2); border-radius: 16px; padding: 8px 4px; direction: rtl; }
.letter h3 { margin: 0; font: 700 20px var(--serif); }
.letter .snd { color: var(--gold-ink); font-weight: 700; font-size: 14px; }
.letter p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.55; }
.forms { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.forms span { flex: 1; min-width: 56px; text-align: center; background: var(--surface-2); border-radius: 10px; padding: 6px 4px; font: 400 30px/1.3 'Hafs', serif; direction: rtl; position: relative; }
.forms span small { display: block; font: 600 10.5px var(--ui); color: var(--muted); direction: ltr; margin-top: 2px; }
.ex { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 8px 12px; background: var(--gold-soft); border-radius: 12px; }
.ex .ar { font-size: 30px; line-height: 1.4; color: var(--gold-ink); }
.ex small { color: var(--gold-ink); }
.ex b { font-size: 14.5px; }
@media (max-width: 420px) { .letter { grid-template-columns: 76px 1fr; padding: 12px; } .letter .big { font-size: 50px; } }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.syl { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.syl button { padding: 10px 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.syl button:hover { border-color: var(--gold); }
.syl .ar { display: block; font-size: 34px; line-height: 1.3; color: var(--accent); }
.syl small { display: block; font-size: 13px; font-weight: 700; color: var(--muted); }
.syl.big .ar { font-size: 44px; }
.demo { text-align: center; padding: 20px; margin: 12px 0; }
.demo .ar { font-size: 72px; line-height: 1.3; color: var(--accent); }
.demo b { display: block; font-size: 22px; }

/* сура */
.surah-head { text-align: center; padding: 20px 16px; margin: 8px 0 14px; }
.surah-head .ar { font-size: clamp(36px, 9vw, 52px); line-height: 1.5; color: var(--accent); }
.surah-head h2 { font: 700 24px/1.15 var(--serif); margin: 2px 0; }
.surah-head p { margin: 0; color: var(--muted); font-size: 14px; }
.ctrls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.ctrls select { height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; max-width: 100%; }
.ayah { padding: 14px 4px 16px; border-bottom: 1px solid var(--line); border-radius: 6px; transition: background .3s; }
.ayah.cur { background: var(--hl); padding-left: 12px; padding-right: 12px; margin: 0 -8px; border-bottom-color: transparent; border-radius: 14px; }
.ayah-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ayah-key { font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-right: auto; }
.ayah-top .ib { width: 36px; height: 36px; color: var(--muted); }
.ar-text { font-family: 'Hafs', serif; font-size: var(--ar); line-height: 2; direction: rtl; text-align: right; margin: 0; }
.tr-text { font-size: 17px; font-weight: 600; color: var(--gold-ink); margin: 8px 0 0; line-height: 1.55; }
.bg-text { font-size: 15px; color: var(--text); opacity: .85; margin: 6px 0 0; line-height: 1.55; }
.hide-tr .tr-text, .hide-bg .bg-text { display: none; }
.rec { padding: 16px; margin-top: 18px; }
.rec h3 { margin: 0 0 6px; font: 700 19px var(--serif); }
.rec p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.rec .btn.rec-on { background: var(--bad); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { filter: brightness(1.2); } }
.rec audio { width: 100%; margin-top: 12px; }

/* дуа */
.dua { padding: 16px; margin-bottom: 12px; }
.dua h3 { margin: 0 0 2px; font: 700 20px var(--serif); }
.dua .when { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.dua .ar-text { font-size: calc(var(--ar) * .85); line-height: 2; }
.dua .note { padding: 10px 12px; margin: 10px 0 0; background: var(--surface-2); border-radius: 10px; }

/* езан */
.ezan-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.ezan-line:last-child { border-bottom: 0; }
.ezan-line .ar-text { font-size: calc(var(--ar) * .8); line-height: 1.8; grid-column: 1; }
.ezan-line .x { font: 700 14px var(--ui); color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 10px; grid-row: 1 / span 3; align-self: start; }
.ezan-line .tr-text { margin: 0; font-size: 16px; }
.ezan-line .bg-text { margin: 0; }
.ezan-line .reply { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); margin-top: 4px; padding: 8px 10px; background: var(--surface-2); border-radius: 10px; }
.ezan-line .reply b { color: var(--text); }
.ezan-line.sabah { background: color-mix(in srgb, var(--gold-soft) 50%, transparent); }

/* стъпки (абдест/намаз) */
.steps { display: grid; gap: 10px; }
.step { display: flex; gap: 14px; padding: 14px; }
.step .n { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--surface); display: grid; place-items: center; font-weight: 800; flex: none; }
.step .mid { flex: 1; }
.step b { display: block; }
.step p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.55; }
.step .x { font-size: 12.5px; font-weight: 700; color: var(--gold-ink); }
.stepper { padding: 18px; text-align: center; }
.stepper .fig { display: grid; place-items: center; margin: 4px auto 8px; }
.figure .fg { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.figure .fg-head { fill: var(--accent); }
.figure .fg.ground { stroke: var(--line); stroke-width: 3; }
.figure .fg.foot { stroke-width: 4; }
.figure .fg.eye { stroke: var(--gold); stroke-width: 3; }
.stepper .pos { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stepper h3 { font: 700 22px/1.2 var(--serif); margin: 4px 0 8px; }
.stepper p { margin: 0 auto; max-width: 52ch; font-size: 15px; line-height: 1.6; text-align: left; }
.stepper .reads { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 14px 0 6px; }
.stepper .nav { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 16px; }
.stepper .dots { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; }
.stepper .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.stepper .dots i.on { background: var(--accent); }
.prayer { padding: 14px 16px; margin-bottom: 10px; }
.prayer .top { display: flex; align-items: baseline; gap: 10px; }
.prayer h3 { margin: 0; font: 700 21px var(--serif); flex: 1; }
.prayer .top .ar { font-size: 24px; color: var(--gold); }
.prayer .tm { font-size: 13px; color: var(--muted); margin: 2px 0 10px; }
.rak { display: flex; gap: 6px; flex-wrap: wrap; }
.rak span { padding: 6px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; background: var(--surface-2); }
.rak span.farz { background: var(--accent); color: var(--surface); }
.rak span.vitir { background: var(--gold); color: #fff; }
.rak span b { font-size: 16px; }
.prayer .nt { font-size: 13.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }

/* тест */
.quiz { padding: 18px; }
.quiz .q { font: 700 20px/1.3 var(--serif); margin: 0 0 14px; }
.quiz .q .ar { display: block; font-size: 56px; line-height: 1.3; color: var(--accent); text-align: center; margin: 8px 0; }
.opts { display: grid; gap: 8px; }
.opt { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); text-align: left; font-weight: 600; transition: border-color .15s, background .15s; }
.opt .ar { font-size: 30px; line-height: 1.3; display: block; text-align: center; }
.opt:hover { border-color: var(--gold); }
.opt.ok { background: var(--ok-soft); border-color: var(--ok); }
.opt.bad { background: var(--bad-soft); border-color: var(--bad); }
.opt:disabled { cursor: default; }
.quiz .fb { margin: 12px 0 0; font-size: 14.5px; min-height: 1.5em; }
.quiz .fb.ok { color: var(--ok); font-weight: 700; }
.quiz .fb.bad { color: var(--bad); font-weight: 700; }
.quiz .prog { font-size: 12.5px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.result { text-align: center; padding: 26px 18px; }
/* „Сглоби думата“ */
.build .word { text-align: center; margin: 4px 0 10px; color: var(--muted); font-weight: 600; }
.build .word .ar { display: block; font-size: 60px; line-height: 1.6; color: var(--accent); }
.slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.slots span { width: 50px; height: 58px; border-radius: 12px; border: 2px dashed var(--line); display: grid; place-items: center; font: 32px/1 'Hafs', serif; }
.slots span.ok { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 8px; }
.tile { height: 64px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); font: 34px/1 'Hafs', serif; transition: opacity .2s, border-color .15s; }
.tile:hover:not(:disabled) { border-color: var(--gold); }
.tile.used { opacity: .25; }
.tile:disabled { cursor: default; }
.tile.shake { border-color: var(--bad); background: var(--bad-soft); animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.result b { display: block; font: 700 46px/1 var(--serif); color: var(--accent); margin: 6px 0; }

/* настройки */
.set-group { padding: 6px 0; margin-bottom: 16px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row .mid { flex: 1; min-width: 160px; }
.set-row .mid b { display: block; font-weight: 600; }
.set-row .mid small { color: var(--muted); font-size: 12.5px; }
.seg { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; }
.seg button { height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.range { width: 100%; accent-color: var(--accent); height: 28px; }
.switch { position: relative; width: 50px; height: 30px; border-radius: 999px; background: var(--line); transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }
.about { font-size: 13.5px; color: var(--muted); line-height: 1.65; padding: 16px 18px; }
.about a { color: var(--accent); text-decoration: underline; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tab) + 24px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; transition: opacity .25s, transform .25s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.loader { display: grid; place-items: center; padding: 80px 0; }
.loader::after { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }

/* ---------- „Инсталирай“ и „Сподели“ (js/pwa.js – еднакво в Муаллим и Куран-и Керим) ---------- */
.pw-card { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 16px 46px 16px 16px; margin-top: 16px; }
.pw-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.pw-mid b { display: block; font-weight: 700; }
.pw-mid small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 2px; }
.pw-acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pw-acts .btn { flex: 1 1 130px; height: 44px; padding: 0 14px; }
@media (min-width: 720px) { .pw-card { grid-template-columns: auto 1fr auto; } .pw-acts { grid-column: auto; margin-top: 0; } .pw-acts .btn { flex: none; } }
.pw-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.pw-x:hover { background: var(--surface-2); color: var(--text); }
.pw-x .ic { width: 18px; height: 18px; }

.pw-sheet { border: 0; padding: 0 0 env(safe-area-inset-bottom); margin: auto auto 0; width: 100%; max-width: 100%; max-height: 90dvh; background: var(--surface); color: var(--text); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .25); overflow: hidden; }
.pw-sheet[open] { display: flex; flex-direction: column; animation: pwUp .3s cubic-bezier(.2, .9, .3, 1); }
.pw-sheet::backdrop { background: rgba(5, 12, 10, .45); backdrop-filter: blur(2px); }
@keyframes pwUp { from { transform: translateY(100%); } }
@media (min-width: 700px) {
  .pw-sheet { margin: auto; width: min(540px, 92vw); border-radius: 24px; max-height: 86dvh; }
  .pw-sheet[open] { animation: pwPop .22s ease; }
  @keyframes pwPop { from { opacity: 0; transform: translateY(12px); } }
}
html:has(.pw-sheet[open]) { overflow: hidden; }
.pw-body { overflow-y: auto; min-height: 0; padding: 22px 20px 24px; overscroll-behavior: contain; }
.pw-sheet h3 { font: 700 22px/1.25 var(--serif); margin: 0 40px 10px 0; }
.pw-lead { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.pw-small { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.pw-wide { width: 100%; }
.pw-ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; line-height: 1.5; }
.pw-ol li::marker { color: var(--gold); font-weight: 700; }

/* iPhone: три малки картинки „Сподели → Добави към началния екран → Добави“ */
.pw-steps { display: grid; gap: 12px; }
.pw-steps figure { margin: 0; display: grid; grid-template-columns: 156px 1fr; gap: 14px; align-items: center; }
.pw-steps figcaption { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; line-height: 1.4; }
.pw-steps figcaption b { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--surface); display: grid; place-items: center; font-size: 14px; }
.pw-steps figcaption small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.pw-mock { border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 8px; font-size: 11px; line-height: 1.3; display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 56px; }
.pw-mock .ic { width: 18px; height: 18px; color: var(--muted); }
.pw-hi { outline: 2.5px solid var(--gold); outline-offset: 2px; border-radius: 7px; }
.pw-bar .pw-hi { display: grid; place-items: center; width: 28px; height: 28px; }
.pw-bar .pw-hi .ic, .pw-menu .pw-hi .ic { color: var(--accent); }
.pw-menu { flex-direction: column; align-items: stretch; gap: 5px; }
.pw-menu div { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 6px; background: var(--surface); border-radius: 6px; }
.pw-menu .ic { width: 15px; height: 15px; }
.pw-top span { color: var(--accent); font-weight: 600; padding: 2px 4px; }
.pw-top img { border-radius: 8px; }
@media (max-width: 380px) { .pw-steps figure { grid-template-columns: 1fr; gap: 8px; } }

/* споделяне */
.pw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pw-act { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 14.5px; text-align: left; }
.pw-act:hover { border-color: var(--gold); }
.pw-act i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.pw-act .ic { width: 18px; height: 18px; color: var(--accent); }
.pw-url { display: flex; gap: 8px; margin-top: 12px; }
.pw-url input { flex: 1; min-width: 0; height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; }
.pw-url .btn { padding: 0 14px; }
.pw-qr { display: flex; gap: 16px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.pw-qr img { background: #fff; border-radius: 12px; flex: none; width: 168px; height: 168px; }
.pw-qr b { display: block; font-weight: 700; }
.pw-qr small { display: block; color: var(--muted); font-size: 13px; margin: 2px 0 10px; line-height: 1.45; }
.pw-qr .btn { height: 40px; padding: 0 14px; font-size: 14px; }
@media (max-width: 420px) { .pw-qr { flex-direction: column; text-align: center; } .pw-qr img { width: 150px; height: 150px; } }
.pw-share { width: 100%; margin-top: 4px; }
