/* /p/<id> — a shared post, played as the app plays it (worker.ts postPage, post.js).
   On a wide screen the post runs inside a phone on a table; on a phone the page is the screen. */
@font-face{font-family:Teshrin;src:url(/fonts/teshrin-ar-lt-regular.woff2) format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:Teshrin;src:url(/fonts/teshrin-ar-lt-medium.woff2) format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:Teshrin;src:url(/fonts/teshrin-ar-lt-bold.woff2) format("woff2");font-weight:700;font-display:swap}
@font-face{font-family:Teshrin;src:url(/fonts/teshrin-ar-lt-black.woff2) format("woff2");font-weight:900;font-display:swap}

.pv-body *, .pv-body *::before, .pv-body *::after { box-sizing: border-box; }
.pv-body {
  --bg: #0B1A14;
  --cream: #F6EFE2;
  --muted: rgba(246, 239, 226, 0.62);
  --gold: #D7B46A;
  --font: "Teshrin", Tahoma, "Segoe UI", system-ui, sans-serif;
  margin: 0;
  min-height: 100svh;
  background: radial-gradient(120% 90% at 30% 40%, #14302A 0%, var(--bg) 62%);
  color: var(--cream);
  font-family: var(--font);
  color-scheme: dark;
}

.pv {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(260px, 380px) auto;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 4.5vw, 72px);
  padding: 16px clamp(16px, 3vw, 48px);
}
.pv-side { order: -1; display: grid; gap: 14px; text-align: start; }
.pv-stage { display: grid; place-items: center; }

/* The phone on the table: a square photo, the glass laid over it and cut by the photo's own
   mask. post.js maps the screen onto the photo's quad. */
.pv-photo {
  --s: min(calc(100svh - 32px), 60vw, 980px);
  position: relative;
  width: var(--s);
  height: var(--s);
  border-radius: 28px;
  overflow: hidden;
  background: #0E1F18;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
/* The photo's own box; --z crops in on the glass when a scene leaves the phone small. */
.pv-frame {
  --z: 1;
  position: absolute;
  width: calc(var(--s) * var(--z));
  height: calc(var(--s) * var(--z));
  left: calc(var(--s) * (0.5 - 0.4958 * var(--z)));
  top: calc(var(--s) * (0.5 - 0.5038 * var(--z)));
}
.pv-shot { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.pv-glass {
  position: absolute;
  inset: 0;
  -webkit-mask: url(/img/post/scene-mask.png) 0 0 / 100% 100% no-repeat;
  mask: url(/img/post/scene-mask.png) 0 0 / 100% 100% no-repeat;
}
.pv-screen { position: absolute; top: 0; left: 0; width: 340px; height: 736px; transform-origin: 0 0; }

/* «·» between two parts of a label, drawn: the dot itself reads as an Arabic zero beside a digit. */
.pv-body .sep { display: inline-block; width: 1.5px; height: 0.78em; margin: 0 0.55em; border-radius: 1px; background: currentColor; opacity: 0.45; vertical-align: -0.06em; }
.pv-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-weight: 900; font-size: 22px; width: fit-content; }
.pv-brand img { width: 40px; height: 40px; border-radius: 11px; }
.pv-kicker { margin: 18px 0 0; color: var(--gold); font-size: 15px; font-weight: 700; }
.pv-side h1 { margin: 0; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.2; font-weight: 900; letter-spacing: -0.01em; }
.pv-lead { margin: 0; font-size: 18px; color: var(--muted); line-height: 1.7; }
.pv-verses { margin: 0; font-size: 15px; color: var(--cream); opacity: 0.85; }
.pv-howto { margin: 6px 0 0; font-size: 14px; line-height: 1.8; color: var(--muted); max-width: 34ch; }
.pv-side .open { margin: 8px 0 0; }
.pv-side .open-app {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 28px; border-radius: 26px;
  background: var(--gold); color: #1A1408; font-weight: 800; font-size: 17px; text-decoration: none;
}
.pv-side .ctas { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 0; }
.pv .store, .sc .store {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 12px;
  background: #F6EFE2; color: #111; text-decoration: none; direction: ltr; min-width: 160px;
}
.pv .store svg, .sc .store svg { width: 22px; height: 22px; flex: none; }
.pv .store > span, .sc .store > span { display: grid; text-align: start; line-height: 1.15; font-size: 16px; font-weight: 700; font-family: system-ui, sans-serif; }
.pv .store small, .sc .store small { font-size: 11px; font-weight: 400; opacity: 0.75; direction: rtl; font-family: var(--font); }
/* «كل المقاطع والمنشورات» under a player page's store buttons. */
.pv-more { color: var(--gold); font-weight: 700; font-size: 15px; text-decoration: none; width: fit-content; }
.pv-more:hover { text-decoration: underline; text-underline-offset: 5px; }
.pv-noscript { display: grid; gap: 10px; max-width: 560px; margin: 0 auto; padding: 16px; }
.pv-noscript img { width: 100%; height: auto; border-radius: 14px; }

/* On a phone the page is the screen, the words and the stores under it. */
@media (max-width: 760px) {
  .pv { display: block; padding: 0; }
  .pv-photo { width: 100%; height: 100svh; border-radius: 0; box-shadow: none; background: #000; }
  .pv-frame { position: absolute; inset: 0; width: auto; height: auto; }
  .pv-shot { display: none; }
  .pv-glass { -webkit-mask: none; mask: none; }
  .pv-screen { width: 100%; height: 100%; }
  .pv-side { padding: 32px 20px 48px; text-align: center; justify-items: center; }
  .pv-side .ctas { justify-content: center; }
}

/* ─── The screen ─────────────────────────────────────────────────────────── */
.sc {
  position: absolute; inset: 0; overflow: hidden;
  background: #000; color: var(--cream); font-family: var(--font);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  touch-action: pan-y;
  border-radius: inherit;
}
.sc button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
.sc img { -webkit-user-drag: none; pointer-events: none; }

.sc-slide { position: absolute; inset: 0; overflow: hidden; transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; }
.sc-slide .bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(28px) brightness(0.62) saturate(1.1); transform: scale(1.08); }
.sc-slide .fg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.sc-shade-top, .sc-shade-bottom { position: absolute; left: 0; right: 0; pointer-events: none; }
.sc-shade-top { top: 0; height: 140px; background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)); }
.sc-shade-bottom { bottom: 0; height: 46%; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.78)); }

.sc-status { display: none; }
.sc.is-mock .sc-status {
  display: flex; justify-content: space-between; align-items: center; direction: ltr;
  position: absolute; top: 0; left: 0; right: 0; height: 34px; padding: 0 26px;
  font: 600 13px/1 system-ui, -apple-system, sans-serif; letter-spacing: 0.01em;
}
.sc-status svg { height: 11px; width: auto; margin-left: 5px; }

.sc-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 0; display: grid; gap: 10px; transition: opacity 200ms; }
.sc.is-mock .sc-top { padding-top: 38px; }
.sc-bars { display: flex; gap: 3px; }
.sc-bar { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(246, 239, 226, 0.3); overflow: hidden; position: relative; }
.sc-bar i { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 0; background: var(--cream); border-radius: 2px; }

.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-start-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sc-count { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.sc-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; max-width: 210px;
  padding-inline: 5px 10px; border-radius: 16px; background: rgba(0, 0, 0, 0.35);
}
.sc-chip img { width: 23px; height: 23px; border-radius: 50%; object-fit: cover; flex: none; }
.sc-chip span { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-chip svg { width: 13px; height: 13px; flex: none; color: var(--muted); }
.sc-logo { display: block; width: 32px; height: 32px; border-radius: 9px; overflow: hidden; flex: none; }
.sc-logo img { width: 100%; height: 100%; }

.sc-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 14px calc(env(safe-area-inset-bottom, 0px) + 20px);
  display: flex; align-items: flex-end; gap: 12px; transition: opacity 200ms;
}
.sc.is-mock .sc-bottom { padding-bottom: 26px; }
.sc-words { flex: 1; min-width: 0; display: grid; gap: 3px; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.sc-series { margin: 0; font-size: 12px; font-weight: 700; color: var(--gold); }
.sc-title { margin: 0; font-size: 21px; line-height: 1.3; font-weight: 900; }
.sc-caption { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-verses { margin: 4px 0 0; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; color: var(--cream); opacity: 0.9; }
.sc-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; }
.sc-eq i { width: 2.5px; height: 30%; border-radius: 1px; background: var(--gold); }
.sc.is-voicing .sc-eq i { animation: sc-eq 900ms ease-in-out infinite alternate; }
.sc.is-voicing .sc-eq i:nth-child(2) { animation-delay: -300ms; animation-duration: 700ms; }
.sc.is-voicing .sc-eq i:nth-child(3) { animation-delay: -600ms; animation-duration: 1100ms; }
@keyframes sc-eq { from { height: 25%; } to { height: 100%; } }

.sc-side { display: grid; gap: 12px; justify-items: center; }
.sc-round {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform 120ms ease-out, background-color 150ms;
}
.sc-round:active { transform: scale(0.92); }
.sc-round svg { width: 21px; height: 21px; }

.sc.is-held .sc-top, .sc.is-held .sc-bottom { opacity: 0; }

/* A film stopped by a tap shows the play mark in the middle, as the app's films pager does. */
.sc-paused {
  position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  display: grid; place-items: center; border-radius: 50%; pointer-events: none;
  background: rgba(0, 0, 0, 0.38); opacity: 0; transform: scale(1.2);
  transition: opacity 160ms ease-out, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.sc-paused svg { width: 30px; height: 30px; margin-left: 4px; color: var(--cream); }
.sc.is-paused .sc-paused { opacity: 1; transform: none; }
.sc-film .sc-count { color: var(--cream); opacity: 0.85; }

/* Before the first tap: the browser lets sound start only from one. */
.sc-start {
  position: absolute; inset: 0; z-index: 15; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: rgba(6, 12, 10, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  text-align: center; padding: 24px; cursor: pointer;
  transition: opacity 260ms ease-out;
}
.sc-start[hidden] { display: none; }
.sc-play {
  width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(246, 239, 226, 0.14); box-shadow: inset 0 0 0 1.5px rgba(215, 180, 106, 0.85);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform 150ms ease-out;
}
.sc-start:active .sc-play { transform: scale(0.94); }
.sc-play svg { width: 30px; height: 30px; margin-left: 4px; color: var(--cream); }
.sc-start b { font-size: 19px; font-weight: 900; }
.sc-start small { font-size: 13px; color: var(--muted); line-height: 1.7; max-width: 26ch; }

/* The reciter sheet, as the app's ReciterSheet. */
.sc-sheet { position: absolute; inset: 0; z-index: 20; }
.sc-sheet[hidden] { display: none; }
.sc-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); opacity: 0; transition: opacity 180ms; }
.sc-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 72%; display: flex; flex-direction: column;
  background: #100E0C; border-radius: 22px 22px 0 0; border-top: 1px solid rgba(215, 180, 106, 0.25);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  transform: translateY(60px); opacity: 0; transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms;
}
.sc-sheet.is-open .sc-dim { opacity: 1; }
.sc-sheet.is-open .sc-panel { transform: none; opacity: 1; }
.sc-grab { display: grid; place-items: center; padding: 10px 0 6px; width: 100%; }
.sc-grab i { width: 36px; height: 4.5px; border-radius: 3px; background: rgba(246, 239, 226, 0.25); }
.sc-head { padding: 0 20px 10px; display: grid; gap: 2px; }
.sc-head b { font-size: 18px; font-weight: 900; }
.sc-head span { font-size: 13px; color: var(--gold); font-weight: 500; }
.sc-list { overflow-y: auto; padding: 0 12px; display: grid; gap: 2px; overscroll-behavior: contain; }
.sc-voice {
  display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 8px; border-radius: 14px; text-align: start; width: 100%;
  transition: background-color 150ms;
}
.sc-voice:hover { background: rgba(246, 239, 226, 0.06); }
.sc-voice.is-on { background: rgba(215, 180, 106, 0.1); }
.sc-voice:disabled { opacity: 0.4; cursor: default; }
.sc-voice img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.sc-voice .w { flex: 1; min-width: 0; display: grid; }
.sc-voice .n { font-size: 15.5px; font-weight: 500; }
.sc-voice.is-on .n { font-weight: 900; }
.sc-voice .note { font-size: 12px; color: var(--muted); }
.sc-voice svg { width: 22px; height: 22px; color: var(--gold); flex: none; }
.sc-voice .tick { width: 22px; flex: none; }

/* After the last slide: again, the next part, or the app. */
.sc-end {
  position: absolute; inset: 0; z-index: 12; display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 28px 22px; text-align: center; background: rgba(6, 12, 10, 0.72);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  opacity: 0; pointer-events: none; transition: opacity 280ms ease-out;
}
.sc-end.is-on { opacity: 1; pointer-events: auto; }
.sc-end .k { margin: 0; font-size: 13px; color: var(--gold); font-weight: 700; }
.sc-end h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.35; font-weight: 900; }
.sc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px;
  border-radius: 23px; font-size: 15px; font-weight: 800; text-decoration: none; width: 100%; max-width: 250px;
}
.sc-btn.primary { background: var(--gold); color: #1A1408; }
.sc-btn.ghost { box-shadow: inset 0 0 0 1px rgba(246, 239, 226, 0.3); color: var(--cream); }
.sc-btn svg { width: 18px; height: 18px; }
.sc-end .more { margin: 14px 0 2px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.sc-end .stores { display: grid; gap: 8px; }
.sc-end .store { min-width: 0; width: 200px; padding: 6px 12px; }

.sc-toast {
  position: absolute; left: 50%; bottom: 120px; z-index: 30; transform: translate(-50%, 8px);
  padding: 8px 16px; border-radius: 18px; background: rgba(20, 20, 18, 0.9); font-size: 13px; font-weight: 700;
  opacity: 0; transition: opacity 180ms, transform 180ms; pointer-events: none; white-space: nowrap;
}
.sc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .sc-slide { transition: none; }
  .sc.is-voicing .sc-eq i { animation: none; height: 70%; }
}
