/* =========================================================
   عالم الأنمي — الهوية البصرية: أسود عميق + بنفسجي متوهج
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root{
  --bg:#07050c;
  --bg-soft:#0b0714;
  --surface:#120d1f;
  --surface-2:#1a1230;
  --line:rgba(168,133,255,.16);
  --line-strong:rgba(168,133,255,.34);
  --text:#f5f2ff;
  --muted:#a89ec9;
  --muted-2:#7b7396;
  --accent:#a855f7;
  --accent-2:#7c3aed;
  --accent-3:#d8b4fe;
  --gold:#fbbf24;
  --font-body:'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display:'Cairo', 'Tajawal', system-ui, -apple-system, sans-serif;
}

html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  min-height:100vh;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overscroll-behavior-y:none;
}
body.locked{ overflow:hidden; }

h1,h2,h3{ font-family:var(--font-display); margin:0; line-height:1.25; }
p{ margin:0; }

button{
  font-family:inherit;
  font-size:inherit;
  color:inherit;
  border:0;
  background:none;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  -webkit-user-select:none;
  user-select:none;
}
button:focus-visible{ outline:2px solid var(--accent-3); outline-offset:3px; }

img{ display:block; max-width:100%; }

.hidden{ display:none !important; }

svg{ flex:0 0 auto; }

/* ---------- خلفية متوهجة ---------- */
.glow-layer{
  position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(820px 520px at 88% -8%, rgba(124,58,237,.42), transparent 68%),
    radial-gradient(620px 420px at 6% 4%, rgba(168,85,247,.18), transparent 70%),
    radial-gradient(900px 620px at 50% 112%, rgba(88,28,135,.32), transparent 72%);
}

.container{
  width:100%;
  max-width:1120px;
  margin-inline:auto;
  padding-inline:16px;
  position:relative;
  z-index:1;
}
@media (min-width:820px){ .container{ padding-inline:28px; } }

/* ---------- الشريط العلوي ---------- */
.topbar{
  position:sticky; top:0; z-index:30;
  background:rgba(7,5,12,.74);
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(168,133,255,.1);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  min-height:60px; padding-block:8px;
}
.brand{ display:flex; align-items:center; gap:10px; min-width:0; }
.brand-mark{
  width:38px; height:38px; flex:0 0 38px; border-radius:13px;
  display:grid; place-items:center;
  background:linear-gradient(150deg, rgba(168,85,247,.35), rgba(124,58,237,.1));
  border:1px solid rgba(168,133,255,.3);
  box-shadow:0 8px 22px -12px rgba(168,85,247,.9);
}
.brand-mark svg{ width:25px; height:25px; }
.brand-text{ display:flex; flex-direction:column; line-height:1.15; min-width:0; }
.brand-text strong{ font-family:var(--font-display); font-size:16.5px; font-weight:800; letter-spacing:0; }
.brand-text small{ font-size:10.5px; color:var(--muted-2); }

.topnav{ display:none; }
@media (min-width:820px){
  .topnav{ display:flex; align-items:center; gap:6px; }
  .topnav-btn{
    display:inline-flex; align-items:center; gap:7px;
    padding:9px 16px; border-radius:999px;
    font-size:14.5px; font-weight:500; color:var(--muted);
    border:1px solid transparent; transition:color .18s, background .18s, border-color .18s;
  }
  .topnav-btn:hover{ color:#fff; background:rgba(168,85,247,.1); }
  .topnav-btn.is-active{
    color:#fff; background:rgba(168,85,247,.18); border-color:rgba(168,85,247,.4);
  }
}
.nav-count{
  min-width:20px; height:20px; padding:0 6px; border-radius:999px;
  display:inline-grid; place-items:center;
  font-size:11px; font-weight:700;
  background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff;
}

/* ---------- الهيكل ---------- */
.main{ padding-block:16px 104px; }
@media (min-width:820px){ .main{ padding-block:20px 64px; } }

.view-title{ font-size:22px; font-weight:800; margin-bottom:14px; }

/* ---------- الغلاف البطل ---------- */
.hero{
  position:relative;
  display:flex; align-items:flex-end;
  min-height:420px;
  border-radius:26px; overflow:hidden;
  border:1px solid var(--line);
  background:linear-gradient(160deg,#251838,#0a0714);
  box-shadow:0 34px 70px -34px rgba(124,58,237,.75);
  isolation:isolate;
}
.hero-img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; object-position:50% 18%;
  transition:transform 1.2s cubic-bezier(.2,.7,.2,1);
}
.hero:hover .hero-img{ transform:scale(1.04); }
.hero-shade{
  position:absolute; inset:0;
  background:linear-gradient(to top,
    rgba(7,5,12,.99) 4%,
    rgba(7,5,12,.9) 30%,
    rgba(7,5,12,.36) 62%,
    rgba(7,5,12,.55) 100%);
}
.hero-content{ position:relative; padding:22px; width:100%; }
@media (min-width:768px){
  .hero{ min-height:500px; }
  .hero-content{ padding:34px; max-width:620px; }
}
.hero-tag{
  display:inline-flex; align-items:center; gap:6px;
  font-size:11.5px; font-weight:700; color:#f0e2ff;
  background:rgba(168,85,247,.2);
  border:1px solid rgba(168,85,247,.46);
  padding:6px 12px; border-radius:999px;
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
}
.hero-tag svg{ width:13px; height:13px; color:var(--accent-3); }
.hero-title{
  font-size:clamp(28px, 7.4vw, 46px);
  font-weight:900;
  margin-top:14px;
  text-shadow:0 6px 30px rgba(0,0,0,.55);
}
.hero-tagline{
  margin-top:10px; max-width:46ch;
  color:#cfc6e8; font-size:14.5px; line-height:1.7;
}
.hero-pills{ display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.hero-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }

/* ---------- أزرار ---------- */
.btn-primary{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:50px; padding:0 22px;
  border-radius:999px;
  font-family:var(--font-body); font-size:15px; font-weight:700;
  color:#fff;
  background:linear-gradient(135deg,#b16bff,#7c3aed);
  box-shadow:0 14px 30px -14px rgba(168,85,247,.95);
  transition:transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.btn-primary svg{ width:18px; height:18px; }
.btn-primary:active{ transform:scale(.97); filter:brightness(1.08); }
.btn-primary.is-saved{
  background:rgba(168,85,247,.2);
  color:#eddfff;
  border:1px solid rgba(168,85,247,.6);
  box-shadow:none;
}

.btn-ghost{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  min-height:50px; padding:0 20px;
  border-radius:999px;
  font-size:15px; font-weight:600;
  color:var(--text);
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.16);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  transition:transform .16s ease, background .16s ease;
}
.btn-ghost svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.9; }
.btn-ghost:active{ transform:scale(.97); background:rgba(255,255,255,.12); }
.btn-ghost.is-saved{
  background:rgba(168,85,247,.22);
  border-color:rgba(168,85,247,.6);
  color:#f0e2ff;
}

.icon-btn{
  width:44px; height:44px; border-radius:999px;
  display:grid; place-items:center;
  color:#fff;
  background:rgba(20,14,32,.72);
  border:1px solid rgba(168,133,255,.28);
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  transition:background .16s, transform .16s;
}
.icon-btn svg{ width:21px; height:21px; }
.icon-btn:active{ transform:scale(.94); background:rgba(168,85,247,.32); }

/* ---------- رؤوس الأقسام ---------- */
.section-head{
  display:flex; align-items:baseline; justify-content:space-between; gap:12px;
  margin:28px 2px 12px;
}
.section-head h2{ font-size:18px; font-weight:800; }
.section-count{ font-size:12.5px; color:var(--muted-2); }

/* ---------- شرائح التصفية ---------- */
.chips{
  display:flex; gap:8px;
  overflow-x:auto;
  padding:2px 2px 8px;
  scrollbar-width:none;
  -ms-overflow-style:none;
  -webkit-overflow-scrolling:touch;
}
.chips::-webkit-scrollbar{ display:none; }
.chip{
  flex:0 0 auto;
  min-height:42px; padding:0 16px;
  display:inline-flex; align-items:center; gap:7px;
  border-radius:999px;
  font-size:14px; font-weight:500;
  color:var(--muted);
  background:rgba(255,255,255,.045);
  border:1px solid var(--line);
  transition:color .18s, background .18s, border-color .18s, transform .16s;
}
.chip:active{ transform:scale(.96); }
.chip.is-active{
  color:#fff;
  background:rgba(168,85,247,.24);
  border-color:rgba(168,85,247,.65);
  box-shadow:inset 0 0 0 1px rgba(216,180,254,.18);
}
.chip-count{
  display:inline-grid; place-items:center;
  min-width:20px; height:19px; padding:0 6px;
  border-radius:999px;
  font-size:11px; font-weight:700; line-height:1;
  color:var(--muted-2);
  background:rgba(255,255,255,.07);
  transition:color .18s, background .18s;
}
.chip.is-active .chip-count{ color:#fff; background:rgba(255,255,255,.2); }

@media (min-width:820px){
  .chips{ flex-wrap:wrap; overflow:visible; }
}

/* ---------- شبكة الأعمال ---------- */
.grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:14px;
}
@media (min-width:520px){ .grid{ grid-template-columns:repeat(3, minmax(0,1fr)); gap:18px; } }

.card{
  display:flex; flex-direction:column; gap:9px; min-width:0;
  animation:riseIn .48s cubic-bezier(.2,.7,.2,1) both;
}
.poster{
  position:relative;
  border-radius:18px;
  overflow:hidden;
  aspect-ratio:3 / 4;
  background:linear-gradient(160deg,#2a1c46,#0c0816);
  border:1px solid var(--line);
  box-shadow:0 18px 34px -22px rgba(0,0,0,.9);
}
.poster img{
  width:100%; height:100%;
  object-fit:cover;
  transition:transform .55s cubic-bezier(.2,.7,.2,1);
}
.poster::after{
  content:'';
  position:absolute; inset:auto 0 0 0; height:42%;
  background:linear-gradient(to top, rgba(7,5,12,.72), transparent);
  pointer-events:none; z-index:1;
}
@media (hover:hover){
  .card:hover .poster img{ transform:scale(1.06); }
  .card:hover .poster{ border-color:var(--line-strong); }
}
.poster-hit{
  position:absolute; inset:0; z-index:2;
  background:transparent; border-radius:18px;
}
.poster-badges{
  position:absolute; top:9px; inset-inline-end:9px; z-index:3;
  display:flex; gap:6px; pointer-events:none;
}
.badge{
  display:inline-flex; align-items:center; gap:4px;
  padding:4px 8px; border-radius:999px;
  font-size:11.5px; font-weight:700; color:#fff;
  background:rgba(9,6,16,.68);
  border:1px solid rgba(255,255,255,.14);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
}
.badge svg{ width:12px; height:12px; color:var(--gold); }

/* ---------- أغلفة فنية مصمّمة (بدون صورة) ---------- */
.poster-art{
  position:relative;
  display:flex; flex-direction:column; justify-content:flex-end; align-items:center;
  gap:3px;
  width:100%; height:100%;
  padding:18px 12px 16px;
  text-align:center;
  overflow:hidden;
  background:
    radial-gradient(118% 78% at 50% 2%, var(--art-glow, rgba(168,85,247,.42)), transparent 64%),
    linear-gradient(165deg, var(--art-a, #2a1c46), var(--art-b, #0c0816) 82%);
}
.hero .poster-art, .detail-cover .poster-art{ position:absolute; inset:0; }
.art-rings{
  position:absolute; top:-26%; inset-inline-end:-24%;
  width:76%; aspect-ratio:1; border-radius:50%;
  border:1px solid rgba(255,255,255,.13);
  box-shadow:0 0 0 16px rgba(255,255,255,.028), 0 0 0 38px rgba(255,255,255,.018);
  pointer-events:none;
}
.art-letter{
  position:absolute; top:6%; inset-inline-start:6%;
  font-family:var(--font-display); font-weight:900;
  font-size:clamp(58px, 30vw, 108px); line-height:1;
  color:rgba(255,255,255,.1);
  pointer-events:none;
}
.art-title{
  position:relative;
  font-family:var(--font-display);
  font-size:13.5px; font-weight:800; line-height:1.4;
  color:#fff;
  text-shadow:0 3px 16px rgba(0,0,0,.7);
  max-width:100%;
}
.art-genre{
  position:relative;
  font-size:10.5px; font-weight:600;
  color:rgba(255,255,255,.62);
}
.detail-cover .art-title{ font-size:clamp(16px, 4.6vw, 24px); }
.detail-cover .art-genre{ font-size:12px; }

.art-violet{ --art-a:#2a1c46; --art-b:#0c0816; --art-glow:rgba(168,85,247,.45); }
.art-rose{ --art-a:#3d1130; --art-b:#0d0714; --art-glow:rgba(244,114,182,.46); }
.art-amber{ --art-a:#3a2409; --art-b:#110a05; --art-glow:rgba(251,146,60,.46); }
.art-cyan{ --art-a:#082a3d; --art-b:#050e15; --art-glow:rgba(56,189,248,.44); }
.art-sand{ --art-a:#33291b; --art-b:#0f0b07; --art-glow:rgba(214,171,110,.42); }
.art-indigo{ --art-a:#1b1147; --art-b:#08060f; --art-glow:rgba(129,140,248,.46); }
.art-copper{ --art-a:#3b1f14; --art-b:#110805; --art-glow:rgba(234,140,90,.44); }

.fav-btn{
  position:absolute; top:9px; inset-inline-start:9px; z-index:4;
  width:40px; height:40px; border-radius:999px;
  display:grid; place-items:center;
  color:#fff;
  background:rgba(9,6,16,.6);
  border:1px solid rgba(255,255,255,.18);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  transition:transform .16s ease, background .2s ease, border-color .2s ease;
}
.fav-btn svg{ width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.9; }
.fav-btn:active{ transform:scale(.88); }
.fav-btn.is-on{
  background:linear-gradient(135deg,#b16bff,#7c3aed);
  border-color:transparent;
  box-shadow:0 8px 20px -8px rgba(168,85,247,.95);
}
.fav-btn.is-on svg{ fill:currentColor; }

.card-body{ display:flex; flex-direction:column; gap:3px; padding-inline:2px; min-width:0; }
.card-title{
  font-family:var(--font-display);
  font-size:15px; font-weight:700; line-height:1.35;
  text-align:start;
  color:var(--text);
  padding:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  max-width:100%;
  transition:color .18s;
}
.card-title:hover{ color:var(--accent-3); }
.card-meta{
  display:flex; align-items:center; flex-wrap:wrap; gap:6px;
  font-size:12px; color:var(--muted-2); line-height:1.4;
}
.dot-sep{ width:3px; height:3px; border-radius:50%; background:currentColor; opacity:.6; }

/* ---------- الأنواع ---------- */
.pill{
  display:inline-flex; align-items:center;
  padding:4px 11px; border-radius:999px;
  font-size:12px; font-weight:500;
  color:#e6d8ff;
  background:rgba(168,85,247,.13);
  border:1px solid rgba(168,85,247,.3);
}
.pills{ display:flex; flex-wrap:wrap; gap:7px; margin-top:12px; }

/* ---------- البحث ---------- */
.search-box{
  display:flex; align-items:center; gap:10px;
  min-height:56px;
  padding:4px 14px;
  border-radius:18px;
  background:var(--surface);
  border:1px solid var(--line);
  transition:border-color .2s, box-shadow .2s;
}
.search-box:focus-within{
  border-color:rgba(168,85,247,.62);
  box-shadow:0 0 0 4px rgba(168,85,247,.14);
}
.search-ico{ width:20px; height:20px; color:var(--muted-2); }
.search-box input{
  flex:1 1 auto; min-width:0;
  padding:13px 0;
  font-family:inherit; font-size:16px;
  color:var(--text);
  background:none; border:0; outline:none;
}
.search-box input::placeholder{ color:var(--muted-2); }
.search-box input::-webkit-search-cancel-button{ -webkit-appearance:none; appearance:none; }
.search-clear{
  width:32px; height:32px; border-radius:999px;
  display:grid; place-items:center;
  color:var(--muted);
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.1);
}
.search-clear svg{ width:15px; height:15px; }
.search-clear:active{ background:rgba(255,255,255,.16); }

/* ---------- الحالة الفارغة ---------- */
.empty{
  display:flex; flex-direction:column; align-items:center; gap:12px;
  padding:44px 22px;
  text-align:center;
  border:1px dashed rgba(168,133,255,.26);
  border-radius:22px;
  background:rgba(168,85,247,.045);
}
.empty-ico{
  width:66px; height:66px; border-radius:999px;
  display:grid; place-items:center;
  color:var(--accent-3);
  background:rgba(168,85,247,.15);
  border:1px solid rgba(168,85,247,.28);
}
.empty-ico svg{ width:28px; height:28px; }
.empty h3{ font-size:17px; font-weight:800; }
.empty p{ color:var(--muted); font-size:14px; max-width:34ch; line-height:1.7; }
.empty .btn-primary{ margin-top:6px; }

/* ---------- الشريط السفلي ---------- */
.bottombar{
  position:fixed; bottom:0; inset-inline:0; z-index:40;
  display:flex; align-items:stretch; justify-content:space-around; gap:4px;
  padding:8px 10px 10px;
  background:rgba(9,6,16,.88);
  -webkit-backdrop-filter:blur(22px); backdrop-filter:blur(22px);
  border-top:1px solid var(--line);
}
.tab{
  position:relative;
  flex:1 1 0;
  min-height:54px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  border-radius:14px;
  font-size:11px; font-weight:500;
  color:var(--muted-2);
  transition:color .18s, background .18s;
}
.tab svg{ width:23px; height:23px; }
.tab.is-active{ color:var(--accent-3); background:rgba(168,85,247,.1); }
.tab.is-active::before{
  content:'';
  position:absolute; top:-9px;
  width:28px; height:3px; border-radius:0 0 4px 4px;
  background:linear-gradient(90deg,#a855f7,#e9d5ff);
  box-shadow:0 0 12px rgba(168,85,247,.9);
}
@media (min-width:820px){ .bottombar{ display:none; } }

/* ---------- صفحة العمل ---------- */
.overlay{
  position:fixed; inset:0; z-index:60;
  background:var(--bg);
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  animation:overlayIn .26s ease both;
}
.detail-bar{
  position:sticky; top:0; z-index:5;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 16px 14px;
  background:linear-gradient(180deg, rgba(7,5,12,.96) 42%, rgba(7,5,12,0));
}
.detail-cover{
  position:relative;
  margin-top:-74px;
  height:min(56vh, 420px);
  overflow:hidden;
}
.detail-cover img, .detail-cover .poster-art{
  width:100%; height:100%;
  object-fit:cover; object-position:50% 22%;
}
.detail-cover::after{
  content:'';
  position:absolute; inset:0;
  background:linear-gradient(to top,
    var(--bg) 1%,
    rgba(7,5,12,.72) 34%,
    rgba(7,5,12,.1) 76%,
    rgba(7,5,12,.35) 100%);
}
.detail-inner{
  position:relative; z-index:2;
  max-width:720px; margin-inline:auto;
  margin-top:-44px;
  padding:0 18px 64px;
}
.detail-title{
  font-size:clamp(25px, 6.4vw, 40px);
  font-weight:900;
  text-shadow:0 8px 28px rgba(0,0,0,.6);
}
.detail-sub{
  display:flex; align-items:center; flex-wrap:wrap; gap:8px;
  margin-top:10px;
  font-size:13.5px; color:var(--muted);
}
.detail-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
.detail-actions .btn-primary{ flex:1 1 190px; }

.info-grid{
  display:grid; grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px; margin-top:20px;
}
@media (min-width:520px){ .info-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); } }
.info-cell{
  padding:12px 14px;
  border-radius:16px;
  background:var(--surface);
  border:1px solid var(--line);
}
.info-cell span{ display:block; font-size:11px; color:var(--muted-2); margin-bottom:3px; }
.info-cell strong{ font-size:14.5px; font-weight:700; color:var(--text); }

.story{ margin-top:24px; }
.story h3{
  font-size:14px; font-weight:800; color:var(--accent-3);
  margin-bottom:9px;
}
.story p{
  font-size:15.5px; line-height:1.95; color:#d9d2ee;
  -webkit-user-select:text; user-select:text;
}

.rating-row{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px;
  margin-top:22px; padding:13px 16px;
  border-radius:18px;
  background:var(--surface);
  border:1px solid var(--line);
}
.rating-label{ display:flex; flex-direction:column; line-height:1.35; }
.rating-label strong{ font-size:14px; font-weight:700; }
.rating-label span{ font-size:12px; color:var(--muted-2); }
.stars{ display:flex; gap:2px; }
.star{
  width:38px; height:38px; border-radius:10px;
  display:grid; place-items:center;
  color:#3d3459;
  transition:color .16s ease, transform .16s ease;
}
.star svg{ width:23px; height:23px; fill:currentColor; }
.star:active{ transform:scale(.88); }
.star.is-on{ color:var(--gold); }

@media (min-width:820px){
  .overlay::-webkit-scrollbar{ width:10px; }
  .overlay::-webkit-scrollbar-thumb{
    background:rgba(168,85,247,.4); border-radius:99px;
    border:3px solid var(--bg);
  }
}

/* ---------- الإعلانات ---------- */
.ad-kicker{
  display:inline-flex; align-items:center;
  padding:3px 9px; border-radius:6px;
  font-size:10.5px; font-weight:800; line-height:1.5;
  color:#2a1c00;
  background:linear-gradient(135deg,#fcd34d,#f59e0b);
  letter-spacing:0;
}

.ad-banner{
  position:fixed; z-index:45;
  inset-inline:10px; bottom:78px;
  max-width:520px; margin-inline:auto;
  animation:adIn .32s cubic-bezier(.2,.7,.2,1) both;
}
@media (min-width:820px){ .ad-banner{ bottom:16px; } }

.ad-banner-inner{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  border-radius:16px;
  background:rgba(19,14,30,.95);
  border:1px solid rgba(251,191,36,.45);
  box-shadow:0 20px 44px -22px rgba(0,0,0,.95);
  -webkit-backdrop-filter:blur(16px); backdrop-filter:blur(16px);
}
.ad-banner-text{ display:flex; flex-direction:column; gap:1px; min-width:0; flex:1 1 auto; line-height:1.35; }
.ad-banner-text strong{
  font-size:13px; font-weight:700; color:var(--text);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.ad-banner-text small{
  font-size:11px; color:var(--muted-2);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.ad-cta{
  flex:0 0 auto; min-height:36px; padding:0 14px;
  border-radius:999px;
  font-size:12.5px; font-weight:800;
  color:#241800;
  background:linear-gradient(135deg,#fcd34d,#f59e0b);
  transition:transform .16s ease, filter .16s ease;
}
.ad-cta:active{ transform:scale(.95); filter:brightness(1.06); }
.ad-close{
  flex:0 0 auto; width:32px; height:32px; border-radius:999px;
  display:grid; place-items:center;
  font-size:19px; line-height:1;
  color:var(--muted);
  background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.12);
}
.ad-close:active{ transform:scale(.92); background:rgba(255,255,255,.14); }

body.ad-open .main{ padding-bottom:200px; }
body.ad-open .toast{ bottom:190px; }
@media (min-width:820px){
  body.ad-open .main{ padding-bottom:120px; }
  body.ad-open .toast{ bottom:150px; }
}

/* ---------- بطاقة مموّلة داخل الشبكة ---------- */
.sponsor-art{
  position:relative;
  aspect-ratio:3 / 4;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px;
  padding:18px 14px;
  border-radius:18px;
  text-align:center;
  overflow:hidden;
  background:
    radial-gradient(120% 88% at 50% 0%, rgba(251,191,36,.26), transparent 64%),
    linear-gradient(165deg,#241a34,#0d0918);
  border:1px dashed rgba(251,191,36,.5);
}
.sponsor-art .ad-kicker{ position:absolute; top:9px; inset-inline-start:9px; }
.sponsor-bolt{ display:grid; place-items:center; width:36px; height:36px; color:#fbbf24; }
.sponsor-bolt svg{ width:30px; height:30px; }
.sponsor-head{
  font-family:var(--font-display);
  font-size:14.5px; font-weight:800; line-height:1.45;
  color:#ffe9b8;
}
.sponsor-sub{ font-size:11.5px; line-height:1.55; color:var(--muted-2); max-width:20ch; }

/* ---------- الإعلان البيني ---------- */
.ad-interstitial{
  position:fixed; inset:0; z-index:80;
  display:grid; place-items:center;
  padding:20px;
  background:rgba(5,3,10,.88);
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  animation:overlayIn .2s ease both;
}
.ad-card{
  width:100%; max-width:420px;
  display:flex; flex-direction:column; align-items:center; gap:12px;
  text-align:center;
  padding:26px 22px 22px;
  border-radius:24px;
  background:linear-gradient(165deg,#1c1430,#0c0816);
  border:1px solid rgba(251,191,36,.32);
  box-shadow:0 40px 80px -40px rgba(0,0,0,.95);
}
.ad-card-title{ font-size:20px; font-weight:900; line-height:1.35; }
.ad-card-body{ font-size:14px; line-height:1.75; color:var(--muted); max-width:32ch; }
.ad-card-cta{ width:100%; margin-top:4px; }
.ad-skip{
  width:100%; min-height:44px; border-radius:999px;
  font-size:13.5px; font-weight:700;
  color:var(--muted);
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  transition:color .16s ease, background .16s ease;
}
.ad-skip:disabled{ opacity:.55; }
.ad-skip:not(:disabled){ color:var(--text); background:rgba(255,255,255,.1); }
.ad-note{ font-size:11px; color:var(--muted-2); }

@keyframes adIn{
  from{ opacity:0; transform:translateY(18px) scale(.98); }
  to{ opacity:1; transform:none; }
}

/* ---------- التنبيه ---------- */
.toast{
  position:fixed; z-index:90;
  bottom:92px; left:50%;
  transform:translate(-50%, 16px);
  max-width:calc(100vw - 40px);
  padding:11px 20px;
  border-radius:999px;
  font-size:13.5px; font-weight:500; text-align:center;
  color:#fff;
  background:rgba(26,18,48,.96);
  border:1px solid rgba(168,85,247,.45);
  box-shadow:0 18px 40px -20px rgba(0,0,0,.9);
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  opacity:0; pointer-events:none;
  transition:opacity .22s ease, transform .22s ease;
}
.toast.show{ opacity:1; transform:translate(-50%, 0); }
@media (min-width:820px){ .toast{ bottom:32px; } }

/* ---------- حركة ---------- */
@keyframes riseIn{
  from{ opacity:0; transform:translateY(14px); }
  to{ opacity:1; transform:none; }
}
@keyframes overlayIn{
  from{ opacity:0; transform:translateY(10px); }
  to{ opacity:1; transform:none; }
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
}