/* =========================================================
   main.css — النسخة المستقلة الكاملة للصفحة الرئيسية
   دمج + تنظيف + ضمان الشكل الحالي 100%
========================================================= */

/* ============== 1) المتغيرات الأساسية ============== */
:root {
  --primary: #AD3103;
  --secondary: #EBCE8F;
  --dark: #2b0a00;
  --text: #fffdf8;
  --muted: #d8c9a7;
  --card: #FFF5E1;
  --gold: #EBCE8F;
  --footer-h: 68px; /* ارتفاع الفوتر للجوال */
}

/* ============== 2) Reset & الخطوط ============== */
* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  font-family: 'Tajawal','Segoe UI','Tahoma',Arial,sans-serif;
  color: var(--text);
overflow-x: hidden;
  /* الخلفية الأصلية */
  background-color: #2b0a00; /* fallback فوري */
  background-image: url(/assets/img/Main_Background.webp);
  background-size: cover;
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: center;
}

/* ============== 3) هيكل الصفحة ============== */
body.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.footer { margin-top: auto; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ============== 4) التوب بار ============== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.topbar .brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.topbar .brand-title .badge {
  background: var(--secondary);
  color: var(--primary);
  padding: 6px 10px;
  border-radius: 10px;
}

.topbar .brand-title span {
  font-size: 1rem;
  color: var(--secondary);
}

/* روابط الدخول */
.auth-links {
  display: flex;
  align-items: center;
  gap: 10px;
}
.auth-links .welcome {
  font-weight: 600;
  color: var(--secondary);
}

/* ============== 4.1) Topbar Coins (رصيد العملات) ============== */
.topbar .brand-title { flex: 0 0 auto; }
.topbar .auth-links  { flex: 0 0 auto; }

.topbar-coins{
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.topbar-coins .coin-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 1.5px 2.5px;
  border-radius: 999px;
  border: 1px solid rgba(235,206,143,.25);
  background: rgba(0,0,0,.22);
  text-decoration: none;
  color: var(--secondary);
  font-weight: 800;
  transition: transform .15s ease, filter .15s ease, box-shadow .2s ease;
  white-space: nowrap;
}

.topbar-coins .coin-pill:hover{
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 0 12px rgba(235,206,143,.18);
}

.topbar-coins .coin-pill:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(235,206,143,.22);
}

.topbar-coins .coin-pill.empty{ opacity: .55; }

.topbar-coins .coin-pill img{
  width: 50px;
  height: 50px;
  border-radius: 999px;
  object-fit: cover;
  border: 1.5px solid rgb(255, 174, 0);
  background: rgba(0,0,0,.25);
}

.topbar-coins .coin-fallback{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(235,206,143,.45);
  color: var(--secondary);
  background: rgba(0,0,0,.25);
}

.topbar-coins .coin-name{
  color: var(--secondary);
  font-weight: 900;
  font-size: .95rem;
}

.topbar-coins .coin-count{
  font-weight: 900;
  color: var(--text);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(235,206,143,.25);
  background: rgba(235,206,143,.12);
  font-size: .95rem;
}

/* ✅ Mobile: سطر ثاني داخل التوب بار للعملات */
@media (max-width: 600px){

  /* نحول الـ wrap إلى Grid: صف 1 (حساب/ترحيب + دخول/خروج) / صف 2 (شريط العملات) */
  .topbar .wrap{
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
    padding: 0; /* لأن .topbar عنده padding بالجوال */
  }

  .topbar .brand-title{
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .topbar .brand-title .welcome{
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .auth-links{
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  /* تصغير أزرار التوب بار فقط */
  .topbar .btn{
    padding: 8px 10px;
    border-radius: 10px;
  }

  /* صف العملات: كامل العرض + سكرول أفقي مرتب */
  .topbar-coins{
    grid-column: 1 / -1;
    grid-row: 2;

    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;

    gap: 8px;
    padding: 6px 4px;

    border-top: 1px solid rgba(235,206,143,.14);
  }

  .topbar-coins::-webkit-scrollbar{ height: 0; }

  /* بالجوال نخفي اسم اللعبة ونخلي (أيقونة + ×العدد) */
  .topbar-coins .coin-name{ display: none; }

  .topbar-coins .coin-pill{ padding: 1px 1.25px; }

  .topbar-coins .coin-pill img,
  .topbar-coins .coin-fallback{
    width: 45px;
    height: 45px;
  }

  .topbar-coins .coin-count{
    font-size: .9rem;
    padding: 2px 7px;
  }
}

/* ============== 5) الأزرار (من base.css) ============== */
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border: none;
  transition: all .2s;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: #ff0b0b; }

.btn.secondary { background: var(--secondary); color: #000; }
.btn.secondary:hover { background: #f7e3b3; }

.btn.danger { background: #c0392b; color: #fff; }
.btn.success { background: #27ae60; color: #fff; }

/* *** ملاحظة:
     أزرار الكروت لها ستايل إضافي لاحقًا، ولا يوجد تعارض
*/

/* ============== 6) الهيرو ============== */
.hero {
  max-width: 1200px;
  margin: 50px auto 30px auto;
  padding: 32px 18px;
  text-align: center;
}

/* ← دمج شعار base.css بدل شعار main */
.hero .logo {
  width: 220px;
  height: 220px;
  margin: 0 auto 0px auto;
  border-radius: 50%;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.hero .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero h1 {
  margin: 0;
  font-size: 2.2rem;
  color: var(--secondary);
}

.hero p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.2rem;
}
/* =========================================================
   7) قائمة الألعاب + الشبكة
========================================================= */

.games {
  max-width: 1200px;
  margin: 24px auto 40px;
  padding: 0 18px;
}

.games h2 {
  margin: 12px 0 18px;
  color: var(--secondary);
  text-align: center;
}

/* شبكة الألعاب */
.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
  justify-items: center;
}

/* شاشات عريضة */
@media (min-width: 1200px) {
  .game-grid { grid-template-columns: repeat(4, 1fr); }
}

/* شاشات متوسطة */
@media (min-width: 920px) and (max-width: 1199px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}

/* تابلت */
@media (min-width: 600px) and (max-width: 919px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================================
   8) كروت الألعاب (Tile Cards)
========================================================= */

.game-card {
  background: var(--card);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  transition: transform .15s;
}

/* منع الثيم القديم */
.game-card.tile {
  padding: 0;
  display: flex;
}

/* النسخة المحسّنة */
.game-card.tile {
  flex-direction: column;
  background: linear-gradient(180deg, #240407 0%, #240407 100%);
  border: 1px solid rgba(235,206,143,.25);
  border-radius: 16px;
  overflow: hidden;
  min-height: 300px;
  width: 100%;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
  transition: transform .25s ease, box-shadow .25s ease;
  margin: 4px;
}

.game-card.tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(0,0,0,.32);
}

/* =========================================================
   9) صورة الكرت
========================================================= */



.tile-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .35s ease;
}

.game-card.tile:hover .tile-image img {
  transform: scale(1.03);
}

/* =========================================================
   10) محتوى الكرت
========================================================= */

.tile-content {
  padding: 14px 14px 18px;
  text-align: center;
  color: #f8f1e0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tile-content h3 {
  font-size: 1.15rem;
  margin: 0 0 8px;
  color: var(--secondary);
}

.tile-content p {
  font-size: .95rem;
  color: #f3e6c9cc;
  margin: 0 0 12px;
}

/* زر الكرت */
.tile-content .btn {
  border-radius: 999px;
  padding: 10px 24px;
  font-weight: 700;
  min-width: 140px;
  font-size: .95rem;
  align-self: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  transition: transform .15s ease, box-shadow .2s ease, filter .15s ease;
}

/* ألوان الزر للكروت (نحتفظ بها كما هي) */
.game-card.tile .btn.primary,
.game-card.tile .btn.secondary,
.game-card.tile .btn.danger {
  color: #fff;
  background: linear-gradient(180deg, #6B1119 0%, #6B1119 100%);
  border: 1px solid rgba(235,206,143,.25);
}

.game-card.tile .btn.primary:hover,
.game-card.tile .btn.secondary:hover,
.game-card.tile .btn.danger:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 0 15px rgba(235,206,143,.28);
}

/* =========================================================
   FOOTER — الشكل الأصلي للصفحة الرئيسية فقط
========================================================= */

/* Desktop footer (غير مثبت) */
.footer {
  padding: 18px 0;
  background: rgba(0,0,0,0.55);
  color: var(--text);
  margin-top: auto;
}

.footer .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Social icons */
.social {
  display: flex;
  gap: 12px;
}

.social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  color: var(--secondary);
  transition: transform .15s;
}

.social a:hover {
  transform: translateY(-3px);
}

.social svg {
  width: 28px;
  height: 28px;
}

/* =========================================================
   Footer — Mobile version (الفوتر المثبّت)
========================================================= */
@media (max-width: 600px) {
    body.layout {
        background-image: url(/assets/img/Main_Background.webp);
        background-size: cover;
        background-repeat: repeat;
        background-position: center;
        background-attachment: scroll; /* للجوال */
    }
  .footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--footer-h);
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(6px);
    text-align: center;
    font-size: 0.9rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .social a {
    width: 40px;
    height: 40px;
  }

  .social svg {
    width: 22px;
    height: 22px;
  }
}

/* =========================================================
   Footer — iPad mode
========================================================= */
@media (min-width: 768px) and (max-width: 1024px) {
  .footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--secondary);
    z-index: 999;
  }
}

/* =========================================================
   12) الشعار (تم استبداله بنسخة base.css)
========================================================= */

.logo {
  border-radius: 50%;
  background: var(--primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* =========================================================
   13) تحسينات للشاشات المتوسطة
========================================================= */
@media (max-width: 768px) {
  .games { margin-bottom: 48px; }
  .tile-content h3 { font-size: 1.05rem; }
  .tile-image { padding: 0px; }
}

/* =========================================================
   14) تصميم خاص للجوال
========================================================= */
@media (max-width: 600px) {

  body.layout {
      /* الخلفية الأصلية */
  background-image: url(/assets/img/Main_Background.webp);
  background-size: cover;
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: center;
    padding-top: 130px; /* حتى لا يغطي الهيدر */
    padding-bottom: calc(var(--footer-h) + env(safe-area-inset-bottom) + 12px) !important;
    min-height: auto;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(10px);
    padding: 10px 14px;
  }

  .hero {
    margin-top: 60px;
    padding: 0 10px;
  }

  .hero .logo {
    width: 140px;
    height: 140px;
    box-shadow: none;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 1rem;
    color: #f3e6c9;
  }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 0 10px;
  }

  .game-card.tile {
    border-radius: 10px;
    min-height: 220px;
    box-shadow: none;
    background: linear-gradient(180deg, #5b1d00 0%, #3a0e00 100%);
  }

  .tile-image {
    aspect-ratio: 1 / 1;
    border-bottom: none;
  }

  .tile-content {
    padding: 10px 8px 14px;
  }

  .tile-content h3 {
    font-size: 1.1rem;
  }

  .tile-content p {
    font-size: 0.9rem;
    color: #f0e2c2;
  }

  .tile-content .btn {
    width: 100%;
    padding: 12px 0;
    border-radius: 12px;
    font-size: 1rem;
  }

  /* مساحة إضافية للكروت */
  .games {
    padding-bottom: 16px;
    margin-bottom: 0 !important;
  }

  .game-card.tile:last-child {
    margin-bottom: 18px;
  }

  .social a {
    width: 40px;
    height: 40px;
  }

  .social svg {
    width: 22px;
    height: 22px;
  }

  body.layout::after {
    height: var(--footer-h);
  }
}

/* =========================================================
   15) سطح المكتب + منع تأثير ::after
========================================================= */
body.layout::after {
  content: "";
  display: block;
  height: 0;
}

/* =========================================================
   16) مظهر تطبيق الآيباد
========================================================= */
@media (min-width: 768px) and (max-width: 1024px) {

  body.layout {
      /* الخلفية الأصلية */
  background-image: url(/assets/img/Main_Background.webp);
  background-size: cover;
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: center;

  
    margin: 0;
    padding: 0 0 calc(60px + env(safe-area-inset-bottom) + 12px) 0;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  
  }
  .topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    z-index: 1000;
  }

  .hero {
    margin-top: 100px;
    text-align: center;
  }

  .hero .logo {
    width: 100px;
    height: 100px;
    box-shadow: none;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
    color: #f3e6c9;
  }

  .games {
    flex: 1;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    max-width: 1000px;
  }

  .game-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    justify-items: center;
  }

  .game-card.tile {
    border-radius: 14px;
    min-height: 260px;
    max-width: 90%;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
    background: linear-gradient(180deg, #240407 0%, #240407 100%);

  }
}

/* =========================================================
   HOME SECTIONS — بلوكات الشرح
   (تستخدم متغيرات CSS تأتي من index.php)
========================================================= */

.home-sections {
  width: 100%;
  margin: 60px auto 40px;
  padding: 0 0;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* كل بلوك بعرض الشاشة الحقيقي */
.home-section {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  overflow: hidden;

  margin-top: var(--mt-desktop, 40px);
  margin-bottom: var(--mb-desktop, 40px);
}


/* خلفية ورق الجدران */
.home-section .bg {
  position: relative;
  width: 100%;
  min-height: var(--block-h-desktop, 420px);

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding-top: var(--pt-desktop, 40px);
  padding-bottom: var(--pb-desktop, 40px);

  /* مهم: لا تحط opacity هنا */
  overflow: hidden;
}

/* طبقة الخلفية للصورة (تشتغل لما الخلفية صورة) */
.home-section .hs-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;

  background-image: var(--bg-img-desktop, none);
  background-size: var(--bg-size-desktop, cover);
  background-position: var(--bg-position, center);
  background-repeat: var(--bg-repeat, no-repeat);

  opacity: var(--block-opacity, 1);
}

/* فيديو الخلفية (لما الخلفية فيديو) */
.home-section .hs-bg-video {
  position: absolute;
  inset: 0;
  z-index: 0;

  width: 100%;
  height: 100%;
  object-fit: var(--bg-fit-desktop, cover);
  object-position: var(--bg-position, center);

  opacity: var(--block-opacity, 1);
}

.home-section .hs-bg-video.hs-bg-mobile {
  display: none;
}

/* overlay فوق الخلفية */
.hs-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* المحتوى فوق كل شيء */
.home-section .content,
.home-section .side-image {
  position: relative;
  z-index: 2;
}

/* side-image: ندعم دوران + سكيل بدون تعارض */
.home-section .side-image {
  --img-rot: 0deg;
  --img-scale: 1;

  transform: rotate(var(--img-rot)) scale(var(--img-scale));
  transition: transform .3s ease;

  flex: 0 0 var(--img-w-desktop, 50%);
  max-width: 100%;
  height: 100%;
  min-height: 260px;
  box-sizing: border-box;
  padding: var(--img-pad-y, 0px) var(--img-pad-x, 0px);
  border-radius: var(--img-radius, 0px);
  overflow: hidden;

  background-image: var(--side-img-desktop, none);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;

  display: flex;
  align-items: center;
  justify-content: center;
}

.home-section .side-image:hover {
  --img-scale: 1.02;
}

/* فيديو الوسيط الجانبي */
.home-section .side-image .hs-side-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  display: none;
}

.home-section .side-image .hs-side-video.hs-side-desktop {
  display: block;
}

/* ========= Mobile ========= */
@media (max-width: 768px) {

  .home-section .bg {
    min-height: var(--block-h-mobile, var(--block-h-desktop, 420px)) !important;
    flex-direction: column !important;
    padding-top: var(--pt-mobile, 24px);
    padding-bottom: var(--pb-mobile, 24px);
  }

  .home-section .hs-bg-layer {
    background-image: var(--bg-img-mobile, var(--bg-img-desktop, none));
    background-size: var(--bg-size-mobile, var(--bg-size-desktop, cover));
  }

  /* افتراضيًا: نخلي فيديو الدسكتوب شغال حتى لو ما عندك فيديو جوال */
  .home-section.has-bg-video-mobile .hs-bg-video.hs-bg-desktop { display: none; }
  .home-section.has-bg-video-mobile .hs-bg-video.hs-bg-mobile  {
    display: block;
    object-fit: var(--bg-fit-mobile, cover);
  }

  .home-section .content {
    padding-inline: 18px;
    text-align: center;
  }

  .home-section .side-image {
    flex: 0 0 var(--img-w-mobile, 90%);
    width: var(--img-w-mobile, 90%);
    min-height: 100px;
    background-image: var(--side-img-mobile, var(--side-img-desktop, none));
  }

  .home-section.has-side-video-mobile .hs-side-video.hs-side-desktop { display: none; }
  .home-section.has-side-video-mobile .hs-side-video.hs-side-mobile  { display: block; }
}



/* طبقة التعتيم الاختيارية */
.hs-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* المحتوى */
.home-section .content {
  flex: 1 1 auto;
  padding-inline: 40px;
  z-index: 2;
  color: #fff;
}

.home-section .content h2 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 12px 0;
  text-shadow: 0 2px 6px rgba(0,0,0,0.45);
}

.home-section .content .content-body {
  margin-top: 8px;
  font-size: 1.7rem;
  color: var(--hs-subtext-color, #f4e7c8);
}

.home-section .content .content-cta {
  margin-top: 16px;
}
.home-section .content .hs-cta {
  background: var(--hs-cta-bg, #6B1119);
  color: var(--hs-cta-text, #ffffff);
  border: 1px solid var(--hs-cta-border, rgba(235,206,143,.25));
}

.home-section .content .hs-cta:hover {
  background: var(--hs-cta-bg-hover, var(--hs-cta-bg, #6B1119));
  color: var(--hs-cta-text-hover, var(--hs-cta-text, #ffffff));
  filter: brightness(1.06);
}

/* الصورة الجانبية */
.home-section .side-image {
  flex: 0 0 var(--img-w-desktop, 50%);
  max-width: 100%;
  height: 100%;
  min-height: 260px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s ease;
}

/* الاتجاه اليمين/اليسار */
.home-section.right .bg {
  flex-direction: row;
}

.home-section.left .bg {
  flex-direction: row-reverse;
}

/* هوفر بسيط */
.home-section .side-image:hover {
  --img-scale: 1.02;
}

/* =========================================================
   HOME SECTIONS — Responsive
========================================================= */

@media (max-width: 768px) {

  .home-sections {
    margin-top: 40px;
    gap: 32px;
  }

  .home-section {
    margin-top: var(--mt-mobile, 24px);
    margin-bottom: var(--mb-mobile, 24px);
  }

    .home-section .bg {
    height: auto !important;

    /* 🔧 هنا الأمان:
       - لو فيه block-h-mobile → يستخدمه
       - لو مافيه → يرجع لـ block-h-desktop (نفس سلوك اللابتوب)
    */
    min-height: var(--block-h-mobile, var(--block-h-desktop, 420px)) !important;

    flex-direction: column !important;
    padding-top: var(--pt-mobile, 24px);
    padding-bottom: var(--pb-mobile, 24px);

    background-size: var(--bg-size-mobile, var(--bg-size-desktop, cover));
  }

  .home-section .content {
    padding-inline: 18px;
    text-align: center;
  }

  .home-section .content h2 {
    font-size: 1.6rem;
  }

  .home-section .content .content-body {
    font-size: 0.95rem;
  }

    .home-section .side-image {
    /* 🔧 اجعل عرض الصورة على الجوال قابل للتحكم من لوحة التحكم */
    flex: 0 0 var(--img-w-mobile, 90%);
    width: var(--img-w-mobile, 90%);
    min-height: 100px;
    /* flex-basis يضبطه flex مباشرة من السطر الأول */
  }

}

@media (min-width: 768px) and (max-width: 1024px) {

  .home-section {
    margin-top: var(--mt-desktop, 40px);
    margin-bottom: var(--mb-desktop, 40px);
  }

  .home-section .bg {
    min-height: var(--block-h-desktop, 380px);
  }

  .home-section .content {
    padding-inline: 28px;
  }

  .home-section .content h2 {
    font-size: 1.8rem;
  }

  .home-section .side-image {
    flex-basis: var(--img-w-desktop, 50%);
  }
}
/* === إصلاح امتلاء صورة الكرت بدون قص على جميع الأجهزة === */

/* خلفية ممتدة للصورة بدون قص — نسخة مطابقة لأسلوب الموقف الحرج */
.tile-image {
  position: relative;
  overflow: hidden;
  background: #120a0a; /* fallback بسيط */
}

/* الخلفية المموهة */
.tile-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--img);     /* هنا السحر */
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(0.6);
  transform: scale(1.25);
  opacity: 0.55;
  z-index: 1;
}

/* الصورة الأمامية */
.tile-image img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* =========================================================
   Home Sections Video Player (مشغل الفيديو + زر الصوت)
========================================================= */

.home-section .side-image.has-player {
  /* لا نبي الخلفية (صورة) تغطي الفيديو */
  background-image: none !important;

  /* مهم: لا نلف/ندور المشغل عشان ما تتلخبط الـ controls */
  transform: scale(var(--img-scale, 1)) !important;

  overflow: hidden;
  border-radius: var(--img-radius, 0px);
}

.home-section .hs-video-player {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* الفيديو نفسه */
.home-section .hs-video-player video {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: rgba(0,0,0,0.25);
}
/* Phase 4: CSRF-safe logout form */
.logout-form-inline { display: inline-flex; margin: 0; padding: 0; }
