/* ===== سكينة — التنسيقات ===== */
@font-face{font-family:'Cairo';font-style:normal;font-weight:200 1000;font-display:swap;src:url('fonts/cairo-arabic.woff2') format('woff2');}

:root{
  --gold:#D9B65F; --gold2:#F2DCA6; --gold-dim:#8C7434;
  --radius:22px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* ---------- داكن (الافتراضي) ---------- */
body[data-theme="dark"]{
  --bg:#07130F; --bg2:#0B1D17; --card:#0E241C; --card-2:#123026;
  --text:#F4EFE2; --muted:#9CB2A7; --line:rgba(217,182,95,.16);
  --shadow:0 12px 30px rgba(0,0,0,.35);
  --hero-grad:linear-gradient(150deg,#123026 0%,#0C1F19 60%,#0A1A15 100%);
  --tabbar:rgba(9,26,21,.92);
}
/* ---------- فاتح ---------- */
body[data-theme="light"]{
  --bg:#F6F1E4; --bg2:#FFFDF7; --card:#FFFFFF; --card-2:#FBF6EA;
  --text:#12291F; --muted:#61786C; --line:rgba(18,41,31,.10);
  --shadow:0 10px 24px rgba(18,41,31,.08);
  --gold:#B0872F; --gold2:#8C6A1F; --gold-dim:#D8C38A;
  --hero-grad:linear-gradient(150deg,#FFFFFF 0%,#FBF6EA 100%);
  --tabbar:rgba(255,253,247,.94);
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:'Cairo',system-ui,-apple-system,'Segoe UI',sans-serif;
  background:var(--bg); color:var(--text);
  min-height:100vh; min-height:100dvh;
  padding-bottom:calc(84px + var(--safe-b));
  transition:background .35s ease, color .35s ease;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
button{font-family:inherit; cursor:pointer; border:0; background:none; color:inherit}
h1,h2,h3,p{margin:0}
[hidden]{display:none !important}

/* ---------- شاشة البداية ---------- */
.splash{
  position:fixed; inset:0; z-index:90;
  background:radial-gradient(120% 90% at 50% 0%,#123026 0%,#07130F 62%,#050F0C 100%);
  display:flex; align-items:center; justify-content:center;
  padding:28px 24px calc(28px + var(--safe-b));
  transition:opacity .45s ease, visibility .45s;
}
.splash.is-out{opacity:0; visibility:hidden}
.splash-inner{width:100%; max-width:360px; text-align:center; color:#F4EFE2}
.splash-logo{width:104px;height:104px;border-radius:26px;box-shadow:0 18px 40px rgba(0,0,0,.45);margin-bottom:18px}
.splash-name{font-size:38px;font-weight:800;letter-spacing:.5px;color:#F2DCA6;margin-bottom:22px}
.splash-verse{font-size:19px;line-height:2;font-weight:600;color:#F4EFE2}
.splash-sura{font-size:13px;color:#9CB2A7;margin-top:6px}
.splash-tag{font-size:13.5px;color:#9CB2A7;margin-top:26px;line-height:1.8}
.btn-gold{
  margin-top:30px; width:100%; padding:17px 20px; border-radius:18px;
  background:linear-gradient(180deg,#EBCB80,#C99F45); color:#12241C;
  font-size:18px; font-weight:800; box-shadow:0 12px 26px rgba(201,159,69,.28);
}
.btn-gold:active{transform:scale(.985)}

/* ---------- الهيدر ---------- */
.topbar{
  display:flex; align-items:center; gap:10px;
  padding:calc(12px + env(safe-area-inset-top,0px)) 16px 6px;
  position:relative; z-index:5;
}
.dates{flex:1; text-align:right; padding-right:2px}
.hijri{font-size:14.5px; font-weight:700}
.greg{font-size:11.5px; color:var(--muted); margin-top:2px}
.chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 12px; border-radius:999px;
  background:var(--card); border:1px solid var(--line);
  font-size:13px; font-weight:600; color:var(--text);
}
.chip svg{color:var(--gold)}
.icon-btn{
  width:38px;height:38px;border-radius:12px;display:grid;place-items:center;
  background:var(--card); border:1px solid var(--line); color:var(--text);
}

/* ---------- الشاشات ---------- */
main{padding:0 16px 8px}
.screen{animation:fade .28s ease}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* ---------- القوس ---------- */
.arc-wrap{position:relative; margin:6px auto 4px; max-width:360px}
.arc{width:100%; height:auto; display:block; overflow:visible}
.arc-track{fill:none; stroke:var(--line); stroke-width:11; stroke-linecap:round}
.arc-progress{
  fill:none; stroke:url(#goldGrad); stroke-width:11; stroke-linecap:round;
  filter:drop-shadow(0 0 7px rgba(217,182,95,.35));
  transition:stroke-dashoffset .6s ease;
}
.arc-center{position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; padding-top:26px}
.arc-count-label{font-size:12.5px; color:var(--muted); letter-spacing:.5px}
.arc-count{font-size:34px; font-weight:800; color:var(--gold2); line-height:1.15; font-variant-numeric:tabular-nums; letter-spacing:.5px}
.arc-next{font-size:26px; font-weight:800; margin-top:2px}
.arc-next-time{font-size:13.5px; color:var(--muted); margin-top:1px}
.arc-ends{position:absolute; left:0; right:0; bottom:2px; display:flex; justify-content:space-between; font-size:11.5px; color:var(--muted)}
.arc-end{display:flex; flex-direction:column; align-items:center; gap:1px; min-width:64px}
.arc-end b{color:var(--text); font-size:12.5px; font-weight:700}
.arc-end-r{align-items:flex-start}
.arc-end-l{align-items:flex-end}

/* ---------- قائمة الصلوات ---------- */
.list{margin-top:14px; display:flex; flex-direction:column; gap:8px}
.prow{
  display:flex; align-items:center; gap:12px;
  background:var(--card); border:1px solid var(--line); border-radius:18px;
  padding:13px 14px; position:relative; overflow:hidden;
  transition:background .2s ease, border-color .2s ease;
}
.prow.is-now{
  background:var(--hero-grad); border-color:rgba(217,182,95,.5);
  box-shadow:inset 0 0 0 1px rgba(217,182,95,.18), var(--shadow);
}
.prow.is-next .prow-name{color:var(--gold2)}
.prow-name{font-size:18px; font-weight:700; min-width:64px}
.prow-times{display:flex; flex-direction:column; align-items:flex-start; margin-right:auto}
.prow-time{font-size:19px; font-weight:700; font-variant-numeric:tabular-nums}
.prow-iqama{font-size:11.5px; color:var(--muted); margin-top:1px}
.prow-badge{
  position:absolute; inset-inline-end:14px; top:50%; transform:translateY(-50%);
  font-size:11px; color:var(--gold); display:none;
}
.prow.is-now .prow-badge{display:block}
.prow.is-now{padding-left:76px}
.bell{
  width:36px;height:36px;border-radius:11px;display:grid;place-items:center;
  background:rgba(217,182,95,.09); color:var(--muted); flex:0 0 auto;
}
.bell.on{color:var(--gold); background:rgba(217,182,95,.18)}
.prow-sub{font-size:11px; color:var(--muted)}

/* ---------- المصحف placeholder ---------- */
.placeholder{
  margin:36px auto 0; max-width:340px; text-align:center;
  background:var(--card); border:1px solid var(--line); border-radius:26px;
  padding:34px 24px; box-shadow:var(--shadow);
}
.ph-ring{
  width:78px;height:78px;border-radius:50%;margin:0 auto 18px;
  display:grid;place-items:center;color:var(--gold);
  border:1px solid var(--line); background:rgba(217,182,95,.07);
}
.placeholder h2{font-size:22px; font-weight:800; margin-bottom:10px}
.placeholder p{font-size:14.5px; line-height:1.95; color:var(--muted)}

/* ---------- القبلة ---------- */
.qibla-wrap{text-align:center; padding-top:6px}
.qibla-status{
  display:inline-block; font-size:13px; font-weight:700; color:var(--gold);
  background:rgba(217,182,95,.1); border:1px solid var(--line);
  padding:7px 14px; border-radius:999px; margin-bottom:10px;
}
.qibla-status.ok{color:#0B1D17; background:linear-gradient(180deg,#EBCB80,#C99F45); border-color:transparent}
.compass{position:relative; width:min(300px,80vw); aspect-ratio:1; margin:6px auto 4px}
.compass-dial{position:absolute; inset:0; transition:transform .12s linear; will-change:transform}
.dial-svg{width:100%;height:100%;display:block}
.dial-outer{fill:none; stroke:url(#goldGrad); stroke-width:3}
.dial-inner{fill:var(--card); stroke:var(--line); stroke-width:1}
.dial-letters .dl{position:absolute; font-size:12.5px; color:var(--muted); font-weight:700}
.dl-n{top:4px; left:50%; transform:translateX(-50%)}
.dl-s{bottom:4px; left:50%; transform:translateX(-50%)}
.dl-e{right:6px; top:50%; transform:translateY(-50%)}
.dl-w{left:6px; top:50%; transform:translateY(-50%)}
.needle{
  position:absolute; inset:0; transition:transform .12s linear; will-change:transform;
  display:flex; flex-direction:column; align-items:center;
}
.needle-kaaba{
  margin-top:14px; width:44px;height:44px;border-radius:50%;
  display:grid;place-items:center; color:#0B1D17;
  background:linear-gradient(180deg,#F2DCA6,#D9B65F);
  box-shadow:0 6px 16px rgba(217,182,95,.35);
}
.needle-line{width:3px; flex:1; background:linear-gradient(180deg,var(--gold),transparent); border-radius:3px; margin-bottom:26%}
.dial-center{
  position:absolute; left:50%; top:50%; width:14px;height:14px; border-radius:50%;
  transform:translate(-50%,-50%); background:var(--gold); box-shadow:0 0 0 6px rgba(217,182,95,.14);
}
.qibla-facts{display:flex; gap:10px; margin-top:8px}
.fact{
  flex:1; background:var(--card); border:1px solid var(--line); border-radius:18px;
  padding:12px 10px; display:flex; flex-direction:column; gap:3px;
}
.fact span{font-size:11.5px; color:var(--muted)}
.fact b{font-size:18px; font-weight:800; color:var(--gold2)}
.qibla-hint{font-size:12.5px; color:var(--muted); line-height:1.9; margin:14px 6px 12px}
.btn-ghost{
  padding:13px 18px; border-radius:14px; border:1px solid var(--line);
  background:var(--card); font-size:14.5px; font-weight:700; color:var(--text);
}
.btn-ghost.full{width:100%; margin-top:10px}

/* ---------- الأذكار ---------- */
.wird-hero{
  position:relative; overflow:hidden;
  background:var(--hero-grad); border:1px solid rgba(217,182,95,.3);
  border-radius:26px; padding:18px; margin-top:10px; box-shadow:var(--shadow);
}
.wird-hero::after{
  content:""; position:absolute; width:190px;height:190px;border-radius:50%;
  left:-70px; bottom:-90px; background:radial-gradient(circle,rgba(217,182,95,.18),transparent 70%);
}
.wird-top{display:flex; justify-content:space-between; align-items:center; font-size:11.5px}
.wird-kicker{color:var(--gold); font-weight:700}
.wird-progress{color:var(--muted); font-variant-numeric:tabular-nums}
.wird-hero h2{font-size:23px; font-weight:800; margin:10px 0 3px}
.wird-hero p{font-size:13px; color:var(--muted)}
.wird-btn{
  margin-top:14px; padding:11px 20px; border-radius:13px;
  background:linear-gradient(180deg,#EBCB80,#C99F45); color:#12241C; font-weight:800; font-size:14px;
}
.cards{display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:12px}
.acard{
  position:relative; overflow:hidden; border-radius:22px; min-height:132px;
  padding:14px; text-align:right; border:1px solid var(--line);
  display:flex; flex-direction:column; justify-content:space-between;
}
.acard .ac-icon{width:34px;height:34px;color:rgba(255,255,255,.92)}
.acard h3{font-size:15.5px; font-weight:800; color:#fff; margin-top:auto}
.acard span{font-size:11.5px; color:rgba(255,255,255,.75)}
.acard .ac-badge{
  position:absolute; top:12px; inset-inline-start:12px;
  background:rgba(0,0,0,.28); color:#fff; font-size:11px; font-weight:700;
  padding:3px 9px; border-radius:999px; backdrop-filter:blur(4px);
}
.ac-morning{background:linear-gradient(150deg,#1F6E5A,#0E3B31)}
.ac-evening{background:linear-gradient(150deg,#3A3566,#171633)}
.ac-sleep{background:linear-gradient(150deg,#233C5C,#0D1A2B)}
.ac-after{background:linear-gradient(150deg,#6E5320,#2C2210)}
.ac-wake{background:linear-gradient(150deg,#5C3A2E,#2A1712)}

.list-head{display:flex; align-items:center; gap:10px; margin:6px 0 12px}
.list-head h2{font-size:19px; font-weight:800; flex:1}
.back-btn{
  width:38px;height:38px;border-radius:12px;display:grid;place-items:center;
  background:var(--card); border:1px solid var(--line);
}
.list-count{font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums}
.dhikr-list{display:flex; flex-direction:column; gap:10px; padding-bottom:8px}
.dhikr{
  background:var(--card); border:1px solid var(--line); border-radius:20px; padding:16px;
  transition:border-color .2s ease, background .2s ease;
}
.dhikr.done{border-color:rgba(217,182,95,.45); background:var(--card-2)}
.dhikr-text{font-size:17px; line-height:2.05; font-weight:600}
.dhikr-src{font-size:11px; color:var(--muted); margin-top:8px}
.dhikr-foot{display:flex; align-items:center; justify-content:space-between; margin-top:12px; gap:10px}
.dhikr-count{font-size:12.5px; color:var(--muted); font-variant-numeric:tabular-nums}
.tapbtn{
  min-width:104px; padding:11px 18px; border-radius:14px; font-weight:800; font-size:15px;
  background:rgba(217,182,95,.12); border:1px solid var(--line); color:var(--gold2);
}
.tapbtn.done{background:linear-gradient(180deg,#EBCB80,#C99F45); color:#12241C; border-color:transparent}

/* ---------- التاب بار ---------- */
.tabbar{
  position:fixed; bottom:0; left:0; right:0; z-index:40;
  display:grid; grid-template-columns:repeat(4,1fr);
  background:var(--tabbar); backdrop-filter:blur(14px);
  border-top:1px solid var(--line);
  padding:8px 6px calc(8px + var(--safe-b));
}
.tab{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:6px 0; color:var(--muted); font-size:11px; font-weight:700;
  border-radius:14px; transition:color .2s ease;
}
.tab svg{width:23px;height:23px}
.tab.is-active{color:var(--gold)}
.tab.is-active svg{filter:drop-shadow(0 0 8px rgba(217,182,95,.4))}

/* ---------- الإعدادات ---------- */
.sheet-backdrop{position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:60; animation:fade .2s ease}
.sheet{
  position:fixed; inset-inline:0; bottom:0; z-index:70; max-height:88vh; overflow-y:auto;
  background:var(--bg2); border-radius:26px 26px 0 0; border-top:1px solid var(--line);
  padding:16px 16px calc(24px + var(--safe-b));
  animation:up .26s ease;
}
@keyframes up{from{transform:translateY(30px);opacity:.6}to{transform:none;opacity:1}}
.sheet-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:8px}
.sheet-head h2{font-size:19px; font-weight:800}
.group{border-top:1px solid var(--line); padding:14px 0}
.group:first-child{border-top:0}
.group-title{font-size:12px; color:var(--gold); font-weight:700; margin-bottom:10px}
.row{display:flex; align-items:center; justify-content:space-between; gap:10px; padding:6px 0; font-size:14px}
.input{
  background:var(--card); color:var(--text); border:1px solid var(--line);
  border-radius:11px; padding:9px 11px; font-family:inherit; font-size:13.5px; max-width:62%;
}
.input.num{max-width:88px; text-align:center; font-variant-numeric:tabular-nums}
.coord{display:flex; gap:6px}
.method-note{font-size:11.5px; color:var(--muted); margin-top:6px; line-height:1.8}
.notif-note{font-size:11.5px; color:var(--muted); margin-top:8px; line-height:1.85}
.iq-row{display:flex; align-items:center; justify-content:space-between; padding:7px 0; font-size:14px}
.stepper{display:flex; align-items:center; gap:8px}
.stepper button{
  width:34px;height:34px;border-radius:10px;display:grid;place-items:center;
  background:var(--card); border:1px solid var(--line); font-size:18px; font-weight:700; color:var(--text);
}
.stepper b{min-width:52px; text-align:center; font-size:13.5px; font-variant-numeric:tabular-nums; color:var(--gold2)}

/* ---------- توست ---------- */
.toast{
  position:fixed; bottom:calc(96px + var(--safe-b)); left:50%; transform:translateX(-50%);
  background:rgba(18,41,31,.95); color:#F4EFE2; font-size:13px; font-weight:600;
  padding:11px 18px; border-radius:14px; z-index:95; max-width:88vw; text-align:center;
  animation:fade .2s ease;
}

@media (min-width:520px){
  main{max-width:440px; margin:0 auto}
  .topbar{max-width:440px; margin:0 auto}
  .tabbar{max-width:440px; margin:0 auto; border-radius:22px 22px 0 0; border-inline:1px solid var(--line)}
}
