/* صفحات الموقع التسويقية — ثيم فيراري: قماش شبه أسود، Rosso Corsa بشحّ، زوايا حادة */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /*
   * الألوان مستخرجة من فن اللعبة نفسه لا مخترَعة:
   *   الليل  #342e44  من diwaniya-night
   *   الرمل  #cb9b7d  من مشهد الغروب
   *   القماش #22191b  من صورة الواجهة
   * فالموقع واللعبة يصيران عالمًا واحدًا لا سطحين متجاورين.
   */
  --primary: #da291c;          /* Rosso Corsa — لون الشعار، يبقى كما هو */
  --primary-active: #b01e0a;
  /*
   * أحمر للنصّ لا للخلفيات: Rosso Corsa نفسه تباينه ٣٫٨٥:١ على القماش، وهو
   * دون عتبة ٤٫٥ للنصّ العادي. هذا أفتح منه بقدر ما يعبر العتبة (٥٫٨ و٥٫١٥)
   * ويبقى من العائلة نفسها. الأزرار تظلّ على --primary لأنها خلفية لا نصّ.
   */
  --primary-ink: #ef6152;
  --ember: #e0a93b;            /* ذهب الفانوس — للتوهّج والتمييز الدافئ */
  --night: #342e44;            /* بنفسجي الليل */
  --sand: #cb9b7d;             /* رمل الغروب */

  --ink: #f6f1ea;              /* أبيض دافئ — الأبيض الناصع يقسو على قماش دافئ */
  --body: #a4978a;
  /* ٥٫٤١:١ على القماش و٤٫٨٠:١ على المرتفع — كان ٣٫١٥ و٢٫٨٠ أي دون العتبة */
  --muted: #94887b;
  --hairline: #332a22;
  --canvas: #16110e;
  --canvas-elevated: #241d17;
  --success: #4a9d5f;

  /* الحركة: منحنى واحد لكل الموقع كي يحسّ المستخدم بيد واحدة صمّمته */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.16s;
  --t: 0.28s;
  --t-slow: 0.6s;

  /* الارتفاع: ظلّ دافئ لا رمادي، وحدّ خفيف يفصل السطح عن القماش */
  --lift-1: 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px rgba(0, 0, 0, 0.45);
  --lift-2: 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 56px rgba(0, 0, 0, 0.6);
  --glow-ember: 0 0 28px rgba(224, 169, 59, 0.18);
  --sp-xxs: 8px; --sp-xs: 16px; --sp-sm: 24px; --sp-md: 32px; --sp-lg: 48px; --sp-xl: 64px; --sp-xxl: 96px;
  --font: "Inter", "FerrariSans", -apple-system, system-ui, "Segoe UI", Tahoma, sans-serif;
  /* عرض المحتوى الموحّد — الشريط العلوي والأقسام والتذييل تتبعه كلها */
  --content: 1100px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ---------- الشريط العلوي ---------- */
/*
 * الخلفية والحدّ يمتدّان على كامل العرض، لكن المحتوى ينحصر في نفس عرض
 * الأقسام (--content). بلا هذا يجلس الشعار على أقصى اليمين وقائمة الحساب
 * على أقصى اليسار في الشاشات العريضة، فتلفّ عينك بينهما.
 */
/*
 * لا شريط: العناصر تطفو فوق الصفحة نفسها فيمتدّ الفن إلى أعلى الشاشة.
 * الخلفية تظهر تدريجيًا عند التمرير وحده كي يبقى النص مقروءًا فوق المحتوى.
 */
nav {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(var(--sp-sm), calc((100% - var(--content)) / 2));
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  z-index: 40;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease),
              backdrop-filter var(--t) var(--ease);
}
nav.scrolled {
  background: rgba(22, 17, 14, 0.82);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom-color: var(--hairline);
}
/* الشريط صار عائمًا فما عاد يدفع المحتوى — نعوّض الفراغ في الصفحات بلا بطل */
body:not(.has-hero) main,
body:not(.has-hero) .auth-wrap { padding-top: 68px; }

/* الاسم والأيقونة يُقرآن فوق أي مشهد */
.nav-logo, .nav-links > a { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
nav.scrolled .nav-logo, nav.scrolled .nav-links > a { text-shadow: none; }
.nav-logo { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.nav-logo .mark { color: var(--primary-ink); }
.logo-img { width: 30px; height: 30px; display: block; object-fit: contain; }
.hero-logo { width: 88px; height: 88px; object-fit: contain; margin-bottom: var(--sp-sm); }
.nav-links { display: flex; align-items: center; gap: var(--sp-sm); font-size: 0.85rem; font-weight: 600; }
.nav-links > a { color: var(--body); transition: color 0.15s; }
.nav-links > a:hover { color: var(--ink); }
.nav-links a.cta {
  color: var(--ink);
  background: var(--primary);
  padding: 10px 20px;
}
.nav-links a.cta:hover { background: var(--primary-active); }
.nav-credits {
  background: var(--canvas-elevated);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 600;
}
.nav-credits b { color: var(--primary-ink); }

/* ---------- نافذة «كيف تريد أن تلعب؟» ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 3, 3, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: var(--sp-xs);
  animation: modalFade 0.2s ease;
}
@keyframes modalFade { from { opacity: 0; } }
.modal-card {
  position: relative;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--primary);
  padding: var(--sp-md) var(--sp-sm);
  max-width: 620px;
  width: 100%;
  text-align: center;
  animation: modalPop 0.28s cubic-bezier(0.2, 1, 0.3, 1);
}
@keyframes modalPop { from { transform: scale(0.92) translateY(12px); opacity: 0; } }
.modal-card h3 { font-size: 1.5rem; font-weight: 500; }
.modal-sub { color: var(--body); font-size: 0.9rem; margin-top: 6px; }
.modal-close {
  position: absolute;
  top: 12px; left: 12px;
  /* min مع width: قواعد الجوال تصغّر الأزرار، والحد الأدنى يمنع نزولها عن ٤٤ */
  width: 44px; height: 44px;
  min-width: 44px; min-height: 44px;
  padding: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.04);
  color: var(--body);
  font-size: 1.1rem;
  line-height: 1;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.modal-close:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--ink);
  transform: rotate(90deg);
}
.modal-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-xs);
  margin: var(--sp-sm) 0 var(--sp-xs);
}
@media (max-width: 560px) { .modal-choices { grid-template-columns: 1fr; } }
.choice {
  display: block;
  background: var(--canvas-elevated);
  border: 1px solid var(--canvas-elevated);
  padding: var(--sp-sm) var(--sp-xs);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.choice:hover { transform: translateY(-4px); border-color: var(--primary); }
.choice-icon { font-size: 2.2rem; }
.choice h4 { font-size: 1.05rem; font-weight: 700; margin: 8px 0 4px; }
.choice p { color: var(--body); font-size: 0.82rem; line-height: 1.6; }
.modal-note { color: var(--muted); font-size: 0.82rem; margin-top: var(--sp-xs); }
.modal-note a { color: var(--primary-ink); font-weight: 600; }

/* ---------- قائمة الحساب ---------- */
.account-wrap { position: relative; }
.account-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--canvas-elevated);
  border: 1px solid var(--hairline);
  color: var(--ink);
  padding: 7px 13px;
  height: auto;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 9999px;
}
.account-btn:hover { background: #3c3c3c; }
.account-avatar { font-size: 1rem; }
.account-caret { color: var(--muted); font-size: 0.82rem; }

/*
 * تُفتح من حافة الزر اليسرى نحو اليمين. تثبيتها من اليمين كان يمدّها يسارًا
 * فتخرج ٧٠ بكسل عن حافة الشاشة، لأن زر الحساب أصلًا في أقصى يسار الشريط.
 */
.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: auto;
  min-width: 232px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
  z-index: 60;
  display: none;
  flex-direction: column;
  text-align: right;
}
.account-menu.open { display: flex; animation: acctIn 0.16s ease; }
@keyframes acctIn { from { opacity: 0; transform: translateY(-6px); } }

.account-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
}
.account-head-name { font-weight: 700; font-size: 0.9rem; }
.account-head-mail { color: var(--muted); font-size: 0.82rem; margin-top: 2px; direction: ltr; text-align: right; }

.account-menu a {
  padding: 13px 16px;
  min-height: 46px;
  display: flex;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--body);
  border-bottom: 1px solid var(--hairline);
  transition: background 0.15s, color 0.15s;
}
.account-menu a:last-child { border-bottom: none; }
.account-menu a:hover { background: var(--canvas-elevated); color: var(--ink); }
.account-menu a.danger:hover { color: #ff8a80; }
/*
 * الاسم والقيمة بحجمين مختلفين. مع align-items: center تتوسّط الصناديق لكن
 * خطّي الأساس يختلفان فتبدو القيمة هابطة قليلًا — والعين تقرأ خط الأساس لا
 * الصندوق. baseline يحاذي ما تراه فعلًا.
 */
.account-credits { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-xs); }
.account-credits b { color: var(--primary-ink); font-size: 0.86rem; white-space: nowrap; }
.account-credits b.sub-on { color: #57d99a; }
.account-credits b.sub-off { color: var(--primary-ink); }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  padding: 14px 32px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); }
.btn.primary { background: var(--primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-active); border-color: var(--primary-active); }
.btn.ghost { border-color: var(--hairline); color: var(--body); }
.btn:disabled { border-color: var(--muted); color: var(--muted); background: transparent; cursor: not-allowed; }
.btn.block { display: block; width: 100%; }

/* ---------- البطل (Hero) ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--sp-xxl) var(--sp-sm);
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
  background:
    radial-gradient(900px 500px at 50% 115%, rgba(218, 41, 28, 0.16), transparent 65%),
    linear-gradient(180deg, #1f1f1f 0%, var(--canvas) 60%);
}
.hero .kicker {
  color: var(--primary-ink);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: var(--sp-xs);
}
.hero h1 {
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  font-weight: 500;
  line-height: 1.1;
  max-width: 800px;
}
.hero .lead {
  color: var(--body);
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
  line-height: 1.8;
  max-width: 560px;
  margin: var(--sp-sm) 0 var(--sp-md);
}
.hero .actions { display: flex; gap: var(--sp-xs); flex-wrap: wrap; justify-content: center; }
.hero .trust { color: var(--muted); font-size: 0.82rem; margin-top: var(--sp-sm); }

/* ---------- الأقسام ---------- */
.section { padding: var(--sp-xxl) var(--sp-sm); max-width: var(--content); margin: 0 auto; width: 100%; }
.section-head { text-align: center; margin-bottom: var(--sp-lg); }
.section-head .kicker { color: var(--primary-ink); font-size: 0.82rem; font-weight: 700; margin-bottom: var(--sp-xxs); }
.section-head h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 500; }
.section-head p { color: var(--body); margin-top: var(--sp-xxs); line-height: 1.7; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-xs); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-xs); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.feature-card {
  background: var(--canvas-elevated);
  border-radius: 0;
  padding: var(--sp-md) var(--sp-sm);
  text-align: right;
}
.feature-card .icon { font-size: 2rem; margin-bottom: var(--sp-xs); }
.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--body); font-size: 0.88rem; line-height: 1.7; }
.feature-card .step-num {
  color: var(--primary);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--sp-xs);
}

/* شريط الأرقام (spec cells) */
.spec-band {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}
.spec-cell { padding: var(--sp-lg) var(--sp-xs); }
.spec-cell + .spec-cell { border-inline-start: 1px solid var(--hairline); }
.spec-cell .value { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 700; line-height: 1.1; }
.spec-cell .value.red { color: var(--primary); }
.spec-cell .label { color: var(--muted); font-size: 0.82rem; font-weight: 600; margin-top: 8px; }

/* الشريط الأحمر (livery band) */
.livery-band {
  background: linear-gradient(180deg, #a00c01, var(--primary) 64%);
  padding: var(--sp-xxl) var(--sp-sm);
  text-align: center;
}
.livery-band h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 500; max-width: 720px; margin: 0 auto; }
.livery-band p { margin-top: var(--sp-xs); opacity: 0.9; line-height: 1.7; }

/* ---------- صفحة الأسعار: صف بطاقات بثيمنا ---------- */
.price-title { font-size: clamp(2rem, 5vw, 3rem); font-weight: 500; }

/*
 * ثلاث باقات اشتراك في صف واحد، متساوية الارتفاع ومحدودة العرض.
 * عدد الأعمدة يصل من الجافاسكربت عبر --cols لا بسطر داخلي: السطر الداخلي
 * يغلب كل نقاط التوقّف فيبقى الصفّ ثلاثة أعمدة على شاشة ٣٧٥ بكسل. القرار
 * هنا في CSS كي تستطيع نقطة توقّف الجوال أدناه أن تنقضه.
 */
.price-row {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 300px));
  justify-content: center;
  gap: var(--sp-xs);
  align-items: stretch;
}
@media (max-width: 860px) { .price-row { grid-template-columns: repeat(var(--cols, 3), 1fr); } }
@media (max-width: 620px) { .price-row { grid-template-columns: 1fr; max-width: 340px; margin: 0 auto; } }

.pack {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--canvas-elevated);
  border: 1px solid var(--hairline);
  padding: var(--sp-sm) var(--sp-xs) var(--sp-xs);
  text-align: right;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.pack:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}
.pack.featured { border-color: var(--primary); }

.pack-badge {
  position: absolute;
  top: -11px; right: var(--sp-xs);
  background: var(--primary);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 12px;
}
.pack-name { font-size: 1rem; font-weight: 700; }
.pack-tag {
  display: inline-block;
  align-self: flex-start;
  background: rgba(218, 41, 28, 0.18);
  color: #ff8a80;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 10px;
  margin-top: 6px;
}
.pack-price {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  margin: var(--sp-xxs) 0;
}
.pack-price small { font-size: 0.85rem; color: var(--body); font-weight: 400; }
.pack-note {
  color: var(--body);
  font-size: 0.82rem;
  line-height: 1.55;
  flex: 1;
  margin-bottom: var(--sp-xs);
}
.pack-btn {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-align: center;
  padding: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
}
.pack:hover .pack-btn { background: var(--primary); border-color: var(--primary); }
.pack.featured .pack-btn { background: var(--primary); border-color: var(--primary); }

.price-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-xs);
  color: var(--body);
  font-size: 0.9rem;
  font-weight: 700;
  margin: var(--sp-lg) 0 var(--sp-sm);
}
.price-divider::before, .price-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
}
.price-foot { text-align: center; color: var(--muted); font-size: 0.86rem; margin-top: var(--sp-lg); }

/* ---------- بطاقات الأسعار (الصفحة الرئيسية) ---------- */
.price-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: var(--sp-md) var(--sp-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
  position: relative;
}
.price-card.featured { border-color: var(--primary); }
.price-card .flag {
  position: absolute; top: -12px; right: 50%; transform: translateX(50%);
  background: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 14px;
}
.price-card h3 { font-weight: 700; font-size: 1rem; }
.price-card .price { font-size: 2.8rem; font-weight: 700; line-height: 1; }
.price-card .price small { font-size: 1rem; color: var(--body); font-weight: 400; }
.price-card .per { color: var(--muted); font-size: 0.82rem; }
.price-card ul { list-style: none; color: var(--body); font-size: 0.85rem; line-height: 2; }

/* ---------- الأسئلة الشائعة ---------- */
.faq { max-width: 720px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--hairline); padding: var(--sp-xs) 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.faq p { color: var(--body); font-size: 0.88rem; line-height: 1.8; margin-top: var(--sp-xxs); }

/* ---------- شريط الدعوة الختامي ---------- */
.cta-band {
  border-top: 1px solid var(--hairline);
  padding: var(--sp-xxl) var(--sp-sm);
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 500; margin-bottom: var(--sp-sm); }

/* ---------- التذييل ---------- */
footer {
  border-top: 1px solid var(--hairline);
  padding: var(--sp-lg) max(var(--sp-sm), calc((100% - var(--content)) / 2));
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  margin-top: auto;
}
footer .flinks { display: flex; gap: var(--sp-sm); justify-content: center; margin-bottom: var(--sp-xs); flex-wrap: wrap; }
footer a { color: var(--body); }
footer a:hover { color: var(--ink); }

/* ---------- النماذج (دخول/تسجيل/دفع) ---------- */
.auth-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-lg) var(--sp-xs);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--primary);
  padding: var(--sp-md);
  display: flex;
  flex-direction: column;
  gap: var(--sp-xs);
}
.auth-card h1 { font-size: 1.5rem; font-weight: 500; text-align: center; }
.auth-card .sub { color: var(--body); font-size: 0.88rem; text-align: center; line-height: 1.6; }
.auth-card label { font-size: 0.82rem; font-weight: 600; color: var(--body); margin-bottom: -8px; text-align: right; }
.auth-card input {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--ink);
  padding: 14px 16px;
  height: 48px;
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  text-align: right;
}
.auth-card input:focus { border-color: var(--ink); }
.auth-card .alt { text-align: center; color: var(--body); font-size: 0.85rem; }
/* أخصّ من ‎.alt a‎ الآتية لاحقًا، فهذا اللون هو ما يظهر فعلًا لا لون الجمرة */
.auth-card .alt a { color: var(--primary-ink); font-weight: 600; }
.form-error {
  background: rgba(218, 41, 28, 0.12);
  border-right: 3px solid var(--primary);
  color: #ff8a80;
  padding: 10px 14px;
  font-size: 0.85rem;
  text-align: right;
}
.form-note { color: var(--muted); font-size: 0.82rem; text-align: center; line-height: 1.6; }

/* ---------- لوحة التحكم ---------- */
.dash { max-width: var(--content); margin: 0 auto; padding: var(--sp-lg) var(--sp-sm); width: 100%; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: var(--sp-xs); margin-bottom: var(--sp-md); }
.dash-head h1 { font-size: 1.7rem; font-weight: 500; }
.dash-head p { color: var(--body); font-size: 0.9rem; margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-xs); margin-bottom: var(--sp-md); }
@media (max-width: 900px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-tile {
  background: var(--canvas-elevated);
  padding: var(--sp-sm);
  text-align: center;
}
.stat-tile .value { font-size: 2.4rem; font-weight: 700; line-height: 1.1; }
.stat-tile .value.red { color: var(--primary); }
.stat-tile .label { color: var(--body); font-size: 0.82rem; font-weight: 600; margin-top: 6px; }

.dash-section { margin-bottom: var(--sp-lg); }
.dash-section h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: var(--sp-xs); padding-bottom: var(--sp-xxs); border-bottom: 1px solid var(--hairline); }

table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th { color: var(--muted); font-weight: 600; text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--hairline); font-size: 0.82rem; }
td { padding: 12px 8px; border-bottom: 1px solid var(--hairline); color: var(--body); text-align: right; }
td b { color: var(--ink); }
.tag { display: inline-block; border-radius: 9999px; padding: 2px 12px; font-size: 0.82rem; font-weight: 600; background: var(--canvas-elevated); }
.tag.red { background: rgba(218, 41, 28, 0.18); color: #ff8a80; }
.tag.green { background: rgba(3, 144, 74, 0.18); color: #57d99a; }
.empty-note { color: var(--muted); font-size: 0.85rem; padding: var(--sp-sm) 0; text-align: center; }

/* ---------- نموذج تعديل المعلومات ---------- */
.profile-form { display: flex; flex-direction: column; gap: var(--sp-xs); }
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-xs);
}
.profile-grid label { display: flex; flex-direction: column; gap: 6px; text-align: right; }
.profile-grid label > span { font-size: 0.82rem; font-weight: 600; color: var(--body); }
.profile-grid label small { color: var(--muted); font-weight: 400; }
.profile-grid input {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--ink);
  padding: 12px 14px;
  height: 46px;
  font-size: 0.92rem;
  font-family: var(--font);
  text-align: right;
  outline: none;
}
.profile-grid input:focus { border-color: var(--ink); }
.profile-form .btn { align-self: flex-start; }
.profile-msg {
  padding: 10px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: right;
}
.profile-msg.ok { background: rgba(3, 144, 74, 0.14); border-right: 3px solid var(--success); color: #57d99a; }
.profile-msg.err { background: rgba(218, 41, 28, 0.12); border-right: 3px solid var(--primary); color: #ff8a80; }

/* ---------- صفحة الدفع ---------- */
.checkout-summary { border: 1px solid var(--hairline); padding: var(--sp-sm); }
.checkout-summary .row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 0.9rem; color: var(--body); }
.checkout-summary .row.total { border-top: 1px solid var(--hairline); font-weight: 700; color: var(--ink); font-size: 1.05rem; }
.test-badge {
  background: rgba(246, 229, 0, 0.1);
  border-right: 3px solid #f6e500;
  color: #d8cf6a;
  padding: 10px 14px;
  font-size: 0.82rem;
  line-height: 1.7;
  text-align: right;
}

#toast {
  position: fixed; top: var(--sp-xs); right: 50%; transform: translateX(50%);
  background: var(--primary);
  color: var(--ink);
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 100;
}

@media (max-width: 640px) {
  /* الشريط العلوي: سطر واحد لا يلتف مهما ضاقت الشاشة */
  nav { padding: 0 var(--sp-xs); gap: var(--sp-xxs); }
  .nav-logo { font-size: 0.92rem; white-space: nowrap; gap: 7px; }
  .nav-logo .logo-img { width: 24px; height: 24px; }
  .nav-links { gap: 10px; font-size: 0.82rem; white-space: nowrap; }
  .nav-links .hide-sm { display: none; }
  .nav-links a.cta { padding: 9px 14px; }
  .nav-credits { padding: 3px 9px; font-size: 0.82rem; }

  /* أزرار البطل: عرض كامل ومتساوية بدل عرضين مختلفين */
  .hero .actions { flex-direction: column; align-self: stretch; width: 100%; }
  .hero .actions .btn { width: 100%; }

  /* مساحة أسفل البطل كي لا يجلس النص فوق أفق المدينة */
  .hero { padding-bottom: calc(var(--sp-xxl) + 60px); }

  .spec-band { grid-template-columns: 1fr; }
  .spec-cell + .spec-cell { border-inline-start: none; border-top: 1px solid var(--hairline); }
}

/* ==================== الحركة والإبداع ==================== */

/* ---------- مشهد البطل السينمائي ---------- */
.hero { position: relative; overflow: hidden; }
.hero > *:not(.hero-scene) { position: relative; z-index: 2; }
.hero-scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

/* صورة القرية ليلًا — ثابتة تمامًا */
.hero-img {
  position: absolute;
  inset: 0;
  background-image: url("/bg/hero.webp");
  background-size: cover;
  background-position: center 62%;
}
@media (max-width: 640px) { .hero-img { background-image: url("/bg/hero@sm.webp"); } }

/* تعتيم متدرّج: يترك السماء واضحة ويُعتم خلف النص كي يبقى مقروءًا */
.hero-veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(24,24,24,0.55) 0%, rgba(24,24,24,0.28) 30%, rgba(24,24,24,0.62) 62%, var(--canvas) 100%);
}

.stars {
  position: absolute; inset: 0 0 auto; height: 46%;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #ffffffb0, transparent),
    radial-gradient(1px 1px at 28% 10%, #ffffff80, transparent),
    radial-gradient(1.5px 1.5px at 44% 30%, #ffffff90, transparent),
    radial-gradient(1px 1px at 61% 15%, #ffffff70, transparent),
    radial-gradient(1.5px 1.5px at 76% 25%, #ffffffa0, transparent),
    radial-gradient(1px 1px at 89% 12%, #ffffff80, transparent),
    radial-gradient(1px 1px at 8% 45%, #ffffff60, transparent),
    radial-gradient(1.5px 1.5px at 93% 40%, #ffffff70, transparent);
  animation: twinkle 4s ease-in-out infinite alternate;
}
.stars.s2 {
  background-image:
    radial-gradient(1px 1px at 18% 35%, #ffffff70, transparent),
    radial-gradient(1.5px 1.5px at 35% 18%, #ffffff90, transparent),
    radial-gradient(1px 1px at 52% 8%, #ffffff80, transparent),
    radial-gradient(1px 1px at 68% 33%, #ffffff60, transparent),
    radial-gradient(1.5px 1.5px at 82% 18%, #ffffff80, transparent);
  animation-delay: 2s;
}
@keyframes twinkle { from { opacity: 0.35; } to { opacity: 1; } }

.fog {
  position: absolute;
  bottom: 60px; left: -20%;
  width: 140%; height: 180px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.05), transparent 70%);
  filter: blur(10px);
  animation: fogDrift 26s ease-in-out infinite alternate;
}
.fog.f2 { bottom: 130px; animation-duration: 34s; animation-delay: -12s; opacity: 0.7; }
@keyframes fogDrift { from { transform: translateX(-4%); } to { transform: translateX(5%); } }

/* دخول عناصر البطل تباعًا */
.rise { opacity: 0; animation: riseIn 0.7s ease forwards; }
.r1 { animation-delay: 0.05s; }
.r2 { animation-delay: 0.18s; }
.r3 { animation-delay: 0.32s; }
.r4 { animation-delay: 0.48s; }
.r5 { animation-delay: 0.64s; }
.r6 { animation-delay: 0.8s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

.hero-logo { animation: riseIn 0.7s ease forwards, logoGlow 4s ease-in-out 1s infinite alternate; }
@keyframes logoGlow {
  from { filter: drop-shadow(0 0 6px rgba(218, 41, 28, 0.25)); }
  to { filter: drop-shadow(0 0 22px rgba(218, 41, 28, 0.55)); }
}

/* ---------- الظهور عند التمرير ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- بطاقات حية ---------- */
.feature-card { position: relative; transition: transform 0.25s ease, background 0.25s ease; }
.feature-card::after {
  content: ""; position: absolute; bottom: 0; right: 0;
  width: 0; height: 2px; background: var(--primary);
  transition: width 0.35s ease;
}
.feature-card:hover { transform: translateY(-5px); background: #363636; }
.feature-card:hover::after { width: 100%; }
.feature-card .icon { display: inline-block; transition: transform 0.25s ease; }
.feature-card:hover .icon { transform: scale(1.25) rotate(-6deg); }

.price-card { transition: transform 0.25s ease, border-color 0.25s ease; }
.price-card:hover { transform: translateY(-5px); border-color: var(--muted); }
.price-card.featured:hover { border-color: var(--primary); }
.price-card.featured { animation: featuredPulse 3.5s ease-in-out infinite; }
@keyframes featuredPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(218, 41, 28, 0); }
  50% { box-shadow: 0 0 26px 0 rgba(218, 41, 28, 0.18); }
}

/* ---------- وميض الأزرار ---------- */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.22) 50%, transparent 60%);
  transform: translateX(-160%);
  pointer-events: none;
}
.btn:hover::after { animation: sheen 0.7s ease; }
@keyframes sheen { to { transform: translateX(160%); } }

/* ---------- روابط الشريط العلوي ---------- */
.nav-links > a:not(.cta) { position: relative; padding-bottom: 3px; }
.nav-links > a:not(.cta)::after {
  content: ""; position: absolute; bottom: 0; right: 0;
  width: 0; height: 1.5px; background: var(--primary);
  transition: width 0.25s ease;
}
.nav-links > a:not(.cta):hover::after { width: 100%; }

/* ---------- شريط الأدوار المتحرك ---------- */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 14px 0;
  direction: ltr;
}
.ticker-track {
  display: inline-flex;
  gap: 42px;
  white-space: nowrap;
  animation: tickerMove 30s linear infinite;
}
.ticker-track span { color: var(--body); font-size: 0.95rem; font-weight: 600; }
@keyframes tickerMove { to { transform: translateX(-50%); } }

/* ---------- الشريط الأحمر المتنفس ---------- */
.livery-band {
  background: linear-gradient(120deg, #a00c01, var(--primary), #a00c01);
  background-size: 220% 100%;
  animation: liveryShift 9s ease-in-out infinite alternate;
}
@keyframes liveryShift { from { background-position: 0% 0; } to { background-position: 100% 0; } }

/* ---------- الأرقام الكبيرة ---------- */
.spec-cell .value { transition: transform 0.25s ease; }
.spec-cell:hover .value { transform: scale(1.12); }

/* ---------- توست ---------- */
#toast { animation: toastIn 0.3s ease; }
@keyframes toastIn { from { transform: translate(50%, -18px); opacity: 0; } to { transform: translate(50%, 0); opacity: 1; } }

@media (max-width: 640px) {
  /* الشاشة الطويلة تقصّ الصورة العريضة بشدة — نثبّت القرية أسفلًا كي تبقى ظاهرة */
  .hero-img { background-position: center bottom; }
  .stars { height: 40%; }
}

/* ---------- احترام تفضيل تقليل الحركة ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .rise { opacity: 1 !important; transform: none !important; }
}

/* ==================================================================
 * طبقة الجوّ — تجعل الموقع يحسّ بأنه من عالم اللعبة
 * ================================================================== */

/*
 * ضوء فانوس خافت يهبط من أعلى الصفحة. القماش المسطّح يبدو كصفحة إعدادات،
 * وهذا التدرّج وحده يعطي إحساس مجلس مضاء بمصباح واحد.
 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1200px 620px at 50% -8%, rgba(224, 169, 59, 0.055), transparent 62%),
    radial-gradient(900px 500px at 50% 108%, rgba(52, 46, 68, 0.28), transparent 60%);
}
/*
 * رفع المحتوى فوق طبقة الضوء. .modal مستثناة عمدًا: هي fixed تتوسّط الشاشة،
 * وجعلها relative يُنزلها داخل تدفّق الصفحة فتظهر تحت الطيّة.
 */
main, section, footer { position: relative; z-index: 1; }

/* الأقسام تتنفّس: خيط ضوء رفيع يفصلها بدل الحدّ الميت */
.section + .section::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: var(--sp-xxl);
  background: linear-gradient(to left, transparent, var(--hairline) 22%, var(--hairline) 78%, transparent);
}

/* ---------- الأسطح ---------- */
/* السطح المرتفع يميل للدفء ويحمل ظلًّا، فيُقرأ كورقة فوق الطاولة لا كمربّع ملوّن */
.pack, .feature-card, .choice, .stat-tile, .modal-card, .account-menu {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent 46%), var(--canvas-elevated);
  box-shadow: var(--lift-1);
}

/* ---------- الحركة ---------- */
/* منحنى واحد ومدّة واحدة عبر الموقع كله — الاتساق هو ما يُحسّ «سلاسة» */
a, button, .btn, .pack, .feature-card, .choice, .account-btn, input, summary {
  transition-timing-function: var(--ease);
  transition-duration: var(--t-fast);
}
.pack, .feature-card, .choice { transition-duration: var(--t); }

.btn, button {
  /* الضغط يعطي ردّ فعل جسديًا فوريًا — بلاه يحسّ الزر ميتًا */
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn:active, button:active { transform: translateY(1px); }
.btn.primary:hover { box-shadow: 0 6px 22px rgba(218, 41, 28, 0.32); }

/* التركيز بلوحة المفاتيح: حلقة جمرة واضحة — إتاحة لا زينة */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- إصلاحات لمس وقراءة كشفها التدقيق ---------- */
/*
 * إبهام الكبير يحتاج ٤٤ بكسل. كانت روابط التذييل ١٦ بكسل ارتفاعًا وعناوين
 * الأسئلة ١٨ — تُخطأ في كل ضغطة على الجوال.
 */
/* بلا شرط جهاز: الهدف الكبير لا يضرّ الفأرة ويُنقذ الإبهام */
.nav-logo { min-height: 44px; display: flex; align-items: center; }
.account-btn { min-height: 44px; }
footer .flinks a, .nav-links > a { min-height: 44px; display: inline-flex; align-items: center; }
.faq summary { min-height: 48px; display: flex; align-items: center; }

/* أصغر نص في الموقع صار ١٣ بكسل — ما تحته يُجهد القراءة بالعربية خاصة */
.pack-tag, .pack-badge, .account-head-mail, .account-caret,
.section-head .kicker, .modal-note, footer { font-size: 0.82rem; }

/*
 * أرضية حجم النص: ١٣ بكسل. العربية تحتاج مساحة أكبر من اللاتينية للحرف
 * نفسه بسبب النقاط والتشكيل، فما تحت ذلك يُقرأ بجهد على الجوال.
 */
.hide-sm, .kicker, .trust, .label, .pack-note,
.team, .tag, .profile-grid label small,
.dash table th, .card label { font-size: 0.82rem; }

/* الروابط النصّية داخل النصوص تحتاج مساحة لمس هي الأخرى */
.card a, .sub a, .empty-note a { display: inline-block; padding: 6px 2px; }

/* رابط التبديل بين الدخول والتسجيل — أكثر رابط يُضغط في هاتين الصفحتين */
.alt a {
  display: inline-block;
  padding: 14px 4px;
  color: var(--ember);
  font-weight: 700;
}
.alt a:hover { color: var(--ink); }

/* رابط لوحة المالك: يظهر لصاحب الموقع وحده، ولونه يميّزه عن بقية القائمة */
.account-menu a.owner-link { color: var(--ember); font-weight: 700; }
.account-menu a.owner-link:hover { color: var(--ink); background: rgba(224, 169, 59, 0.12); }
