(function () {

  function nukeBadUI() {
    document.querySelectorAll("*").forEach(el => {
      const t = el.innerText || "";

      if (
        t.includes("تعلم كيف") ||
        t.includes("زراعة الأسهم") ||
        t.includes("تدريب مباشر") ||
        t.includes("استراتيجيات") ||
        t.includes("ورش")
      ) {
        el.style.setProperty("display", "none", "important");
      }
    });
  }

  function injectMarketplace() {
    if (document.querySelector("#forced-marketplace")) return;

    const wrap = document.createElement("div");
    wrap.id = "forced-marketplace";
    wrap.innerHTML = `
      <div style="
        max-width:1200px;
        margin:20px auto;
        padding:30px 20px;
        background:linear-gradient(135deg,#111,#1e1e1e);
        color:#fff;
        border-radius:20px;
        text-align:center;
        box-shadow:0 15px 40px rgba(0,0,0,.35);
      ">
        <h1 style="margin:0 0 8px;font-size:28px;font-weight:800">🛒 سوق شامل</h1>
        <p style="margin:0;font-size:14px;opacity:.9">
          كل ما تحتاجه في مكان واحد · أسعار منافسة · شحن سريع
        </p>
      </div>

      <div style="
        max-width:1200px;
        margin:15px auto 25px;
        display:flex;
        gap:12px;
        overflow-x:auto;
        padding:10px;
      ">
        <a style="padding:10px 18px;background:#fff;border-radius:30px;font-weight:700">🔥 عروض</a>
        <a style="padding:10px 18px;background:#fff;border-radius:30px;font-weight:700">📱 إلكترونيات</a>
        <a style="padding:10px 18px;background:#fff;border-radius:30px;font-weight:700">🏠 المنزل</a>
        <a style="padding:10px 18px;background:#fff;border-radius:30px;font-weight:700">👕 ملابس</a>
        <a style="padding:10px 18px;background:#fff;border-radius:30px;font-weight:700">💄 العناية</a>
        <a style="padding:10px 18px;background:#fff;border-radius:30px;font-weight:700">🧸 أطفال</a>
        <a style="padding:10px 18px;background:#fff;border-radius:30px;font-weight:700">🚗 سيارات</a>
      </div>
    `;

    document.body.prepend(wrap);
  }

  // تشغيل أولي
  nukeBadUI();
  injectMarketplace();

  // مراقبة أي إعادة رسم من القالب
  const observer = new MutationObserver(() => {
    nukeBadUI();
    injectMarketplace();
  });

  observer.observe(document.body, {
    childList: true,
    subtree: true
  });

})();