/* الأذكار: شاشةٌ مثبّتة تتبدّل بطاقاتها مع دولاب الفأرة — في الفهرس وفي داخل الباب. */

.page-head { padding: 136px 0 10px; display: grid; gap: 16px; }
.page-head h1 { font-size: clamp(44px, 6vw, 76px); }
.today { display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border-radius: 999px; font-size: 16px; font-weight: 500; color: var(--ink-2); justify-self: start; }
.today b { font-variant-numeric: tabular-nums; color: var(--ink); }
.today .ring { width: 36px; height: 36px; transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .fill { stroke: var(--gold); transition: stroke-dashoffset 0.45s var(--ease); }
.scroll-hint { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 17.5px; }
.scroll-hint i { width: 22px; height: 34px; border: 1.8px solid currentColor; border-radius: 12px; position: relative; }
.scroll-hint i::after { content: ''; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--gold); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ——— الفهرس: معرضٌ مثبّت يمرّ أفقياً ——— */
.head-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.head-row .btn svg { width: 20px; height: 20px; }
.bar { display: block; flex: 1; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: inherit; transition: width 0.6s var(--ease); }
.is-done .bar i { background: var(--good); }

/* بعرض الشاشة كاملاً، لا داخل حاوية الصفحة. */
.gallery { position: relative; margin-top: 40px; width: 100vw; margin-inline: calc(50% - 50vw); }
.gallery__stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* عمودٌ محدود: الشريط الطويل لا يوسّع المشهد (وإلا انزاح العنوان خارج الشاشة). */
  grid-template-columns: minmax(0, 1fr);
  padding: 108px 0 26px;
  isolation: isolate;
}
.gallery__bg { position: absolute; inset: 0; z-index: -1; }
.gallery__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 15% 50%; opacity: 0; transform: scale(1.06); filter: blur(3px) saturate(0.9); transition: opacity 0.9s var(--ease), transform 1.4s var(--ease); }
.gallery__bg img.is-on { opacity: 0.42; transform: scale(1); }
.gallery__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, var(--ground) 0%, color-mix(in srgb, var(--ground) 40%, transparent) 30%, color-mix(in srgb, var(--ground) 55%, transparent) 70%, var(--ground) 100%); }
.gallery__head { display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: end; }
.gallery__count { display: flex; align-items: baseline; gap: 6px; font-family: var(--f-display); color: var(--gold); font-variant-numeric: tabular-nums; }
.gallery__count b { font-size: clamp(64px, 8vw, 104px); line-height: 0.9; font-weight: 700; }
.gallery__count span { font-size: 24px; font-weight: 600; color: var(--muted); }
.gallery__info h2 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(34px, 4.4vw, 58px); line-height: 1.15; color: var(--ink); }
.gallery__info p { margin: 4px 0 0; font-size: 20px; color: var(--ink-2); font-weight: 500; }

.gallery__track {
  display: flex;
  gap: 28px;
  align-items: center;
  min-width: 0;
  padding-inline: max(var(--gutter), (100vw - var(--wrap)) / 2);
  will-change: transform;
}
.gcard {
  --k: 0;
  --tilt: 0deg;
  position: relative;
  flex: none;
  width: clamp(250px, 24vw, 330px);
  aspect-ratio: 0.72;
  border-radius: 30px;
  overflow: hidden;
  isolation: isolate;
  color: #FBF3E3;
  box-shadow: 0 30px 60px -28px rgba(8, 17, 30, 0.55);
  transform: perspective(1200px) rotateY(var(--tilt)) scale(calc(0.86 + var(--k) * 0.14));
  opacity: calc(0.55 + var(--k) * 0.45);
  transition: box-shadow 0.5s var(--ease);
}
.gcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 14% 55%; z-index: -2; transform: scale(calc(1.12 - var(--k) * 0.12)); }
.gcard::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 17, 30, 0.92) 0%, rgba(8, 17, 30, 0.55) 42%, rgba(8, 17, 30, 0.05) 75%); }
.gcard::after { content: ''; position: absolute; inset: 10px; border-radius: 22px; border: 1px solid rgba(240, 220, 172, calc(0.15 + var(--k) * 0.45)); pointer-events: none; }
.gcard.is-active { box-shadow: 0 40px 80px -30px rgba(8, 17, 30, 0.7), 0 0 0 2px rgba(214, 180, 131, 0.6); }
.gcard__num { position: absolute; top: 22px; inset-inline-start: 24px; font-family: var(--f-display); font-size: 22px; font-weight: 600; color: #E7C996; font-variant-numeric: tabular-nums; }
.gcard__body { position: absolute; inset-inline: 0; bottom: 0; padding: 24px 24px 26px; display: grid; gap: 6px; }
.gcard h3 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(26px, 2.4vw, 32px); line-height: 1.2; color: #FFF7E8; }
.gcard p { margin: 0; font-size: 17px; color: rgba(251, 243, 227, 0.86); }
.gcard__meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 15.5px; font-weight: 600; color: rgba(251, 243, 227, 0.9); font-variant-numeric: tabular-nums; }
.gcard__meta .bar { background: rgba(251, 243, 227, 0.22); }
.gcard__meta .bar i { background: #E7C996; }
.gcard__go { display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin-top: 12px; padding: 9px 16px; border-radius: 999px; background: rgba(251, 243, 227, 0.16); border: 1px solid rgba(251, 243, 227, 0.38); color: #FFF7E8; font-weight: 600; font-size: 15.5px; opacity: 0; transform: translateY(10px); transition: opacity 0.4s var(--ease), transform 0.5s var(--ease); }
.gcard__go svg { width: 18px; height: 18px; }
.gcard.is-active .gcard__go { opacity: 1; transform: none; }
.gallery__progress { padding-top: 10px; }
.gallery__progress .bar { height: 4px; }

.all { margin-top: 110px; }
.all__head { display: grid; gap: 12px; margin-bottom: 30px; }
.all__head h2 { font-size: clamp(32px, 4vw, 48px); }
.all__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row { display: grid; grid-template-columns: 62px 1fr auto; gap: 16px; align-items: center; padding: 12px 18px 12px 12px; border-radius: 22px; transition: transform 0.4s var(--ease), box-shadow 0.4s; }
.row:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.row img { width: 62px; height: 62px; border-radius: 16px; object-fit: cover; object-position: 14% 55%; }
.row__text { min-width: 0; display: grid; gap: 2px; }
.row__text b { font-size: 19px; font-weight: 600; line-height: 1.3; }
.row__text small { font-size: 15.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__count { font-family: var(--f-display); font-size: 20px; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
.row.is-done .row__count { color: var(--good); }

/* ——— داخل الباب: رزمةٌ ثابتة ——— */
body.deck-mode { overflow: hidden; height: 100dvh; }
body.deck-mode .footer { display: none; }
.deck { position: fixed; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 96px 0 22px; isolation: isolate; }
.deck__bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.deck__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 12% 50%; opacity: 0.55; filter: blur(2px) saturate(0.9); transform: scale(1.04); }
.deck__bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, color-mix(in srgb, var(--ground) 55%, transparent), var(--ground) 92%); }

.deck__head { width: min(900px, 100% - var(--gutter) * 2); margin-inline: auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 10px 12px 10px 20px; border-radius: 22px; }
.deck__back { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--gold); font-size: 16px; }
.deck__back svg { width: 20px; height: 20px; transform: scaleX(-1); }
.deck__title { min-width: 0; display: grid; gap: 6px; }
.deck__title h1 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 24px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck__title .row { display: flex; align-items: center; gap: 12px; font-size: 17px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.deck__title .bar { height: 7px; }
.deck__reset { border: 0; background: none; color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 17px; padding: 8px 12px; border-radius: 999px; }
.deck__reset:hover { background: var(--hl-hover); color: var(--ink); }
.deck__reset svg { width: 17px; height: 17px; }

.deck__stage { position: relative; width: min(860px, 100% - var(--gutter) * 2); margin: 18px auto 0; min-height: 0; }
.dk {
  position: absolute;
  inset: 0 0 60px;
  border-radius: 32px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 24px clamp(20px, 3.4vw, 40px) 22px;
  background: var(--glass-strong);
  transform-origin: 50% 100%;
  transition: transform 0.7s var(--ease), opacity 0.55s var(--ease);
  will-change: transform, opacity;
}
.dk[data-d="0"] { z-index: 5; box-shadow: var(--shadow-lift); }
.dk[data-d="1"] { transform: translateY(26px) scale(0.95); opacity: 0.7; z-index: 4; }
.dk[data-d="2"] { transform: translateY(48px) scale(0.9); opacity: 0.35; z-index: 3; }
.dk[data-d="far"] { transform: translateY(64px) scale(0.86); opacity: 0; z-index: 1; }
.dk[data-d="past"] { transform: translateY(-110%) rotate(-2deg); opacity: 0; z-index: 6; }
.dk:not([data-d="0"]) { pointer-events: none; }
.dk__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 17px; color: var(--muted); }
.dk__num { font-family: var(--f-display); font-weight: 600; font-size: 18px; color: var(--gold); font-variant-numeric: tabular-nums; }
.dk__cat { font-weight: 600; color: var(--ink-2); }
.dk__scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding-inline-end: 4px; display: grid; align-content: safe center; gap: 14px; cursor: pointer; }
.dk__text { margin: 0; font-family: var(--f-naskh); font-weight: 500; font-size: clamp(22px, 2.3vw, 27px); line-height: 2.05; white-space: pre-line; color: var(--ink); text-align: center; text-wrap: pretty; }
.dk__text.is-quran { font-family: var(--f-quran); font-size: clamp(25px, 2.6vw, 30px); line-height: 2.15; color: var(--quran-ink); }
.dk__fadl { margin: 0; padding: 14px 18px; border-radius: 18px; background: var(--hl-hover); font-size: 17.5px; line-height: 1.9; color: var(--ink); text-align: center; }
.dk__ref { font-size: 17.5px; color: var(--muted); text-align: center; }
.dk__ref b { color: var(--gold); font-weight: 600; }
.dk__foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.dk__foot > :first-child { justify-self: end; }
.dk__foot > :last-child { justify-self: start; }
.dk__more { display: none; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 14.5px; font-weight: 600; box-shadow: 0 8px 18px -8px rgba(21, 42, 68, 0.6); animation: nudge 1.6s var(--ease) infinite; }
.dk__more svg { width: 15px; height: 15px; }
.dk.is-scrollable:not(.is-at-end) .dk__more { display: inline-flex; }
.dk.is-scrollable:not(.is-at-end) .dk__scroll { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
.tap {
  position: relative;
  width: 104px; height: 104px;
  border: 0; border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: grid; place-items: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tap svg.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.tap__in { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: var(--brand); color: var(--on-brand); box-shadow: 0 14px 26px -12px rgba(21, 42, 68, 0.75); transition: transform 0.16s var(--ease), background 0.3s; line-height: 1.1; }
.tap:active .tap__in { transform: scale(0.9); }
.tap__in b { font-size: 27px; font-variant-numeric: tabular-nums; }
.tap__in small { font-size: 14.5px; opacity: 0.85; }
.tap__in svg { width: 32px; height: 32px; }
.dk.is-done .tap__in { background: var(--good); }
.dk.is-done .ring .fill { stroke: var(--good); }
.dk__mini { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16.5px; display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 999px; }
.dk__mini:hover { background: var(--hl-hover); color: var(--ink); }
.dk__mini svg { width: 16px; height: 16px; }
.dk--end { align-content: center; justify-items: center; text-align: center; grid-template-rows: none; gap: 16px; }
.dk--end img { width: 120px; }
.dk--end h2 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: clamp(30px, 3.4vw, 42px); }
.dk--end p { margin: 0; font-size: 18px; color: var(--ink-2); }
.dk--end .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.deck__rail { position: absolute; inset-inline-start: calc(100% + 22px); top: 50%; transform: translateY(-50%); display: grid; gap: 7px; }
.deck__rail button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; transition: transform 0.3s var(--ease), background 0.3s; }
.deck__rail button.is-done { background: color-mix(in srgb, var(--good) 70%, transparent); }
.deck__rail button[aria-current="true"] { background: var(--gold); transform: scale(1.5); }

.deck__nav { display: flex; align-items: center; justify-content: center; gap: 14px; }
.deck__nav .icon-btn { background: var(--glass-strong); }
.deck__nav .icon-btn svg { width: 22px; height: 22px; }

@media (max-width: 1100px) { .deck__rail { display: none; } }
@media (max-width: 900px) {
  .all__grid { grid-template-columns: 1fr 1fr; }
  .gallery__head { grid-template-columns: auto 1fr; }
  .gallery__head .scroll-hint { display: none; }
}
@media (max-width: 640px) {
  .page-head { padding-top: 108px; }
  .all__grid { grid-template-columns: 1fr; }
  .gcard { width: 72vw; }
  .gallery__stage { padding-top: 92px; }
  .gallery__head { gap: 14px; }
  .gallery__info p { font-size: 17px; }
  .deck { padding-top: 76px; padding-bottom: 12px; }
  .deck__head { grid-template-columns: 1fr auto; padding: 10px 12px; gap: 8px 10px; }
  .deck__back { grid-column: 1 / -1; font-size: 17px; }
  .deck__title h1 { font-size: 20px; }
  .deck__reset span { display: none; }
  .dk { inset: 0 0 46px; padding: 18px 16px 16px; border-radius: 26px; }
  .dk__fadl { font-size: 16.5px; }
  .tap { width: 92px; height: 92px; }
  .tap__in { width: 70px; height: 70px; }
  .deck__nav .scroll-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dk { transition: opacity 0.2s; }
  .scroll-hint i::after { animation: none; }
}

/* شاشاتٌ قصيرة (لابتوب 768px): بطاقة الذكر تأخذ ارتفاعاً أكبر بتقليص ما حولها. */
@media (max-height: 800px) and (min-width: 641px) {
  .deck { padding-top: 84px; padding-bottom: 14px; }
  .deck__head { padding: 8px 12px 8px 18px; }
  .deck__title h1 { font-size: 21px; }
  .deck__stage { margin-top: 12px; }
  .dk { inset: 0 0 48px; padding: 16px 24px 14px; gap: 8px; }
  .dk__text { font-size: clamp(20px, 2vw, 24px); line-height: 1.95; }
  .dk__text.is-quran { font-size: clamp(22px, 2.2vw, 26px); line-height: 2; }
  .dk__fadl { padding: 10px 14px; font-size: 16px; line-height: 1.8; }
  .tap { width: 88px; height: 88px; }
  .tap__in { width: 68px; height: 68px; }
  .tap__in b { font-size: 23px; }
  .deck__nav .scroll-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dk__more { animation: none; } }
