/* =====================================================================
   هیروی بازارچه (خرید و فروش بین کاربران)
   هم‌سبک هیروی صفحه‌ی اصلی: عنوان با اسم بازیِ چرخان، چیپ‌های بازی (شیشه‌ای)،
   دکمه‌ها و عکسِ تمام‌صحنه. فقط کلاس‌های mh-* → با بقیه‌ی CSS تداخل نداره.
   تنظیم‌های اصلی: --mh-h (ارتفاع)، --rot-ms (مدت هر بازی؛ باید با mp-hero.js یکی باشه)
   ===================================================================== */

.mh{
  --mh-h:420px;
  --gc:#e07a3f;                 /* رنگ بازیِ فعال؛ جاوااسکریپت عوضش می‌کنه */
  --rot-ms:3400ms;
  --mh-glass:rgba(255,255,255,.09);
  position:relative;isolation:isolate;overflow:hidden;direction:rtl;
  min-height:var(--mh-h);
  display:flex;align-items:center;
  padding:clamp(26px,3.4vw,46px) clamp(22px,4.4vw,64px);
  border-radius:8px;border:1px solid var(--line);
  /* رنگِ لبه‌ی راستِ عکس؛ عکس از چپ شروع می‌شه و توی همین رنگ محو می‌شه */
  background:linear-gradient(180deg,#573685 0,#341f58 52%,#170c2e 100%);
}

/* ---------- عکس ---------- */
.mh__art{
  position:absolute;z-index:-2;top:0;bottom:0;left:0;
  height:100%;aspect-ratio:1376/768;
  background:url(../image/hero/market-trade.webp) 0 0/100% 100% no-repeat;
  -webkit-mask-image:linear-gradient(to right,#000 0,#000 72%,transparent 100%);
          mask-image:linear-gradient(to right,#000 0,#000 72%,transparent 100%);
  transform-origin:30% 55%;
  animation:mh-drift 16s ease-in-out infinite alternate;
}
@keyframes mh-drift{from{transform:scale(1)}to{transform:scale(1.045)}}

/* درخششِ هم‌رنگِ بازیِ فعال پشت اسکین + سایه‌ی خوانایی پشت متن */
.mh::before{
  content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:
    radial-gradient(ellipse 30% 62% at 24% 50%,color-mix(in srgb,var(--gc) 24%,transparent),transparent 72%),
    radial-gradient(ellipse 46% 92% at 76% 52%,rgba(14,6,30,.62),rgba(14,6,30,.26) 58%,transparent 100%),
    linear-gradient(to bottom,rgba(16,0,25,.34),transparent 24%);
  transition:background .9s ease;
}
/* پایینِ هیرو کمی تیره می‌شه تا به کارت‌های پایینی وصل بشه */
.mh::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:22%;z-index:-1;pointer-events:none;
  background:linear-gradient(to top,rgba(20,23,42,.55),transparent);
}

/* ---------- متن ---------- */
.mh__copy{position:relative;z-index:1;display:flex;flex-direction:column;align-items:flex-start;text-align:right;width:min(100%,560px)}
.mh__eyebrow{
  display:inline-flex;align-items:center;gap:8px;margin-bottom:clamp(10px,1.4vw,16px);
  font-size:13px;font-weight:700;color:#d8d3f7;
  padding:5px 12px 5px 14px;border-radius:7px;
  background:rgba(110,95,212,.2);border:1px solid rgba(197,191,238,.28);
}
.mh__eyebrow .bi{font-size:14px}

.mh__title{
  margin:0;color:#fff;font-family:Peyda,Vazirmatn,sans-serif;font-weight:800;
  font-size:clamp(26px,3.3vw,46px);line-height:1.3;letter-spacing:-.01em;
  text-shadow:0 2px 18px rgba(0,0,0,.45);
}
.mh__title>span{display:block}
.mh__line2{display:flex!important;align-items:baseline;gap:.28em;flex-wrap:nowrap}
.mh__line2>span:first-child{white-space:nowrap}

/* اسم بازیِ چرخان */
.mh__game{position:relative;display:inline-block;direction:ltr;line-height:1.3}
.mh__sizer{display:block;visibility:hidden;white-space:nowrap;font-weight:800}      /* عرض = پهن‌ترین کلمه */
.mh__live{
  position:absolute;inset:0;display:block;overflow:hidden;
  clip-path:inset(-.3em -2em -.3em -2em);                                            /* فقط بالا/پایین بریده بشه */
}
.mh__w{
  position:absolute;inset:0 0 0 auto;display:flex;align-items:center;white-space:nowrap;
  font-weight:800;color:var(--gc-w,#fff);
  text-shadow:0 0 28px var(--gc-w-glow,transparent);
  opacity:0;transform:translateY(60%);filter:blur(8px);pointer-events:none;
  transition:transform .65s cubic-bezier(.2,.8,.2,1),opacity .45s ease,filter .55s ease;
}
.mh__w.is-active{opacity:1;transform:none;filter:none}
.mh__w.is-leaving{opacity:0;transform:translateY(-60%);filter:blur(8px)}

.mh__text{
  margin:clamp(12px,1.6vw,20px) 0 0;max-width:34em;
  color:#e9e7f8;font-size:clamp(13.5px,1.25vw,16px);font-weight:500;line-height:2.05;
  text-shadow:0 1px 10px rgba(0,0,0,.55);
}

/* ---------- چیپ‌های بازی (شیشه‌ای) ---------- */
.mh__games{display:flex;flex-wrap:wrap;gap:8px;margin:clamp(14px,1.8vw,22px) 0 0;padding:0;list-style:none;direction:ltr;justify-content:flex-end}
.mh__gbtn{
  --c:#999;position:relative;overflow:hidden;display:inline-flex;align-items:center;gap:8px;
  height:36px;padding:0 14px 0 12px;border-radius:8px;
  font:700 13px/1 'Vazirmatn',sans-serif;color:rgba(255,255,255,.86);cursor:pointer;
  background:linear-gradient(180deg,rgba(255,255,255,.14),rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter:blur(14px) saturate(160%);backdrop-filter:blur(14px) saturate(160%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 6px 18px rgba(8,2,24,.28);
  transition:color .25s,border-color .25s,background .25s,transform .2s;
}
.mh__gbtn::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--c);transition:box-shadow .3s}
.mh__gbtn:hover{color:#fff;border-color:rgba(255,255,255,.4);background:linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,.09))}
.mh__gbtn:active{transform:scale(.97)}
.mh__gbtn:focus-visible{outline:2px solid var(--c);outline-offset:2px}
.mh__gbtn[aria-pressed="true"]{
  color:#fff;border-color:color-mix(in srgb,var(--c) 75%,transparent);
  background:linear-gradient(180deg,color-mix(in srgb,var(--c) 38%,transparent),color-mix(in srgb,var(--c) 16%,transparent));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.3),0 6px 18px rgba(8,2,24,.28),0 0 18px -4px color-mix(in srgb,var(--c) 60%,transparent);
}
.mh__gbtn[aria-pressed="true"]::before{box-shadow:0 0 10px 1px var(--c)}
.mh__gbtn::after{                       /* نوارِ زمانِ تا بازیِ بعدی */
  content:"";position:absolute;inset:auto 0 0 0;height:2px;background:var(--c);transform:scaleX(0);transform-origin:left;
}
.mh__gbtn[aria-pressed="true"]::after{animation:mh-fill var(--rot-ms) linear forwards}
.mh__games.is-paused .mh__gbtn[aria-pressed="true"]::after{animation-play-state:paused}
@keyframes mh-fill{to{transform:scaleX(1)}}

/* ---------- دکمه‌ها ---------- */
.mh__cta{display:flex;flex-wrap:wrap;gap:12px;margin-top:clamp(16px,2vw,24px)}
.mh__btn{
  display:inline-flex;align-items:center;gap:10px;height:50px;padding:0 24px;border-radius:8px;
  font-size:15.5px;font-weight:800;color:#fff;cursor:pointer;
  transition:transform .2s,box-shadow .2s,filter .2s,background .2s;
}
.mh__btn .bi{font-size:17px;line-height:1}
.mh__btn .mh__arr{transition:transform .25s}
.mh__btn:hover .mh__arr{transform:translateX(-5px)}
.mh__btn:hover{transform:translateY(-2px)}
.mh__btn:focus-visible{outline:3px solid #fff;outline-offset:3px}
.mh__btn--buy{
  background:linear-gradient(135deg,#7d6fe6,var(--v));border:1px solid rgba(255,255,255,.3);
  box-shadow:0 12px 30px -10px rgba(110,95,212,.95),inset 0 1px 0 rgba(255,255,255,.35);
}
.mh__btn--buy:hover{filter:brightness(1.1);box-shadow:0 16px 36px -8px rgba(110,95,212,1),inset 0 1px 0 rgba(255,255,255,.4)}
.mh__btn--sell{
  color:#e2dcff;background:linear-gradient(180deg,rgba(132,113,242,.26),rgba(132,113,242,.1));
  border:1px solid rgba(255,255,255,.22);
  -webkit-backdrop-filter:blur(14px) saturate(160%);backdrop-filter:blur(14px) saturate(160%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 6px 18px rgba(8,2,24,.28);
}
.mh__btn--sell:hover{color:#fff;background:linear-gradient(180deg,rgba(132,113,242,.42),rgba(132,113,242,.2))}

/* ---------- مزایای کوتاه ---------- */
.mh__trust{display:flex;flex-wrap:wrap;gap:8px 18px;margin:clamp(14px,1.8vw,20px) 0 0;padding:0;list-style:none}
.mh__trust li{display:inline-flex;align-items:center;gap:7px;font-size:13.5px;font-weight:700;color:#dedaf3;text-shadow:0 1px 8px rgba(0,0,0,.6)}
.mh__trust .bi{color:#9a90f0;font-size:15px}

/* ---------- ریسپانسیو ---------- */
@media(max-width:1100px){.mh{--mh-h:400px}}
@media(max-width:860px){
  /* در سایزهای کوچیک دست/اسکین کامل مخفی می‌شه (دیگه بالای متن نمی‌ره) */
  .mh{--mh-h:0px;padding:26px 20px 16px}
  .mh__art{display:none}
  .mh::before{background:linear-gradient(to bottom,rgba(16,0,25,.34),transparent 24%)}
  .mh__copy{width:100%}
  }
@media(max-width:480px){
  .mh__btn{height:46px;padding:0 18px;font-size:14.5px;flex:1 1 auto;justify-content:center}
  .mh__games{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;width:100%;direction:ltr}
  .mh__gbtn{width:100%;height:36px;padding:0 6px;gap:6px;font-size:12.5px;justify-content:center;white-space:nowrap}
  .mh__title{font-size:clamp(24px,7.6vw,30px)}
  .mh__trust{flex-direction:column;align-items:flex-start;gap:6px}
}
@media(prefers-reduced-motion:reduce){
  .mh__art{animation:none}
  .mh__w{transition:opacity .2s;transform:none;filter:none}
  .mh__gbtn[aria-pressed="true"]::after{animation:none;transform:scaleX(1)}
  .mh__btn,.mh__btn .mh__arr{transition:none}
}

/* =====================================================================
   حالت تمام‌عرض (لبه تا لبه‌ی ستونِ اصلی، چپ تا چتِ کناری) مثل هیروی صفحه‌ی اصلی
   بقیه‌ی بخش‌ها همون عرض ۱۲۸۰ قبلی رو نگه می‌دارن؛ فقط هیرو بازتر می‌شه.
   ===================================================================== */
body .home-wrap main.home{
  --sec-gap:clamp(24px,3vw,36px);          /* فاصله‌ی ثابت بین همه‌ی بخش‌های صفحه‌ی اصلی */
  display:flex;flex-direction:column;gap:var(--sec-gap);   /* قبلاً display نداشت و gap اثری نداشت: بخش‌ها چسبیده بودن */
  max-width:none;padding-inline:0;padding-top:0
}
body .home-wrap main.home>*{flex:none}
body .home-wrap main.home>*:not(.mh){width:min(calc(100% - 2*var(--gut)),calc(var(--wrap) - 2*var(--gut)));margin-inline:auto}   /* هم‌ردیفِ نوار تب و هیرو */
body .home-wrap main.home>.mh{width:100%}

.mh{
  --mh-h:clamp(420px,27vw,500px);
  --mh-edge:calc(max(0px,(100% - var(--wrap))/2) + var(--gut));   /* لبه‌ی متن = لبه‌ی نوار تب و بقیه‌ی بخش‌ها */
  border-radius:0;border-width:0 0 1px;
  padding-inline:var(--mh-edge);
  padding-bottom:36px;   /* فاصله‌ی متن‌های زیر دکمه‌ها تا نوار مزایا */
  -webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent 100%);
          mask-image:linear-gradient(to bottom,#000 calc(100% - 16px),transparent 100%);
}
@media(max-width:860px){
  .mh{--mh-h:0px;padding-top:24px;padding-inline:var(--gut)}
  .mh__text{max-width:none}
  .mh__trust{gap:6px 14px}
  .mh__trust li{font-size:12.5px}
  }
/* سایز متوسط (یا چتِ باز که عرض محتوا رو کم می‌کنه): عکس کمرنگ‌تر و عقب‌تر که روی متن نیاد */
@media(max-width:1100px) and (min-width:861px){
  .mh__art{left:-10%;opacity:.55}
  .mh__copy{width:min(100%,500px)}
}
@media(max-width:1400px) and (min-width:1101px){
  body:not(.chat-closed) .mh__art{left:-8%;opacity:.7}
}

/* ===================== نوار مزایای زیر هیرو (تمام‌عرض، لوپ با JS) ===================== */
body .home-wrap main.home>.mh-strip{width:100%;max-width:none;margin-top:calc(-1*var(--sec-gap))}   /* gap رو خنثی می‌کنه تا نوار بچسبه به هیرو */
.mh-strip{
  direction:rtl;position:relative;overflow:hidden;padding:16px 0;
  background:linear-gradient(90deg,rgba(110,95,212,.16),rgba(110,95,212,.05) 50%,rgba(110,95,212,.16));
  border-block:1px solid rgba(110,95,212,.28);
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);
          mask-image:linear-gradient(90deg,transparent,#000 8%,#000 92%,transparent);
}
.mh-strip__track{display:flex;align-items:center;width:max-content;min-width:100%;margin:0;padding:0;list-style:none;will-change:transform}
.mh-strip__item{
  flex:0 0 auto;margin-inline:7px;display:inline-flex;align-items:center;gap:10px;padding:9px 18px 9px 20px;white-space:nowrap;
  border-radius:7px;font-size:13.5px;font-weight:700;color:#f3f2fb;
  background:rgba(110,95,212,.09);border:1px solid rgba(110,95,212,.32);transition:border-color .3s,background .3s;
}
.mh-strip__item i{font-size:16px;color:#8E83E6}
.mh-strip__item:hover{border-color:#6E5FD4;background:rgba(110,95,212,.2)}
@media(max-width:900px){.mh-strip{padding:12px 0}.mh-strip__item{font-size:12.5px;padding:8px 14px 8px 16px}}

/* درخششِ اسم بازی: قبلاً داخل یه جعبه (overflow/clip-path) بریده می‌شد و مربعی دیده می‌شد.
   الان برش برداشته شده و نور آزادانه اطراف کلمه پخش می‌شه. */
.mh__live{overflow:visible;clip-path:none}
.mh__w{text-shadow:0 0 14px var(--gc-w-glow,transparent),0 0 38px var(--gc-w-glow,transparent),0 0 70px var(--gc-w-glow,transparent)}
.mh__w:not(.is-active){text-shadow:none}body .home-wrap main.home>.feat{margin-top:0}   /* فاصله‌اش فقط از gap بیاد */
