/* ==========================================================================
   Abu Yazen — أبو يزن  |  نظام التصميم
   الألوان، الخطوط، المكوّنات. RTL-first, dark/light.
   ========================================================================== */

/* ---------- 1. الرموز (Tokens) ---------- */
:root {
  /* الألوان — الوضع الداكن (افتراضي) */
  --bg:          #0a0a0b;
  --bg-2:        #101013;
  --bg-3:        #17171b;
  --bg-inset:    #050506;
  --border:      #26262c;
  --border-str:  #3a3a42;
  --text:        #f5f5f4;
  --text-2:      #a8a8b0;
  --text-3:      #82828c;
  --accent:      #eeac50;   /* ذهبي الشعار */
  --accent-hi:   #fdd98a;
  --accent-ink:  #171004;
  --accent-soft: rgba(238, 172, 80, .14);
  --accent-line: rgba(238, 172, 80, .40);
  --danger:      #ff6b6b;
  --ok:          #4ade80;
  --scrim:       rgba(10, 10, 11, .78);
  --shadow-1:    0 1px 2px rgba(0,0,0,.5);
  --shadow-2:    0 8px 28px rgba(0,0,0,.55);
  --shadow-3:    0 20px 60px rgba(0,0,0,.6);

  /* الشكل — قاعدة واحدة: أزرار = حبّة كاملة، بطاقات = 16px */
  --r-card:  16px;
  --r-sm:    10px;
  --r-pill:  999px;

  /* الخطوط */
  --f-display: "Zain", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --f-body:    "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;

  /* المقياس */
  --step--1: .8125rem;
  --step-0:  .9375rem;
  --step-1:  1.0625rem;
  --step-2:  clamp(1.25rem, .6vw + 1.1rem, 1.5rem);
  --step-3:  clamp(1.5rem, 1.2vw + 1.15rem, 2rem);
  --step-4:  clamp(1.9rem, 2vw + 1.3rem, 2.75rem);
  --step-5:  clamp(2.4rem, 4vw + 1rem, 4rem);

  --shell: 1240px;
  --gap: clamp(1rem, 2vw, 1.5rem);
  --sec-y: clamp(3.5rem, 7vw, 6.5rem);

  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg:          #fafaf9;
  --bg-2:        #ffffff;
  --bg-3:        #f2f2f0;
  --bg-inset:    #ececea;
  --border:      #e3e3e0;
  --border-str:  #cbcbc6;
  --text:        #18181b;
  --text-2:      #52525b;
  --text-3:      #6a6a73;
  --accent:      #7d4a10;   /* برونزي مستخرج من ذهب الشعار — تباين كافٍ على الفاتح */
  --accent-hi:   #663b0b;
  --accent-ink:  #fffaf1;
  --accent-soft: rgba(125, 74, 16, .10);
  --accent-line: rgba(125, 74, 16, .30);
  --scrim:       rgba(250, 250, 249, .8);
  --shadow-1:    0 1px 2px rgba(24,24,27,.07);
  --shadow-2:    0 8px 28px rgba(24,24,27,.10);
  --shadow-3:    0 20px 60px rgba(24,24,27,.14);
  color-scheme: light;
}

/* ---------- 2. إعادة الضبط ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

body {
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; background-color: var(--bg-3); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- الأيقونات (Phosphor — مستضافة كـ SVG مضمّن) ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico {
  width: 1em; height: 1em;
  display: inline-block;
  flex-shrink: 0;
  fill: currentColor;
  vertical-align: -0.125em;
  overflow: hidden;
}

/* ---------- 3. التخطيط ---------- */
.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}
.shell-wide { width: min(100% - 2.5rem, 1440px); margin-inline: auto; }

.section { padding-block: var(--sec-y); }
.section-tight { padding-block: calc(var(--sec-y) * .6); }

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: .7rem 1.25rem; border-radius: 0 0 var(--r-sm) 0; font-weight: 700;
}
.skip:focus { inset-inline-start: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- 4. الترويسة ---------- */
.hdr {
  position: sticky; top: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.hdr.is-stuck { border-bottom-color: var(--border); }

.hdr-in {
  height: 68px;
  display: flex; align-items: center; gap: 1.25rem;
}

.brand { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: transparent; flex-shrink: 0;
  transition: transform .4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name {
  font-family: var(--f-display); font-weight: 800;
  font-size: 1.32rem; line-height: 1; letter-spacing: -.01em;
}
.brand-name small {
  display: block; font-family: var(--f-body); font-weight: 500;
  font-size: .6rem; color: var(--text-3); letter-spacing: .16em;
  margin-top: 3px;
}

.nav { display: flex; align-items: center; gap: .25rem; margin-inline-start: auto; }
.nav a {
  padding: .5rem .85rem; border-radius: var(--r-pill);
  font-size: var(--step--1); font-weight: 600; color: var(--text-2);
  transition: color .2s, background-color .2s;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--bg-3); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.hdr-tools { display: flex; align-items: center; gap: .5rem; }

.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-pill);
  background: var(--bg-3); border: 1px solid var(--border);
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-2); flex-shrink: 0;
  transition: color .2s, border-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-str); }
.icon-btn:active { transform: scale(.93); }
.icon-btn svg { width: 17px; height: 17px; }

.theme-ico-moon { display: block; }
.theme-ico-sun  { display: none; }
html[data-theme="light"] .theme-ico-moon { display: none; }
html[data-theme="light"] .theme-ico-sun  { display: block; }

.burger { display: none; }

/* قائمة الجوال */
.m-nav {
  position: fixed; inset: 0; z-index: 95;
  background: var(--bg);
  padding: 5.5rem 1.5rem 2rem;
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform .45s var(--ease), visibility .45s;
  overflow-y: auto;
}
.m-nav.is-open { transform: translateY(0); visibility: visible; }
.m-nav a {
  display: block; padding: 1rem 0;
  font-family: var(--f-display); font-size: 1.6rem; font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.m-nav a:last-child { border-bottom: 0; }
.m-nav-close {
  position: absolute; top: 1rem; inset-inline-end: 1.25rem;
}

/* ---------- 5. البطل (Hero) ---------- */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
}
.hero-in {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
}
.hero-in > * { min-width: 0; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--step--1); font-weight: 600; color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: .35rem .85rem; border-radius: var(--r-pill);
  margin-bottom: 1.25rem;
}
.hero-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero h1 {
  font-family: var(--f-display);
  font-size: var(--step-5);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.hero h1 em {
  font-style: normal; color: var(--accent);
  position: relative; white-space: nowrap;
}
.hero h1 em::after {
  content: ""; position: absolute; inset-inline: 0; bottom: .06em;
  height: .1em; background: var(--accent); opacity: .3;
  border-radius: var(--r-pill);
}

.hero-sub {
  margin-top: 1.1rem;
  max-width: 46ch;
  color: var(--text-2);
  font-size: var(--step-1);
  line-height: 1.8;
}

/* البحث */
.search {
  margin-top: 1.75rem;
  position: relative;
  display: flex; align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: .35rem .35rem .35rem 1.35rem;
  transition: border-color .25s, box-shadow .25s;
  max-width: 540px;
}
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0;
  padding-block: .6rem;
  font-size: var(--step-1);
}
.search input::placeholder { color: var(--text-3); }
.search-btn {
  flex-shrink: 0;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: var(--r-pill);
  padding: .6rem 1.35rem; font-weight: 700; font-size: var(--step-0);
  cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease);
}
.search-btn:hover { background: var(--accent-hi); }
.search-btn:active { transform: scale(.96); }

/* فسيفساء الأغلفة — جدار متحرك: ثلاثة أعمدة تنساب عمودياً بلا توقف */
.hero-art {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .7rem;
  height: 440px;
  overflow: hidden;
  transform: rotate(-2deg);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}
.hero-art::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(75% 85% at 50% 50%, transparent 55%, var(--bg) 100%);
  pointer-events: none;
}
.ha-col { min-width: 0; overflow: hidden; }
/* every column drifts slowly upward; offsets keep the columns from lining up */
.ha-track {
  display: flex; flex-direction: column; gap: .7rem;
  animation: ha-up 70s linear infinite;
  will-change: transform;
}
.ha-col-1 .ha-track { animation-duration: 84s; animation-delay: -30s; }
.ha-col-2 .ha-track { animation-duration: 76s; animation-delay: -55s; }
.hero-art:hover .ha-track { animation-play-state: paused; }
@keyframes ha-up { from { transform: translateY(0); } to { transform: translateY(calc(-50% - .35rem)); } }
.hero-art figure {
  margin: 0; min-width: 0; flex-shrink: 0;
  overflow: hidden; border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--bg-3);
  aspect-ratio: 460/215;
  box-shadow: var(--shadow-2);
  transition: transform .35s var(--ease), border-color .35s;
}
.hero-art figure:hover { transform: scale(1.04); border-color: var(--accent-line, var(--border)); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (prefers-reduced-motion: reduce) { .ha-track { animation: none; } }

/* ---------- 6. شريط الأرقام ---------- */
.stats {
  border-block: 1px solid var(--border);
  background: var(--bg-2);
}
.stats-in {
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: clamp(1.5rem, 3vw, 2.25rem) 1rem;
  text-align: center;
  border-inline-start: 1px solid var(--border);
}
.stat:first-child { border-inline-start: 0; }
.stat b {
  display: block;
  font-family: var(--f-display); font-weight: 800;
  font-size: clamp(1.9rem, 3.5vw, 2.75rem);
  line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat span {
  display: block; margin-top: .5rem;
  font-size: var(--step--1); color: var(--text-3); font-weight: 500;
}
.stat.is-accent b { color: var(--accent); }

/* ---------- 7. عناوين الأقسام ---------- */
.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  margin-bottom: clamp(1.75rem, 3vw, 2.75rem);
}
.sec-head-txt { max-width: 62ch; }
.eyebrow {
  font-size: .7rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: .7rem;
}
.sec-head h2 {
  font-family: var(--f-display);
  font-size: var(--step-4); font-weight: 800;
  line-height: 1.15; letter-spacing: -.015em;
  text-wrap: balance;
}
.sec-head p { margin-top: .7rem; color: var(--text-2); }

.link-more {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: var(--step-0);
  color: var(--accent);
  padding: .6rem 1.2rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  white-space: nowrap;
  transition: background-color .22s, transform .22s var(--ease);
}
.link-more:hover { background: var(--accent-soft); }
.link-more:active { transform: scale(.97); }
.link-more svg { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.link-more:hover svg { transform: translateX(-4px); }

/* ---------- 8. البطاقات ---------- */
.grid-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: clamp(1rem, 1.8vw, 1.5rem);
}

.card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .35s var(--ease);
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-str);
  box-shadow: var(--shadow-2);
}

.card-media {
  position: relative;
  aspect-ratio: 460/215;
  overflow: hidden;
  background: var(--bg-3);
}
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease), filter .4s;
}
.card:hover .card-media img { transform: scale(1.06); }

.card-badges {
  position: absolute; top: .65rem; inset-inline-start: .65rem;
  display: flex; gap: .4rem; flex-wrap: wrap;
}
.badge {
  font-size: .66rem; font-weight: 700; letter-spacing: .04em;
  padding: .22rem .6rem; border-radius: var(--r-pill);
  background: rgba(10,10,11,.78);
  backdrop-filter: blur(6px);
  color: #f5f5f4;
  border: 1px solid rgba(255,255,255,.16);
}
html[data-theme="light"] .badge { background: rgba(255,255,255,.86); color: #18181b; border-color: rgba(0,0,0,.1); }
.badge-official  { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
html[data-theme="light"] .badge-official { background: var(--accent); color: var(--accent-ink); }

.card-body { padding: .95rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-title {
  font-family: var(--f-display); font-weight: 700;
  font-size: 1.14rem; line-height: 1.3;
  letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title-ar { font-size: .8rem; color: var(--text-3); font-weight: 500; }
.card-meta {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  font-size: var(--step--1); color: var(--text-3);
  margin-top: auto;
}
.card-meta i { font-style: normal; width: 3px; height: 3px; border-radius: 50%; background: var(--border-str); }
.card-team {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: var(--step--1); color: var(--text-2);
}
.team-chip {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  background: var(--bg-inset); border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: .58rem; font-weight: 800; color: var(--text-3);
  letter-spacing: -.02em;
}
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 5; }

/* ---------- 9. الكاروسيل ---------- */
.rail-wrap { position: relative; }
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(320px, 78vw);
  gap: clamp(1rem, 1.8vw, 1.5rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: .25rem;
  padding-block: .5rem .75rem;
  padding-inline: .25rem;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

.rail-nav { display: flex; gap: .5rem; }

/* ---------- 10. المميّز ---------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
}
.feature-media { position: relative; min-height: 300px; background: var(--bg-3); }
.feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-body {
  padding: clamp(1.75rem, 3.5vw, 3rem);
  display: flex; flex-direction: column; justify-content: center; gap: 1rem;
}
.feature-body h3 {
  font-family: var(--f-display); font-weight: 800;
  font-size: var(--step-3); line-height: 1.2; letter-spacing: -.015em;
}
.feature-body p { color: var(--text-2); max-width: 52ch; }
.kv { display: flex; flex-wrap: wrap; gap: .5rem; }
.kv span {
  font-size: var(--step--1); font-weight: 600;
  padding: .3rem .8rem; border-radius: var(--r-pill);
  background: var(--bg-3); border: 1px solid var(--border);
  color: var(--text-2);
}
.feature-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .35rem; }

/* ---------- 11. الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.5rem;
  border-radius: var(--r-pill);
  font-weight: 700; font-size: var(--step-0);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .22s, color .22s, border-color .22s, transform .2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-str); }
.btn-ghost:hover { background: var(--bg-3); border-color: var(--accent-line); }
.btn svg { width: 16px; height: 16px; }

/* ---------- 12. شريط الفرق (Marquee) ---------- */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--border);
  background: var(--bg-2);
  padding-block: 1.1rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex; gap: .6rem; width: max-content;
  animation: slide 46s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem 1rem;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--step--1); color: var(--text-2); font-weight: 600;
  white-space: nowrap;
}
.marquee-item b {
  width: 20px; height: 20px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
  font-size: .55rem; font-weight: 800;
}
@keyframes slide {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
html[dir="rtl"] .marquee-track { animation-name: slide-rtl; }
@keyframes slide-rtl {
  from { transform: translateX(0); }
  to   { transform: translateX(50%); }
}

/* ---------- 13. الأسئلة الشائعة ---------- */
.faq { display: grid; gap: .75rem; max-width: 820px; margin-inline: auto; }
.faq details {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  transition: border-color .25s;
}
.faq details[open] { border-color: var(--border-str); }
.faq summary {
  list-style: none; cursor: pointer;
  padding: 1.1rem 1.35rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  font-weight: 700; font-size: var(--step-1);
  font-family: var(--f-display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border-str);
  background:
    linear-gradient(var(--text-2), var(--text-2)) center/9px 1.5px no-repeat,
    linear-gradient(var(--text-2), var(--text-2)) center/1.5px 9px no-repeat;
  transition: transform .35s var(--ease), background-color .25s, border-color .25s;
}
.faq details[open] summary::after {
  transform: rotate(135deg);
  background: linear-gradient(var(--accent), var(--accent)) center/9px 1.5px no-repeat;
  border-color: var(--accent-line);
}
.faq-answer {
  padding: 0 1.35rem 1.25rem;
  color: var(--text-2);
  animation: slidein .35s var(--ease);
}
@keyframes slidein { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- 14. الفوتر ---------- */
.ftr {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding-block: clamp(2.5rem, 5vw, 4rem) 1.5rem;
  margin-top: var(--sec-y);
}
.ftr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.ftr-about p { color: var(--text-3); margin-top: 1rem; max-width: 34ch; font-size: var(--step--1); }
.ftr h3 {
  font-family: var(--f-display); font-weight: 700;
  font-size: var(--step-0); margin-bottom: .9rem;
}
.ftr-links { display: grid; gap: .55rem; }
.ftr-links a { color: var(--text-3); font-size: var(--step--1); transition: color .2s; }
.ftr-links a:hover { color: var(--accent); }
.ftr-base {
  padding-top: 1.5rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--text-3); font-size: var(--step--1);
}
.ftr-social { display: flex; gap: .5rem; }

/* ---------- 15. أدوات البحث والتصفية ---------- */
.toolbar {
  display: flex; gap: .75rem; flex-wrap: wrap; align-items: center;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  position: sticky; top: 68px; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  padding: .45rem 1rem;
  border-radius: var(--r-pill);
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: var(--step--1); font-weight: 600; color: var(--text-2);
  cursor: pointer;
  transition: all .22s var(--ease);
}
.chip:hover { border-color: var(--border-str); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent);
}
.chip[aria-pressed="true"]:hover { color: var(--accent-ink); }

.field {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-pill); padding: .3rem .3rem .3rem 1rem;
  min-width: 240px; flex: 1; max-width: 420px;
  transition: border-color .25s, box-shadow .25s;
}
.field:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.field input, .field select { background: none; border: 0; outline: 0; flex: 1; min-width: 0; padding-block: .45rem; font-size: var(--step-0); }
.field select { cursor: pointer; }
.field svg { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }

.count { font-size: var(--step--1); color: var(--text-3); margin-inline-start: auto; font-variant-numeric: tabular-nums; }

/* الحالة الفارغة */
.empty {
  text-align: center;
  padding: clamp(3rem, 8vw, 6rem) 1rem;
  border: 1px dashed var(--border-str);
  border-radius: var(--r-card);
  grid-column: 1 / -1;
}
.empty b { display: block; font-family: var(--f-display); font-size: var(--step-3); margin-bottom: .5rem; }
.empty p { color: var(--text-3); }

/* ---------- 16. صفحة التفاصيل ---------- */
.game-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.game-hero-bg { position: absolute; inset: 0; }
.game-hero-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(28px) saturate(1.3); transform: scale(1.15); opacity: .35; }
.game-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent, var(--bg) 88%);
}
.game-hero-in { position: relative; z-index: 1; padding-block: clamp(2rem, 5vw, 3.5rem); }

.game-top {
  display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.game-cover {
  border-radius: var(--r-card); overflow: hidden;
  border: 1px solid var(--border-str);
  box-shadow: var(--shadow-3);
  aspect-ratio: 460/215;
  background: var(--bg-3);
}
.game-cover img { width: 100%; height: 100%; object-fit: cover; }

.breadcrumb { display: flex; gap: .5rem; align-items: center; font-size: var(--step--1); color: var(--text-3); margin-bottom: 1.25rem; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { opacity: .5; }

.game-title {
  font-family: var(--f-display); font-weight: 800;
  font-size: var(--step-4); line-height: 1.15; letter-spacing: -.02em;
}
.game-title-ar { color: var(--text-3); font-size: var(--step-1); font-weight: 500; margin-top: .35rem; }

.game-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.15rem; }
.game-lead { margin-top: 1.25rem; color: var(--text-2); max-width: 66ch; font-size: var(--step-1); }
.game-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.6rem; }

.panel {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: clamp(1.35rem, 3vw, 2rem);
}
.panel + .panel { margin-top: 1rem; }
.panel h2,
.panel h3 {
  font-family: var(--f-display); font-weight: 700;
  font-size: var(--step-2); margin-bottom: 1rem;
  padding-bottom: .8rem; border-bottom: 1px solid var(--border);
}
.panel p { color: var(--text-2); }
.panel p + p { margin-top: .85rem; }

.spec { display: grid; gap: 0; }
.spec-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .8rem 0; border-bottom: 1px solid var(--border);
  font-size: var(--step--1);
}
.spec-row:last-child { border-bottom: 0; }
.spec-row dt { color: var(--text-3); }
.spec-row dd { font-weight: 600; text-align: end; }

.dl-list { display: grid; gap: .6rem; }
.dl-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1.1rem;
  background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--step--1); font-weight: 600;
  transition: border-color .22s, background-color .22s;
}
.dl-item:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.dl-item small { color: var(--text-3); font-weight: 500; }

.score {
  display: inline-flex; align-items: baseline; gap: .3rem;
  font-family: var(--f-display); font-weight: 800;
  color: var(--accent); font-size: var(--step-3);
  font-variant-numeric: tabular-nums;
}
.score small { font-size: .8rem; color: var(--text-3); font-weight: 500; }

.game-cols {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: clamp(1rem, 2vw, 1.5rem);
  align-items: start;
}
.game-side { position: sticky; top: 90px; display: grid; gap: 1rem; }

/* ---------- 16ب. لقطات الشاشة والعارض ---------- */
.shots {
  display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.shot {
  padding: 0; cursor: zoom-in; line-height: 0; display: block;
  background: var(--bg-3); overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  transition: border-color .2s, transform .2s;
}
.shot img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 16 / 9; object-fit: cover;
}
.shot:hover { border-color: var(--accent-line); }
.shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shots-credit { margin-top: .8rem; font-size: .75rem; color: var(--text-3); }

.shotbox {
  padding: 0; border: 0; background: transparent;
  width: min(96vw, 1400px); max-width: none;
  max-height: 92vh; overflow: visible;
}
.shotbox::backdrop {
  background: color-mix(in srgb, var(--bg) 86%, #000 14%);
}
.shotbox img {
  display: block; width: auto; max-width: 100%; max-height: 86vh;
  margin: 0 auto; background: var(--bg-3);
  border: 1px solid var(--border); border-radius: var(--r-sm);
}
.shotbox-x {
  position: absolute; top: .6rem; inset-inline-end: .6rem;
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer; color: var(--text);
  background: var(--bg-3); border: 1px solid var(--border);
  transition: color .18s, border-color .18s;
}
.shotbox-x:hover { color: var(--accent); border-color: var(--accent-line); }

/* ---------- 17. صفحة "عن الموقع" ---------- */
.prose { max-width: 72ch; }
.prose h2 {
  font-family: var(--f-display); font-weight: 800;
  font-size: var(--step-3); margin-top: 2.5rem; margin-bottom: .9rem;
  letter-spacing: -.01em;
}
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--text-2); margin-bottom: 1rem; }
.prose ul { display: grid; gap: .6rem; margin-block: 1rem; }
.prose li { padding-inline-start: 1.4rem; position: relative; color: var(--text-2); }
.prose li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .7em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

/* ---------- 18. الكشف عند التمرير ---------- */
.reveal { opacity: 0; transform: translateY(22px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--d, 0ms);
}

/* ---------- 19. زر الرأس لأعلى ---------- */
.to-top {
  position: fixed; bottom: 1.5rem; inset-inline-end: 1.5rem; z-index: 70;
  width: 44px; height: 44px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  border: 0; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .3s, visibility .3s, transform .3s var(--ease), background-color .2s;
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--accent-hi); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- 20. الاستجابة ---------- */
@media (max-width: 1080px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .hero-art { max-width: 560px; margin-inline: auto; transform: none; }
  .game-cols { grid-template-columns: 1fr; }
  .game-side { position: static; }
  .ftr-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .burger { display: grid; }
  .hdr-tools { margin-inline-start: auto; }
  .stats-in { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
  .feature { grid-template-columns: 1fr; }
  .feature-media { min-height: 220px; aspect-ratio: 460/215; }
  .game-top { grid-template-columns: 1fr; }
  .game-cover { max-width: 420px; }
}

@media (max-width: 640px) {
  .shell, .shell-wide { width: min(100% - 1.75rem, var(--shell)); }
  .grid-games { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .85rem; }
  .card-body { padding: .75rem .8rem .9rem; }
  .card-title { font-size: 1rem; }
  .ftr-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .sec-head { flex-direction: column; align-items: flex-start; }
  .toolbar { position: static; }
  .field { max-width: none; }
  .hero-art { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; height: 300px; }
  .ha-track { gap: .55rem; }
  .ha-col-2 { display: none; }
  .search { padding-inline-start: 1rem; }
  .search-btn { padding-inline: 1rem; }
}

/* ---------- Ad slots & banners (injected via panel) ---------- */
.ay-ad-slot, .ay-banner-slot { display: none; margin-block: 1.5rem; }
.ay-ad-slot.is-filled, .ay-banner-slot.is-filled { display: block; }
.ay-ad-slot { text-align: center; overflow: hidden; }
.ay-banner-slot { display: none; }
.ay-banner-slot.is-filled { display: flex; gap: .85rem; flex-wrap: wrap; }
.ay-banner {
  position: relative; display: block; flex: 1 1 280px; min-width: 240px;
  border-radius: var(--r-card, 14px); overflow: hidden; text-decoration: none; color: #fff;
  box-shadow: var(--shadow-1, 0 8px 24px rgba(0,0,0,.25));
}
.ay-banner img { width: 100%; height: 100%; min-height: 140px; object-fit: cover; display: block; }
.ay-banner-cap {
  position: absolute; inset-inline: 0; bottom: 0; padding: .9rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,.78), transparent);
  display: flex; flex-direction: column; gap: .15rem;
}
.ay-banner-cap b { font-size: 1rem; font-weight: 800; }
.ay-banner-cap small { font-size: .78rem; opacity: .85; }

/* ---------- Hero banner carousel (home_hero position only) ---------- */
.ay-banner-slot[data-banner-slot="home_hero"] {
  position: relative; display: block !important;
  width: min(100% - 2.5rem, var(--shell, 1240px)); margin: 1.75rem auto;
  aspect-ratio: 16 / 6; border-radius: var(--r-card, 18px); overflow: hidden;
  background: var(--bg-2, #141414); border: 1px solid var(--border, #262626);
  box-shadow: 0 24px 60px -24px rgba(0,0,0,.7);
}
.ay-banner-slot[data-banner-slot="home_hero"] .ay-banner {
  position: absolute; inset: 0; opacity: 0; z-index: 0; display: block;
  transition: opacity .9s ease; min-width: 0; border-radius: 0; box-shadow: none; color: #fff;
}
.ay-banner-slot[data-banner-slot="home_hero"] .ay-banner.is-active { opacity: 1; z-index: 1; }
.ay-banner-slot[data-banner-slot="home_hero"] .ay-banner > img {
  width: 100%; height: 100%; min-height: 0; object-fit: cover; display: block;
  transform: scale(1.06); transition: transform 6s ease;
}
.ay-banner-slot[data-banner-slot="home_hero"] .ay-banner.is-active > img { transform: scale(1); }
.ay-banner-slot[data-banner-slot="home_hero"] .ay-banner::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to left, rgba(0,0,0,.82) 0%, rgba(0,0,0,.45) 42%, transparent 75%),
              linear-gradient(to top, rgba(0,0,0,.6), transparent 45%);
}
.ay-hero-cap {
  position: absolute; z-index: 2; inset-inline-start: clamp(1.2rem, 4vw, 3rem); bottom: clamp(1.2rem, 4vw, 2.6rem);
  max-width: min(520px, 75%); display: flex; flex-direction: column; gap: .55rem;
  transform: translateY(12px); opacity: 0; transition: transform .7s ease .15s, opacity .7s ease .15s;
}
.ay-banner.is-active .ay-hero-cap { transform: none; opacity: 1; }
.ay-hero-kicker { font-size: .74rem; font-weight: 800; color: var(--accent, #eaa44c); }
.ay-hero-cap b { font-size: clamp(1.25rem, 3.2vw, 2.3rem); font-weight: 800; line-height: 1.2; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.ay-hero-cap small { font-size: clamp(.8rem, 1.4vw, .95rem); opacity: .88; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ay-hero-btn {
  align-self: flex-start; margin-top: .35rem; display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.15rem; border-radius: 999px; font-weight: 800; font-size: .85rem;
  background: var(--accent, #eaa44c); color: var(--accent-ink, #1c1206);
}
.ay-hero-logo { max-height: 70px; max-width: 260px; width: auto; object-fit: contain; object-position: right; filter: drop-shadow(0 4px 14px rgba(0,0,0,.6)); }
.ay-hero-dots { position: absolute; bottom: 16px; inset-inline-end: 20px; display: flex; gap: 7px; z-index: 3; }
.ay-hero-dots button { width: 9px; height: 9px; border-radius: 99px; border: 0; padding: 0; cursor: pointer; background: rgba(255,255,255,.45); transition: width .3s, background .3s; }
.ay-hero-dots button.is-active { width: 26px; background: var(--accent, #eaa44c); }
.ay-hero-arrow {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35); color: #fff; font-size: 1.1rem; cursor: pointer; backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .25s;
}
.ay-banner-slot[data-banner-slot="home_hero"]:hover .ay-hero-arrow { opacity: 1; }
.ay-hero-arrow[data-dir="prev"] { inset-inline-end: 14px; }
.ay-hero-arrow[data-dir="next"] { inset-inline-start: 14px; }
@media (max-width: 720px) {
  .ay-banner-slot[data-banner-slot="home_hero"] { width: min(100% - 1.75rem, var(--shell, 1240px)); aspect-ratio: 4 / 3; margin: 1.25rem auto; }
  .ay-hero-cap { max-width: 88%; }
  .ay-hero-logo { max-height: 48px; max-width: 180px; }
  .ay-hero-arrow { display: none; }
  .ay-hero-dots { inset-inline: 0; justify-content: center; bottom: 10px; }
}
.ay-banner-slot:not([data-banner-slot="home_hero"]).is-filled { width: min(100% - 2.5rem, var(--shell, 1240px)); margin-inline: auto; }
.ay-banner-slot:not([data-banner-slot="home_hero"]) .ay-banner { min-width: 0; flex: 1 1 260px; }
.ay-banner-slot:not([data-banner-slot="home_hero"]) .ay-banner img { min-height: 0; aspect-ratio: 16 / 7; }
/* safety net: nothing may widen the page on phones */
html, body { overflow-x: clip; }
