/* phone-stories.css — نسخة الموبايل «تطبيق». كل القواعد جوّه @media (max-width:767px) وتحت html.phone-app
   صف دواير «نتايج حقيقية» تحت الهيرو + عارض الستوري بملء الشاشة (جزيرة غامقة في الثيمين). مفيش blur خالص. */
@media (max-width: 767px) {
  html.phone-app {
    --pst-lime: #C4F82A;
    --pst-ink: #0A0A0B;
    --pst-ring: #C4F82A;
    --pst-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  }
  html.phone-app[data-theme="light"] { --pst-ring: #6E9A0C; }

  /* ---------- صف الدواير ---------- */
  html.phone-app .pstories {
    position: relative; z-index: 1; padding: 22px 0 6px;
    scroll-margin-top: calc(var(--phone-top-h, 64px) + 8px);
  }
  html.phone-app .pstories__head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding-inline: var(--pad-x, 18px); margin-bottom: 12px;
  }
  html.phone-app .pstories__t {
    display: flex; align-items: center; gap: 8px; margin: 0;
    font-size: 19px; font-weight: 800; line-height: 1.3; letter-spacing: 0; color: var(--text);
  }
  html.phone-app .pstories__t::before {
    content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%;
    background: var(--pst-ring); box-shadow: 0 0 0 4px var(--accent-soft);
  }
  html.phone-app .pstories__hint { font-size: 12px; color: var(--text-2); white-space: nowrap; }
  html.phone-app .pstories__rings {
    list-style: none; margin: 0; display: flex; gap: 6px;
    padding: 6px var(--pad-x, 18px) 10px; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; touch-action: pan-x pan-y; scroll-snap-type: x proximity;
    scroll-padding-inline: var(--pad-x, 18px);
  }
  html.phone-app .pstories__rings::-webkit-scrollbar { display: none; }
  html.phone-app .pring { flex: none; width: 86px; scroll-snap-align: start; }
  html.phone-app .pring__btn {
    width: 100%; min-height: 44px; display: flex; flex-direction: column; align-items: center;
    padding: 2px 0 4px; text-align: center; border-radius: 16px; -webkit-tap-highlight-color: transparent;
  }
  html.phone-app .pring__btn:focus-visible { outline: 2px solid var(--pst-ring); outline-offset: 2px; }
  /* حلقة ليموني بفاصل غامق؛ اللي اتشافت بتبقى خط رمادي رفيع */
  html.phone-app .pring__o {
    position: relative; display: block; width: 72px; height: 72px; padding: 3px; border-radius: 50%;
    background: conic-gradient(from 200deg, var(--pst-ring), #7BE0A4 40%, var(--pst-ring) 70%, var(--pst-ring));
    transition: transform .2s ease;
  }
  html.phone-app .pring__btn:active .pring__o { transform: scale(.93); }
  html.phone-app .pring__c {
    display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
    border: 3px solid var(--bg); background: var(--surface); color: var(--text); overflow: hidden;
  }
  html.phone-app .pring.is-seen .pring__o { padding: 1.5px; background: var(--glass-brd-hi); }
  html.phone-app .pring.is-seen .pring__c { border-width: 4.5px; }
  html.phone-app .pring--me .pring__c { background: var(--pst-lime); color: var(--pst-ink); }
  html.phone-app .pst-ico { display: inline-grid; place-items: center; }
  html.phone-app .pst-ico svg { width: 100%; height: 100%; }
  html.phone-app .pring__person { width: 32px; height: 32px; }
  html.phone-app .pring__person svg { stroke-width: 2.2; }
  html.phone-app .pring__icon { width: 28px; height: 28px; color: var(--accent-txt); }
  html.phone-app .pring__k {
    font-size: 19px; font-weight: 800; line-height: 1; letter-spacing: -.01em; color: var(--accent-txt);
    direction: ltr; unicode-bidi: isolate;
  }
  html.phone-app .pring__n {
    position: absolute; top: -3px; inset-inline-end: -4px; display: grid; place-items: center;
    min-width: 25px; height: 21px; padding-inline: 4px; border-radius: 11px;
    background: var(--surface-2); box-shadow: 0 0 0 2px var(--bg); color: var(--text);
    font: 600 11px/1 var(--pst-mono); direction: ltr; unicode-bidi: isolate;
  }
  html.phone-app .pring__n--mic { width: 23px; min-width: 0; height: 23px; padding: 4px; background: var(--pst-lime); color: var(--pst-ink); }
  html.phone-app .pring__l {
    margin-top: 7px; max-width: 100%; font-size: 12px; font-weight: 700; line-height: 1.35; color: var(--text);
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  }
  html.phone-app .pring__s { margin-top: 1px; font-size: 11px; line-height: 1.3; color: var(--text-2); white-space: nowrap; }

  /* ---------- العارض ---------- */
  html.phone-app.story-open, html.phone-app.story-open body { overflow: hidden !important; }
  html.phone-app .pstory:not([hidden]) {
    position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; overflow: hidden;
    padding-block: calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-bottom) + 10px);
    color: #F5F5F4; color-scheme: dark;
    background:
      radial-gradient(110% 46% at 70% 8%, rgba(196,248,42,.16), transparent 70%),
      linear-gradient(180deg, #121411 0%, #0A0A0B 55%, #070708 100%);
    touch-action: none; overscroll-behavior: contain; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    font-family: inherit;
  }
  html.phone-app .pstory button { color: inherit; }
  html.phone-app .pstory :focus-visible { outline: 2px solid var(--pst-lime); outline-offset: 2px; }
  html.phone-app .pst-num { direction: ltr; unicode-bidi: isolate; }

  html.phone-app .pstory__bars { display: flex; gap: 4px; padding-inline: 10px; }
  html.phone-app .pstory__bars i { flex: 1; height: 3px; overflow: hidden; border-radius: 2px; background: rgba(245,245,244,.24); }
  html.phone-app .pstory__bars b { display: block; height: 100%; background: #F5F5F4; transform: scaleX(0); transform-origin: left center; }
  html.phone-app[dir="rtl"] .pstory__bars b { transform-origin: right center; }
  html.phone-app .pstory__bars .is-done b { transform: scaleX(1); }

  html.phone-app .pstory__head { display: flex; align-items: center; gap: 10px; padding: 8px 6px 0 14px; padding-inline: 14px 6px; }
  html.phone-app .pstory__av {
    flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
    background: #1B1B1F; box-shadow: 0 0 0 2px #0A0A0B, 0 0 0 4px var(--pst-lime);
  }
  html.phone-app .pstory__av img { width: 100%; height: 100%; object-fit: cover; }
  html.phone-app .pstory__av.is-me { background: var(--pst-lime); color: var(--pst-ink); }
  html.phone-app .pstory__av .pst-ico { width: 22px; height: 22px; }
  html.phone-app .pstory__who { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
  html.phone-app .pstory__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 700; }
  html.phone-app .pstory__count {
    align-self: flex-start; font: 500 11.5px/1.2 var(--pst-mono); letter-spacing: .06em; color: rgba(245,245,244,.62);
    direction: ltr; unicode-bidi: isolate;
  }
  html.phone-app .pstory__icon { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
  html.phone-app .pstory__icon .pst-ico { width: 22px; height: 22px; }
  html.phone-app .pstory__i-play, html.phone-app .pstory.is-paused .pstory__i-pause { display: none; }
  html.phone-app .pstory.is-paused .pstory__i-play { display: inline-grid; }

  html.phone-app .pstory__stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  html.phone-app .pstory__body {
    position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
    padding: clamp(10px, 2svh, 20px) 22px 0; pointer-events: none;
  }
  html.phone-app .pstory__body :is(button, a) { pointer-events: auto; }
  html.phone-app .pstory__zone {
    position: absolute; top: 0; bottom: 0; z-index: 0; width: 33.334%; padding: 0; border: 0; background: none;
    -webkit-tap-highlight-color: transparent;
  }
  html.phone-app .pstory__zone--prev { inset-inline-start: 0; }
  html.phone-app .pstory__zone--next { inset-inline-end: 0; width: 66.666%; }
  html.phone-app .pstory__zone:focus-visible { outline-offset: -4px; border-radius: 16px; }

  /* --- يحيي: لقطة مدير الإعلانات مايلة --- */
  html.phone-app .pstory__shot {
    flex: none; width: min(100%, 330px); margin: 4px auto 0; padding: 8px; border-radius: 18px;
    background: #1B1B1F; transform: rotate(-3deg);
    box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 30px 60px -24px #000, 0 20px 60px -30px rgba(196,248,42,.45);
  }
  html.phone-app[dir="rtl"] .pstory__shot { transform: rotate(3deg); }
  html.phone-app .pstory__shotcap {
    display: flex; align-items: center; gap: 6px; padding: 0 6px 7px; font-size: 11px; color: rgba(245,245,244,.62);
  }
  html.phone-app .pstory__shotcap::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--pst-lime); }
  html.phone-app .pstory__shot img {
    display: block; width: 100%; height: clamp(130px, 31svh, 290px); object-fit: cover; object-position: center 12%;
    border-radius: 12px; background: #EEF1F7;
  }

  html.phone-app .pstory__res { margin-top: clamp(16px, 3.4svh, 30px); }
  html.phone-app .pstory__k { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
  html.phone-app .pstory__tag {
    display: inline-flex; align-items: center; gap: 6px; height: 26px; padding-inline: 10px; border-radius: 999px;
    background: var(--pst-lime); color: var(--pst-ink); font-size: 12px; font-weight: 800;
  }
  html.phone-app .pstory__tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--pst-ink); }
  html.phone-app .pstory__role { font-size: 12.5px; color: rgba(245,245,244,.7); }
  html.phone-app .pstory__fig { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 0; line-height: .9; }
  html.phone-app .pstory__big {
    font-size: clamp(66px, 21vw, 92px); font-weight: 800; letter-spacing: -.035em; color: #fff;
    direction: ltr; unicode-bidi: isolate; text-shadow: 0 0 44px rgba(196,248,42,.22);
  }
  html.phone-app .pstory__unit { font-size: clamp(26px, 8vw, 32px); font-weight: 800; color: var(--pst-lime); }
  html.phone-app .pstory__note { margin: 6px 0 0; font-size: 15px; color: rgba(245,245,244,.72); }
  html.phone-app .pstory__note b { color: #fff; }

  html.phone-app .pstory__vrow {
    display: flex; align-items: center; gap: 10px; margin-top: clamp(14px, 2.6svh, 24px); height: 56px;
    padding-inline: 6px 18px; border-radius: 999px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
  }
  html.phone-app .pstory__vtime { flex: none; min-width: 34px; font: 600 13px/1 var(--pst-mono); color: rgba(245,245,244,.8); }
  html.phone-app .pstory__wave { flex: 1; min-width: 0; height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 2px; direction: ltr; }
  html.phone-app[dir="rtl"] .pstory__wave { flex-direction: row-reverse; }
  html.phone-app .pstory__wave i { flex: 1; max-width: 3px; height: calc(var(--h, .5) * 100%); min-height: 3px; border-radius: 2px; background: rgba(245,245,244,.3); }
  html.phone-app .pstory__wave i.is-on { background: var(--pst-lime); }
  html.phone-app .pstory__voice {
    flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: var(--pst-lime); color: var(--pst-ink) !important; box-shadow: 0 0 0 6px rgba(196,248,42,.14);
  }
  html.phone-app .pstory__voice .pst-ico { width: 20px; height: 20px; }
  html.phone-app .pstory__vpause, html.phone-app .pstory__voice.is-playing .pstory__vplay { display: none; }
  html.phone-app .pstory__voice.is-playing .pstory__vpause { display: inline-grid; }
  html.phone-app .pstory__quote {
    margin: clamp(12px, 2.4svh, 22px) 0 0; font-size: 17px; font-weight: 700; line-height: 1.6; color: #fff; text-wrap: pretty;
  }
  html.phone-app .pstory__quote mark { background: none; color: var(--pst-lime); }

  /* --- الحملات --- */
  html.phone-app .pstory__wm {
    position: absolute; top: 2%; inset-inline-start: 6px; z-index: -1; font: 800 clamp(190px, 58vw, 250px)/1 var(--pst-mono);
    letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 1.5px rgba(245,245,244,.07);
  }
  html.phone-app .pstory__ep { margin-block: auto; padding-inline-end: 34px; padding-bottom: 12px; }
  html.phone-app .pstory__fig--ep { margin-top: 14px; }
  html.phone-app .pstory__fig--ep .pstory__big { font-size: clamp(88px, 29vw, 124px); }
  html.phone-app .pstory__unitline { margin: 6px 0 0; font-size: clamp(22px, 6.6vw, 27px); font-weight: 800; line-height: 1.3; color: #fff; }
  html.phone-app .pstory__phrase { margin: 14px 0 0; font-size: clamp(32px, 10vw, 40px); font-weight: 800; line-height: 1.25; color: #fff; text-wrap: balance; }
  html.phone-app .pstory__desc { margin: 14px 0 0; font-size: 16px; line-height: 1.7; color: rgba(245,245,244,.78); text-wrap: pretty; }
  html.phone-app .pstory__desc--sm { margin-top: 10px; font-size: 13px; color: rgba(245,245,244,.6); }
  html.phone-app .pstory__pill {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 5px; margin: 18px 0 0; padding: 8px 14px;
    border-radius: 999px; font-size: 13px; line-height: 1.4; color: rgba(245,245,244,.8); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
  }
  html.phone-app .pstory__pill .pst-num { color: #fff; font-weight: 700; font-family: var(--pst-mono); }
  html.phone-app .pstory__pill .pst-ico { width: 13px; height: 13px; color: var(--pst-lime); }
  html.phone-app[dir="rtl"] .pstory__pill .pst-ico { transform: scaleX(-1); }
  html.phone-app .pstory__lesson { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
  html.phone-app .pstory__lnum { display: flex; align-items: baseline; gap: 8px; }
  html.phone-app .pstory__lnum small { font-size: 15px; font-weight: 700; color: var(--pst-lime); }
  html.phone-app .pstory__lnum .pst-num { font: 800 clamp(64px, 20vw, 84px)/1 var(--pst-mono); letter-spacing: -.05em; color: #fff; }
  html.phone-app .pstory__ltitle { margin: 0; font-size: clamp(21px, 6.2vw, 25px); font-weight: 800; line-height: 1.45; color: #fff; text-wrap: balance; }
  html.phone-app .pstory__ltitle .hit { color: var(--pst-ink); background: var(--pst-lime); padding: 0 .25em; border-radius: 6px; }

  /* اللي بعده مستني على الحافة */
  html.phone-app .pstory__peek {
    position: absolute; top: 40%; inset-inline-end: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 8px;
    width: 40px; min-height: 120px; max-height: 210px; padding: 10px 0; overflow: hidden;
    border-start-start-radius: 14px; border-end-start-radius: 14px;
    background: #17181A; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1);
  }
  html.phone-app[dir="rtl"] .pstory__peek { border-radius: 0 14px 14px 0; }
  html.phone-app[dir="ltr"] .pstory__peek { border-radius: 14px 0 0 14px; }
  html.phone-app .pstory__peek[hidden] { display: none; }
  html.phone-app .pstory__peek-k { font-size: 12px; font-weight: 800; color: var(--pst-lime); writing-mode: vertical-rl; }
  html.phone-app .pstory__peek-i { width: 20px; height: 20px; color: var(--pst-lime); }
  html.phone-app .pstory__peek small {
    min-height: 0; overflow: hidden; writing-mode: vertical-rl; font-size: 11px; line-height: 1.2; color: rgba(245,245,244,.75);
    white-space: nowrap; text-overflow: ellipsis;
  }
  html.phone-app[dir="ltr"] .pstory__peek small { transform: rotate(180deg); }

  /* شريط الرد = اشترِ */
  html.phone-app .pstory__reply {
    position: relative; z-index: 3; flex: none; display: flex; align-items: center; gap: 10px; height: 58px; margin: 10px 12px 0;
    padding-inline: 18px 6px; border-radius: 999px; background: #121214; box-shadow: inset 0 0 0 1.2px rgba(245,245,244,.22);
    color: rgba(245,245,244,.82); font-size: 14.5px; text-decoration: none; -webkit-tap-highlight-color: transparent;
  }
  html.phone-app .pstory__ask { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  html.phone-app .pstory__go {
    flex: none; display: flex; align-items: center; gap: 7px; height: 46px; margin-inline-start: auto; padding-inline: 18px 16px;
    border-radius: 999px; background: var(--pst-lime); color: var(--pst-ink); font-size: 15px; font-weight: 800;
  }
  html.phone-app .pstory__arr { width: 18px; height: 18px; }
  html.phone-app[dir="rtl"] .pstory__arr { transform: scaleX(-1); }

  /* شاشات قصيرة */
  @media (max-height: 740px) {
    html.phone-app .pstory__shot img { height: clamp(100px, 20svh, 150px); }
    html.phone-app .pstory__big { font-size: clamp(54px, 17vw, 72px); }
    html.phone-app .pstory__fig--ep .pstory__big { font-size: clamp(70px, 22vw, 96px); }
    html.phone-app .pstory__quote { font-size: 15.5px; line-height: 1.5; }
    html.phone-app .pstory__vrow { height: 50px; }
  }
  @media (prefers-reduced-motion: reduce) {
    html.phone-app .pstory__pause { display: none; }
    html.phone-app .pstory__bars .is-now b { transform: scaleX(1); }
    html.phone-app .pring__o { transition: none; }
  }
}
