/* salemalomar.com — الرئيسية بهوية محايدة، وصفحات كل تطبيق بهويته (body.ashkal).
   سياسة الأمان تمنع style="" داخل الصفحات، فكل التنسيق هنا، والحركة اللي تحتاج قيم متغيرة يضبطها js/site.js. */

@font-face {
  font-family: "Aref Ruqaa";
  src: url("/assets/fonts/ArefRuqaa-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

/* لون خلفية قسم الألوان يتحرك بنعومة بين لوحات التطبيق */
@property --tb { syntax: "<color>"; inherits: true; initial-value: #0e3b2e; }
@property --td { syntax: "<color>"; inherits: true; initial-value: #08281f; }

:root {
  --bg: #0b0d10;
  --ink: #f3f1ec;
  --muted: #9aa0a6;
  --line: rgba(255, 255, 255, 0.09);
  --accent: #d9b86c;
  --radius: 22px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Arabic", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  color-scheme: dark;
}

/* هوية أشكل: نفس ألوان التطبيق (Palette.swift)، وما تتغير مع الوضع الليلي. */
body.ashkal {
  --table: #0e3b2e;
  --deep: #08281f;
  --paper: #f6f1e6;
  --gold: #d9b86c;
  --red: #c8463d;
  --ink: #0e3b2e;
  --muted: rgba(14, 59, 46, 0.68);
  --line: rgba(217, 184, 108, 0.45);
  --soft: rgba(246, 241, 230, 0.72);
  --accent: var(--gold);
  color: var(--paper);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.ashkal { background: var(--deep); }

a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #0b0d10; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; }

.ruqaa {
  font-family: "Aref Ruqaa", var(--font);
  font-weight: 700;
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ——— الخلفيات ——— */

/* قماش الطاولة: تدرج أخضر مع حبيبات خفيفة */
.felt {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 760px at 50% -8%, #1d634b 0%, rgba(29, 99, 75, 0) 62%),
    radial-gradient(800px 600px at 105% 70%, rgba(217, 184, 108, 0.09), transparent 60%),
    radial-gradient(700px 520px at -10% 100%, rgba(0, 0, 0, 0.35), transparent 70%),
    linear-gradient(180deg, var(--table) 0%, var(--deep) 100%);
}

.felt::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.13;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* رموز الورق تسبح ببطء في الخلفية */
.suits-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.suits-bg span {
  position: absolute;
  font-size: 120px;
  line-height: 1;
  color: rgba(246, 241, 230, 0.035);
  animation: drift 26s ease-in-out infinite alternate;
}

.suits-bg span:nth-child(1) { top: 12%; inset-inline-start: 6%; font-size: 160px; }
.suits-bg span:nth-child(2) { top: 58%; inset-inline-start: 82%; color: rgba(200, 70, 61, 0.06); animation-duration: 32s; animation-delay: -8s; }
.suits-bg span:nth-child(3) { top: 78%; inset-inline-start: 18%; font-size: 90px; animation-duration: 22s; animation-delay: -4s; }
.suits-bg span:nth-child(4) { top: 24%; inset-inline-start: 70%; font-size: 70px; color: rgba(200, 70, 61, 0.05); animation-duration: 28s; animation-delay: -14s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) rotate(-8deg); }
  to { transform: translate3d(40px, -60px, 0) rotate(10deg); }
}

/* ——— الشريط العلوي والسفلي ——— */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

body.scrolled .topbar {
  background: rgba(11, 13, 16, 0.6);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 1px 0 var(--line);
}

body.ashkal.scrolled .topbar {
  background: rgba(8, 40, 31, 0.62);
  box-shadow: 0 1px 0 rgba(217, 184, 108, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
  font-size: 18px;
}

.lang {
  font-size: 15px;
  text-decoration: none;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background 0.25s ease, transform 0.25s var(--ease);
}

.lang:hover { background: rgba(255, 255, 255, 0.06); transform: translateY(-1px); }

body.ashkal .topbar .brand,
body.ashkal .topbar .lang { color: var(--paper); }
body.ashkal .topbar .lang { border-color: rgba(217, 184, 108, 0.5); }

.footer {
  padding-block: 48px 56px;
  color: var(--muted);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: center;
  text-align: center;
}

.footer a { text-decoration: none; transition: color 0.2s ease; }
.footer a:hover { color: var(--accent); }
body.ashkal .footer { color: rgba(246, 241, 230, 0.55); }

/* ——— الظهور عند التمرير ——— */

.js .reveal {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  filter: blur(6px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease), filter 0.9s var(--ease);
  transition-delay: var(--d, 0s);
}

.js .reveal.in { opacity: 1; transform: none; filter: none; }

.stagger > :nth-child(2) { --d: 0.08s; }
.stagger > :nth-child(3) { --d: 0.16s; }
.stagger > :nth-child(4) { --d: 0.24s; }
.stagger > :nth-child(5) { --d: 0.32s; }
.stagger > :nth-child(6) { --d: 0.4s; }

/* حركة الدخول أول ما تفتح الصفحة */
.rise { animation: rise 1s var(--ease) both; }
.d1 { animation-delay: 0.1s; }
.d2 { animation-delay: 0.25s; }
.d3 { animation-delay: 0.4s; }
.d4 { animation-delay: 0.55s; }
.d5 { animation-delay: 0.7s; }
.d6 { animation-delay: 0.85s; }

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 28px, 0); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ——— الأزرار ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: 16px;
  border: 0;
  font-weight: 800;
  font-size: 17px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s var(--spring), box-shadow 0.3s ease, background 0.3s ease, opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.96); }
.btn[disabled] { opacity: 0.4; cursor: default; }

.btn-gold {
  background: linear-gradient(180deg, #e6c87f, #cfa955);
  color: #0e3b2e;
  box-shadow: 0 10px 30px -8px rgba(217, 184, 108, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-gold:hover:not([disabled]) { transform: translateY(-2px); box-shadow: 0 16px 36px -8px rgba(217, 184, 108, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.45); }

.btn-ghost {
  background: rgba(246, 241, 230, 0.06);
  color: var(--paper, #fff);
  border: 1.5px solid rgba(217, 184, 108, 0.55);
}

.btn-ghost:hover:not([disabled]) { background: rgba(246, 241, 230, 0.12); transform: translateY(-2px); }

.btn .arrow { display: inline-block; transition: transform 0.3s var(--ease); }
.btn:hover .arrow { transform: translateY(3px); }

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  border-radius: 16px;
  background: #000;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-decoration: none;
  line-height: 1.25;
  min-height: 52px;
}

.store-badge svg { width: 24px; height: 24px; flex: none; }
.store-badge small { display: block; font-size: 11px; opacity: 0.75; font-weight: 600; }
.store-badge b { display: block; font-size: 17px; font-weight: 700; }

/* ——— الجوال (مرسوم بالـ CSS) ——— */

.phone {
  --w: 290px;
  position: relative;
  width: var(--w);
  aspect-ratio: 1260 / 2736;
  padding: calc(var(--w) * 0.03);
  background: #0b0d0c;
  border-radius: calc(var(--w) * 0.16);
  box-shadow:
    0 0 0 calc(var(--w) * 0.007) #c9c3b4,
    0 0 0 calc(var(--w) * 0.014) #8f8a7e,
    0 calc(var(--w) * 0.12) calc(var(--w) * 0.25) -10px rgba(0, 0, 0, 0.6);
  flex: none;
}

.phone .screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--w) * 0.13);
  overflow: hidden;
  background: var(--table, #0e3b2e);
  isolation: isolate;
}

.phone .screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* لمعة تمر على الشاشة */
.phone .screen::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.14) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: sheen 7s ease-in-out 2s infinite;
  pointer-events: none;
}

@keyframes sheen {
  0%, 70% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

/* ——— الرئيسية ——— */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.aurora i {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  animation: orbit 24s ease-in-out infinite alternate;
}

/* تدرجات بدل blur: الـ blur على عناصر كبيرة ينقص له حواف حادة في بعض المتصفحات */
.aurora i:nth-child(1) { background: radial-gradient(closest-side, rgba(22, 92, 70, 0.9), transparent); top: -25vmax; inset-inline-start: -15vmax; }
.aurora i:nth-child(2) { background: radial-gradient(closest-side, rgba(59, 91, 219, 0.4), transparent); bottom: -30vmax; inset-inline-end: -20vmax; animation-duration: 30s; animation-delay: -10s; }
.aurora i:nth-child(3) { background: radial-gradient(closest-side, rgba(217, 184, 108, 0.12), transparent); top: 30%; inset-inline-start: 40%; width: 30vmax; height: 30vmax; animation-duration: 20s; }

@keyframes orbit {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(8vmax, 6vmax, 0) scale(1.15); }
}

.home-hero {
  text-align: center;
  padding-block: clamp(56px, 12vh, 120px) 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(217, 184, 108, 0.1);
  border: 1px solid rgba(217, 184, 108, 0.25);
  margin: 0 0 18px;
}

.home-hero h1 {
  font-size: clamp(44px, 9vw, 96px);
  line-height: 1.2;
  margin: 0 0 14px;
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff 30%, rgba(255, 255, 255, 0.55));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-hero .lead {
  color: var(--muted);
  margin: 0 auto;
  font-size: clamp(18px, 2.4vw, 22px);
  max-width: 44ch;
}

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  padding-block: 24px;
}

/* بطاقة التطبيق: ضوء يتبع المؤشر وميلان خفيف */
.app-card {
  --mx: 50%;
  --my: 50%;
  position: relative;
  display: grid;
  gap: 22px;
  padding: 30px;
  min-height: 360px;
  align-content: space-between;
  border-radius: 28px;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s var(--ease), border-color 0.3s ease, box-shadow 0.4s ease;
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, 0.14), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.app-card:hover::before { opacity: 1; }
.app-card:hover { border-color: rgba(255, 255, 255, 0.24); box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7); }

.app-card.ashkal-card {
  background:
    radial-gradient(500px 300px at 80% 0%, #1d634b, transparent 70%),
    linear-gradient(160deg, #0e3b2e, #062019);
}

.app-card.mehzem-card {
  background:
    radial-gradient(500px 300px at 20% 0%, rgba(120, 140, 255, 0.55), transparent 70%),
    linear-gradient(160deg, #3d4fd8, #0a3c9c);
}

.app-card .art {
  position: relative;
  height: 150px;
  display: grid;
  place-items: center;
}

.app-card .art img {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.6s var(--spring);
  position: relative;
  z-index: 1;
}

.app-card:hover .art img { transform: translateY(-6px) scale(1.06) rotate(-3deg); }

/* ورق صغير ينفتح خلف أيقونة أشكل */
.mini-fan i {
  position: absolute;
  width: 62px;
  height: 88px;
  border-radius: 9px;
  background: rgba(246, 241, 230, 0.1);
  border: 1px solid rgba(217, 184, 108, 0.35);
  transform-origin: 50% 130%;
  transition: transform 0.7s var(--spring);
  top: 18px;
}

.mini-fan i:nth-child(1) { transform: rotate(-24deg); }
.mini-fan i:nth-child(2) { transform: rotate(-8deg); }
.mini-fan i:nth-child(3) { transform: rotate(8deg); }
.mini-fan i:nth-child(4) { transform: rotate(24deg); }
.app-card:hover .mini-fan i:nth-child(1) { transform: rotate(-42deg) translateY(-8px); }
.app-card:hover .mini-fan i:nth-child(2) { transform: rotate(-15deg) translateY(-14px); }
.app-card:hover .mini-fan i:nth-child(3) { transform: rotate(15deg) translateY(-14px); }
.app-card:hover .mini-fan i:nth-child(4) { transform: rotate(42deg) translateY(-8px); }

/* حلقات تتسع خلف أيقونة محزم */
.rings i {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  animation: ring 4s ease-out infinite;
}

.rings i:nth-child(2) { animation-delay: 1.33s; }
.rings i:nth-child(3) { animation-delay: 2.66s; }

@keyframes ring {
  from { transform: scale(0.7); opacity: 0.8; }
  to { transform: scale(1.9); opacity: 0; }
}

.app-card h2 { margin: 0; font-size: 30px; color: #fff; line-height: 1.3; }
.app-card h2.ruqaa { font-size: 40px; line-height: 1.2; }
.app-card p { margin: 6px 0 14px; color: rgba(255, 255, 255, 0.75); font-size: 16px; line-height: 1.6; }

.app-card .meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.go {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 20px;
  transition: transform 0.4s var(--spring), background 0.3s ease;
}

.app-card:hover .go { transform: translateX(-4px) scale(1.08); background: rgba(255, 255, 255, 0.26); }
[dir="ltr"] .app-card:hover .go { transform: translateX(4px) scale(1.08); }

.home .footer { padding-top: 64px; }

/* صفحة غير موجودة */
.lost {
  min-height: 80vh;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: 8px;
}

.lost .big { font-size: clamp(90px, 20vw, 180px); line-height: 1; font-weight: 800; margin: 0; color: rgba(255, 255, 255, 0.9); }
.lost .big span { display: inline-block; animation: wobble 3s ease-in-out infinite; color: #c8463d; }
.lost p { margin: 0; color: var(--muted); }
.lost .actions { display: flex; gap: 10px; margin-top: 18px; }

@keyframes wobble {
  0%, 100% { transform: rotate(-10deg) translateY(0); }
  50% { transform: rotate(10deg) translateY(-10px); }
}

/* ——— صفحة أشكل: البطل ——— */

.hero-wrap { position: relative; }

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 32px;
  min-height: min(860px, calc(100svh - 76px));
  padding-block: 16px 56px;
}

.hero-copy { display: grid; justify-items: start; }

.hero-icon-wrap { animation: bob 6s ease-in-out 1.2s infinite; }

.hero-icon {
  width: 92px;
  height: 92px;
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(217, 184, 108, 0.25);
  margin-bottom: 8px;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(-2deg); }
}

/* العنوان ينكشف كأنه ينكتب بالحبر من اليمين */
.hero-title {
  font-size: clamp(96px, 15vw, 184px);
  line-height: 1.15;
  margin: 0;
  color: var(--paper);
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  animation: ink 1.6s var(--ease) 0.25s both;
}

@keyframes ink {
  from { clip-path: inset(-30% -10% -30% 110%); filter: blur(10px); opacity: 0.2; }
  to { clip-path: inset(-30% -10% -30% -10%); filter: blur(0); opacity: 1; }
}

[dir="ltr"] .hero-title { animation-name: ink-ltr; }

@keyframes ink-ltr {
  from { clip-path: inset(-30% 110% -30% -10%); filter: blur(10px); opacity: 0.2; }
  to { clip-path: inset(-30% -10% -30% -10%); filter: blur(0); opacity: 1; }
}

.hero-sub {
  color: var(--gold);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 800;
  margin: 0;
}

.hero-tag {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.5;
  margin: 6px 0 28px;
  color: var(--paper);
}

.kw {
  font-family: "Aref Ruqaa", var(--font);
  font-style: normal;
  font-weight: 700;
  background: linear-gradient(100deg, #b38a3a 0%, #f6e3a8 35%, #d9b86c 55%, #b38a3a 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4.5s linear infinite;
  padding-inline: 0.06em;
  font-size: 1.3em;
  line-height: 1;
}

[dir="ltr"] .kw { font-family: Georgia, "Times New Roman", serif; font-style: italic; }

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -120% 0; }
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* المسرح: ورق ينفتح خلف الجوال */
.stage {
  position: relative;
  height: min(680px, 82vh);
  display: grid;
  place-items: center;
  perspective: 1400px;
}

.fan {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  animation: sway 9s ease-in-out 2s infinite;
}

.fan .card {
  position: absolute;
  top: 4%;
  width: clamp(110px, 13vw, 160px);
  aspect-ratio: 5 / 7;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 50%, rgba(217, 184, 108, 0.35) 0 14%, transparent 15%),
    repeating-linear-gradient(45deg, #14503d 0 7px, #0f4232 7px 14px);
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--gold), 0 18px 40px rgba(0, 0, 0, 0.35);
  transform-origin: 50% 135%;
  transform: rotate(var(--r));
  animation: fan-out 1.4s var(--spring) both;
}

.fan .card:nth-child(1) { --r: -40deg; animation-delay: 0.45s; }
.fan .card:nth-child(2) { --r: -20deg; animation-delay: 0.55s; }
.fan .card:nth-child(3) { --r: 0deg; animation-delay: 0.65s; }
.fan .card:nth-child(4) { --r: 20deg; animation-delay: 0.75s; }
.fan .card:nth-child(5) { --r: 40deg; animation-delay: 0.85s; }

.fan .card.face {
  background: var(--paper);
  box-shadow: inset 0 0 0 7px var(--paper), inset 0 0 0 8px var(--gold), 0 18px 40px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  color: var(--red);
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 700;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1;
}

@keyframes fan-out {
  from { transform: rotate(0deg) translateY(60px); opacity: 0; }
  to { transform: rotate(var(--r)); opacity: 1; }
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(3deg); }
}

.tilt {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s var(--ease);
}

.hero .phone {
  --w: clamp(230px, 24vw, 300px);
  margin-top: 90px;
  animation: phone-in 1.4s var(--ease) 0.3s both;
}

.hero .bob { animation: bob 7s ease-in-out 1.8s infinite; }

@keyframes phone-in {
  from { transform: translateY(120px) rotateX(24deg) scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* بطاقات صغيرة تطفو حول الجوال */
.chip {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(246, 241, 230, 0.96);
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(217, 184, 108, 0.6);
  animation: chip-in 0.9s var(--spring) both, float 5s ease-in-out infinite;
}

.chip .suit { color: var(--red); font-size: 18px; }
.chip b { font-size: 22px; font-family: Georgia, "Times New Roman", serif; }
.chip.gold { background: linear-gradient(180deg, #e6c87f, #cfa955); }

.chip-1 { top: 30%; inset-inline-start: 0; animation-delay: 1.2s, 2.1s; }
.chip-2 { top: 54%; inset-inline-end: 0; animation-delay: 1.4s, 2.3s; animation-duration: 0.9s, 6s; }
.chip-3 { bottom: 10%; inset-inline-start: 6%; animation-delay: 1.6s, 2.5s; animation-duration: 0.9s, 5.5s; }

@keyframes chip-in {
  from { opacity: 0; transform: scale(0.6) translateY(20px); }
  to { opacity: 1; transform: none; }
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

.scroll-hint {
  position: absolute;
  bottom: 14px;
  inset-inline: 0;
  margin: auto;
  width: 26px;
  height: 42px;
  border-radius: 14px;
  border: 1.5px solid rgba(246, 241, 230, 0.35);
}

.scroll-hint::after {
  content: "";
  position: absolute;
  top: 8px;
  inset-inline: 0;
  margin: auto;
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold);
  animation: wheel 1.8s ease-in-out infinite;
}

@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(14px); opacity: 0; }
  100% { opacity: 0; }
}

/* ——— شريط متحرك ——— */

.marquee {
  overflow: hidden;
  padding-block: 20px;
  border-block: 1px solid rgba(217, 184, 108, 0.2);
  background: rgba(0, 0, 0, 0.12);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.marquee:hover .marquee-track { animation-play-state: paused; }

.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding-inline: 26px;
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 800;
  white-space: nowrap;
  color: rgba(246, 241, 230, 0.88);
}

.marquee-track .suit { color: var(--gold); }
.marquee-track span:nth-child(even) .suit { color: var(--red); }

@keyframes marquee { to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

/* ——— عناوين الأقسام ——— */

.section { padding-block: clamp(72px, 12vw, 140px); position: relative; }

.sec-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto clamp(40px, 6vw, 72px);
}

.sec-head h2 {
  font-size: clamp(34px, 5.6vw, 60px);
  line-height: 1.3;
  margin: 0 0 12px;
  font-weight: 800;
}

.sec-head p { margin: 0; color: var(--soft); font-size: clamp(17px, 2vw, 20px); }

/* ——— المزايا مع جوال ثابت يتغير مع التمرير ——— */

.show {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.step {
  min-height: 78vh;
  display: grid;
  align-content: center;
  justify-items: start;
  opacity: 0.28;
  transform: scale(0.97);
  transform-origin: right center;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

[dir="ltr"] .step { transform-origin: left center; }

.step.active { opacity: 1; transform: none; }

.step-n {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(64px, 8vw, 96px);
  line-height: 1;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(217, 184, 108, 0.7);
  margin-bottom: 10px;
}

.step h3 {
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.35;
  margin: 0 0 12px;
  font-weight: 800;
}

.step p { margin: 0; color: var(--soft); font-size: clamp(17px, 2vw, 21px); max-width: 30ch; }

.step-phone { display: none; }

.show-stage .sticky {
  position: sticky;
  top: 11vh;
  height: 78vh;
  display: grid;
  place-items: center;
}

.show-stage .glow {
  position: absolute;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 184, 108, 0.28), transparent 65%);
  filter: blur(20px);
  animation: pulse 5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

.show-stage .phone { --w: min(300px, 31vh); }

.show-stage .screen img {
  opacity: 0;
  transform: scale(1.06);
  filter: blur(4px);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease), filter 0.7s var(--ease);
}

.show-stage .screen img.on { opacity: 1; transform: none; filter: none; }

.dots {
  position: absolute;
  inset-inline-end: 4%;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  gap: 10px;
}

.dots i {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(246, 241, 230, 0.25);
  transition: height 0.4s var(--spring), background 0.3s ease;
}

.dots i.on { height: 28px; background: var(--gold); }

/* ——— جربها ——— */

.demo-board {
  position: relative;
  max-width: 520px;
  margin-inline: auto;
  padding: 22px;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(14, 59, 46, 0.92), rgba(8, 40, 31, 0.96));
  box-shadow: 0 0 0 1px rgba(217, 184, 108, 0.28), 0 40px 90px -30px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.paper {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  position: relative;
}

body.ashkal .paper::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}

.score {
  display: grid;
  justify-items: center;
  padding: 16px 14px 18px;
  transition: box-shadow 0.4s ease, transform 0.4s var(--spring);
}

.score .team { font-size: 16px; color: var(--muted); font-weight: 700; }

.score .num {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 10vw, 64px);
  line-height: 1.1;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.score .bar {
  width: 82%;
  height: 6px;
  border-radius: 3px;
  background: rgba(14, 59, 46, 0.16);
  overflow: hidden;
  margin-top: 6px;
}

.score .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 3px;
  transition: width 0.7s var(--ease), background 0.3s ease;
}

.score.bump { transform: scale(1.04); }
.score.won { box-shadow: 0 0 0 3px var(--red), 0 20px 40px -10px rgba(200, 70, 61, 0.5); }
.score.won .num { color: var(--red); }
.score.won .bar i { background: var(--red); }

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(217, 184, 108, 0.32);
  color: rgba(246, 241, 230, 0.8);
  font-size: 14px;
  font-weight: 600;
}

.pill b { color: var(--gold); }
.pill .suit { color: var(--gold); }
.pill b.flip { animation: rise 0.5s var(--ease) both; }

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(217, 184, 108, 0.32);
  transition: opacity 0.3s ease;
}

.seg button {
  border: 0;
  background: transparent;
  color: rgba(246, 241, 230, 0.75);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.seg button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.seg button:disabled { cursor: default; }
.seg.locked { opacity: 0.55; }

.rounds-head, .round {
  display: grid;
  grid-template-columns: 40px 1fr 1fr;
  align-items: center;
  text-align: center;
}

.rounds-head { color: var(--gold); font-size: 14px; font-weight: 700; padding: 0 14px 6px; }

.rounds {
  list-style: none;
  margin: 0;
  padding: 6px 14px;
  height: 236px;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.rounds::-webkit-scrollbar { display: none; }
body.ashkal .rounds::after { display: none; }

.round {
  padding-block: 9px;
  border-bottom: 1px solid rgba(217, 184, 108, 0.4);
  animation: row-in 0.6s var(--spring) both;
}

.round:last-child { border-bottom: 0; }
.round .n { color: var(--muted); font-size: 14px; }
.round b { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 22px; line-height: 1.2; }
.round small { display: block; color: var(--muted); font-size: 13px; line-height: 1.2; font-variant-numeric: tabular-nums; }

@keyframes row-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); background: rgba(217, 184, 108, 0.35); }
  to { opacity: 1; transform: none; background: transparent; }
}

.empty {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  padding: 0 20px;
  line-height: 1.6;
}

.controls { display: flex; gap: 10px; margin-top: 14px; }
.controls .btn-gold { flex: 1; }
.controls .btn-ghost { width: 56px; padding: 0; font-size: 22px; }

/* لوحة الفوز تطلع من تحت مثل التطبيق */
.win {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 26px 22px 24px;
  background: rgba(7, 30, 23, 0.97);
  border-top: 1px solid rgba(217, 184, 108, 0.3);
  text-align: center;
  transform: translateY(105%);
  visibility: hidden;
  transition: transform 0.7s var(--spring), visibility 0s 0.7s;
}

.win.open { transform: none; visibility: visible; transition: transform 0.7s var(--spring), visibility 0s; }
.win .ruqaa { font-size: 52px; line-height: 1.2; margin: 0; color: var(--gold); }
.win .who { font-size: 24px; font-weight: 800; margin: 0; }
.win .final { margin: 0 0 12px; color: var(--soft); font-variant-numeric: tabular-nums; }
.win .btn { width: 100%; }

.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6;
}

.confetti span {
  position: absolute;
  top: -40px;
  font-size: 22px;
  animation: fall linear forwards;
}

@keyframes fall {
  to { transform: translate3d(var(--x, 0), 760px, 0) rotate(var(--rot, 360deg)); opacity: 0.2; }
}

/* ——— الألوان ——— */

.themes {
  --tb: #0e3b2e;
  --td: #08281f;
  --ta: #d9b86c;
  background:
    radial-gradient(900px 520px at 50% 62%, var(--tb), transparent 75%),
    linear-gradient(180deg, transparent, var(--td) 30%, var(--td) 70%, transparent);
  transition: --tb 0.9s var(--ease), --td 0.9s var(--ease);
  overflow: hidden;
}

.theme-stage {
  position: relative;
  height: clamp(420px, 56vw, 590px);
  perspective: 1600px;
}

.theme-stage .phone {
  --w: clamp(180px, 22vw, 260px);
  position: absolute;
  left: 50%;
  top: 0;
  margin-left: calc(var(--w) / -2);
  cursor: pointer;
  transition: transform 0.9s var(--ease), opacity 0.9s var(--ease), filter 0.9s var(--ease);
}

.theme-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.theme-picker button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(246, 241, 230, 0.16);
  color: var(--paper);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s var(--spring);
}

.theme-picker button:hover { transform: translateY(-2px); }
.theme-picker button[aria-selected="true"] { background: rgba(246, 241, 230, 0.14); border-color: var(--ta); }

.swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(246, 241, 230, 0.6);
}

.sw-table { background: #0e3b2e; }
.sw-navy { background: #132440; }
.sw-burgundy { background: #4e1622; }
.sw-night { background: #161618; }

/* ——— بطاقات المزايا ——— */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.feature {
  padding: 26px 26px 24px;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s var(--ease), box-shadow 0.4s ease, opacity 0.9s var(--ease), filter 0.9s var(--ease);
}

.feature:hover { box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.7); }

.feature .suit {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(14, 59, 46, 0.08);
  color: var(--ink);
  font-size: 24px;
  margin-bottom: 14px;
  transition: transform 0.5s var(--spring);
}

.feature:nth-child(even) .suit { color: var(--red); }
.feature:hover .suit { transform: rotate(-12deg) scale(1.12); }
.feature h3 { margin: 0 0 4px; font-size: 20px; }
.feature p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }

/* ——— مجاني والخاتمة ——— */

.cta {
  text-align: center;
  padding: clamp(48px, 8vw, 88px) 24px;
  border-radius: 40px;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(217, 184, 108, 0.2), transparent 70%),
    linear-gradient(180deg, rgba(14, 59, 46, 0.7), rgba(8, 40, 31, 0.9));
  box-shadow: 0 0 0 1px rgba(217, 184, 108, 0.25);
  position: relative;
  overflow: hidden;
}

.cta-icon {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
}

.cta-icon::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 40px;
  background: conic-gradient(from 0deg, transparent, var(--gold), transparent 40%);
  animation: spin 4s linear infinite;
  filter: blur(6px);
  opacity: 0.8;
}

.cta-icon img { position: relative; width: 132px; height: 132px; border-radius: 30px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5); }

@keyframes spin { to { transform: rotate(360deg); } }

.cta h2 { font-size: clamp(36px, 6vw, 64px); line-height: 1.3; margin: 0 0 8px; font-weight: 800; }
.cta > p { margin: 0 0 30px; color: var(--soft); font-size: clamp(17px, 2vw, 20px); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin: 0 auto 34px;
}

.stat {
  padding: 18px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(217, 184, 108, 0.2);
}

.stat b {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 6vw, 48px);
  line-height: 1.1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.stat span { font-size: 15px; color: var(--soft); font-weight: 600; }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.links a {
  color: var(--paper);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(217, 184, 108, 0.4);
  font-size: 15px;
  transition: background 0.25s ease, transform 0.25s var(--ease);
}

.links a:hover { background: rgba(217, 184, 108, 0.14); transform: translateY(-2px); }

/* ——— الصفحات النصية (الخصوصية، الشروط، الدعم) ——— */

.doc-title {
  display: grid;
  justify-items: center;
  text-align: center;
  padding-block: 40px 28px;
}

.doc-title img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
  margin-bottom: 14px;
}

.doc-title h1 {
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1.3;
  margin: 0;
  color: var(--paper);
}

.doc-title p { margin: 4px 0 0; color: var(--gold); font-size: 16px; font-weight: 700; }

.doc { padding: 34px 36px; box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.7); }
.doc h2 { font-size: 20px; margin: 26px 0 4px; display: flex; align-items: center; gap: 10px; }
.doc h2::before { content: "♠"; color: var(--red); font-size: 14px; }
.doc h2:nth-of-type(even)::before { content: "♦"; }
.doc h2:first-of-type { margin-top: 6px; }
.doc p { margin: 0; color: var(--muted); }
.doc .updated { font-size: 14px; margin-bottom: 8px; display: inline-block; padding: 2px 12px; border-radius: 999px; background: rgba(14, 59, 46, 0.07); }

.contact {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  margin-bottom: 22px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.contact .btn-gold { direction: ltr; }

.faq details {
  border-top: 1px solid var(--line);
  padding-block: 4px;
}

.faq details:first-of-type { border-top: 0; }

.faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 12px;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(14, 59, 46, 0.08);
  font-size: 20px;
  line-height: 1;
  transition: transform 0.4s var(--spring), background 0.3s ease, color 0.3s ease;
}

.faq details[open] summary::after { transform: rotate(135deg); background: var(--ink); color: var(--paper); }
.faq details p { padding-bottom: 12px; animation: rise 0.5s var(--ease) both; }

/* ——— الجوال والشاشات الصغيرة ——— */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    min-height: auto;
    padding-block: 12px 40px;
    gap: 8px;
  }

  .hero-copy { justify-items: center; }
  .hero-cta { justify-content: center; }
  .stage { height: 580px; }
  .hero .phone { --w: 230px; margin-top: 80px; }
  .chip-3 { display: none; }
  .scroll-hint { display: none; }

  .show { grid-template-columns: 1fr; gap: 0; }
  .show-stage { display: none; }

  .step {
    min-height: auto;
    opacity: 1;
    transform: none;
    justify-items: center;
    text-align: center;
    padding-block: 40px;
  }

  .step p { margin-inline: auto; }
  .step-phone { display: block; --w: 240px; margin-top: 28px; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .doc { padding: 26px 22px; }
  .app-card { padding: 24px; min-height: 320px; }
  .demo-board { padding: 14px; border-radius: 28px; }
  .rounds { height: 210px; }
  .chip { font-size: 13px; padding: 8px 12px; }
  .chip b { font-size: 18px; }
  .stats { gap: 8px; }
  .stat span { font-size: 13px; }
  .fan .card { width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal { opacity: 1; transform: none; filter: none; }
  .marquee-track { animation: none; }
}
