/* «الإعلان التجريبي» (js/ads.js، قرار المالك ١٤/١١): الموقع والتطبيق بس. index.html بيحمّله بـdata-site، فمش في الـArtifact */

/* زرار «اتفرج على إعلان» في ورقة «خلص»: بعرض الورقة، والأيقونة جنب الكلام */
.apSheet .apAdBtn{ width:100%; font-size:17px; padding:10px 12px; }
.apSheet .apAdBtn .apIco{ width:24px; height:24px; flex:none; }
.apSheet .apAdLeft{ margin-top:-4px; font-size:13px; }
/* عنوان «خلص …» طويل: أصغر شوية عشان مايبقاش ٣ سطور */
.apSheet .dkCard:has(.apAdBtn) h2{ font-size:24px; }

/* الكارت بملا الشاشة فوق كل حاجة (الورقة ٢٠ والتوست ٣٠) */
.adWrap{
  position:absolute; inset:0; z-index:40;
  display:flex; align-items:center; justify-content:center;
  padding:calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background:
    repeating-linear-gradient(45deg, #C8102E 0 8px, #F6EBD0 8px 10px, #F2B705 10px 18px, #F6EBD0 18px 20px, #1C4FA0 20px 28px, #F6EBD0 28px 30px, #176B3A 30px 38px, #F6EBD0 38px 40px) top / 100% 7px no-repeat,
    radial-gradient(circle at 50% 30%, #23295A, #0F1437 70%);
  animation:adFade 0.2s ease-out;
}
@keyframes adFade{ from{ opacity:0; } to{ opacity:1; } }
.adCard{
  width:100%; max-width:360px; max-height:100%; overflow-y:auto;
  display:flex; flex-direction:column; align-items:center; gap:10px;
  background:#F6EBD0; border:4px solid #0F1437; border-radius:22px;
  padding:14px 18px 20px;
  box-shadow:0 6px 0 #070A1C, 0 14px 40px rgba(0,0,0,0.5);
  animation:dkIn 0.32s cubic-bezier(0.34,1.4,0.64,1);
}
.adTop{ align-self:stretch; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.adTag{ display:inline-flex; align-items:center; gap:6px; background:#0F1437; color:#FFD23F; border-radius:999px; padding:4px 12px 5px; font-size:14px; font-weight:800; line-height:1.3; }
.adTagIco{ display:flex; width:16px; height:16px; }
.adTagIco svg, .adClose svg{ width:100%; height:100%; }
/* مساحة الدوسة ٤٤ على الأقل من غير ما الشكل يكبر (tap.min44) */
.adClose::after{ content:''; position:absolute; inset:-5px; }
.adClose{ position:relative; flex:none; width:38px; height:38px; padding:8px; border:2px solid #0F1437; border-radius:50%; background:#FFF8E6; color:#0F1437; display:flex; }

/* العدّاد: دايرة بتخلص حوالين أيقونة المكافأة، والرقم في الركن */
.adRing{ position:relative; width:150px; height:150px; margin:6px 0 2px; display:flex; align-items:center; justify-content:center; }
.adRing > svg{ position:absolute; inset:0; width:100%; height:100%; transform:rotate(-90deg); }
.adRingBg{ fill:#FFF8E6; stroke:#E4D8BC; stroke-width:8; }
.adRingFg{ fill:none; stroke:#C8102E; stroke-width:8; stroke-linecap:round; transition:stroke-dashoffset 0.2s linear; }
.adWrap.ready .adRingFg{ stroke:#176B3A; }
.adPrizeIco{ position:relative; display:flex; width:76px; height:76px; }
.adPrizeIco svg{ width:100%; height:100%; }
.adCount{ position:absolute; top:2px; left:2px; min-width:40px; height:40px; border-radius:20px; background:#0F1437; color:#F6EBD0; border:3px solid #F6EBD0;
  font-family:'Rakkas', 'Changa', sans-serif; font-weight:400; font-size:24px; line-height:34px; text-align:center; font-variant-numeric:tabular-nums; }
.adCount:empty{ display:none; }
.adTitle{ font-family:'Changa', sans-serif; font-weight:800; font-size:25px; line-height:1.3; color:#C8102E; margin:0; text-align:center; }
.adNote{ margin:0; text-align:center; font-size:14px; font-weight:700; color:#6B4A2A; line-height:1.55; }
.adPrize{ margin:2px 0 4px; text-align:center; font-size:17px; font-weight:800; color:#176B3A; }
.adTake{ align-self:stretch; }
.adTake:disabled{ background:#D8CCB2; color:#6B5A44; box-shadow:0 4px 0 #A8977A; cursor:default; }
.adTake:disabled:active{ transform:none; }
@media (prefers-reduced-motion: reduce){ .adWrap, .adCard{ animation:none; } .adRingFg{ transition:none; } }
