/* =========================================================
   claude-flow — طبقة الحركة بعد اللصق + صف المنصات بالنقاط
   تُحمَّل بعد claude-sp.css وتعلو عليه. لا تغيّر منطق الصفحة.
   ========================================================= */

/* ── صف المنصات: أسماء خفيفة + نقطة حالة تلمع ── */
.sp-head .sp-plats{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:10px 30px;
  margin-top:24px;padding:0;background:none;border:0;border-radius:0;box-shadow:none;
  font-size:15px;font-weight:400;letter-spacing:.01em;color:#8b8b93;text-decoration:none}
.sp-head .sp-plats,.sp-head .sp-plats:hover{background:none!important;border:0!important;box-shadow:none!important;
  -webkit-backdrop-filter:none!important;backdrop-filter:none!important}
.sp-head{overflow:visible}
@media(min-width:641px){.sp-head .sp-plats{width:min(900px,94vw);margin-inline:50%;transform:translateX(50%);gap:10px 28px;font-size:14.5px}}
.sp-head .sp-plats:after,.sp-head .sp-plats .pl-more,.sp-head .sp-plats .pl img{display:none}
.sp-head .sp-plats{direction:rtl}
.sp-head .sp-plats .pl{direction:ltr;height:auto;padding:0;gap:9px;background:none;border-radius:0;color:#8b8b93;transition:color .35s ease}
.sp-head .sp-plats .pl i{order:2;width:7px;height:7px;border-radius:50%;flex:none;animation:none;
  background:#3fcf73;box-shadow:0 0 10px rgba(63,207,115,.55)}
.sp-head .sp-plats .pl[data-s="warn"] i{background:#d8a23c;box-shadow:0 0 10px rgba(216,162,60,.5)}
.sp-head .sp-plats .pl[data-s="down"] i{background:#ef5b5b;box-shadow:0 0 10px rgba(239,91,91,.55)}
.sp-head .sp-plats .pl:hover,.sp-head .sp-plats .pl.is-on{color:#ededf1}
.sp-head .sp-plats .pl.is-on i{box-shadow:0 0 14px currentColor,0 0 4px rgba(63,207,115,.9)}
@media(max-width:640px){.sp-head .sp-plats{gap:10px 18px;font-size:13.5px;padding:0 6px}}

/* ── 1) لحظة اللصق: الشريط يلمع ويضغط ── */
.sp-pill{position:relative}
.sp-pill:after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;opacity:0;
  background:linear-gradient(100deg,transparent 30%,rgba(255,255,255,.16) 48%,rgba(255,255,255,.04) 56%,transparent 70%) 0 0/250% 100% no-repeat}
body.fl-catch .sp-pill:after{animation:fl-sweep .9s cubic-bezier(.4,0,.2,1) both}
@keyframes fl-sweep{0%{opacity:1;background-position:120% 0}100%{opacity:0;background-position:-60% 0}}
body.fl-catch .sp-pill{animation:fl-press .55s cubic-bezier(.32,.72,0,1) both}
@keyframes fl-press{30%{transform:scale(.985)}100%{transform:none}}

/* ── 2) العنوان يطير قبل ما ينطوي (بلا تقطّع الحروف) ── */
body.fl .sp-head{transition:opacity .32s ease,filter .32s ease,transform .45s cubic-bezier(.32,.72,0,1),
  max-height .6s .22s cubic-bezier(.32,.72,0,1),margin .6s .22s cubic-bezier(.32,.72,0,1)}
body.fl.is-loading .sp-head,body.fl.is-ready .sp-head{transform:translateY(-18px) scale(.97);animation:none;opacity:0;visibility:hidden;
  transition:opacity .22s ease,filter .3s ease,transform .45s cubic-bezier(.32,.72,0,1),visibility 0s .3s,max-height .6s .22s cubic-bezier(.32,.72,0,1),margin .6s .22s cubic-bezier(.32,.72,0,1)}
body.fl.is-loading .sp-head .pl,body.fl.is-ready .sp-head .pl{opacity:0;transition:opacity .25s ease}

/* ── 3) المربع الكبير: ستوري أثناء الجلب ── */
.fl-bars{position:absolute;top:14px;inset-inline:16px;z-index:3;display:flex;gap:6px;direction:rtl;opacity:0;transition:opacity .4s ease .35s}
body.fl .fl-bars{opacity:1}
.fl-bars i{flex:1;height:3px;border-radius:3px;background:rgba(255,255,255,.22);overflow:hidden;position:relative}
.fl-bars i:before{content:"";position:absolute;inset:0;background:#fff;border-radius:inherit;
  transform:scaleX(var(--p,0));transform-origin:right;transition:transform var(--d,.8s) var(--e,cubic-bezier(.4,0,.2,1))}
.fl-say{position:absolute;inset:auto 0 22px;z-index:3;text-align:center;font-size:14px;font-weight:500;color:rgba(255,255,255,.9);letter-spacing:.01em}
.fl-say b{display:inline-block;font-weight:500;animation:fl-word .5s cubic-bezier(.32,.72,0,1) both}
@keyframes fl-word{from{opacity:0;transform:translateY(8px);filter:blur(6px)}to{opacity:1;transform:none;filter:none}}
body.fl .sp-loader-frame>span{display:none}
body.fl .sp-loader-frame{animation:none;will-change:transform}

/* ── 4) الانكشاف: المربع يصغر ويتحوّل للفيديو ── */
body.fl .preview.show .sp-media{animation:none}
body.fl .preview.show .sp-info{animation:none}
body.fl.media-ok .sp-info>*{animation:fl-up .7s cubic-bezier(.32,.72,0,1) both}
body.fl.media-ok .sp-info>*:nth-child(1){animation-delay:.55s}
body.fl.media-ok .sp-info>*:nth-child(2){animation-delay:.68s}
body.fl.media-ok .sp-info>*:nth-child(3){animation-delay:.8s}
@keyframes fl-up{from{opacity:0;transform:translateY(14px);filter:blur(8px)}to{opacity:1;transform:none;filter:none}}

/* لا شاشة سوداء: الغلاف خلف المشغّل حتى يبدأ الفيديو فعلاً */
.player-wrap{background:var(--poster,none) center/contain no-repeat,#0d0d10}
body.fl .player-wrap video{transition:opacity .5s ease}
body.fl .player-wrap:not(.fl-vid) video{opacity:0}

/* الأزرار تطلع وحدة وحدة */
body.fl-pop .sp-stage.has-url .sp-orb{animation:fl-orb .7s cubic-bezier(.34,1.45,.64,1) both;animation-delay:calc(.42s + var(--fi,0) * 80ms)}
/* المرحلة الثانية: الأيقونات مخفية حتى يبدأ المربع الكبير، ثم الشريط يصغر وتطلع جنبه */
body.fl:not(.fl-icons) .sp-stage.has-url .sp-orbs,body.fl:not(.fl-icons) .sp-stage.has-url .b-orbs{width:0}
body.fl:not(.fl-icons) .sp-stage.has-url .sp-orb{opacity:0;pointer-events:none}
@media(max-width:640px){body.fl:not(.fl-icons) .sp-stage.has-url .sp-orbs,body.fl:not(.fl-icons) .sp-stage.has-url .b-orbs{width:auto;height:0}}
@keyframes fl-orb{from{opacity:0;transform:translateY(10px) scale(.6)}to{opacity:1;transform:none}}

@media (prefers-reduced-motion:reduce){
  body.fl .sp-head,body.fl .fl-bars i:before{transition:none}
  body.fl-catch .sp-pill,body.fl-catch .sp-pill:after,body.fl-pop .sp-orb,body.fl-pop .sp-pill,body.fl.media-ok .sp-info>*{animation:none}
}

/* المنصات أصغر + مربع صغير بعدد الباقي */
.sp-head .sp-plats{gap:8px 20px;font-size:12.5px;margin-top:20px}
.sp-head .sp-plats .pl{gap:7px}
.sp-head .sp-plats .pl i{width:6px;height:6px}
.fl-more{direction:ltr;display:inline-flex;align-items:center;height:20px;padding:0 7px;border-radius:6px;
  border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.04);color:#c9c9cf;
  font-size:11px;font-weight:500;font-variant-numeric:tabular-nums;letter-spacing:.02em;transition:background .25s,color .25s,border-color .25s}
.sp-head .sp-plats:hover .fl-more{background:#fff;color:#0b0b0c;border-color:#fff}
body.fl.is-loading .sp-head .fl-more,body.fl.is-ready .sp-head .fl-more{opacity:0}
@media(min-width:641px){.sp-head .sp-plats{gap:8px 22px;font-size:13px}}
@media(max-width:640px){.sp-head .sp-plats{gap:8px 14px;font-size:12px}}

/* مشغّل يوتيوب: لا مربع أبيض — الغلاف يبقى حتى يجهز المشغّل */
body.fl .player-wrap iframe{transition:opacity .6s ease}
body.fl .player-wrap:not(.fl-ifr) iframe{opacity:0}
/* الملاحظات تحت ما تزاحم الشريط وهو ينزل */
body.fl .sp-notes{transition:opacity .5s ease .9s}
body.fl.is-loading:not(.media-ok) .sp-notes,body.fl.is-ready:not(.media-ok) .sp-notes{opacity:0;transition:none}

/* =========================================================
   المربع المختار: خلفية «هادئ» + نسبة مئوية + عبارات تقنية
   ========================================================= */
body.fl .sp-loader-frame{background:#0b0b0d!important}
body.fl .sp-loader-frame .sp-waves,body.fl .sp-loader-frame:after,body.fl .fl-bars{display:none}
.fl-line{position:absolute;left:24%;right:24%;top:50%;height:1px;z-index:3;background:rgba(255,255,255,.12);overflow:hidden}
.fl-line:before{content:"";position:absolute;inset:0;width:40%;background:linear-gradient(90deg,transparent,#fff,transparent);animation:fl-run 1.6s cubic-bezier(.6,0,.3,1) infinite}
@keyframes fl-run{from{transform:translateX(-120%)}to{transform:translateX(320%)}}
body.fl .fl-say{inset:calc(50% + 16px) 0 auto}
.fl-pct{position:absolute;top:14px;inset-inline-end:14px;z-index:4;padding:5px 10px;border-radius:999px;direction:ltr;
  background:rgba(0,0,0,.35);border:1px solid rgba(255,255,255,.14);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  font-size:12px;font-weight:500;font-variant-numeric:tabular-nums;color:#fff}
@media (prefers-reduced-motion:reduce){.fl-line:before{animation:none;left:30%}}

/* الفيديو العمودي: الغلاف يملأ المربع (صور يوتيوب للشورتس عرضية بحواف) */
.player-wrap.portrait{background-size:cover}
.player-wrap.portrait .poster{object-fit:cover!important}
/* العنوان ينطوي فورًا في التخطيط (يختفي بصريًا بالتلاشي) — فالشريط يعرف مكانه النهائي من أول لحظة */
body.fl.is-loading .sp-head,body.fl.is-ready .sp-head{transition:opacity .2s ease,visibility 0s .2s;max-height:0;margin:0}
body.fl.is-loading .sp-stage,body.fl.is-ready .sp-stage{transition:none}
/* تلميح الآيفون يظهر فقط داخل لوح التنزيل المفتوح — لا يغطي الشريط أو العنوان */
body.fl:not(:has(#preview.show[data-panel="get"])) #shareHint{display:none!important}

/* =========================================================
   19 نوفمبر — اختيار المالك + إصلاح الآيفون
   ========================================================= */
/* العنوان بأسلوب M5: القناة في سطر، والأرقام بأيقونات صغيرة */
.sp-byline{flex-direction:column;gap:8px}
.by-who{display:inline-flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap}
.by-row{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;font-size:12.5px;color:rgba(255,255,255,.62)}
.by-row span{display:inline-flex;align-items:center;gap:6px}
.by-row b{font-weight:500;color:rgba(255,255,255,.85);font-variant-numeric:tabular-nums}
.by-row svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;opacity:.8}

/* لمعة بيضاء على شريط اللصق — خفيفة، تمرّ مرتين فقط (لا تكرار) */
@property --fa{syntax:"<angle>";inherits:false;initial-value:0deg}
.fl-beam{position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:5;opacity:0}
.fl-beam:before,.fl-beam .sp:before{content:"";position:absolute;border-radius:inherit;
  background:conic-gradient(from var(--fa),transparent 0deg,transparent 260deg,rgba(255,255,255,.1) 282deg,rgba(255,255,255,.85) 310deg,rgba(255,255,255,.1) 338deg,transparent 360deg)}
.fl-beam:before{inset:-1px;padding:1.2px;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}
.fl-beam .sp{position:absolute;inset:0;border-radius:inherit;overflow:hidden;
  -webkit-mask:linear-gradient(to bottom,#000,transparent 45%,transparent 55%,#000),linear-gradient(to right,#000,transparent 20%,transparent 80%,#000);
  mask:linear-gradient(to bottom,#000,transparent 45%,transparent 55%,#000),linear-gradient(to right,#000,transparent 20%,transparent 80%,#000)}
.fl-beam .sp:before{inset:-30%;filter:blur(14px);opacity:.3}
.fl-beam.run{animation:flb-life 4.6s linear forwards}
.fl-beam.run:before,.fl-beam.run .sp:before{animation:flb-spin 2.2s cubic-bezier(.45,.05,.4,.95) 2 forwards}
@keyframes flb-spin{from{--fa:0deg}to{--fa:360deg}}
@keyframes flb-life{0%{opacity:0}6%{opacity:1}90%{opacity:1}100%{opacity:0}}

/* الآيفون والجوال: الفيديو العمودي أقصر، والشريط المثبّت له خلفية داكنة لا تشفّ */
@media(max-width:640px){
  :root{--tall-h:min(48svh,440px)}
  .player-wrap.portrait{width:min(calc(var(--tall-h) * 9 / 16),calc(100vw - 32px))!important;height:auto!important;aspect-ratio:9/16!important;max-height:none!important}
  body[data-shape="tall"] .sp-loader-frame{width:min(calc(var(--tall-h) * 9 / 16),calc(100vw - 32px))!important;height:auto!important;aspect-ratio:9/16}
  body.is-ready .sp-stage{background:linear-gradient(rgba(10,10,11,0),rgba(10,10,11,.97) 16px)!important;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px)}
  .by-row{gap:6px 14px;font-size:12px}
}
@media (prefers-reduced-motion:reduce){.fl-beam{display:none}}

/* الترجمة: لغات المقطع نفسه كأزرار بدل القائمة المضغوطة */
#subtitleSource,#videoSubtitleSource{display:none!important}
.sub-chips{display:flex;flex-wrap:wrap;gap:8px;width:100%}
.sub-chips button{all:unset;cursor:pointer;height:38px;padding:0 14px;border-radius:999px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.05);
  color:#e6e6ea;font-size:13px;display:inline-flex;align-items:center;gap:6px;transition:background .2s,color .2s}
.sub-chips button small{font-size:11px;color:rgba(255,255,255,.5)}
.sub-chips button.on{background:#fff;color:#0b0b0c;border-color:#fff}.sub-chips button.on small{color:rgba(0,0,0,.55)}
.sub-chips .none{font-size:12.5px;color:rgba(255,255,255,.55);line-height:1.6}
/* تلميح الآيفون داخل لوح التنزيل تحت الأزرار، مو عائم فوق زر التنزيل */
#shareHint.in-panel{position:static;margin:10px 0 0;background:none;padding:0;font-size:12px;color:rgba(255,255,255,.55);text-align:center}

/* الألواح (التنزيل، القص، النص، الصور): خلفية داكنة ووضوح أعلى للنصوص والأرقام */
body .sp-panel.story{background:linear-gradient(180deg,rgba(30,30,35,.97),rgba(16,16,19,.98))!important;border-color:rgba(255,255,255,.1)!important}
.sp-panel.story .st-head h3{color:#fff}
.sp-panel.story .st-head p,.sp-panel.story .seg-label{color:rgba(255,255,255,.72)}
.sp-panel.story .clip-field label,.sp-panel.story .clip-times,.sp-panel.story .clip-times *{color:rgba(255,255,255,.7)}
.sp-panel.story .clip-field input{color:#fff;background:#0b0b0d;border-color:rgba(255,255,255,.14)}
.sp-panel.story .clip-note{color:rgba(255,255,255,.6)}
.sp-panel.story .cut-len,.sp-panel.story .cut-len *{color:#fff}
.sp-panel.story .cut-kind button,.sp-panel.story .cut-q button{color:rgba(255,255,255,.82)}
.sp-panel.story .cut-kind button[aria-pressed="true"],.sp-panel.story .cut-q button[aria-pressed="true"]{background:#fff;color:#0b0b0c;box-shadow:none}
.sp-panel.story .cut-go{background:#fff!important;color:#0b0b0c!important;opacity:1!important}
.sp-panel.story .cut-go *{color:inherit}
body .sp-panel.story:after{display:none!important}
/* القص: تظليل خارج التحديد يبقى داخل شريط اللقطات فقط (كان يغطي اللوح كله ويخلّيه باهت) */
.story .clip-track{clip-path:inset(-6px round 16px)}
.story .clip-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.story .clip-field{min-width:0}
.story .clip-field input{width:100%;min-width:0;box-sizing:border-box}
