* { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; direction:rtl; }
body { font-family:'Tajawal',sans-serif; background:var(--bg); color:var(--ink); overflow-x:hidden; }

/* القوالب: ت١ فجر (افتراضي)، ت٢ مِسك، ت٣ ضُحى */
body { --bg:#221836; --bg2:#2C2044;
       --glow:radial-gradient(ellipse 130% 60% at 50% -8%, rgba(233,166,105,.42), rgba(88,58,110,.20) 45%, transparent 70%);
       --card:rgba(255,255,255,.06); --card2:rgba(255,255,255,.09); --line:rgba(224,168,110,.32);
       --ink:#F5EDE2; --mut:#AC9EC0; --acc:#E8B478; --acc2:#C88B52; --onAcc:#2A1706; --paper:#FBF6EC;
       --shadow:0 18px 50px rgba(10,5,25,.45); --starop:1; }
body.t2 { --bg:#171310; --bg2:#1D1813;
       --glow:radial-gradient(ellipse 120% 50% at 50% -8%, rgba(198,167,94,.20), transparent 65%);
       --card:rgba(255,252,245,.05); --card2:rgba(255,252,245,.085); --line:rgba(198,167,94,.40);
       --ink:#F0E7D5; --mut:#A2967F; --acc:#D4B26A; --acc2:#A98B45; --onAcc:#1C1406; --paper:#FBF6EC;
       --shadow:0 18px 50px rgba(0,0,0,.5); --starop:.7; }
body.t3 { --bg:#F4EADC; --bg2:#EFE2CE;
       --glow:radial-gradient(ellipse 130% 55% at 50% -8%, rgba(161,92,51,.16), transparent 65%);
       --card:#FDF8EF; --card2:#FFFFFF; --line:#DFCBAF;
       --ink:#3B2A1E; --mut:#8C7A66; --acc:#A15C33; --acc2:#7F4525; --onAcc:#FCF6EC; --paper:#FFFFFF;
       --shadow:0 16px 40px rgba(120,80,40,.14); --starop:0; }

/* السماء الحية */
.sky { position:relative; min-height:100vh; background:linear-gradient(180deg,var(--bg2) 0%,var(--bg) 32%); }
.sky::before { content:''; position:absolute; inset:0; background:var(--glow); pointer-events:none;
               animation:breathe 9s ease-in-out infinite; }
@keyframes breathe { 0%,100%{opacity:.85} 50%{opacity:1} }
.stars { position:absolute; inset:0 0 auto 0; height:420px; overflow:hidden; pointer-events:none; opacity:var(--starop); }
.stars i { position:absolute; width:2px; height:2px; border-radius:50%; background:#F5E7C8;
           animation:tw 3.6s ease-in-out infinite; }
@keyframes tw { 0%,100%{opacity:.15; transform:scale(.8)} 50%{opacity:.95; transform:scale(1.25)} }

.wrap { position:relative; max-width:560px; margin:0 auto; padding:0 16px 52px; }

header { display:flex; justify-content:space-between; align-items:center; padding:18px 2px 4px; }
.brand { font-family:'El Messiri'; font-size:25px; color:var(--acc); text-decoration:none; text-shadow:0 0 22px rgba(232,180,120,.35); }
.share { font-size:13px; color:var(--mut); border:1px solid var(--line); border-radius:18px; padding:6px 16px;
         background:var(--card); font-family:'Tajawal'; cursor:pointer; transition:.25s; }
.share:active { transform:scale(.95); }

/* المحراب الحي */
.mihrab { margin:44px auto 0; max-width:340px; border:1.5px solid var(--line); border-radius:170px 170px 26px 26px;
          padding:58px 26px 24px; text-align:center; position:relative;
          background:linear-gradient(180deg,var(--card2),var(--card)); box-shadow:var(--shadow); }
.mihrab::before { content:''; position:absolute; inset:9px; border:1px solid var(--line); opacity:.5;
          border-radius:162px 162px 19px 19px; pointer-events:none; }
/* نقش معيني خافت داخل المحراب */
.mihrab::after { content:''; position:absolute; inset:10px; border-radius:161px 161px 18px 18px;
          pointer-events:none; opacity:.05;
          background:repeating-linear-gradient(45deg, var(--acc) 0 1px, transparent 1px 14px),
                     repeating-linear-gradient(-45deg, var(--acc) 0 1px, transparent 1px 14px);
          -webkit-mask-image:linear-gradient(180deg, #000 0%, transparent 78%);
          mask-image:linear-gradient(180deg, #000 0%, transparent 78%); }
/* الهلال تاج المحراب */
.finial { position:absolute; top:-19px; left:50%; transform:translateX(-50%); width:38px; height:38px;
          border-radius:50%; background:var(--bg2); border:1.5px solid var(--line);
          display:flex; align-items:center; justify-content:center;
          box-shadow:0 0 22px rgba(232,180,120,.35); animation:lampGlow 4.5s ease-in-out infinite; }
.finial .cres { width:16px; height:16px; border-radius:50%;
          box-shadow:4.5px -2.5px 0 0 var(--acc); transform:rotate(-18deg); }
@keyframes lampGlow { 0%,100%{box-shadow:0 0 10px rgba(232,180,120,.25)} 50%{box-shadow:0 0 26px rgba(232,180,120,.6)} }
/* فاصل زخرفي أسفل الدعاء */
.basmal { display:flex; align-items:center; justify-content:center; gap:10px; padding-top:16px;
          color:var(--acc); font-size:11px; }
.basmal span { width:56px; height:1px; background:linear-gradient(90deg,transparent,var(--line),transparent); }
.mihrab .niyyah { color:var(--acc); font-size:13.5px; padding-top:14px; letter-spacing:2px; }
.mihrab h1 { font-family:'El Messiri'; font-size:35px; font-weight:700; padding:10px 0 6px; line-height:1.5;
             background:linear-gradient(100deg,var(--ink) 20%,var(--acc) 42%,var(--ink) 60%);
             background-size:220% 100%; -webkit-background-clip:text; background-clip:text; color:transparent;
             animation:shimmer 6.5s ease-in-out infinite; }
@keyframes shimmer { 0%,100%{background-position:110% 0} 50%{background-position:-10% 0} }
.mihrab .dua { color:var(--mut); font-size:14.5px; line-height:2; }

.visitors { margin:16px auto 4px; max-width:350px; text-align:center; font-size:13.5px; color:var(--mut); }
.visitors b { font-size:17px; color:var(--acc); font-family:'El Messiri'; }

/* شبكة الأقسام */
.nav6 { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; padding:22px 0 8px; }
.nav6 a { display:flex; flex-direction:column; align-items:center; gap:8px; padding:14px 6px 12px;
          background:var(--card); border:1px solid var(--line); border-radius:16px; color:var(--ink);
          text-decoration:none; font-size:13.5px; font-weight:700; transition:.3s; }
.nav6 a svg { width:22px; height:22px; color:var(--acc); transition:.3s; }
.nav6 a:active { transform:scale(.94); }
.nav6 a.cur { background:linear-gradient(180deg,var(--acc),var(--acc2)); color:var(--onAcc);
              border-color:transparent; box-shadow:0 10px 24px rgba(200,139,82,.35); }
.nav6 a.cur svg { color:var(--onAcc); }

/* ظهور الأقسام مع التمرير */
.reveal { opacity:0; transform:translateY(22px); transition:opacity .7s ease, transform .7s ease; }
.reveal.in { opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity:1; transform:none; transition:none; }
  .stars i, .sky::before, .mihrab .lamp, .mihrab h1 { animation:none; }
}

section { margin-top:30px; }
section h2 { font-size:18px; font-weight:800; padding-bottom:12px; display:flex; align-items:center; gap:10px; }
section h2::before { content:'✦'; color:var(--acc); font-size:13px; }
section h2::after { content:''; flex:1; height:1px;
                    background:linear-gradient(90deg,var(--line),transparent); }

/* المصحف */
.mushaf { background:var(--card); border:1px solid var(--line); border-radius:20px; padding:14px; box-shadow:var(--shadow); }
.mushaf .pagebox { background:var(--paper); border-radius:14px; overflow:hidden; min-height:340px;
                   display:flex; align-items:center; justify-content:center; position:relative;
                   box-shadow:inset 0 0 0 1px var(--line), inset 0 0 26px rgba(140,100,40,.10); }
.mushaf .pagebox img { width:100%; display:block; opacity:0; transition:opacity .45s ease; }
.mushaf .pagebox img.ld { opacity:1; }

/* رسائل تعذّر التحميل — المصحف والتلاوات والإذاعة من خوادم خارجية */
.loaderr { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
           gap:12px; padding:20px; text-align:center; background:var(--paper); }
.loaderr p { font-size:14px; color:#6B5B4A; line-height:1.8; }
.loaderr button { font-family:'Tajawal'; font-weight:800; font-size:14px; background:var(--acc); color:var(--onAcc);
                  border:0; border-radius:11px; padding:10px 20px; cursor:pointer; }
.playerr { font-size:13px; color:var(--acc); background:var(--card2); border:1px solid var(--line);
           border-radius:11px; padding:10px 14px; margin-top:12px; text-align:center; line-height:1.7; }
.mushaf .bar { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:12px; }
.mushaf .bar button { font-family:'Tajawal'; font-weight:800; font-size:14px; background:var(--card2); color:var(--ink);
                      border:1px solid var(--line); border-radius:12px; padding:11px 16px; cursor:pointer; transition:.2s; }
.mushaf .bar button:active { transform:scale(.94); background:var(--acc); color:var(--onAcc); }
.mushaf .bar .pg { color:var(--mut); font-size:13.5px; }
.mushaf .bar .pg b { color:var(--acc); font-size:17px; font-family:'El Messiri'; }
.mushaf .jump { display:flex; gap:8px; padding-top:10px; }
.mushaf select, .mushaf input { flex:1; font-family:'Tajawal'; font-size:14px; background:var(--card2); color:var(--ink);
                    border:1px solid var(--line); border-radius:10px; padding:10px; }
.mushaf option { color:#222; }

/* المواقيت */
.times { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
.times > div { background:var(--card); border:1px solid var(--line); border-radius:13px; text-align:center;
               padding:11px 2px; transition:.3s; }
.times .n { font-size:12.5px; color:var(--mut); }
.times .t { font-family:'El Messiri'; font-size:15px; color:var(--acc); padding-top:2px; }
.times .on { border-color:var(--acc); background:var(--card2);
             box-shadow:0 0 0 1px var(--acc) inset, 0 8px 22px rgba(200,139,82,.25); }
.times .on .n { color:var(--ink); font-weight:800; }
.countdown { text-align:center; padding-top:12px; font-size:14px; color:var(--mut); }
.countdown b { color:var(--acc); font-family:'El Messiri'; font-size:19px; padding:0 4px; }
.cityrow { display:flex; gap:8px; justify-content:center; padding-top:14px; }
.cityrow select, .cityrow button { font-family:'Tajawal'; font-size:13.5px; background:var(--card2); color:var(--ink);
                border:1px solid var(--line); border-radius:11px; padding:9px 14px; cursor:pointer; }
.cityrow select { min-width:150px; }
.cityrow button { font-weight:700; color:var(--acc); white-space:nowrap; }
.cityrow button:hover { border-color:var(--acc); }
.timesnote { color:var(--mut); font-size:12px; text-align:center; padding-top:8px; opacity:.8; }

/* شاشة انتهاء المدة — تحل محل المكتبة كاملة */
.expired { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.expired-card { position:relative; width:min(440px,100%); background:var(--card); border:1px solid var(--line);
                border-radius:26px; padding:52px 26px 30px; text-align:center; }
.expired-card .niyyah { color:var(--acc); font-size:13px; letter-spacing:1px; }
.expired-card h1 { font-family:'El Messiri'; font-size:29px; color:var(--ink); margin:8px 0 18px; }
.expired-msg { font-size:14.5px; color:var(--mut); line-height:2; }
.expired-cta { display:inline-block; margin-top:22px; background:var(--acc); color:var(--onAcc);
               font-weight:800; font-size:15px; border-radius:13px; padding:13px 30px; text-decoration:none; }
.expired-note { font-size:12px; color:var(--mut); opacity:.8; padding-top:14px; }

/* المسبحة */
.sabha { background:var(--card); border:1px solid var(--line); border-radius:20px; padding:20px; text-align:center;
         cursor:pointer; -webkit-tap-highlight-color:transparent; user-select:none; box-shadow:var(--shadow);
         position:relative; overflow:hidden; }
.sabha .ring { width:150px; height:150px; margin:10px auto 4px; border-radius:50%; border:1.5px solid var(--line);
               display:flex; flex-direction:column; align-items:center; justify-content:center;
               background:radial-gradient(circle at 50% 38%, var(--card2), transparent 75%); transition:.15s; }
.sabha.pulse .ring { transform:scale(1.05); border-color:var(--acc); box-shadow:0 0 26px rgba(232,180,120,.35); }
.sabha .count { font-family:'El Messiri'; font-size:46px; color:var(--acc); line-height:1.15; }
.sabha .hint { color:var(--mut); font-size:12px; }
.sabha select { font-family:'Tajawal'; font-weight:700; font-size:14px; border:1px solid var(--line);
                background:var(--card2); color:var(--ink); border-radius:10px; padding:8px 14px; }
.sabha option { color:#222; }
.sabha .row { display:flex; gap:8px; justify-content:center; padding-top:12px; }
.sabha button { font-family:'Tajawal'; font-weight:700; font-size:13px; border:1px solid var(--line);
                background:none; color:var(--mut); border-radius:10px; padding:7px 16px; cursor:pointer; }

/* الأذكار */
.acc { background:var(--card); border:1px solid var(--line); border-radius:15px; margin-bottom:10px; overflow:hidden; }
.acc summary { padding:15px 16px; font-weight:700; font-size:15px; cursor:pointer; list-style:none;
               display:flex; justify-content:space-between; transition:.2s; }
.acc summary::after { content:'+'; color:var(--acc); font-size:19px; }
.acc[open] summary { color:var(--acc); }
.acc[open] summary::after { content:'−'; }
.acc .body { padding:0 14px 14px; }
.thikr { border:1px solid var(--line); border-radius:13px; padding:13px 15px; margin-bottom:9px; cursor:pointer;
         -webkit-tap-highlight-color:transparent; user-select:none; background:var(--card); transition:.25s; }
.thikr:active { transform:scale(.985); }
.thikr p { font-size:14.5px; line-height:2.05; }
.thikr .meta { display:flex; justify-content:space-between; align-items:center; padding-top:9px; }
.thikr .badge { font-size:12.5px; color:var(--onAcc); background:linear-gradient(180deg,var(--acc),var(--acc2));
                border-radius:12px; padding:2px 13px; font-weight:800; min-width:38px; text-align:center; }
.thikr .left { font-size:12.5px; color:var(--mut); }
.thikr.done { opacity:.42; }
.thikr .openq { font-size:13px; color:var(--acc); font-weight:700; }

/* حصن المسلم */
.hisn-shell { background:var(--card); border:1px solid var(--line); border-radius:20px; padding:14px;
              box-shadow:var(--shadow); }
.hisn-search { width:100%; font-family:'Tajawal'; font-size:15px; background:var(--card2); color:var(--ink);
               border:1px solid var(--line); border-radius:13px; padding:12px 14px; outline:none; }
.hisn-search::placeholder { color:var(--mut); }
.hisn-search:focus { border-color:var(--acc); box-shadow:0 0 0 2px color-mix(in srgb,var(--acc) 20%,transparent); }
.hisn-summary { color:var(--mut); font-size:12.5px; padding:10px 3px; }
.hisn-index { display:grid; gap:8px; max-height:440px; overflow-y:auto; padding-left:2px; scrollbar-color:var(--line) transparent; }
.hisn-chapter { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px;
                font-family:'Tajawal'; font-size:14px; font-weight:700; text-align:right; color:var(--ink);
                background:var(--card2); border:1px solid var(--line); border-radius:12px; padding:12px 13px; cursor:pointer; }
.hisn-chapter:active { transform:scale(.985); }
.hisn-chapter b { flex:0 0 auto; min-width:28px; border-radius:12px; padding:2px 8px; text-align:center;
                  font-family:'El Messiri'; font-size:13px; color:var(--onAcc); background:var(--acc); }
.hisn-reader-head { display:flex; flex-direction:column; align-items:flex-start; gap:10px; padding-bottom:12px; }
.hisn-reader-head h3 { font-size:17px; color:var(--acc); line-height:1.7; }
.hisn-reader-head button, .hisn-dua-meta button { font-family:'Tajawal'; font-weight:700; color:var(--ink);
                  background:var(--card2); border:1px solid var(--line); border-radius:10px; padding:7px 12px; cursor:pointer; }
.hisn-dua { background:var(--card2); border:1px solid var(--line); border-radius:14px; padding:15px; margin-bottom:10px; }
.hisn-dua p { font-size:15.5px; line-height:2.15; }
.hisn-dua .hisn-dua-ref { font-size:11.5px; color:var(--mut); line-height:1.8; padding-top:8px; opacity:.85; }
.hisn-dua-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:12px;
                 color:var(--mut); font-size:12px; }
.hisn-dua-meta button { color:var(--acc); padding:5px 11px; }
.hisn-empty { color:var(--mut); font-size:14px; text-align:center; padding:28px 10px; }
.hisn-source { color:var(--mut); font-size:11.5px; text-align:center; line-height:1.7; padding:12px 5px 1px; opacity:.8; }
.hisn-source a { color:var(--acc); }

/* الاستماع */
.live { background:var(--card); border:1px solid var(--line); border-radius:20px; padding:17px; margin-bottom:10px; box-shadow:var(--shadow); }
.live .head { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.live .i h4 { font-size:15.5px; display:flex; align-items:center; gap:9px; }
.live .i p { color:var(--mut); font-size:12.5px; padding-top:3px; }
.live .play { background:linear-gradient(180deg,var(--acc),var(--acc2)); color:var(--onAcc); border:none; border-radius:13px;
              font-family:'Tajawal'; font-weight:800; font-size:14px; padding:11px 24px; cursor:pointer;
              min-width:96px; transition:.2s; box-shadow:0 8px 20px rgba(200,139,82,.30); }
.live .play:active { transform:scale(.94); }
.live .row { display:flex; gap:8px; padding-top:12px; }
.live select { flex:1; font-family:'Tajawal'; font-size:14px; background:var(--card2); color:var(--ink);
               border:1px solid var(--line); border-radius:10px; padding:10px; }
.live option { color:#222; }
.live audio { width:100%; margin-top:12px; display:none; accent-color:var(--acc); }
.live audio.show { display:block; }
/* موجات صوت حية عند التشغيل */
.eq { display:none; align-items:flex-end; gap:2.5px; height:15px; }
.eq.on { display:inline-flex; }
.eq i { width:3px; background:var(--acc); border-radius:2px; animation:eqb 1s ease-in-out infinite; }
.eq i:nth-child(1){height:6px} .eq i:nth-child(2){height:13px; animation-delay:.15s}
.eq i:nth-child(3){height:9px; animation-delay:.3s} .eq i:nth-child(4){height:12px; animation-delay:.45s}
@keyframes eqb { 0%,100%{transform:scaleY(.45)} 50%{transform:scaleY(1)} }

footer { margin-top:36px; text-align:center; border-top:1px solid var(--line); padding-top:24px; }
footer .cta-order { color:var(--mut); font-size:14px; line-height:1.9; }
footer .cta-order a { color:var(--acc); font-weight:700; text-decoration:none; border-bottom:1px solid var(--line); padding-bottom:2px; }
footer .tiny { color:var(--mut); font-size:12px; padding-top:15px; opacity:.75; }
footer .tiny b { font-family:'El Messiri'; color:var(--acc); font-weight:400; }
/* الإسناد واجب رخصةً فيظهر، وليس رسالةً للقارئ فيصغُر */
footer .credit { font-size:10.5px; padding-top:7px; opacity:.5; }
footer .credit a { color:inherit; }


/* أزرار الترويسة والباركود */
.hbtns { display:flex; gap:8px; }
.qr-overlay { position:fixed; inset:0; z-index:50; background:rgba(10,6,20,.72); backdrop-filter:blur(5px);
              display:flex; align-items:center; justify-content:center; padding:22px; }
/* سمة hidden لا تغلب display المصرّح — بلا هذه القاعدة يظهر أي عنصر مخفي بـflex قسراً
   (علة نافذة الباركود التي اكتشفها فهد 2026-07-16). عامة عمداً لتشمل كل عنصر جديد. */
[hidden] { display:none !important; }
.qr-card { background:#FFFDF8; color:#2A2033; border-radius:22px; padding:24px 22px; text-align:center;
           max-width:320px; width:100%; box-shadow:0 30px 80px rgba(0,0,0,.5); }
.qr-title { font-weight:800; font-size:17px; padding-bottom:14px; }
.qr-box { display:flex; justify-content:center; }
.qr-box img, .qr-box canvas { width:210px; height:210px; image-rendering:pixelated; border:1px solid #E8DFCE; border-radius:12px; padding:10px; background:#FFF; }
.qr-hint { color:#8A7C90; font-size:12.5px; padding:12px 0 2px; line-height:1.7; }
.qr-actions { display:flex; gap:8px; justify-content:center; padding-top:12px; }
.qr-actions button { font-family:'Tajawal'; font-weight:800; font-size:14px; border-radius:11px; padding:10px 20px;
                     cursor:pointer; border:1px solid #D9C9AE; background:none; color:#6B5B47; }
.qr-actions button:first-child { background:linear-gradient(180deg,#E8B478,#C88B52); color:#2A1706; border:none; }
