/* «جولة في الوِرد» (/tour): a phone with a drawn mini-screen per step, the text beside it on wide
   screens. The mocks follow the site's palette (light and dark). Without JavaScript every step is
   shown in its final state ("played"); public/js/tour.js resets them and plays them on demand.
   Reduced motion: no pulse, no movement, the final state appears at once. */

.tour { --phone-w: 272px; --phone-h: 560px; }
.tour-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 8px; }
.tour-head h1 { color: var(--green); margin: 0; }
.tour-head .lead { margin: 0; }
.tour-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tour-share .tour-link { display: none; }
.tour:not(.tour-js) .tour-share .tour-link { display: inline-block; }

.tour-steps { list-style: none; margin: 0; padding: 0; }
/* Phones: title and sentence, the phone, then «كيف؟». Wide screens: the phone, the text beside it. */
.tour-step {
  display: grid; gap: 14px; justify-items: center; grid-template-areas: "intro" "device" "how";
  padding: 28px 0; border-bottom: 1px solid var(--line);
}
.tour-step:last-child { border-bottom: 0; }
.tour-intro { grid-area: intro; }
.tour-device { grid-area: device; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tour-how-block { grid-area: how; }
.tour-intro, .tour-how-block { max-width: 560px; width: 100%; }
.tour-count { color: var(--gold-text); font-weight: 600; margin: 0 0 2px; font-size: .95rem; }
.tour-intro h2 { color: var(--green); font-size: 1.7rem; margin-bottom: .15em; }
.tour-lead { font-size: 1.05rem; line-height: 1.85; margin: 0; }
.tour-how-title { font-family: var(--font-ui); font-size: .95rem; font-weight: 600; color: var(--ink-2); margin: 4px 0 8px; }
.tour-how { list-style: none; margin: 0; padding: 0; counter-reset: how; display: grid; gap: 10px; }
.tour-how li { counter-increment: how; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; line-height: 1.8; }
.tour-how li::before {
  content: counter(how); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--on-gold-soft); font-weight: 700; font-size: .9rem; margin-top: 1px;
}
.tour-end .tour-device { min-height: 160px; justify-content: center; }
.end-mark { padding: 24px; }
.tour-end .actions { margin-top: 16px; }
.tour-end .free-banner { margin-top: 0; }
.tour-again { margin: 14px 0 0; }

@media (min-width: 860px) {
  .tour-step {
    grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "device intro" "device how";
    grid-template-rows: 1fr 1fr; column-gap: 56px; row-gap: 18px; justify-items: start;
  }
  .tour-intro { align-self: end; }
  .tour-how-block { align-self: start; }
  .tour-device { justify-self: center; align-self: center; }
  .tour-intro h2 { font-size: 2.1rem; }
  .tour-lead { font-size: 1.15rem; }
}

/* ---- the simulator (with JavaScript): one step at a time ---- */
.tour-js .tour-step { display: none; border-bottom: 0; padding: 16px 0 8px; }
.tour-js .tour-step.on { display: grid; animation: tour-in .35s ease both; }
.tour-js .tour-step.on.back { animation-name: tour-in-back; }
@keyframes tour-in { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes tour-in-back { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
.tour-stage { touch-action: pan-y; }

.tour-nav {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line);
}
.tour-dots { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tour-dots button {
  width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--surface-4); transition: width .2s, background .2s;
}
.tour-dots button[aria-current="step"] { width: 26px; background: var(--gold); }
.tour-dots button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.tour-skip { background: none; border: 0; color: var(--ink-2); font: inherit; font-weight: 600; cursor: pointer; padding: 8px 10px; border-radius: 10px; min-height: 44px; }
.tour-skip:hover { color: var(--ink); background: var(--surface-3); }
.tour-nav [data-prev][disabled] { visibility: hidden; }
@media (max-width: 560px) {
  .tour-nav { flex-wrap: wrap; }
  .tour-dots { order: -1; flex-basis: 100%; }
  .tour-nav .btn { flex: 1; }
}

/* ---- the phone ---- */
.phone {
  position: relative; width: var(--phone-w); height: var(--phone-h); flex: none;
  border-radius: 44px; padding: 10px; background: #1B231E;
  box-shadow: 0 0 0 1px var(--line-strong), 0 24px 48px -24px rgba(20, 30, 25, .55);
}
.phone::before { /* camera pill */
  content: ""; position: absolute; top: 17px; left: 50%; width: 70px; height: 18px; margin-left: -35px;
  border-radius: 12px; background: #1B231E; z-index: 4;
}
.phone-screen {
  position: relative; height: 100%; border-radius: 34px; overflow: hidden; isolation: isolate;
  background: var(--paper); color: var(--ink); font-size: 13px; line-height: 1.55;
  display: flex; flex-direction: column; text-align: start;
}
.phone-screen p { margin: 0; }
.phone-screen ul, .phone-screen ol { list-style: none; margin: 0; padding: 0; }
@media (max-width: 380px) { .phone { zoom: .86; } }
@media (max-width: 330px) { .phone { zoom: .76; } }
@media (max-width: 859px) and (max-height: 760px) { .phone { zoom: .84; } }

.m-status { height: 30px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 6px 22px 0; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.m-sys { display: flex; gap: 4px; direction: ltr; }
.m-sys i { width: 14px; height: 8px; border-radius: 2px; background: var(--ink-2); opacity: .7; }
.m-sys i:first-child { width: 10px; }
.m-appbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 16px 8px; }
.m-title { font-family: var(--font-display); font-size: 21px; line-height: 1.3; color: var(--ink); }
.m-sub { font-size: 11.5px; color: var(--ink-2); }
.m-body { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 14px; min-height: 0; }
.m-center { align-items: center; text-align: center; }
.m-foot { flex: none; padding: 0 16px 22px; }
.m-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; }
.m-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.m-row small, .m-who small { color: var(--ink-2); font-size: 11px; }
.m-who { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; flex: 1; }
.m-btn {
  display: block; width: 100%; min-height: 42px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--green); color: var(--on-green); font: 600 14px/1.2 var(--font-ui); padding: 0 14px;
}
.m-btn.soft { background: var(--green-soft); color: var(--on-green-soft); }
.m-chip { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.m-chip.done { background: var(--green-soft); color: var(--on-green-soft); }
.m-chip.partial { background: var(--gold-soft); color: var(--on-gold-soft); }
.m-chip.pending { background: var(--danger-soft); color: var(--late); }
.m-chip.new { background: var(--gold); color: var(--on-gold); }
.m-av { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--gold-soft); color: var(--on-gold-soft); font: 400 17px/1 var(--font-display); }
.m-av.child { background: var(--green-soft); color: var(--on-green-soft); }
.m-lines { display: grid; gap: 9px; width: 100%; }
.m-lines i { display: block; height: 7px; border-radius: 4px; background: var(--surface-4); }
.m-lines i.short { width: 55%; }
.m-surah-band { text-align: center; font-family: var(--font-display); font-size: 15px; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 10px; padding: 2px 0; background: color-mix(in srgb, var(--gold-soft) 45%, transparent); }
.m-tick { color: var(--success); font-weight: 700; }
.m-toast {
  position: absolute; inset-inline: 14px; bottom: 16px; z-index: 6; padding: 10px 14px; border-radius: 14px;
  background: #1B231E; color: #F6F0E1; font-size: 12.5px; font-weight: 500; text-align: center;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6);
  opacity: 0; transform: translateY(14px); transition: opacity .3s, transform .3s;
}
.played .m-toast { opacity: 1; transform: none; transition-delay: var(--toast-delay, .8s); }
.m-after { opacity: 0; transition: opacity .35s ease; }
.played .m-after { opacity: 1; transition-delay: var(--after-delay, 1s); }
.m-ring {
  --p: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), color-mix(in srgb, var(--green) 15%, transparent) 0);
}
.m-ring > span { width: 76%; height: 76%; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }

/* ---- the pulsing hotspot (the control that plays the action) ---- */
.hotspot { position: relative; cursor: pointer; }
.hotspot::after {
  content: ""; position: absolute; inset: -5px; border-radius: inherit; pointer-events: none;
  border: 2.5px solid var(--gold); opacity: 0;
}
.tour-js .tour-step:not(.played) .hotspot::after { animation: hot-pulse 1.5s ease-out infinite; }
@keyframes hot-pulse { 0% { opacity: .95; transform: scale(.94); } 100% { opacity: 0; transform: scale(1.22); } }
.hotspot:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.played .hotspot { cursor: default; }

/* ---- welcome ---- */
.m-welcome .m-body, .m-placeholder { justify-content: center; gap: 6px; }
.m-mark-wrap { transition: transform .5s ease; }
.played .m-mark-wrap { transform: scale(1.08); }
.m-app-name { font-family: var(--font-display); font-size: 34px; color: var(--green); line-height: 1.3; }
.m-tagline { color: var(--ink-2); }
.m-promises { display: grid; gap: 8px; margin-top: 14px !important; width: 100%; }
.m-promises li {
  display: flex; gap: 8px; align-items: center; justify-content: center; padding: 7px 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600;
  opacity: .35; transition: opacity .35s ease, transform .35s ease, border-color .35s;
}
.m-promises .m-tick { opacity: 0; transition: opacity .3s; }
.played .m-promises li { opacity: 1; border-color: color-mix(in srgb, var(--green) 40%, var(--line)); transition-delay: calc(.25s + var(--i) * .35s); }
.played .m-promises .m-tick { opacity: 1; transition-delay: calc(.35s + var(--i) * .35s); }
.m-dua { margin-top: 14px !important; font-family: var(--font-display); font-size: 16px; color: var(--gold); opacity: 0; transition: opacity .5s ease 1.4s; }
.played .m-dua { opacity: 1; }

/* ---- riwaya switch (Warsh → Hafs, same ayah) ---- */
.m-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; gap: 2px; }
.m-seg > * { border: 0; border-radius: 999px; padding: 3px 12px; font: 600 12px/1.4 var(--font-ui); background: transparent; color: var(--ink-2); }
.m-seg .seg-w { background: var(--green); color: var(--on-green); transition: background .3s, color .3s; }
.played .m-seg .seg-w { background: transparent; color: var(--ink-2); }
.played .m-seg .seg-h { background: var(--green); color: var(--on-green); transition: background .3s, color .3s; }
.m-pages { position: relative; }
.m-page { position: absolute; inset: 4px 14px 14px; display: flex; flex-direction: column; gap: 12px; padding: 14px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: opacity .45s ease, transform .45s ease; }
.m-face-h { opacity: 0; transform: translateX(-30px); }
.played .m-face-w { opacity: 0; transform: translateX(30px); }
.played .m-face-h { opacity: 1; transform: none; transition-delay: .15s; }
.m-ayah { font-family: var(--font-display); font-size: 21px; line-height: 1.9; text-align: center; border-radius: 10px; padding: 2px 4px; }
.m-ayah .m-num { color: var(--gold); font-size: 17px; }
.m-ayah mark { background: color-mix(in srgb, var(--gold) 28%, transparent); color: inherit; border-radius: 6px; padding: 0 2px; }
.m-face-w .m-ayah { background: color-mix(in srgb, var(--green) 10%, transparent); }
.played .m-hl { animation: hl-flash 1.6s ease .5s both; }
@keyframes hl-flash { 0% { background: transparent; } 25% { background: color-mix(in srgb, var(--gold) 34%, transparent); } 100% { background: color-mix(in srgb, var(--green) 10%, transparent); } }
.m-hl { background: color-mix(in srgb, var(--green) 10%, transparent); }
.m-page-no { text-align: center; font-size: 11px; color: var(--ink-2); margin-top: auto !important; }
.m-diff {
  position: absolute; inset-inline: 14px; bottom: 16px; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; justify-content: center;
  padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--gold); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(16px); transition: opacity .35s ease, transform .35s ease;
}
.m-diff b { font-family: var(--font-display); font-size: 17px; font-weight: 400; color: var(--green); }
.m-diff-tag { flex-basis: 100%; text-align: center; font-size: 11px; font-weight: 600; color: var(--gold); }
.played .m-diff { opacity: 1; transform: none; transition-delay: 1.3s; }

/* ---- wird: start → the page opens → «تمّ الورد» → the ring fills ---- */
.m-wird-card { display: flex; gap: 12px; align-items: center; }
.m-wird-info { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.m-wird-info small { color: var(--ink-2); font-size: 11.5px; }
.m-wird .m-after { --after-delay: 3.1s; }
.m-free { border-style: dashed; }
.m-sync-chip { align-self: center; font-size: 12px; font-weight: 600; color: var(--success); }
.m-reader {
  position: absolute; inset: 30px 0 0; z-index: 8; display: flex; flex-direction: column; gap: 12px; padding: 10px 14px 18px;
  background: var(--surface); transform: translateY(105%);
}
.played .m-reader { animation: reader-open 2.6s ease both; }
@keyframes reader-open { 0% { transform: translateY(105%); } 14% { transform: none; } 84% { transform: none; } 100% { transform: translateY(105%); } }
.m-reader-bar { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-2); }
.m-reader-bar b { color: var(--ink); font-size: 13px; }
.m-reader-page { flex: 1; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px; background: var(--paper); }
.played .m-reader-page { animation: page-turn .3s ease-in-out .55s 4; }
@keyframes page-turn { 50% { transform: perspective(500px) rotateY(-14deg); opacity: .6; } }
.m-confirm { text-align: center; background: var(--green); color: var(--on-green); border-radius: 14px; padding: 10px; font-weight: 600; opacity: 0; }
.played .m-confirm { animation: pop-in .3s ease 1.75s both; }
@keyframes pop-in { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

/* ---- hifz map: «حفظت» → waiting → «ممتاز» ---- */
.m-map { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.m-tile { display: grid; place-items: center; min-height: 40px; border-radius: 10px; font: 400 14px/1.2 var(--font-display); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.t-excellent { background: var(--grade-excellent); color: var(--grade-excellent-on); border-color: transparent; }
.t-good { background: var(--grade-good); color: var(--grade-good-on); border-color: transparent; }
.t-acceptable { background: var(--grade-acceptable); color: var(--grade-acceptable-on); border-color: transparent; }
.t-claimed { background: var(--h-claimed); }
.m-tile.t-target { box-shadow: inset 0 0 0 2px var(--gold); }
.played .m-tile.t-target { background: var(--h-excellent); color: #fff; animation: tile-steps 2.2s ease both; }
@keyframes tile-steps { 0% { background: var(--surface); color: var(--ink); } 12%, 70% { background: var(--h-claimed); color: var(--ink); } 100% { background: var(--h-excellent); color: #fff; } }
.m-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 10.5px; color: var(--ink-2); }
.m-legend span { display: inline-flex; gap: 4px; align-items: center; }
.m-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.m-sheet {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 5; display: grid; gap: 8px; padding: 14px 16px 22px;
  background: var(--surface); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 24px -18px rgba(0, 0, 0, .4);
}
.m-sheet-title b { font-family: var(--font-display); font-size: 17px; font-weight: 400; }
.m-wait, .m-grades, .m-ok { display: none; }
.played .m-sheet .hotspot { display: none; }
.played .m-wait { display: block; color: var(--on-gold-soft); background: var(--gold-soft); border-radius: 12px; padding: 0 10px; font-weight: 600; text-align: center; max-height: 0; opacity: 0; overflow: hidden; animation: wait-show 1.4s ease both; }
@keyframes wait-show { 0%, 78% { max-height: 40px; opacity: 1; padding-block: 6px; } 100% { max-height: 0; opacity: 0; padding-block: 0; } }
.played .m-sheet .m-grades { display: grid; animation: pop-in .3s ease 1.1s both; }
.played .m-ok { display: block; color: var(--success); font-weight: 600; text-align: center; animation: pop-in .3s ease 1.8s both; }
.m-grades { grid-template-columns: repeat(4, 1fr); gap: 5px; }
.m-grades .g { display: grid; place-items: center; min-height: 34px; border-radius: 10px; border: 0; font: 600 12px/1 var(--font-ui); background: var(--surface-3); color: var(--ink-2); }
.m-grades .g-ex { background: var(--h-excellent); color: #fff; }
.played .m-sheet .m-grades .g-ex { box-shadow: 0 0 0 3px var(--gold); transition: box-shadow .2s 1.6s; }

/* ---- family: scan the QR → the child appears ---- */
.m-members { display: grid; gap: 6px; }
.m-members li { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.m-members .m-new { display: none; }
.played .m-members .m-new { display: flex; border-color: var(--gold); animation: slide-in .45s ease 1.25s both; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.m-qr-panel { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 10px; border-radius: 16px; border: 1px dashed var(--line-strong); }
.m-qr-panel p { font-size: 11.5px; color: var(--ink-2); }
.m-qr { position: relative; width: 104px; height: 104px; padding: 6px; background: #fff; border-radius: 10px; overflow: hidden; }
.m-qr svg { display: block; width: 100%; height: 100%; }
.m-scanline { position: absolute; inset-inline: 0; top: 0; height: 3px; background: var(--gold); box-shadow: 0 0 12px 2px var(--gold); opacity: 0; }
.played .m-scanline { animation: scan 1s ease-in-out both; }
@keyframes scan { 0% { top: 0; opacity: 1; } 100% { top: 100%; opacity: 1; } }
.m-qr-panel { max-height: 260px; overflow: hidden; }
.played .m-qr-panel { max-height: 0; opacity: 0; padding-block: 0; border-width: 0; animation: qr-out 1.5s ease both; }
@keyframes qr-out { 0%, 70% { max-height: 260px; opacity: 1; padding-block: 10px; border-width: 1px; } 100% { max-height: 0; opacity: 0; padding-block: 0; border-width: 0; } }
.m-khatma { display: grid; gap: 4px; }
.m-khatma small { color: var(--ink-2); font-size: 11px; }
.m-progress { display: block; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.m-progress i { display: block; height: 100%; background: var(--green); border-radius: inherit; }

/* ---- school: «ممتاز» → next portion, guardian informed ---- */
.m-att { display: flex; gap: 6px; }
.m-student { display: grid; gap: 8px; }
.m-st-head { display: flex; align-items: center; gap: 9px; }
.m-portion { font-size: 12px; color: var(--ink-2); }
.m-result { display: none; font-size: 12px; font-weight: 600; color: var(--success); }
.played .m-result { display: block; animation: pop-in .3s ease .4s both; }
.played .m-student .g-ex { box-shadow: 0 0 0 3px var(--gold); }
.m-dim { opacity: .75; }
.m-school { --toast-delay: 1.1s; }

/* ---- prayer: the Qibla compass turns ---- */
.m-hijri { text-align: center; font-family: var(--font-display); font-size: 15px; color: var(--gold); }
.m-next-prayer { display: grid; justify-items: center; padding: 10px; border-radius: 16px; background: var(--green); color: var(--on-green); }
.m-next-prayer b { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.3; }
.m-next-prayer .ltr { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.m-next-prayer small { opacity: .85; font-size: 11px; }
.m-times { display: grid; gap: 2px; }
.m-times li { display: flex; justify-content: space-between; padding: 5px 10px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.m-times li.on { background: var(--green-soft); color: var(--on-green-soft); font-weight: 600; }
.m-qibla {
  position: absolute; inset: 30px 0 0; z-index: 8; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center;
  background: color-mix(in srgb, var(--paper) 96%, transparent); opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.played .m-qibla { opacity: 1; }
.m-qibla small { color: var(--ink-2); }
.m-compass { position: relative; width: 170px; height: 170px; }
.m-dial { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--line-strong); background: radial-gradient(circle, var(--surface) 0 58%, var(--surface-2) 59%); transform: rotate(0deg); }
.played .m-dial { transform: rotate(-101deg); transition: transform 1.6s cubic-bezier(.2, .8, .2, 1) .3s; }
.m-dial .n { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-weight: 700; color: var(--late); font-size: 13px; }
/* The Kaaba at the Qibla's bearing on the dial (101°, Algiers): turned around the dial's centre. */
.m-kaaba { position: absolute; top: 8px; left: 50%; width: 20px; height: 20px; margin-left: -10px; background: #1B231E; border-radius: 3px; box-shadow: inset 0 5px 0 -1px #D9B762; transform-origin: 10px 75px; transform: rotate(101deg); }
.m-needle { position: absolute; top: 18px; bottom: 50%; left: 50%; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--gold); transform-origin: bottom; }
.m-needle::after { content: ""; position: absolute; bottom: -7px; left: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--green); }

/* ---- tasbih: 0 → 33 ---- */
.m-phrase { font-family: var(--font-display); font-size: 26px; color: var(--green); margin-top: 18px !important; }
.m-ring.big { width: 170px; height: 170px; margin-top: 8px; }
.m-ring.big > .m-tap { width: 84%; height: 84%; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-content: center; gap: 2px; font: inherit; color: var(--green); box-shadow: var(--shadow); }
.m-count { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.m-tap small { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.played .m-tap { animation: tap-beat .18s ease .2s 10 alternate; }
@keyframes tap-beat { to { transform: scale(.95); } }
.m-targets { display: flex; gap: 6px; margin-top: 14px; }
.m-targets span { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; }
.m-targets .on { background: var(--green); border-color: var(--green); color: var(--on-green); }
.m-done-line { font-weight: 700; color: var(--success); font-size: 15px; }
.m-tasbih .m-after { --after-delay: 2s; }

/* ---- friends: ranking by steady days, «ذكّره بلطف» ---- */
.m-rank-note { font-size: 11.5px; color: var(--gold); font-weight: 600; }
.m-rank { display: grid; gap: 6px; }
.m-rank li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.m-rank li.me { background: var(--green-soft); color: var(--on-green-soft); border-color: transparent; }
.m-rank li.excused { opacity: .7; }
.m-rank .pos { width: 14px; text-align: center; font-weight: 700; color: var(--gold); }
.m-rank .days { font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.m-nudge { border: 0; border-radius: 999px; padding: 4px 9px; font: 600 11px/1.3 var(--font-ui); background: var(--gold-soft); color: var(--on-gold-soft); white-space: nowrap; }
.m-sent { display: none; font-size: 11px; font-weight: 600; color: var(--success); white-space: nowrap; }
.played .m-nudge { display: none; }
.played .m-sent { display: inline; animation: pop-in .3s ease .2s both; }
.m-badge-row { display: flex; align-items: center; gap: 10px; }
.m-medal { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 700 15px/1 var(--font-ui); color: #3B2A06; background: radial-gradient(circle at 35% 30%, #F7E3A2, #D9B762 45%, #8C6418 100%); }
.m-friends { --toast-delay: .5s; }

/* ---- sync: phone → website ---- */
.m-devices-art { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 6px; }
.m-dev { display: grid; justify-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); }
.m-dev i { display: block; border: 2.5px solid var(--green); border-radius: 8px; background: var(--surface); }
.m-dev-phone i { width: 34px; height: 58px; }
.m-dev-web i { width: 74px; height: 50px; border-radius: 6px; box-shadow: 0 6px 0 -3px var(--green); }
.m-flow { position: relative; flex: 1; height: 10px; border-top: 2px dashed var(--line-strong); margin-top: 8px; }
.m-flow i { position: absolute; top: -7px; right: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); opacity: 0; }
.played .m-flow i { animation: flow 1s ease-in-out calc(var(--i) * .3s) 2 both; }
@keyframes flow { 0% { right: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { right: calc(100% - 12px); opacity: 0; } }
.m-sync-list { display: grid; gap: 6px; }
.m-sync-list li { display: flex; justify-content: space-between; padding: 7px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.m-sync-list .m-tick { opacity: 0; transition: opacity .3s; }
.played .m-sync-list .m-tick { opacity: 1; transition-delay: calc(.7s + var(--i) * .4s); }
.m-last { text-align: center; font-size: 12px; color: var(--success); font-weight: 600; }
.m-sync .m-after { --after-delay: 2s; }
.m-dev-list { display: grid; gap: 2px; font-size: 12px; color: var(--ink-2); }
.m-dev-list li { display: flex; justify-content: space-between; padding: 4px 4px; border-bottom: 1px solid var(--line); }
.m-link { color: var(--danger); font-weight: 600; }

/* ---- share card → chat ---- */
.m-share-card {
  width: 100%; aspect-ratio: 1; border-radius: 18px; padding: 16px 14px 10px; display: grid; align-content: space-between; text-align: center;
  color: #F3E4BC; background: radial-gradient(120% 90% at 50% 0%, #2B6E57 0%, #1E5A46 45%, #0F3A2D 100%);
  transition: transform .6s ease, opacity .6s ease; transform-origin: 50% 100%;
}
.m-share-card .k { font-size: 11px; opacity: .85; font-weight: 600; }
.m-share-card .big { font-family: var(--font-display); font-size: 18px; line-height: 1.75; }
.m-share-card .src { font-size: 11px; opacity: .85; }
.m-share-card .strip { display: flex; gap: 6px; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 14px; border-top: 1px solid rgba(243, 228, 188, .25); padding-top: 6px !important; }
.played .m-share-card { transform: scale(.55) translateY(-30%); opacity: .25; }
.m-chat {
  position: absolute; inset-inline: 0; bottom: 0; z-index: 6; padding: 12px 14px 20px; display: grid; gap: 8px;
  background: #E7DED0; border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .5s ease .5s;
}
:root[data-theme="dark"] .m-chat { background: #0E1A16; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .m-chat { background: #0E1A16; } }
.played .m-chat { transform: none; }
.m-chat-head { font-size: 11px; font-weight: 700; color: #2E7D5B; }
.m-bubble { justify-self: start; max-width: 85%; display: grid; gap: 6px; padding: 6px; border-radius: 12px 12px 12px 4px; background: #D9F5C9; color: #1B231E; }
.m-mini-card { display: grid; place-items: center; aspect-ratio: 1; width: 120px; border-radius: 8px; font-family: var(--font-display); font-size: 13px; color: #F3E4BC; background: radial-gradient(120% 90% at 50% 0%, #2B6E57, #0F3A2D); }
.m-bubble small { font-size: 11px; padding: 0 4px; }

/* ---- sources: thanks, hearts ---- */
.m-credits { display: grid; gap: 6px; }
.m-credits li { display: grid; gap: 1px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.m-credits b { font-size: 12.5px; color: var(--green); }
.m-credits small { font-size: 11.5px; color: var(--ink-2); }
.m-thanks { text-align: center; font-family: var(--font-display); font-size: 17px; color: var(--gold); }
.m-sources .m-after { --after-delay: .5s; }
.m-hearts { position: absolute; inset: auto 0 70px; height: 0; z-index: 7; pointer-events: none; }
.m-hearts i { position: absolute; bottom: 0; right: calc(18% + var(--i) * 15%); width: 16px; height: 16px; opacity: 0; background: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 6-8 11-8 11z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-8-5-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 6-8 11-8 11z'/%3E%3C/svg%3E") center / contain no-repeat; }
.played .m-hearts i { animation: heart-up 1.6s ease-out calc(var(--i) * .15s) both; }
@keyframes heart-up { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-160px) scale(1.2); } }

/* ---- placeholder ---- */
.m-placeholder .m-lines { width: 70%; margin-top: 14px; }

/* ---- without JavaScript, or with reduced motion: the final state at once ---- */
.tour:not(.tour-js) .phone-screen *, .tour:not(.tour-js) .phone-screen *::before, .tour:not(.tour-js) .phone-screen *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .tour *, .tour *::before, .tour *::after { animation: none !important; transition: none !important; }
}
