/* =============================================================================
   Gateway Landing — استایل کامل
   فارسی · RTL · موبایل‌اول · بدون هیچ وابستگی بیرونی
============================================================================= */

/* ---------- فونت (خودمیزبان) --------------------------------------------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn-arabic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200E,
                 U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2000-206F, U+2212;
}

/* ---------- توکن‌های طراحی ------------------------------------------------ */
:root {
  --bg:            #06080D;
  --text:          #F2F5FA;
  --text-2:        rgba(242, 245, 250, 0.64);
  --text-3:        rgba(242, 245, 250, 0.52);

  --card-bg-a:     rgba(255, 255, 255, 0.055);
  --card-bg-b:     rgba(255, 255, 255, 0.018);
  --line:          rgba(255, 255, 255, 0.085);
  --line-soft:     rgba(255, 255, 255, 0.06);

  --radius-card:   22px;
  --radius-md:     14px;
  --radius-btn:    12px;

  --pad-card:      22px;
  --gap-grid:      20px;
  --maxw:          1320px;

  --ease:          cubic-bezier(0.22, 0.72, 0.28, 1);
  --dur:           200ms;

  /* پیش‌فرض؛ هر کارت مقدار خودش را از brands.js می‌گیرد */
  --accent:        #6B4AD9;
  --accent-rgb:    107, 74, 217;
  --on-accent:     #FFFFFF;
}

/* ---------- پایه ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100svh;
  padding: clamp(28px, 6vh, 72px) clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;

  font-family: "Vazirmatn", "Tahoma", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 50% -12%, rgba(124, 140, 255, 0.10), transparent 62%),
    radial-gradient(820px 520px at 8% 108%,  rgba(225,  90,  60, 0.055), transparent 60%),
    radial-gradient(760px 480px at 96% 100%, rgba(210, 177, 131, 0.045), transparent 60%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* بافت بسیار ملایم روی پس‌زمینه */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

h1, h2, p { margin: 0; }

svg { display: block; }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* حلقهٔ فوکوس سفید است تا روی هر رنگ برندی کاملاً دیده شود */
:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 3px;
  border-radius: var(--radius-btn);
}

/* ---------- چیدمان ------------------------------------------------------- */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: auto;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-grid);
}

.grid__item { display: flex; min-width: 0; }

@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1140px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- کارت --------------------------------------------------------- */
.card {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: var(--pad-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background-image: linear-gradient(180deg, var(--card-bg-a), var(--card-bg-b));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 24px 48px -30px rgba(0, 0, 0, 0.9);
  transition:
    transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

/* خط لطیف رنگ برند در بالای کارت */
.card::before {
  content: "";
  position: absolute;
  inset-inline-start: 16%;
  inset-inline-end: 16%;
  top: -1px;
  height: 1px;
  border-radius: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(var(--accent-rgb), 0.85),
    transparent);
  opacity: 0.5;
  transition: opacity var(--dur) var(--ease),
              inset-inline-start var(--dur) var(--ease),
              inset-inline-end var(--dur) var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--accent-rgb), 0.32);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.075),
      0 30px 60px -30px rgba(0, 0, 0, 0.95),
      0 0 0 1px rgba(var(--accent-rgb), 0.06);
  }
  .card:hover::before {
    opacity: 1;
    inset-inline-start: 6%;
    inset-inline-end: 6%;
  }
  .card:hover .logo-stage::before { opacity: 1; }
}

.card:focus-within {
  border-color: rgba(var(--accent-rgb), 0.32);
}

/* ---------- سر کارت ------------------------------------------------------ */
.card__head { display: flex; flex-direction: column; align-items: center; }

/* کارت بدون اطلاعات (فعلاً بازی انفجار) — محتوا وسط، دکمه‌ها پایین */
.card--minimal .card__head { margin-block: auto; padding-block: 8px; }

.logo-stage {
  position: relative;
  width: 100%;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* هالهٔ بسیار ملایم رنگ برند پشت لوگو */
.logo-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 190px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), 0.22), transparent);
  filter: blur(14px);
  opacity: 0.55;
  transition: opacity var(--dur) var(--ease);
}

.logo {
  width: var(--logo-w);
  height: var(--logo-h);
  max-width: 100%;
  max-height: 76px;
  object-fit: contain;
}

/* در کارت بدون اطلاعات، لوگو کمی بزرگ‌تر نمایش داده می‌شود */
.card--minimal .logo-stage { height: 96px; margin-bottom: 20px; }
.card--minimal .logo {
  width: calc(var(--logo-w) * 1.2);
  height: calc(var(--logo-h) * 1.2);
  max-height: 96px;
}

/* لوگوهای مربعی/آیکونی مثل کاشی اپلیکیشن نمایش داده می‌شوند */
.logo--round {
  border-radius: 17px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.10),
    0 10px 24px -12px rgba(0, 0, 0, 0.95);
}

.card__name {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-align: center;
}

.card__desc {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  text-align: center;
  min-height: calc(2 * 1.75 * 13.5px);
}

/* ---------- آمار سریع ---------------------------------------------------- */
.stats {
  display: flex;
  align-items: stretch;
  padding: 12px 0;
  border-block: 1px solid var(--line-soft);
}

.stat {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  padding-inline: 6px;
}

.stat + .stat { border-inline-start: 1px solid var(--line-soft); }

.stat__value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.stat__star {
  width: 15px;
  height: 15px;
  fill: #F5B841;
  flex: none;
}

.stat__label {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-3);
  text-align: center;
}

/* ---------- بونوس -------------------------------------------------------- */
.bonus {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg,
    rgba(var(--accent-rgb), 0.11),
    rgba(var(--accent-rgb), 0.042));
}

.bonus__label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  /* نسخهٔ روشن‌شدهٔ رنگ برند تا روی پنل تیره کنتراست کافی داشته باشد */
  color: var(--accent);
  color: color-mix(in srgb, var(--accent) 62%, #FFFFFF);
}

.bonus__icon { width: 14px; height: 14px; fill: currentColor; flex: none; }

.bonus__text {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

.bonus__note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
}

/* ---------- دکمه‌ها ------------------------------------------------------- */
.cta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 16px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition:
    transform var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    filter var(--dur) var(--ease);
}

.btn__icon { width: 17px; height: 17px; flex: none; }

.btn--primary {
  color: var(--on-accent);
  background-color: var(--accent);
  background-image: linear-gradient(180deg,
    rgba(255, 255, 255, 0.06),
    rgba(0, 0, 0, 0.12));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 6px 18px -11px rgba(var(--accent-rgb), 0.6);
}
.btn--primary .btn__icon { fill: currentColor; }

.btn--ghost {
  min-height: 46px;
  color: rgba(242, 245, 250, 0.86);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
}
.btn--ghost .btn__icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.75;
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
  .btn--ghost:hover {
    color: #fff;
    border-color: rgba(var(--accent-rgb), 0.45);
    background: rgba(var(--accent-rgb), 0.09);
  }
  .btn--ghost:hover .btn__icon { opacity: 1; }
}

.btn:active { transform: translateY(0) scale(0.99); }

/* ---------- موبایل ------------------------------------------------------- */
@media (max-width: 619px) {
  :root { --pad-card: 20px; --gap-grid: 16px; }

  .card { gap: 16px; }
  .card__name { font-size: 21px; }
  .card__desc { min-height: 0; }

  .btn          { min-height: 54px; font-size: 15.5px; }
  .btn--ghost   { min-height: 50px; }
}

/* ---------- کاهش حرکت ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .card:hover { transform: none; }
}
