/* ==========================================================
   صلاتي — التصميم
   ========================================================== */
:root {
  --f-display: 'Kufam', serif;
  --f-quran: 'Scheherazade New', 'Amiri', serif;
  --f-ui: 'Readex Pro', system-ui, sans-serif;
  --f-kufi: 'Readex Pro', system-ui, sans-serif;
  --zikr-scale: 1;

  --bg: #08121f;
  --bg-2: #0c1b2d;
  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --surface-solid: #102338;
  --line: rgba(217, 180, 90, .18);
  --line-strong: rgba(217, 180, 90, .42);
  --text: #f1e8d4;
  --muted: #a3afbf;
  --gold: #d9b45a;
  --gold-2: #f3d58a;
  --gold-ink: #2a1d05;
  --emerald: #2aa184;
  --emerald-soft: rgba(42, 161, 132, .16);
  --pattern-opacity: .07;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, .65);
  --card-bg: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  --zikr-bg: linear-gradient(165deg, #12263c 0%, #0e1f33 100%);

  --radius: 22px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6efe0;
  --bg-2: #efe4cc;
  --surface: rgba(255, 252, 244, .75);
  --surface-2: #fffaf0;
  --surface-solid: #fffaf0;
  --line: rgba(150, 105, 30, .2);
  --line-strong: rgba(150, 105, 30, .45);
  --text: #1b2833;
  --muted: #5e6a72;
  --gold: #a5741a;
  --gold-2: #c8952f;
  --gold-ink: #fffaf0;
  --emerald: #0f7a62;
  --emerald-soft: rgba(15, 122, 98, .1);
  --pattern-opacity: .09;
  --shadow: 0 18px 40px -22px rgba(80, 55, 10, .35);
  --card-bg: linear-gradient(160deg, #fffdf7, #fbf3e2);
  --zikr-bg: linear-gradient(165deg, #fffdf6 0%, #f9efd9 100%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.motion-off { scroll-behavior: auto; }
body {
  margin: 0;
  font-family: var(--f-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color .6s var(--ease), color .6s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
[hidden] { display: none !important; }

/* زخرفة نجمية ثمانية في الخلفية */
.bg-pattern {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--gold);
  opacity: var(--pattern-opacity);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M60 18l12.4 17.6L93.6 31.6l-4 21.2L107 60l-17.4 12.4 4 21.2-21.2-4L60 107l-12.4-17.4-21.2 4 4-21.2L13 60l17.4-12.4-4-21.2 21.2 4z'/%3E%3Cpath d='M60 36l7 10 12-2.4-2.4 12L87 60l-10.4 7 2.4 12-12-2.4L60 87l-7-10.4-12 2.4 2.4-12L33 60l10.4-7-2.4-12 12 2.4z'/%3E%3Cpath d='M0 0l26 26M120 0L94 26M0 120l26-26M120 120l-26-26'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 120px 120px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23000' stroke-width='1'%3E%3Cpath d='M60 18l12.4 17.6L93.6 31.6l-4 21.2L107 60l-17.4 12.4 4 21.2-21.2-4L60 107l-12.4-17.4-21.2 4 4-21.2L13 60l17.4-12.4-4-21.2 21.2 4z'/%3E%3Cpath d='M60 36l7 10 12-2.4-2.4 12L87 60l-10.4 7 2.4 12-12-2.4L60 87l-7-10.4-12 2.4 2.4-12L33 60l10.4-7-2.4-12 12 2.4z'/%3E%3Cpath d='M0 0l26 26M120 0L94 26M0 120l26-26M120 120l-26-26'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 120px 120px;
}

/* ================= الشريط العلوي ================= */
.topbar {
  position: fixed; inset-inline: 0; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  padding-top: max(14px, env(safe-area-inset-top));
  transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
  color: #f1e8d4;
}
.topbar.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
          backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 1px 0 var(--line);
  color: var(--text);
  padding-block: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand span { font-family: var(--f-display); font-size: 1.75rem; line-height: 1; }
.brand-mark { width: 34px; height: 34px; color: var(--gold-2); animation: spin 40s linear infinite; }
.nav { display: flex; gap: 4px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 4px; }
.topbar.scrolled .nav { background: var(--surface); border-color: var(--line); }
.nav a {
  color: inherit; text-decoration: none; font-size: .92rem; font-weight: 500;
  padding: 6px 16px; border-radius: 999px; transition: background .3s, color .3s;
}
.nav a:hover, .nav a.active { background: var(--gold); color: var(--gold-ink); }
.top-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  transition: transform .3s var(--spring), background .3s;
}
.topbar.scrolled .icon-btn, .drawer .icon-btn, .modal .icon-btn, .month-bar .icon-btn { background: var(--surface); border-color: var(--line); }
.icon-btn:hover { transform: rotate(-12deg) scale(1.08); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ================= البطل ================= */
.hero {
  position: relative; min-height: 100svh; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden; color: #f6eedc; isolation: isolate;
  padding: 110px 16px 250px;
}
@supports (min-height: 100svh) { .hero { min-height: 100svh; } }
.sky { position: absolute; inset: 0; z-index: -2; }
.sky-grad { position: absolute; inset: 0; transition: background 2s ease; }
.hero[data-phase="night"] .sky-grad { background: radial-gradient(120% 80% at 70% 0%, #1b2f55 0%, #0b1730 45%, #050b18 100%); }
.hero[data-phase="fajr"]  .sky-grad { background: linear-gradient(180deg, #1a2350 0%, #4a3a78 45%, #c9737a 80%, #f0b27a 100%); }
.hero[data-phase="day"]   .sky-grad { background: linear-gradient(180deg, #2f78b8 0%, #5ea3d6 50%, #a9d3ec 100%); }
.hero[data-phase="asr"]   .sky-grad { background: linear-gradient(180deg, #3a6fa0 0%, #8fb4c9 45%, #f0cf8f 100%); }
.hero[data-phase="maghrib"] .sky-grad { background: linear-gradient(180deg, #23214f 0%, #6b3a6e 40%, #d4624a 75%, #f2a65a 100%); }
.hero[data-phase="isha"]  .sky-grad { background: linear-gradient(180deg, #0a1430 0%, #1d2350 60%, #3a2f5e 100%); }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 2s ease; }
.hero[data-phase="day"] #stars, .hero[data-phase="asr"] #stars { opacity: 0; }
.hero[data-phase="fajr"] #stars, .hero[data-phase="maghrib"] #stars { opacity: .45; }

.celestial { position: absolute; width: 0; height: 0; left: 50%; top: 50%; transition: left 1.5s var(--ease), top 1.5s var(--ease); }
.orb {
  position: absolute; width: 90px; height: 90px; margin: -45px 0 0 -45px; border-radius: 50%;
  transition: all 1.5s ease;
}
.celestial.sun .orb {
  background: radial-gradient(circle, #fffbe8 0 30%, #ffe39a 45%, rgba(255,214,120,.35) 62%, transparent 72%);
  width: 160px; height: 160px; margin: -80px 0 0 -80px;
  animation: pulse 6s ease-in-out infinite;
}
.celestial.moon .orb {
  background: transparent;
  box-shadow: inset -20px 8px 0 0 #f6e7b8;
  filter: drop-shadow(0 0 22px rgba(246, 231, 184, .55));
  animation: float 7s ease-in-out infinite;
}
.clouds { position: absolute; bottom: 160px; left: 0; width: 200%; height: 120px; fill: rgba(255,255,255,.07); animation: drift 60s linear infinite; }

.hero-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; will-change: transform; }
.location-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-weight: 500; transition: background .3s, transform .3s var(--spring);
}
.location-chip:hover { background: rgba(255,255,255,.18); transform: translateY(-2px); }
.location-chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.location-chip .chev { width: 14px; height: 14px; opacity: .7; }
.dates { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; font-size: .98rem; opacity: .92; }
.dates .hijri { font-family: var(--f-quran); font-size: 1.15rem; font-weight: 700; color: var(--gold-2); }
.dates .dot { color: var(--gold-2); opacity: .7; }

.next-wrap { position: relative; width: min(78vw, 340px); aspect-ratio: 1; margin-top: 6px; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: rgba(5, 10, 25, .28); stroke: rgba(255,255,255,.14); stroke-width: 6; }
.ring-fill {
  fill: none; stroke: url(#ringGrad); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 628.3; stroke-dashoffset: 628.3;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 8px rgba(243, 213, 138, .6));
}
.ring-ticks line { stroke: rgba(255,255,255,.35); stroke-width: 1.4; }
.ring-ticks line.major { stroke: var(--gold-2); stroke-width: 2.2; }
.next-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.next-label { font-size: .88rem; letter-spacing: .02em; opacity: .85; }
.next-name {
  margin: 0; font-family: var(--f-display); font-weight: 700;
  font-size: clamp(3rem, 13vw, 4.6rem); line-height: 1.15;
  background: linear-gradient(180deg, #fff8e2, #f3d58a 60%, #c99a3b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0,0,0,.35));
}
.countdown { font-family: var(--f-kufi); font-variant-numeric: tabular-nums; font-size: clamp(1.7rem, 7vw, 2.3rem); font-weight: 700; letter-spacing: .04em; direction: ltr; font-variant-numeric: tabular-nums; }
.countdown .sep { opacity: .5; animation: blink 1s steps(1) infinite; }
.next-at { font-size: .92rem; opacity: .85; }
.clock { font-family: var(--f-kufi); font-variant-numeric: tabular-nums; font-size: 1.05rem; opacity: .85; padding: 4px 14px; border-radius: 999px; background: rgba(0,0,0,.18); }

.mosque { position: absolute; bottom: -1px; left: 0; width: 100%; height: 240px; z-index: 1; pointer-events: none; }
.m-top { stop-color: #0c1a2d; }
.m-bot { stop-color: var(--bg); }
.hero[data-phase="day"] .m-top, .hero[data-phase="asr"] .m-top { stop-color: #20405c; }
.windows { fill: #f6c86a; opacity: .0; transition: opacity 2s; }
.hero[data-phase="night"] .windows, .hero[data-phase="isha"] .windows, .hero[data-phase="maghrib"] .windows, .hero[data-phase="fajr"] .windows { opacity: .85; animation: flicker 5s ease-in-out infinite; }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 3; width: 28px; height: 46px; border: 2px solid rgba(255,255,255,.45); border-radius: 16px; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 4px; height: 9px; margin-left: -2px; border-radius: 2px; background: var(--gold-2); animation: cue 1.8s var(--ease) infinite; }

/* ================= الأقسام ================= */
.section { width: min(1180px, 100%); margin: 0 auto; padding: 90px 16px 40px; }
.section-head { text-align: center; margin-bottom: 44px; }
.kicker { display: inline-block; font-family: var(--f-kufi); font-variant-numeric: tabular-nums; color: var(--gold); font-size: .95rem; letter-spacing: .04em; margin-bottom: 6px; }
.section-head h2 { margin: 0; font-family: var(--f-quran); font-weight: 700; font-size: clamp(1.45rem, 4.2vw, 2.3rem); line-height: 1.7; }
.section-head h2.display { font-family: var(--f-display); font-size: clamp(2.2rem, 7vw, 3.4rem); line-height: 1.3; }
.ornament { width: 220px; height: 22px; margin: 14px auto 0; color: var(--gold); }

/* تنبيه التفعيل */
.enable-banner {
  width: min(1148px, calc(100% - 32px)); margin: -60px auto 0; position: relative; z-index: 5;
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.eb-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--emerald-soft); color: var(--emerald); }
.eb-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; animation: ring-bell 3s ease-in-out infinite; transform-origin: 50% 10%; }
.eb-text { flex: 1; display: flex; flex-direction: column; }
.eb-text span { color: var(--muted); font-size: .92rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 14px; border: 1px solid transparent; font-weight: 600;
  transition: transform .3s var(--spring), box-shadow .3s, background .3s;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.btn:active { transform: scale(.95); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: var(--gold-ink); box-shadow: 0 8px 22px -10px var(--gold); }
:root[data-theme="light"] .btn-gold { color: #fffaf0; }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -10px var(--gold); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn.wide { width: 100%; }
.link-btn { background: none; border: 0; color: var(--gold); font-weight: 500; padding: 0; text-decoration: underline; text-underline-offset: 4px; }

/* ================= بطاقات الصلوات ================= */
.prayer-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.p-card {
  position: relative; overflow: hidden;
  padding: 22px 16px 18px; border-radius: var(--radius);
  background: var(--card-bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  transition: transform .5s var(--spring), border-color .4s, box-shadow .4s, opacity .4s;
}
.p-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.p-card .p-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--emerald-soft); color: var(--emerald); margin-bottom: 4px; transition: transform .6s var(--spring); }
.p-card:hover .p-icon { transform: rotate(-14deg) scale(1.08); }
.p-card .p-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.p-card .p-name { font-family: var(--f-display); font-size: 1.6rem; line-height: 1.3; }
.p-card .p-time { font-family: var(--f-kufi); font-variant-numeric: tabular-nums; font-size: 1.65rem; font-weight: 700; color: var(--gold); line-height: 1.2; }
.p-card .p-time small { font-size: .8rem; font-weight: 500; color: var(--muted); margin-inline-start: 4px; }
.p-card .p-left { font-size: .82rem; color: var(--muted); min-height: 1.4em; }
.p-card .bell {
  position: absolute; top: 10px; inset-inline-start: 10px;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; display: grid; place-items: center; color: var(--muted);
  transition: color .3s, background .3s, transform .3s var(--spring);
}
.p-card .bell svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.p-card .bell.on { color: var(--gold); border-color: var(--line-strong); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.p-card .bell.on svg { fill: currentColor; fill-opacity: .25; }
.p-card .bell:active { transform: scale(.85) rotate(-15deg); }
.p-card .bell .slash { display: none; }
.p-card .bell:not(.on) .slash { display: block; }
.p-card.passed { opacity: .62; }
.p-card.passed:hover { opacity: 1; }
.p-card.current {
  border-color: var(--gold); opacity: 1;
  background: linear-gradient(165deg, color-mix(in srgb, var(--gold) 22%, transparent), color-mix(in srgb, var(--gold) 4%, transparent));
  box-shadow: 0 0 0 1px var(--gold), 0 18px 40px -18px var(--gold);
}
.p-card.current .p-icon { background: var(--gold); color: var(--gold-ink); }
:root[data-theme="light"] .p-card.current .p-icon { color: #fffaf0; }
.p-card .badge {
  position: absolute; top: 12px; inset-inline-end: 12px;
  font-size: .72rem; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: var(--gold); color: var(--gold-ink);
}
:root[data-theme="light"] .p-card .badge { color: #fffaf0; }
.p-card.next .badge { background: var(--emerald); color: #fff; }
.p-card.current::after {
  content: ""; position: absolute; inset: -40%; z-index: -1;
  background: conic-gradient(from 0deg, transparent 0 70%, color-mix(in srgb, var(--gold) 35%, transparent) 85%, transparent 100%);
  animation: spin 6s linear infinite;
}
.p-card.current { isolation: isolate; }
.p-card.current::before { content: ""; position: absolute; inset: 1px; border-radius: calc(var(--radius) - 1px); background: var(--surface-solid); z-index: -1; opacity: .92; }

/* مسار الشمس */
.sunpath { margin-top: 26px; padding: 22px 22px 10px; border-radius: var(--radius); background: var(--card-bg); border: 1px solid var(--line); }
.sp-head { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: space-between; align-items: baseline; font-family: var(--f-display); font-size: 1.4rem; }
.sp-meta { font-family: var(--f-ui); font-size: .88rem; color: var(--muted); }
.sp-svg { width: 100%; height: auto; overflow: visible; }
.sp-horizon { stroke: var(--line-strong); stroke-dasharray: 4 6; }
.sp-arc { fill: none; stroke: var(--line); stroke-width: 3; stroke-dasharray: 2 8; stroke-linecap: round; }
.sp-arc-done { fill: none; stroke: url(#arcGrad); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset 1.6s var(--ease); }
.sp-mark circle { fill: var(--bg); stroke: var(--gold); stroke-width: 2.5; }
.sp-mark.passed circle { fill: var(--gold); }
.sp-mark text { fill: var(--text); font-family: var(--f-display); font-size: 21px; text-anchor: middle; }
.sp-mark text.t { fill: var(--muted); font-family: var(--f-kufi); font-variant-numeric: tabular-nums; font-size: 15px; }
#spSun, #spSunCore { transition: cx 1.6s var(--ease), cy 1.6s var(--ease); }

/* ================= الأذكار ================= */
.azkar-bar {
  position: sticky; top: 72px; z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line);
}
.tabs { position: relative; display: flex; background: var(--surface); border-radius: 14px; padding: 4px; border: 1px solid var(--line); }
.tab {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 8px;
  border: 0; background: none; padding: 9px 22px; border-radius: 11px; font-weight: 600; font-size: 1rem;
  transition: color .35s;
}
.tab svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tab.active { color: var(--gold-ink); }
:root[data-theme="light"] .tab.active { color: #fffaf0; }
.tab-ink { position: absolute; top: 4px; bottom: 4px; border-radius: 11px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); transition: left .5s var(--spring), width .5s var(--spring); }
.progress { flex: 1; min-width: 200px; }
.progress-text { display: flex; justify-content: space-between; font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.progress-text span { font-family: var(--f-kufi); font-variant-numeric: tabular-nums; }
.progress-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--emerald), var(--gold-2)); transition: width .8s var(--ease); }
.azkar-hint { text-align: center; color: var(--muted); font-size: .92rem; margin: 18px 0 22px; }

.azkar-list { display: grid; gap: 16px; }
.zikr {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--zikr-bg);
  padding: 26px clamp(18px, 4vw, 34px) 20px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .45s var(--spring), border-color .4s, box-shadow .4s, opacity .5s;
  touch-action: manipulation;
}
.zikr::before { /* زخرفة الزاوية */
  content: ""; position: absolute; top: -40px; inset-inline-start: -40px; width: 140px; height: 140px; z-index: -1;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 16%, transparent), transparent 70%);
}
.zikr:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.zikr:active { transform: scale(.985); }
.zikr.bump { animation: bump .35s var(--spring); }
.zikr-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.zikr-num { font-family: var(--f-kufi); font-variant-numeric: tabular-nums; font-size: .85rem; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--gold); }
.zikr-title { font-family: var(--f-display); font-size: 1.25rem; color: var(--gold); }
.zikr-tag { margin-inline-start: auto; font-size: .78rem; color: var(--muted); padding: 2px 10px; border-radius: 99px; background: var(--surface-2); }
.zikr-pre { font-family: var(--f-quran); color: var(--muted); font-size: 1.05rem; margin: 0 0 4px; }
.zikr-text { font-family: var(--f-quran); font-size: clamp(1.3rem, 3.4vw, 1.6rem); line-height: 2.15; margin: 0; }
.zikr.quran .zikr-text { font-size: clamp(1.4rem, 3.6vw, 1.75rem); }
.zikr-foot { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.zikr-virtue { flex: 1; font-size: .88rem; color: var(--muted); margin: 0; }
.counter { position: relative; flex: none; width: 64px; height: 64px; }
.counter svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.counter .c-track { fill: none; stroke: var(--surface-2); stroke-width: 5; }
.counter .c-fill { fill: none; stroke: var(--emerald); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 169.6; stroke-dashoffset: 169.6; transition: stroke-dashoffset .5s var(--ease); }
.counter .c-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-kufi); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.15rem; transition: transform .3s var(--spring), opacity .3s; }
.counter .c-check { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: transform .5s var(--spring), opacity .3s; }
.counter .c-check svg { width: 30px; height: 30px; transform: none; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.counter .c-check path { stroke-dasharray: 30; stroke-dashoffset: 30; transition: stroke-dashoffset .5s .15s var(--ease); }
.zikr.done { border-color: color-mix(in srgb, var(--emerald) 55%, transparent); opacity: .72; }
.zikr.done:hover { opacity: 1; }
.zikr.done .counter .c-num { opacity: 0; transform: scale(.4); }
.zikr.done .counter .c-check { opacity: 1; transform: scale(1); }
.zikr.done .counter .c-check path { stroke-dashoffset: 0; }
.zikr.done .counter::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--emerald); animation: pop .5s var(--spring); }
.zikr.done .zikr-num { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; background: color-mix(in srgb, var(--gold) 30%, transparent); transform: scale(0); animation: ripple .7s var(--ease) forwards; }
.spark { position: absolute; width: 8px; height: 8px; pointer-events: none; color: var(--gold-2); }

.az-done { text-align: center; margin-top: 30px; padding: 34px 20px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--card-bg); }
.az-done svg { width: 72px; height: 72px; margin: 0 auto 8px; color: var(--gold); animation: spin 18s linear infinite; }
.az-done h3 { margin: 0; font-family: var(--f-display); font-size: 2.2rem; color: var(--gold); }
.az-done p { margin: 4px 0 0; color: var(--muted); }
.az-done.show { animation: rise .9s var(--spring); }

/* ================= جدول الشهر ================= */
.month-bar { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 18px; }
.month-bar strong { font-family: var(--f-display); font-size: 1.6rem; min-width: 220px; text-align: center; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card-bg); -webkit-overflow-scrolling: touch; }
.month-table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .95rem; }
.month-table th { position: sticky; top: 0; background: var(--surface-solid); font-family: var(--f-display); font-weight: 400; font-size: 1.15rem; color: var(--gold); padding: 12px 8px; border-bottom: 1px solid var(--line-strong); }
.month-table td { text-align: center; padding: 9px 8px; border-bottom: 1px solid var(--line); font-family: var(--f-kufi); font-variant-numeric: tabular-nums; }
.month-table td:first-child { font-family: var(--f-ui); text-align: start; padding-inline-start: 18px; white-space: nowrap; }
.month-table td:first-child small { color: var(--muted); display: block; font-size: .78rem; }
.month-table tr:hover td { background: var(--surface); }
.month-table tr.today td { background: color-mix(in srgb, var(--gold) 16%, transparent); font-weight: 700; }
.month-table tr.friday td:first-child { color: var(--emerald); }

/* ================= القبلة ================= */
.qibla-wrap { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: center; padding: 30px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card-bg); }
.compass { position: relative; width: min(300px, 72vw); aspect-ratio: 1; }
.compass-dial {
  position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-conic-gradient(from 0deg, var(--line-strong) 0 .6deg, transparent .6deg 10deg),
    radial-gradient(circle, var(--surface-solid) 58%, var(--bg-2) 59%, var(--bg-2) 70%, var(--surface-solid) 71%);
  border: 2px solid var(--line-strong);
  box-shadow: inset 0 0 40px rgba(0,0,0,.25), var(--shadow);
  transition: transform .4s ease-out;
}
.cd { position: absolute; font-family: var(--f-display); font-size: 1.3rem; color: var(--muted); }
.cd.n { top: 6%; left: 50%; transform: translateX(-50%); color: var(--gold); }
.cd.s { bottom: 6%; left: 50%; transform: translateX(-50%); }
.cd.e { right: 7%; top: 50%; transform: translateY(-50%); }
.cd.w { left: 7%; top: 50%; transform: translateY(-50%); }
.qibla-needle { position: absolute; inset: 0; transition: transform 1.4s var(--spring); }
.qibla-needle > svg:first-child { position: absolute; left: 50%; top: 14%; width: 26px; height: 72%; margin-left: -13px; }
.needle-head { fill: var(--gold); }
.needle-tail { fill: var(--line-strong); }
.kaaba { position: absolute; top: 3%; left: 50%; width: 30px; height: 30px; margin-left: -15px; }
.kaaba rect { fill: #111; stroke: var(--gold); stroke-width: 1; }
.kaaba .band { fill: var(--gold); stroke: none; }
.compass-center { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px var(--surface-solid); }
.qibla-info { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.qi-big { display: flex; align-items: baseline; gap: 10px; }
.qi-big span { font-family: var(--f-kufi); font-variant-numeric: tabular-nums; font-size: 3.4rem; font-weight: 700; color: var(--gold); line-height: 1; }
.qi-big small { color: var(--muted); }
.qi-row { display: flex; gap: 10px; color: var(--muted); }
.qi-row strong { color: var(--text); font-family: var(--f-kufi); font-variant-numeric: tabular-nums; }
.qi-note { color: var(--muted); font-size: .88rem; margin: 0; }

/* ================= التذييل ================= */
.footer { text-align: center; padding: 50px 16px calc(40px + env(safe-area-inset-bottom)); color: var(--muted); }
.footer .ornament { margin-bottom: 10px; }
.footer-verse { font-family: var(--f-quran); font-size: 1.6rem; color: var(--text); margin: 0; }
.footer-meta { font-size: .85rem; }

/* ================= الدرج والنوافذ ================= */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(3, 8, 16, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: fade .3s ease; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 70;
  width: min(420px, 100%); background: var(--bg); border-inline-end: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .55s var(--ease);
  box-shadow: var(--shadow);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; padding-top: max(18px, env(safe-area-inset-top)); }
.drawer-head h3 { margin: 0; font-family: var(--f-display); font-size: 1.8rem; color: var(--gold); }
.drawer-body { overflow-y: auto; padding: 0 20px 40px; }
.group { border: 1px solid var(--line); border-radius: 18px; padding: 8px 16px 14px; margin: 0 0 16px; background: var(--surface); }
.group legend { font-family: var(--f-kufi); font-variant-numeric: tabular-nums; color: var(--gold); padding: 0 8px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: .92rem; color: var(--muted); }
.field select, .field input[type="file"], .search {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface-2); color: var(--text); font-size: .98rem;
}
.field select option { background: var(--surface-solid); color: var(--text); }
.field input[type="range"] { accent-color: var(--gold); }
.row-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--muted); }
.row-btn strong { color: var(--text); }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.switch { display: flex; align-items: center; gap: 12px; margin-top: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .sw { flex: none; position: relative; width: 46px; height: 26px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line-strong); transition: background .3s; }
.switch .sw::after { content: ""; position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .35s var(--spring), background .3s; }
.switch input:checked + .sw { background: var(--emerald); border-color: var(--emerald); }
.switch input:checked + .sw::after { transform: translateX(-20px); background: #fff; }
.switch input:focus-visible + .sw { outline: 2px solid var(--gold); outline-offset: 2px; }
.offsets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.offset { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.offset span { font-family: var(--f-display); font-size: 1.1rem; }
.offset .ctl { display: flex; align-items: center; gap: 4px; }
.offset button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; line-height: 1; }
.offset output { min-width: 26px; text-align: center; font-family: var(--f-kufi); font-variant-numeric: tabular-nums; }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(3, 8, 16, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .3s ease; }
.modal-card { width: min(480px, 100%); max-height: min(680px, 88vh); display: flex; flex-direction: column; gap: 12px; padding: 0 18px 18px; border-radius: 26px; background: var(--bg); border: 1px solid var(--line-strong); box-shadow: var(--shadow); animation: rise .5s var(--spring); }
.modal-card .drawer-head { padding-inline: 0; }
.city-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.city-list li button { width: 100%; display: flex; justify-content: space-between; padding: 12px 14px; border: 0; border-radius: 12px; background: none; text-align: start; transition: background .2s; }
.city-list li button:hover, .city-list li button.sel { background: var(--surface-2); }
.city-list li button small { color: var(--muted); }
.city-list .grp { font-family: var(--f-kufi); font-variant-numeric: tabular-nums; color: var(--gold); font-size: .85rem; padding: 12px 14px 4px; }

/* ================= شاشة الأذان ================= */
.adhan-overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(circle at 50% 40%, #1b3352 0%, #08121f 70%);
  color: #f6eedc; text-align: center; animation: fade .6s ease;
}
.ao-rings span { position: absolute; left: 50%; top: 40%; width: 220px; height: 220px; margin: -110px; border-radius: 50%; border: 1px solid rgba(243, 213, 138, .5); animation: wave 4s var(--ease) infinite; }
.ao-rings span:nth-child(2) { animation-delay: 1.3s; }
.ao-rings span:nth-child(3) { animation-delay: 2.6s; }
.ao-content { position: relative; max-width: 620px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ao-star { width: 90px; height: 90px; color: var(--gold-2); animation: spin 20s linear infinite; }
.ao-kicker { font-family: var(--f-kufi); font-variant-numeric: tabular-nums; color: #f3d58a; }
.ao-title { margin: 0; font-family: var(--f-display); font-size: clamp(3rem, 12vw, 5.5rem); line-height: 1.25; background: linear-gradient(180deg, #fff8e2, #f3d58a 60%, #c99a3b); -webkit-background-clip: text; background-clip: text; color: transparent; animation: rise 1s var(--spring); }
.ao-sub { margin: 0; opacity: .8; }
.ao-dua { font-family: var(--f-quran); font-size: 1.25rem; line-height: 2; opacity: .9; margin: 16px 0 20px; }

/* ================= إشعار صغير ================= */
.toast {
  position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; z-index: 120;
  transform: translate(-50%, 140%); padding: 12px 22px; border-radius: 14px;
  background: var(--surface-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  transition: transform .5s var(--spring); max-width: calc(100% - 32px); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* ================= حركة الظهور مع التمرير ================= */
.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal.from-side { transform: translateX(-40px); }
.js .reveal.from-side.in { transform: none; }
.js .reveal.zoom { transform: scale(.92) translateY(20px); }
.js .reveal.zoom.in { transform: none; }

/* إيقاف المؤثرات بطلب المستخدم من الإعدادات فقط */
.motion-off *, .motion-off *::before, .motion-off *::after { animation: none !important; transition: none !important; }
.motion-off .reveal { opacity: 1 !important; transform: none !important; }

/* ================= حركات ================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes drift { to { transform: translateX(50%); } }
@keyframes blink { 50% { opacity: .15; } }
@keyframes flicker { 0%, 100% { opacity: .85; } 45% { opacity: .7; } 55% { opacity: .95; } }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(16px); opacity: 0; } 100% { opacity: 0; } }
@keyframes ring-bell { 0%, 80%, 100% { transform: rotate(0); } 84% { transform: rotate(14deg); } 88% { transform: rotate(-12deg); } 92% { transform: rotate(8deg); } 96% { transform: rotate(-4deg); } }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(.975); } 100% { transform: scale(1); } }
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wave { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes spark { to { transform: translate(var(--x), var(--y)) scale(0) rotate(180deg); opacity: 0; } }

/* ================= الاستجابة ================= */
@media (max-width: 1020px) {
  .prayer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .nav { display: none; }
  .qibla-wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 26px 18px; }
  .qibla-info { align-items: center; }
}
@media (max-width: 600px) {
  .hero { padding-bottom: 170px; }
  .mosque { height: 170px; }
  .clouds { bottom: 110px; }
  .prayer-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .p-card { padding: 18px 10px 14px; }
  .p-card .p-name { font-size: 1.4rem; }
  .p-card .p-time { font-size: 1.4rem; }
  .p-card .p-icon { width: 46px; height: 46px; }
  .section { padding-top: 70px; }
  .azkar-bar { top: 62px; gap: 10px; padding: 10px; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 9px 10px; }
  .progress { min-width: 100%; }
  .enable-banner { flex-wrap: wrap; margin-top: -40px; }
  .enable-banner .btn { width: 100%; }
  .zikr-foot { align-items: flex-end; }
  .counter { width: 56px; height: 56px; }
  .offsets { grid-template-columns: 1fr; }
  .month-bar strong { min-width: 0; font-size: 1.35rem; }
  .sunpath { padding: 16px 10px 6px; }
  .sp-mark text { font-size: 26px; }
  .sp-mark text.t { font-size: 19px; }
}

@media print {
  .topbar, .hero, .enable-banner, #times, #azkar, #qibla, .footer, .month-bar .icon-btn, .bg-pattern { display: none !important; }
  body { background: #fff; color: #000; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
