/* Sahih Tilawah app: design tokens, layout, components */
:root {
  --bg: #f7f3ea; --bg2: #efe8d8; --card: #ffffff; --ink: #18241f; --muted: #5b6a63; --line: #e4dccb;
  --brand: #0d6b55; --brand2: #0a5141; --brand-ink: #ffffff; --gold: #b8892b; --gold-bg: #f7ecd2;
  --green: #18864a; --green-bg: #e1f3e8; --yellow: #a36a00; --yellow-bg: #fff1d1; --red: #c23a2c; --red-bg: #fde4e0;
  --shadow: 0 6px 20px rgba(24, 36, 31, .08); --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513; --bg2: #141c19; --card: #18221e; --ink: #ecf2ef; --muted: #9fb0a8; --line: #26332e;
    --brand: #3fb58f; --brand2: #2c8f6f; --brand-ink: #08110e; --gold: #d9b45a; --gold-bg: #2b2414;
    --green: #5fd38f; --green-bg: #153424; --yellow: #f0c35a; --yellow-bg: #362b10; --red: #ff8a7c; --red-bg: #3d1e1a;
    --shadow: 0 6px 20px rgba(0, 0, 0, .35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1513; --bg2: #141c19; --card: #18221e; --ink: #ecf2ef; --muted: #9fb0a8; --line: #26332e;
  --brand: #3fb58f; --brand2: #2c8f6f; --brand-ink: #08110e; --gold: #d9b45a; --gold-bg: #2b2414;
  --green: #5fd38f; --green-bg: #153424; --yellow: #f0c35a; --yellow-bg: #362b10; --red: #ff8a7c; --red-bg: #3d1e1a;
  --shadow: 0 6px 20px rgba(0, 0, 0, .35); color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Hind Siliguri', system-ui, sans-serif; line-height: 1.55; min-height: 100vh; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }

/* header with a light geometric (non-figurative) pattern */
.hero { margin: 0 -16px; padding: 18px 16px 22px; color: #fff; border-radius: 0 0 26px 26px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.10) 0 2px, transparent 3px) 0 0 / 22px 22px,
    radial-gradient(circle at 70% 70%, rgba(255,255,255,.07) 0 2px, transparent 3px) 0 0 / 22px 22px,
    linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%); }
:root[data-theme="dark"] .hero, :root:not([data-theme="light"]) .hero { color: #fff; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.chip { background: rgba(255,255,255,.16); border: 0; color: #fff; padding: 6px 12px; border-radius: 999px; font-size: .9rem; }
.hero h1 { font-size: 1.35rem; margin: 14px 0 2px; }
.hero p { margin: 0; opacity: .9; font-size: .95rem; }

h2 { font-size: 1.1rem; margin: 22px 2px 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 12px; box-shadow: var(--shadow); }
.muted { color: var(--muted); } .small { font-size: .88rem; } .center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.btn { border: 1px solid var(--line); background: var(--card); padding: 10px 14px; border-radius: 12px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }
.btn.gold { background: var(--gold); color: #fff; border-color: var(--gold); font-weight: 700; }
.btn.block { width: 100%; padding: 14px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: default; }
select.btn { padding: 9px 10px; }

/* today ring + plan */
.today { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bgc { stroke: var(--line); } .ring .fgc { stroke: var(--gold); transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-weight: 700; line-height: 1.1; }
.ring .lbl small { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); }
.flame { display: inline-flex; align-items: center; gap: 4px; background: var(--gold-bg); color: var(--gold); padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.plan { list-style: none; margin: 12px 0 0; padding: 0; }
.plan li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); margin-top: 8px; cursor: pointer; background: var(--card); }
.plan li .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--bg2); font-size: 1.1rem; flex: none; }
.plan li.done .ic { background: var(--green-bg); color: var(--green); }
.plan li .t { flex: 1; } .plan li .t b { display: block; } .plan li .go { color: var(--muted); }

/* tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border-radius: var(--radius); padding: 14px; background: var(--card); border: 1px solid var(--line); cursor: pointer; box-shadow: var(--shadow); text-align: left; }
.tile .big { font-size: 1.6rem; } .tile b { display: block; margin-top: 4px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.list li:last-child { border-bottom: 0; }
.list .num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--bg2); font-weight: 700; font-size: .85rem; flex: none; }
.list .ar { font-family: 'Amiri Quran', serif; font-size: 1.25rem; margin-left: auto; }
.bar { height: 7px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; transition: width .6s; }

/* practice */
.pr-head { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.pr-head .back { border: 0; background: var(--card); width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--shadow); font-size: 1.1rem; }
.pr-head .ttl { flex: 1; } .pr-head .ttl b { display: block; } .pr-head .ttl small { color: var(--muted); }
.steps { display: flex; gap: 6px; margin-top: 10px; } .steps i { flex: 1; height: 6px; border-radius: 4px; background: var(--line); } .steps i.on { background: var(--brand); } .steps i.done { background: var(--green); }
.verse { direction: rtl; text-align: center; font-family: 'Amiri Quran', serif; font-size: 2.15rem; line-height: 2.5; margin: 6px 0; }
.verse.qaida { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; line-height: 1.6; }
.w { display: inline-block; padding: 0 7px; border-radius: 12px; cursor: pointer; position: relative; transition: background .3s, color .3s, transform .3s; }
.verse.qaida .w { min-width: 70px; border: 1px solid var(--line); background: var(--card); padding: 2px 10px 6px; line-height: 2.3; }
.verse.qaida .w .nm { margin-top: 2px; }
.w .sc { display: block; font-family: 'Hind Siliguri', sans-serif; font-size: .7rem; line-height: 1; opacity: .85; text-align: center; }
.w .nm { display: block; font-family: 'Hind Siliguri', sans-serif; font-size: .78rem; color: var(--muted); line-height: 1.2; }
.w.green { background: var(--green-bg); color: var(--green); } .w.yellow { background: var(--yellow-bg); color: var(--yellow); } .w.red { background: var(--red-bg); color: var(--red); }
.verse.qaida .w.green { border-color: var(--green); } .verse.qaida .w.yellow { border-color: var(--yellow); } .verse.qaida .w.red { border-color: var(--red); }
.w.pop { animation: pop .45s cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.w.sel { outline: 2px solid var(--ink); }
.verse.hidden .w:not(.green):not(.yellow):not(.red) { color: transparent; text-shadow: 0 0 14px rgba(120,120,120,.55); }
.legend { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px; vertical-align: middle; }
.tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.tool { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-size: .92rem; }
.tool.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

.mic-wrap { display: grid; place-items: center; margin: 18px 0 6px; }
.mic { width: 86px; height: 86px; border-radius: 50%; border: 0; background: var(--brand); color: var(--brand-ink); font-size: 2rem; box-shadow: 0 10px 26px rgba(13,107,85,.35); position: relative; }
.mic.rec { background: var(--red); box-shadow: 0 10px 26px rgba(194,58,44,.35); }
.mic.rec::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--red); opacity: .6; animation: ring 1.2s infinite; }
@keyframes ring { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
.mic:disabled { opacity: .5; }
.wave { height: 36px; display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 8px; }
.wave i { width: 4px; border-radius: 3px; background: var(--brand); height: 4px; transition: height .08s; }
.status { text-align: center; color: var(--muted); min-height: 1.5em; font-size: .93rem; }

.result { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.result .ring { width: 96px; height: 96px; }
.result .fgc { stroke: var(--green); }
.counts { display: flex; gap: 10px; font-weight: 700; } .counts span { display: inline-flex; gap: 4px; align-items: center; }
.notes { list-style: none; margin: 10px 0 0; padding: 0; }
.notes li { padding: 10px 12px; border-radius: 12px; margin-top: 8px; }
.notes li.red { background: var(--red-bg); } .notes li.yellow { background: var(--yellow-bg); } .notes li.green { background: var(--green-bg); }
.notes .ar { font-family: 'Amiri Quran', serif; font-size: 1.35rem; direction: rtl; }
.notes button { margin-top: 6px; }
.mk { background: var(--bg2); border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-size: .92rem; }

/* celebration */
.celebrate { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8, 20, 16, .55); z-index: 50; animation: fade .25s; }
.celebrate .box { background: var(--card); border-radius: 24px; padding: 26px 22px; width: min(340px, 90vw); text-align: center; position: relative; overflow: hidden; animation: up .4s cubic-bezier(.2,.9,.3,1.2); }
.celebrate .box .star { font-size: 3rem; }
.celebrate .box h3 { margin: 6px 0 2px; font-size: 1.4rem; } .celebrate .box p { margin: 0 0 14px; color: var(--muted); }
.spark { position: absolute; width: 8px; height: 8px; border-radius: 2px; top: -10px; animation: fall 1.6s ease-in forwards; }
@keyframes fall { to { transform: translateY(340px) rotate(260deg); opacity: 0; } }
@keyframes fade { from { opacity: 0; } } @keyframes up { from { transform: translateY(30px) scale(.95); opacity: 0; } }

/* progress map */
.map { display: grid; grid-template-columns: repeat(auto-fill, minmax(26px, 1fr)); gap: 4px; margin-top: 8px; }
.map i { height: 26px; border-radius: 6px; background: var(--line); display: grid; place-items: center; font-size: .65rem; font-style: normal; color: var(--muted); }
.map i.g { background: var(--green); color: #fff; } .map i.y { background: var(--gold); color: #fff; } .map i.r { background: var(--red); color: #fff; }
.week { display: flex; align-items: flex-end; gap: 8px; height: 90px; margin-top: 10px; }
.week div { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); }
.week div i { display: block; background: var(--brand); border-radius: 6px 6px 2px 2px; margin: 0 auto 4px; width: 70%; min-height: 3px; }

/* family */
.prof { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; margin-top: 8px; cursor: pointer; }
.prof.on { border-color: var(--brand); background: var(--green-bg); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }

/* bottom nav */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.nav .in { display: flex; width: 100%; max-width: 560px; }
.nav button { flex: 1; border: 0; background: none; padding: 8px 0 10px; font-size: .78rem; color: var(--muted); display: grid; justify-items: center; gap: 2px; }
.nav button .i { font-size: 1.3rem; } .nav button.on { color: var(--brand); font-weight: 700; }

/* onboarding */
.ob { min-height: 100vh; display: grid; align-content: center; gap: 12px; padding: 24px 0; }
.ob .opt { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); cursor: pointer; text-align: left; width: 100%; }
.ob .opt.on { border-color: var(--brand); background: var(--green-bg); }
.ob .opt .big { font-size: 1.6rem; }
input.txt { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.hide { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* live classes */
.cls-card { width: 100%; margin-top: 14px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 16px; border-radius: var(--radius); border: 0; color: #fff; box-shadow: var(--shadow);
  background: linear-gradient(135deg, #b8892b, #8a6416); }
.cls-card .big { font-size: 1.8rem; } .cls-card span:nth-child(2) { flex: 1; }
.cls-link { margin-top: 10px; width: 100%; border: 1px dashed var(--gold); background: var(--gold-bg); color: var(--ink); border-radius: 12px; padding: 10px 12px; text-align: left; }
.ticks { list-style: none; margin: 6px 0 0; padding: 0; } .ticks li { padding: 5px 0 5px 26px; position: relative; } .ticks li::before { content: '✓'; position: absolute; left: 4px; color: var(--green); font-weight: 700; }
.pkgs { display: grid; gap: 10px; }
.pkg { position: relative; text-align: left; display: grid; gap: 2px; padding: 14px 14px 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); }
.pkg.pop { border: 2px solid var(--gold); }
.pkg .badge { position: absolute; top: -10px; right: 12px; background: var(--gold); color: #fff; font-size: .75rem; padding: 2px 10px; border-radius: 999px; }
.pkg .price { font-size: 1.35rem; font-weight: 700; color: var(--brand); margin-top: 4px; } .pkg .price small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.fl { display: grid; gap: 4px; margin-top: 10px; font-size: .9rem; color: var(--muted); }
.pkg .price em { font-style: normal; font-size: .85rem; font-weight: 600; color: var(--gold); margin-right: 4px; }
