/* طبقة الحياة: ألوان الأقسام، الرسوم، الحركة */
:root {
  --tl-bg: 93%; --tl-sat: 62%; --tl-ink: 30%; --tl-line: 82%;
  --f-ruqaa: var(--f-ui);
  --danger: #c0573f;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --tl-bg: 19%; --tl-sat: 32%; --tl-ink: 78%; --tl-line: 30%; } }
:root[data-theme="dark"] { --tl-bg: 19%; --tl-sat: 32%; --tl-ink: 78%; --tl-line: 30%; }

body { background:
  radial-gradient(1200px 500px at 110% -10%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, #2f7d8f 8%, transparent), transparent 60%),
  var(--bg); background-attachment: fixed; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic { width: 16px; height: 16px; }

/* الشريط العلوي */
.date-chip { font-size: .8rem; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
@media (max-width: 1100px) { .date-chip { display: none; } }
.mega { min-width: min(760px, 92vw) !important; display: none; grid-template-columns: repeat(4, 1fr); gap: 4px 18px; padding: 16px !important; }
.more.open .mega { display: grid; animation: drop .22s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.mega h4 { margin: 4px 8px 6px; font-family: var(--f-display); font-weight: 500; color: var(--gold); font-size: .95rem; }
.mega-col { display: flex; flex-direction: column; }
.mega a { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .92rem; }
.mega a svg { width: 18px; height: 18px; color: var(--gold); flex: none; }
.mega a:hover { background: var(--surface-2); }
.mega a.on { color: var(--gold); }
@media (max-width: 900px) {
  .nav.open { max-height: calc(100vh - 70px); overflow: auto; }
  .mega { display: grid !important; grid-template-columns: 1fr 1fr; min-width: 0 !important; padding: 8px 0 !important; }
}
@media (max-width: 480px) { .mega { grid-template-columns: 1fr; } }

/* شريط الأذان */
.adhan-banner { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 61px); z-index: 18; background: linear-gradient(90deg, #0f6b4d, #13233f); color: #f1ead6; animation: drop .4s; }
.adhan-in { display: flex; align-items: center; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.adhan-in strong { font-family: var(--f-display); font-size: 1.15rem; flex: 1; }
.ab-icon { width: 26px; height: 26px; color: #d9b562; animation: ring 1s ease-in-out infinite; }
@keyframes ring { 0%,100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-14deg); } }
.adhan-banner .icon-btn { background: transparent; color: inherit; border-color: rgba(255,255,255,.3); }

/* البطل المتحرك */
.hero { background: radial-gradient(ellipse at 50% 0%, #22406f 0%, var(--lapis) 55%, #0a1426 100%); isolation: isolate; }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-rosette {
  position: absolute; z-index: -1; width: 620px; height: 620px; left: 50%; top: 50%; margin: -310px 0 0 -310px; opacity: .13;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23d9b562' stroke-width='.8'%3E%3Ccircle cx='100' cy='100' r='96'/%3E%3Ccircle cx='100' cy='100' r='60'/%3E%3Cg id='a'%3E%3Crect x='40' y='40' width='120' height='120'/%3E%3Crect x='40' y='40' width='120' height='120' transform='rotate(45 100 100)'/%3E%3C/g%3E%3Cuse href='%23a' transform='rotate(22.5 100 100)'/%3E%3Crect x='65' y='65' width='70' height='70' transform='rotate(11.25 100 100)'/%3E%3Crect x='65' y='65' width='70' height='70' transform='rotate(56.25 100 100)'/%3E%3C/g%3E%3C/svg%3E");
  animation: spin 160s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.crescent { position: absolute; top: 26px; inset-inline-end: max(24px, 8vw); width: 74px; height: 74px; z-index: -1; fill: #f3dc96; stroke: none; filter: drop-shadow(0 0 18px rgba(243,220,150,.55)); animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-4deg); } }
.hero-pattern { display: none; }
.hero-greet { margin: 0; font-family: var(--f-ruqaa); color: #d9b562; font-size: 1.25rem; }
.shimmer {
  background: linear-gradient(100deg, #f1ead6 30%, #ffe7a6 45%, #f1ead6 60%) 0 0 / 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 7s linear infinite;
}
@keyframes shine { to { background-position: -250% 0; } }
.hero-cards { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; margin-top: 1rem; width: min(720px, 100%); }
.h-date, .h-prayer {
  display: grid; gap: 2px; text-align: start; text-decoration: none; color: #f1ead6; padding: 14px 18px; border-radius: 16px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(217,181,98,.35); backdrop-filter: blur(6px); transition: transform .2s, background .2s;
}
.h-date:hover, .h-prayer:hover { transform: translateY(-3px); background: rgba(255,255,255,.1); }
.hd-label { font-size: .8rem; color: #d9b562; }
.h-date b { font-family: var(--f-display); font-size: 1.35rem; font-weight: 500; }
.h-prayer b { font-family: var(--f-display); font-size: 1.35rem; font-weight: 500; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.h-prayer .np-count { direction: ltr; letter-spacing: .04em; color: #ffe7a6; }
.hd-sub { font-size: .82rem; opacity: .8; }
.np-bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 6px; }
.np-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d9b562, #ffe7a6); transition: width 1s linear; }
@media (max-width: 620px) { .hero-cards { grid-template-columns: 1fr; } .crescent { width: 50px; height: 50px; } }

/* أقسام الرئيسية الملونة */
.home-sections { padding-bottom: 40px; }
.sec-title { font-family: var(--f-display); font-weight: 700; font-size: 1.6rem; margin: 6px 0 14px; display: flex; align-items: center; gap: 10px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)) !important; }
.tile { --h: 42; position: relative; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.tile.c1 { --h: 42; } .tile.c2 { --h: 158; } .tile.c3 { --h: 190; } .tile.c4 { --h: 222; } .tile.c5 { --h: 345; } .tile.c6 { --h: 268; }
.tile svg { width: 42px; height: 42px; padding: 9px; border-radius: 12px; margin-bottom: 6px; color: hsl(var(--h) var(--tl-sat) var(--tl-ink)); background: hsl(var(--h) var(--tl-sat) var(--tl-bg)); transition: transform .35s; }
.tile::after { content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%; inset-inline-end: -40px; bottom: -50px; background: hsl(var(--h) var(--tl-sat) var(--tl-bg)); opacity: .6; transition: transform .4s; z-index: -1; }
.tile { isolation: isolate; }
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: hsl(var(--h) 50% 55%); }
.tile:hover svg { transform: rotate(-8deg) scale(1.08); }
.tile:hover::after { transform: scale(1.5); }

/* دخول الصفحات */
.view.entering .card, .view.entering .tile, .view.entering .p-row, .view.entering .hisn-card, .view.entering .name-card, .view.entering .radio-card, .view.entering .tl-item {
  animation: rise .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0ms);
}
@keyframes rise { from { opacity: .25; transform: translateY(14px); } }
.page-h h2 { position: relative; display: inline-block; }
.page-h h2::after { content: ""; display: block; height: 3px; width: 60%; margin-top: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--gold), transparent); animation: grow .8s ease-out both; }
@keyframes grow { from { width: 0; } }
.card { transition: transform .25s, box-shadow .25s, border-color .25s; }
.btn { transition: transform .15s, filter .15s, background .2s, color .2s, border-color .2s; }
.btn:active { transform: scale(.96); }

/* مواقيت الصلاة */
.prayer-hero { background: linear-gradient(160deg, #0f1d36, #1d3a63 60%, #0f6b4d); color: #f1ead6; position: relative; overflow: hidden; }
.prayer-hero::before { content: ""; position: absolute; inset: 0; opacity: .08; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cg fill='none' stroke='%23d9b562'%3E%3Crect x='22' y='22' width='36' height='36'/%3E%3Crect x='22' y='22' width='36' height='36' transform='rotate(45 40 40)'/%3E%3C/g%3E%3C/svg%3E"); }
.prayer-hero .wrap { position: relative; padding-block: 28px 18px; }
.ph-top { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.ph-top h2 { font-family: var(--f-display); margin: 0; font-size: 2rem; }
.ph-top p { margin: 0; opacity: .75; font-size: .9rem; }
.ph-dates { display: grid; text-align: end; }
.ph-dates b { font-family: var(--f-display); font-weight: 500; color: #d9b562; font-size: 1.2rem; }
.ph-dates span { opacity: .75; font-size: .85rem; }
.ph-main { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; align-items: center; margin-top: 14px; }
.ph-next { display: grid; gap: 2px; }
.ph-label { opacity: .75; }
.ph-name { font-family: var(--f-ruqaa); font-size: 3rem; line-height: 1.3; color: #ffe7a6; }
.ph-count { font-family: var(--f-display); font-size: 2.6rem; direction: ltr; text-align: start; letter-spacing: .05em; }
.ph-sub { opacity: .85; }
.sun-arc { width: 100%; max-width: 520px; justify-self: center; overflow: visible; }
.arc-track { stroke: rgba(255,255,255,.18); stroke-width: 2; stroke-dasharray: 4 6; }
.arc-done { stroke: #d9b562; stroke-width: 3; transition: stroke-dashoffset 1s; }
.horizon { stroke: rgba(255,255,255,.25); }
.mark { fill: #13233f; stroke: #d9b562; stroke-width: 2; }
.mark-t { fill: #f1ead6; stroke: none; font-size: 12px; text-anchor: middle; font-family: var(--f-ui); }
.sun { fill: #ffd76a; stroke: none; filter: drop-shadow(0 0 10px #ffd76a); transition: cx 1s, cy 1s; }
.sun.night { fill: #e9ecff; filter: drop-shadow(0 0 8px #c9d2ff); }
@media (max-width: 760px) { .ph-main { grid-template-columns: 1fr; } .ph-name { font-size: 2.4rem; } .ph-count { font-size: 2.1rem; } }

.prayer-rows { display: grid; gap: 8px; margin-block: 20px 12px; }
.p-row {
  display: grid; grid-template-columns: 44px 1fr 1fr 1fr auto; gap: 12px; align-items: center;
  padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: transform .2s;
}
.p-row:hover { transform: translateX(-4px); }
.p-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); }
.p-ico svg { width: 22px; height: 22px; }
.p-name { font-family: var(--f-display); font-size: 1.25rem; font-weight: 500; }
.p-time { display: grid; }
.p-time small { color: var(--muted); font-size: .75rem; }
.p-time b { font-size: 1.15rem; font-weight: 600; }
.p-state { font-size: .8rem; color: var(--muted); min-width: 60px; text-align: center; }
.p-row.passed { opacity: .6; }
.p-row.next { border-color: var(--gold); background: linear-gradient(90deg, var(--gold-soft), var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.p-row.next .p-state { color: var(--gold); font-weight: 600; }
.p-row.current { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.p-row.current .p-state { color: var(--ok); font-weight: 700; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (max-width: 600px) {
  .p-row { grid-template-columns: 36px 1fr 1fr; grid-template-areas: "i n s" "i a q"; row-gap: 2px; }
  .p-ico { grid-area: i; width: 34px; height: 34px; } .p-name { grid-area: n; } .p-state { grid-area: s; text-align: end; }
  .p-time:nth-of-type(1) { grid-area: a; } .p-time:nth-of-type(2) { grid-area: q; }
}
.extra-times { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.extra-times span { background: var(--surface); border: 1px dashed var(--line); border-radius: 999px; padding: 4px 14px; font-size: .9rem; }
.extra-times small { color: var(--muted); }
.prayer-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.prayer-settings .card { display: grid; gap: 10px; align-content: start; }
@media (max-width: 760px) { .prayer-settings { grid-template-columns: 1fr; } }
.iqama-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.iq-in { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.iq-in input { width: 70px; }
.switch { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .92rem; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); position: relative; flex: none; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: inset-inline-start .2s, background .2s; }
.switch input:checked { background: var(--gold); border-color: var(--gold); }
.switch input:checked::after { inset-inline-start: 20px; background: var(--surface); }
.month-card { margin-bottom: 40px; }
.month-wrap { overflow-x: auto; }
table.month { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
.month th, .month td { padding: 7px 8px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.month th { color: var(--gold); font-weight: 600; position: sticky; top: 0; background: var(--surface); }
.month tr.today td { background: var(--gold-soft); font-weight: 700; }
.month small { color: var(--gold); }

/* القبلة */
.qibla-page { display: grid; justify-items: center; gap: 8px; padding-bottom: 50px; }
.big-compass { position: relative; width: min(340px, 86vw); aspect-ratio: 1; margin-block: 10px; }
.bc-dial {
  position: absolute; inset: 0; border-radius: 50%; transition: transform .4s ease-out;
  background: radial-gradient(circle, var(--surface) 55%, var(--surface-2) 56%, var(--surface-2) 70%, var(--surface) 71%);
  border: 2px solid var(--gold); box-shadow: var(--shadow), inset 0 0 40px color-mix(in srgb, var(--gold) 15%, transparent);
}
.bc-ticks { position: absolute; inset: 8px; border-radius: 50%; background: repeating-conic-gradient(var(--muted) 0 .6deg, transparent .6deg 10deg); mask: radial-gradient(circle, transparent 88%, #000 89%); -webkit-mask: radial-gradient(circle, transparent 88%, #000 89%); opacity: .6; }
.bc-dial > span { position: absolute; font-family: var(--f-display); font-size: 1.2rem; color: var(--muted); }
.bc-n { top: 22px; left: 50%; transform: translateX(-50%); color: var(--danger) !important; }
.bc-s { bottom: 22px; left: 50%; transform: translateX(-50%); }
.bc-e { right: 26px; top: 50%; transform: translateY(-50%); }
.bc-w { left: 26px; top: 50%; transform: translateY(-50%); }
.bc-needle { position: absolute; inset: 0; transition: transform 1s cubic-bezier(.2,.8,.2,1); }
.bc-needle::before { content: ""; position: absolute; left: 50%; top: 16%; width: 6px; height: 34%; margin-left: -3px; border-radius: 3px; background: linear-gradient(var(--gold), color-mix(in srgb, var(--gold) 30%, transparent)); }
.kaaba { position: absolute; left: 50%; top: 9%; width: 30px; height: 30px; margin-left: -15px; background: #111; border-radius: 4px; box-shadow: inset 0 7px 0 -2px #d9b562, 0 0 16px color-mix(in srgb, var(--gold) 60%, transparent); animation: glow 2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: inset 0 7px 0 -2px #d9b562, 0 0 28px var(--gold); } }
.bc-center { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: var(--ink); border: 3px solid var(--gold); }
.big-compass.aligned .bc-dial { border-color: var(--ok); box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok) 25%, transparent); }

/* التاريخ */
.dates-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dh-card { position: relative; overflow: hidden; border-radius: 20px; padding: 22px; color: #f7f1e1; display: grid; gap: 2px; text-align: center; }
.dh-card.hijri { background: linear-gradient(150deg, #0f6b4d, #0b3b2e); }
.dh-card.greg { background: linear-gradient(150deg, #22406f, #0f1d36); }
.dh-card::after { content: ""; position: absolute; width: 180px; height: 180px; inset-inline-end: -50px; top: -50px; border: 2px solid rgba(217,181,98,.3); transform: rotate(45deg); }
.dh-card span { font-size: .85rem; color: #d9b562; }
.dh-card b { font-family: var(--f-display); font-size: 4.5rem; line-height: 1.1; }
.dh-card strong { font-family: var(--f-ruqaa); font-size: 1.8rem; }
.dh-card em { font-style: normal; opacity: .8; }
.weekday { font-family: var(--f-display); font-size: 1.3rem; color: var(--gold); margin: 14px 0; }
.conv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-bottom: 40px; }
.conv { display: grid; gap: 10px; align-content: start; }
.conv input[type=date] { padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.conv-out { font-family: var(--f-display); font-size: 1.3rem; color: var(--gold); margin: 0; min-height: 1.6em; }
@media (max-width: 700px) { .dates-hero, .conv-grid { grid-template-columns: 1fr; } .dh-card b { font-size: 3.4rem; } }

/* المسبحة */
.tasbeeh { --t1: #d9b562; --t2: #8a6420; }
.t-opts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); cursor: pointer; background: radial-gradient(circle at 35% 30%, var(--c1), var(--c2)); box-shadow: 0 0 0 1px var(--line); transition: transform .2s; }
.swatch.big { width: 46px; height: 46px; border-radius: 12px; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 3px var(--gold); transform: scale(1.1); }
.bead { color: var(--ink); }
.bead .bead-prog { stroke: var(--t1); }
.bead .bead-count { color: var(--t2); }
:root[data-theme="dark"] .bead .bead-count { color: var(--t1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bead .bead-count { color: var(--t1); } }
.bead.pop { animation: pop .18s; }
@keyframes pop { 50% { transform: scale(.96); } }
.bead.pulse { animation: pulse2 .7s; }
@keyframes pulse2 { 50% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--t1) 30%, transparent); } }
.shape-beads { background: transparent !important; box-shadow: none !important; width: min(320px, 84vw); aspect-ratio: 220 / 240; border-radius: 0; }
.beads-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: none !important; }
.beads-svg .b { fill: var(--surface-2); stroke: var(--line); stroke-width: 1; transition: fill .25s; }
.beads-svg .b.on { fill: url(#none); fill: var(--t1); stroke: var(--t2); }
.beads-svg .b.last { animation: beadpop .35s; transform-box: fill-box; transform-origin: center; }
@keyframes beadpop { 50% { transform: scale(1.35); } }
.beads-svg .tassel { stroke: var(--t2); stroke-width: 3; }
.bead-inner { position: relative; display: grid; justify-items: center; gap: 2px; transform: translateY(-6%); }
.shape-digital { width: min(260px, 74vw); aspect-ratio: 3 / 4; border-radius: 40% 40% 32% 32% / 28% 28% 22% 22%; background: linear-gradient(160deg, var(--t1), var(--t2)) !important; display: grid; place-content: center; gap: 18px; padding: 20px; }
.lcd { display: grid; justify-items: center; background: #b9c9a8; color: #1d2a16; border-radius: 10px; padding: 12px 18px; box-shadow: inset 0 3px 8px rgba(0,0,0,.35); min-width: 170px; }
.lcd-phrase { font-size: .85rem; }
.lcd-num { font-family: "Courier New", monospace; font-size: 3rem; font-weight: 700; letter-spacing: .1em; direction: ltr; }
.lcd-t { font-size: .75rem; opacity: .75; }
.dig-btn { justify-self: center; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.45), rgba(0,0,0,.2)); box-shadow: 0 6px 14px rgba(0,0,0,.35), inset 0 -4px 8px rgba(0,0,0,.3); }
.shape-digital:active .dig-btn { transform: scale(.94); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.shape-pearl { background: transparent !important; box-shadow: none !important; }
.pearl-ball { position: absolute; inset: 6%; border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 4px; color: #fff;
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 6%, rgba(255,255,255,.25) 18%, transparent 40%), radial-gradient(circle at 50% 60%, var(--t1), var(--t2) 75%);
  box-shadow: 0 20px 40px color-mix(in srgb, var(--t2) 45%, transparent), inset 0 -18px 40px rgba(0,0,0,.25); }
.pearl-ball .bead-count { color: #fff !important; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.pearl-ball .bead-target { color: rgba(255,255,255,.85); }
.t-foot { flex-wrap: wrap; justify-content: center; }

/* الأسماء الحسنى */
.names-grid.flip { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.name-card { --h: 42; perspective: 900px; border: 0; padding: 0; background: none; height: 170px; cursor: pointer; }
.nc-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.name-card.flipped .nc-in { transform: rotateY(180deg); }
.nc-front, .nc-back { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 16px; display: grid; place-content: center; justify-items: center; gap: 4px; padding: 12px; text-align: center; border: 1px solid var(--line); }
.nc-front { background: radial-gradient(circle at 50% 0%, hsl(var(--h) var(--tl-sat) var(--tl-bg)), var(--surface) 70%); }
.nc-front small { position: absolute; top: 8px; inset-inline-start: 12px; color: hsl(var(--h) 45% 50%); font-size: .75rem; }
.nc-front b { font-family: var(--f-quran); font-weight: 400; font-size: 1.9rem; color: var(--ink); }
.nc-front em { font-style: normal; font-size: .72rem; color: var(--muted); opacity: 0; transition: opacity .2s; }
.name-card:hover .nc-front em { opacity: 1; }
.nc-back { transform: rotateY(180deg); background: linear-gradient(160deg, hsl(var(--h) 45% 30%), hsl(var(--h) 50% 18%)); color: #f7f1e1; border-color: transparent; }
.nc-back b { font-family: var(--f-quran); font-weight: 400; font-size: 1.3rem; color: #ffe7a6; }
.nc-back span { font-size: .9rem; line-height: 1.7; }

/* التفسير */
.tafsir-list { display: grid; gap: 12px; padding-bottom: 40px; }
.tf-row .quran-text { font-size: 1.6rem; }
.tf-row .tafsir { border-top: 1px dashed var(--line); padding-top: 8px; margin: 8px 0 0; }
.tf-row.flash { box-shadow: 0 0 0 3px var(--gold); }
.row-actions { display: flex; gap: 6px; margin-top: 6px; }
.skel-wrap { display: grid; gap: 12px; }
.skel { height: 90px; border-radius: 14px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%) 0 0 / 300% 100%; animation: skel 1.3s infinite; }
@keyframes skel { to { background-position: -300% 0; } }

/* القراء */
.letters .chip { padding: 3px 11px; }
.rc-layout { display: grid; grid-template-columns: 330px 1fr; gap: 16px; padding-bottom: 40px; align-items: start; }
.rc-list { display: grid; gap: 6px; max-height: 70vh; overflow: auto; padding-inline-end: 4px; }
.rc-item { display: flex; align-items: center; gap: 10px; text-align: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .2s, transform .2s; }
.rc-item:hover { transform: translateX(-3px); border-color: var(--gold); }
.rc-item.on { border-color: var(--gold); background: var(--gold-soft); }
.rc-item b { display: block; font-weight: 500; }
.rc-item small { color: var(--muted); }
.rc-avatar { --h: 42; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-display); font-size: 1.2rem; color: hsl(var(--h) var(--tl-sat) var(--tl-ink)); background: hsl(var(--h) var(--tl-sat) var(--tl-bg)); }
.rc-avatar.big { width: 64px; height: 64px; font-size: 1.8rem; }
.rc-panel { display: grid; gap: 12px; position: sticky; top: 80px; }
.rc-head { display: flex; gap: 12px; align-items: center; }
.rc-head h3 { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: 1.4rem; }
.rc-panel select { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.rc-panel .btn { justify-self: start; }
.rc-surahs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; max-height: 50vh; overflow: auto; }
.rc-s { display: flex; gap: 6px; align-items: center; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-family: var(--f-text); font-size: 1rem; text-align: start; }
.rc-s span { color: var(--gold); font-family: var(--f-ui); font-size: .78rem; }
.rc-s:hover { border-color: var(--gold); background: var(--gold-soft); }
@media (max-width: 760px) { .rc-layout { grid-template-columns: 1fr; } .rc-list { max-height: 40vh; } .rc-panel { position: static; } }

/* الراديو */
.radio-now { display: flex; align-items: center; gap: 16px; background: linear-gradient(120deg, var(--surface), var(--gold-soft)); }
.radio-now > div:nth-child(2) { flex: 1; display: grid; }
.radio-now strong { font-family: var(--f-display); font-size: 1.3rem; font-weight: 500; }
.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 34px; }
.eq i { width: 5px; height: 20%; border-radius: 2px; background: var(--gold); }
.radio-now.on .eq i, body.audio-on .player .eq i { animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s !important; } .eq i:nth-child(3) { animation-delay: -.6s !important; } .eq i:nth-child(4) { animation-delay: -.15s !important; } .eq i:nth-child(5) { animation-delay: -.45s !important; }
@keyframes eq { 0%,100% { height: 20%; } 50% { height: 100%; } }
.eq.small { height: 18px; } .eq.small i { width: 3px; background: var(--surface); }
.radio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding-bottom: 20px; }
.radio-card { --h: 200; position: relative; overflow: hidden; isolation: isolate; display: grid; gap: 6px; justify-items: start; text-align: start; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .2s, border-color .2s; }
.radio-card svg { width: 34px; height: 34px; padding: 6px; border-radius: 10px; color: hsl(var(--h) var(--tl-sat) var(--tl-ink)); background: hsl(var(--h) var(--tl-sat) var(--tl-bg)); }
.radio-card b { font-weight: 500; font-size: .95rem; }
.radio-card:hover { transform: translateY(-3px); border-color: hsl(var(--h) 50% 55%); }
.live-dot { font-size: .72rem; color: var(--danger); display: inline-flex; align-items: center; gap: 5px; }
.live-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: blink 1.2s infinite; }
.rc-wave { position: absolute; inset: auto -10% -40% auto; display: flex; gap: 4px; opacity: 0; transition: opacity .3s; z-index: -1; }
.radio-card.on { border-color: var(--gold); background: var(--gold-soft); }
.radio-card.on .rc-wave { opacity: 1; }
.rc-wave i { width: 60px; height: 60px; border-radius: 50%; border: 2px solid var(--gold); animation: ripple 2s infinite; }
.rc-wave i:nth-child(2) { animation-delay: .6s; } .rc-wave i:nth-child(3) { animation-delay: 1.2s; }
@keyframes ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.radio-grid.featured .radio-card { background: linear-gradient(150deg, hsl(var(--h) var(--tl-sat) var(--tl-bg)), var(--surface)); }

/* البطاقات */
.cards-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; padding-bottom: 40px; align-items: start; }
.cards-ctl { display: grid; gap: 12px; }
.cd-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.cd-pick select { flex: 1 1 140px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.cd-pick input { width: 80px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.cards-preview { display: grid; place-items: center; background: var(--surface-2); border-radius: 16px; padding: 16px; min-width: 0; }
.cards-preview canvas { max-width: 100%; max-height: 72vh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
@media (max-width: 800px) { .cards-layout { grid-template-columns: 1fr; } }

/* حصن المسلم */
.hisn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding-bottom: 40px; }
.hisn-card { --h: 160; display: grid; justify-items: start; gap: 4px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: start; transition: transform .2s, border-color .2s; }
.hisn-card:hover { transform: translateY(-3px); border-color: hsl(var(--h) 50% 55%); }
.hc-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: hsl(var(--h) var(--tl-sat) var(--tl-ink)); background: hsl(var(--h) var(--tl-sat) var(--tl-bg)); margin-bottom: 4px; }
.hc-ico svg { width: 24px; height: 24px; }
.hisn-card b { font-family: var(--f-display); font-weight: 500; font-size: 1.05rem; }
.hisn-card small { color: var(--muted); }
.d-src { display: block; font-size: .78rem; color: var(--muted); font-family: var(--f-ui); margin-top: 4px; }
#hisnDetail { padding-bottom: 40px; }

/* الفتاوى والخطب */
.fatwa-list, .khutba-list { display: grid; gap: 12px; }
.khutba-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.fatwa { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start; }
.fw-q { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-ruqaa); font-size: 1.5rem; color: var(--surface); background: linear-gradient(150deg, var(--gold), #8a6420); }
.fatwa h3, .khutba h3 { margin: 0 0 4px; font-family: var(--f-display); font-weight: 500; font-size: 1.15rem; }
.fatwa p { margin: 0; font-family: var(--f-text); font-size: 1.1rem; }
.khutba { display: grid; gap: 6px; align-content: start; position: relative; overflow: hidden; }
.kh-ico { position: absolute; inset-inline-end: -10px; top: -10px; width: 90px; height: 90px; color: var(--gold); opacity: .12; }
.kh-ico svg { width: 100%; height: 100%; }
.khutba p { margin: 0; font-size: .92rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-block: 18px 40px; }
.modal-body { font-family: var(--f-text); font-size: 1.2rem; line-height: 2; }
.modal-body p { margin: 0 0 .7em; }
.sheet { animation: sheetUp .3s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } }

/* الموسوعة */
.timeline { list-style: none; padding: 0 0 40px; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; top: 0; bottom: 40px; inset-inline-start: 50%; width: 2px; background: linear-gradient(var(--gold), var(--line)); }
.tl-era { --h: 40; position: relative; text-align: center; margin: 24px 0 14px; }
.tl-era span { display: inline-block; position: relative; font-family: var(--f-display); padding: 6px 18px; border-radius: 999px; color: hsl(var(--h) var(--tl-sat) var(--tl-ink)); background: hsl(var(--h) var(--tl-sat) var(--tl-bg)); border: 1px solid hsl(var(--h) 40% var(--tl-line)); }
.tl-item { --h: 40; position: relative; width: 50%; padding-inline-end: 34px; margin-bottom: 14px; }
.tl-item:nth-child(even of .tl-item) { margin-inline-start: 50%; padding-inline-end: 0; padding-inline-start: 34px; }
.tl-dot { position: absolute; top: 22px; inset-inline-end: -8px; width: 16px; height: 16px; border-radius: 50%; background: hsl(var(--h) 55% 50%); box-shadow: 0 0 0 4px var(--bg); }
.tl-item:nth-child(even of .tl-item) .tl-dot { inset-inline-end: auto; inset-inline-start: -8px; }
.tl-card { border-top: 3px solid hsl(var(--h) 55% 50%); }
.tl-card:hover { transform: translateY(-3px); }
.tl-date b { color: hsl(var(--h) 50% 45%); font-family: var(--f-display); font-size: 1.1rem; }
.tl-date small { color: var(--muted); }
.tl-card h3 { margin: 2px 0 4px; font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; }
.tl-card p { margin: 0; font-family: var(--f-text); font-size: 1.08rem; line-height: 1.9; }
@media (max-width: 760px) {
  .timeline::before { inset-inline-start: 10px; }
  .tl-item, .tl-item:nth-child(even of .tl-item) { width: auto; margin-inline-start: 0; padding-inline-start: 32px; padding-inline-end: 0; }
  .tl-dot, .tl-item:nth-child(even of .tl-item) .tl-dot { inset-inline-start: 3px; inset-inline-end: auto; }
}

/* المشغل والتذييل */
.player-in { padding-inline: 14px 8px; }
.foot { background: var(--lapis); color: #cfd6e4; border: 0; }
.foot-in { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; align-items: center; }
.foot-brand { font-family: var(--f-display); font-size: 1.4rem; color: #d9b562; }
.foot p { margin: 4px 0 0; font-family: var(--f-text); font-size: 1.1rem; }
.foot p.small { font-family: var(--f-ui); font-size: .8rem; opacity: .75; }
@media (max-width: 700px) { .foot-in { grid-template-columns: 1fr; } }
