/* ==========================================================================
   Sohatshy — site styles
   Arabic first (RTL). Logical properties (inline-start/end) make the same
   rules work for English (LTR) too.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --bg: #080d1c;
  --bg-2: #0c1326;
  --surface: #111a33;
  --surface-2: #17223f;
  --surface-3: #1f2c50;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);

  --gold: #e8b84a;
  --gold-2: #ffd98a;
  --gold-3: #b9842a;
  --gold-grad: linear-gradient(135deg, #ffe29a 0%, #e8b84a 50%, #b9842a 100%);
  --gold-glow: 0 0 0 1px rgba(232, 184, 74, .5), 0 18px 50px -12px rgba(232, 184, 74, .35);

  --text: #edf0f8;
  --muted: #9ba5c2;
  --faint: #6b7594;

  --ok: #43c98b;
  --warn: #f2a546;
  --soon: #8796ff;

  --cut: 18px;               /* size of the clipped card corners */
  --radius: 14px;
  --header-h: 72px;
  --max: 1240px;
  --ease: cubic-bezier(.2, .8, .2, 1);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(80, 100, 200, .14), transparent 60%),
    radial-gradient(900px 500px at 0% 30%, rgba(232, 184, 74, .05), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: var(--gold-2); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .5em; font-weight: 800; }
p { margin: 0 0 1em; }
code, kbd {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .85em;
  direction: ltr;
  unicode-bidi: isolate;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  padding: .1em .45em;
  border-radius: 6px;
  color: #ffe7b5;
  overflow-wrap: anywhere;
}
::selection { background: rgba(232, 184, 74, .35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; inset-inline-start: 16px; top: -60px; z-index: 100;
  background: var(--gold); color: #111; padding: 8px 16px; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 12px; color: #111; }

/* Show only the block that matches the current language */
html[lang="ar"] [data-lang="en"],
html[lang="en"] [data-lang="ar"] { display: none !important; }

/* Small "other-language name" labels: let the text pick its own direction.
   In English mode they hold Arabic, which must not be letter-spaced (it breaks the joined letters). */
.poster-info .en, .card-body .en, .game-title .en { unicode-bidi: plaintext; }
html[lang="en"] .poster-info .en, html[lang="en"] .card-body .en, html[lang="en"] .game-title .en, html[lang="en"] .hero h1 .latin { letter-spacing: 0; font-size: .95rem; text-transform: none; }

/* Latin text inside Arabic layout (game names, versions) */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- Cut-corner shape (used by cards, buttons, panels) ---------- */
.cut {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
}
[dir="rtl"] .cut {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

/* ---------- Section headings: small English label above the title ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .72rem; font-weight: 700; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold); direction: ltr; margin-bottom: 4px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--gold-grad); }
.section { padding-block: 64px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-title {
  font-size: clamp(1.6rem, 3.2vw, 2.3rem); font-weight: 900; margin: 0;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-sub { color: var(--muted); margin: 6px 0 0; }
/* Gradient text is clipped to its box; extra bottom room keeps Arabic dots (like the ones under ي) visible */
.section-title, .hero h1, .page-hero h1 { padding-bottom: .18em; margin-bottom: -.18em; }

/* ---------- Buttons ---------- */
.btn {
  --cut: 10px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 26px; border: 0; cursor: pointer; font-weight: 800; font-size: 1rem;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, color .25s;
  isolation: isolate; overflow: hidden;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-gold { background: var(--gold-grad); color: #1a1205; }
.btn-gold::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn-gold:hover { color: #1a1205; transform: translateY(-2px); box-shadow: 0 14px 40px -10px rgba(232, 184, 74, .6); }
.btn-gold:hover::after { transform: translateX(120%); }
.btn-ghost { background: rgba(255, 255, 255, .06); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; transform: translateY(-2px); }
.btn-lg { padding: 18px 36px; font-size: 1.15rem; --cut: 14px; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; filter: grayscale(.6); }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(8, 13, 28, .55);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}
.site-header.scrolled { background: rgba(8, 13, 28, .88); border-bottom-color: var(--line); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); flex: none; }
.brand:hover { color: #fff; }
.brand img { width: 40px; height: 40px; transition: transform .5s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.35rem; font-weight: 900; line-height: 1.45; }
.brand-sub { font-size: .62rem; letter-spacing: .3em; color: var(--gold); text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a {
  position: relative; padding: 8px 14px; color: var(--muted); font-weight: 700; font-size: .98rem; border-radius: 8px;
}
.nav a::after {
  content: ""; position: absolute; inset-inline: 14px; bottom: 2px; height: 2px; background: var(--gold-grad);
  transform: scaleX(0); transition: transform .3s var(--ease);
}
.nav a:hover { color: #fff; }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--gold-2); }

.header-tools { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px var(--line); color: var(--text);
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); color: var(--gold-2); }
.icon-btn svg { width: 22px; height: 22px; }
.lang-btn { width: auto; padding-inline: 14px; font-weight: 800; font-size: .9rem; gap: 6px; display: inline-flex; }
.menu-btn { display: none; }

/* Mobile drawer */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(3, 6, 15, .6); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 61; width: min(340px, 86vw);
  background: var(--bg-2); border-inline-start: 1px solid var(--line); padding: 20px;
  display: flex; flex-direction: column; gap: 6px;
  transform: translateX(100%); transition: transform .4s var(--ease); visibility: hidden;
}
[dir="rtl"] .drawer { transform: translateX(-100%); }
body.menu-open .drawer { transform: none; visibility: visible; }
body.menu-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
body.menu-open { overflow: hidden; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.drawer > a {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 12px;
  color: var(--text); font-weight: 700; font-size: 1.1rem; background: rgba(255, 255, 255, .03);
  opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s var(--ease), background .2s;
}
body.menu-open .drawer > a { opacity: 1; transform: none; }
.drawer > a:hover, .drawer > a[aria-current="page"] { background: rgba(232, 184, 74, .12); color: var(--gold-2); }
.drawer > a small { color: var(--faint); font-size: .7rem; letter-spacing: .15em; direction: ltr; }

/* ==========================================================================
   Hero (home)
   ========================================================================== */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: min(82vh, 760px); display: flex; align-items: center;
  margin-top: calc(var(--header-h) * -1); padding-top: var(--header-h);
}
/* Background made only with CSS + SVG: navy gradient, gold glow, drifting pattern */
.hero-bg {
  position: absolute; inset: 0; z-index: -2; overflow: hidden;
  background:
    radial-gradient(90% 70% at 15% 10%, #17244c 0%, transparent 60%),
    linear-gradient(165deg, #0e1733 0%, #0a1126 45%, var(--bg) 100%);
}
.hero-glow {
  position: absolute; width: 68vmax; height: 68vmax; top: -22vmax; inset-inline-end: -18vmax;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(232, 184, 74, .16) 0%, rgba(232, 184, 74, .06) 35%, transparent 68%);
  animation: glow-drift 22s ease-in-out infinite alternate;
}
.hero-glow--small {
  width: 34vmax; height: 34vmax; top: 30%; inset-inline-end: auto; inset-inline-start: 8%;
  background: radial-gradient(circle, rgba(255, 217, 138, .09) 0%, transparent 65%);
  animation-duration: 16s; animation-direction: alternate-reverse;
}
@keyframes glow-drift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: .85; }
  to   { transform: translate3d(-6%, 8%, 0) scale(1.12); opacity: 1; }
}
.hero-pattern {
  position: absolute; top: 0; left: 0; width: calc(100% + 280px); height: calc(100% + 280px);
  color: var(--gold); animation: pattern-drift 90s linear infinite; will-change: transform;
}
/* Moving exactly one tile (280px) makes the loop seamless */
@keyframes pattern-drift { to { transform: translate3d(-280px, -280px, 0); } }
.hp-letters { fill: currentColor; fill-opacity: .075; font-family: "Cairo", sans-serif; font-weight: 800; font-size: 46px; text-anchor: middle; }
.hp-icons { fill: none; stroke: currentColor; stroke-opacity: .12; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hero::before {               /* keeps the text side calm and readable */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 13, 28, .35) 0%, rgba(8, 13, 28, .1) 40%, var(--bg) 100%),
    linear-gradient(var(--hero-side, 270deg), rgba(8, 13, 28, .82) 0%, rgba(8, 13, 28, .45) 45%, rgba(8, 13, 28, 0) 100%);
}
[dir="ltr"] .hero { --hero-side: 90deg; }
/* Fade the hero layers out at the bottom so they blend into the page glow (no hard edge) */
.hero-bg, .hero::before, .game-hero-bg, .game-hero::before {
  -webkit-mask-image: linear-gradient(180deg, #000 65%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 65%, transparent 100%);
}
.hero-content { position: relative; max-width: 680px; padding-block: 72px 96px; }
.hero h1 {
  font-size: clamp(3.2rem, 9vw, 6.4rem); font-weight: 900; line-height: 1.05; margin: 8px 0 14px;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 30px rgba(232, 184, 74, .25));
}
.hero h1 .latin { display: block; font-size: .28em; letter-spacing: .5em; font-weight: 700; color: var(--muted); -webkit-text-fill-color: var(--muted); margin-top: 1.3em; }
.hero-lead { font-size: clamp(1.1rem, 2vw, 1.35rem); color: #d5dbec; max-width: 560px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 44px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: 1.9rem; font-weight: 900; color: #fff; line-height: 1.1; }
.hero-stat span { color: var(--muted); font-size: .9rem; }
.hero-stat + .hero-stat { padding-inline-start: 28px; border-inline-start: 1px solid var(--line-strong); }

/* Staggered entrance */
.rise { opacity: 0; transform: translateY(18px); animation: rise .9s var(--ease) forwards; }
.rise:nth-child(2) { animation-delay: .08s; } .rise:nth-child(3) { animation-delay: .16s; }
.rise:nth-child(4) { animation-delay: .24s; } .rise:nth-child(5) { animation-delay: .32s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Reveal on scroll (JS adds .in) */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Popular row: tall posters with rank numbers
   ========================================================================== */
.rail-wrap { position: relative; }
.rail {
  display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 24px;
  padding: 16px 24px 28px; margin-inline: -24px; scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-arrows { display: flex; gap: 8px; }
.rail-arrows .icon-btn:disabled { opacity: .3; cursor: default; }

.rank-item { position: relative; flex: none; display: flex; align-items: flex-end; scroll-snap-align: start; }
.rank-num {
  font-size: 9.5rem; font-weight: 900; line-height: .8; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 2px rgba(232, 184, 74, .7);
  margin-inline-end: -22px; z-index: 0; user-select: none; direction: ltr;
  transition: -webkit-text-stroke-color .3s, transform .5s var(--ease);
}
.rank-item:hover .rank-num { -webkit-text-stroke-color: var(--gold-2); transform: translateY(-6px); }
.rank-item .poster { z-index: 1; }

.poster {
  --cut: 22px;
  position: relative; display: block; width: 210px; aspect-ratio: 2 / 3; flex: none;
  color: var(--text); padding: 1px; background: var(--line-strong);
  transition: transform .5s var(--ease), background .4s, filter .4s;
}
.poster:hover { transform: translateY(-8px); background: var(--gold-grad); color: var(--text); filter: drop-shadow(0 22px 34px rgba(0, 0, 0, .55)) drop-shadow(0 0 18px rgba(232, 184, 74, .25)); }
.poster-inner { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface); }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.poster:hover img { transform: scale(1.07); }
.poster-inner::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(8, 13, 28, 0) 35%, rgba(8, 13, 28, .7) 65%, rgba(8, 13, 28, .97) 100%);
}
.poster-inner::after {          /* shine sweep on hover */
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .16) 50%, transparent 65%);
  transform: translateX(-130%); transition: transform 1s var(--ease);
}
.poster:hover .poster-inner::after { transform: translateX(130%); }
.poster-info { position: absolute; inset-inline: 0; bottom: 0; z-index: 3; padding: 16px; }
.poster-info .en { display: block; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.poster-info .ar { display: block; font-size: 1.15rem; font-weight: 800; line-height: 1.35; }
.poster .badge { position: absolute; top: 12px; inset-inline-start: 12px; z-index: 3; }
.rank-tag {
  --cut: 8px;
  position: absolute; top: 0; inset-inline-end: 0; z-index: 3; padding: 6px 12px 6px 14px;
  background: var(--gold-grad); color: #1a1205; font-weight: 900; font-size: .85rem; direction: ltr;
}

/* ---------- Status badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 800; white-space: nowrap;
  background: rgba(8, 13, 28, .78); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.badge.complete { color: var(--ok); }
.badge.in-progress { color: var(--warn); }
.badge.coming-soon { color: var(--soon); }
.badge.new { color: var(--gold-2); }

/* ==========================================================================
   All translations: toolbar + grid
   ========================================================================== */
.toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 28px; }
.search {
  position: relative; flex: 1 1 280px; max-width: 420px;
}
.search input {
  width: 100%; height: 50px; padding-inline: 48px 16px; border-radius: 14px; border: 0; outline: 0;
  background: var(--surface); color: var(--text); font: inherit; font-size: 1rem;
  box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow .25s, background .25s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--gold), 0 0 0 4px rgba(232, 184, 74, .12); }
.search svg { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--faint); pointer-events: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding-inline: 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--muted); font-weight: 700; font-size: .92rem;
  box-shadow: inset 0 0 0 1px var(--line); transition: all .25s var(--ease);
}
.chip:hover { color: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); }
.chip[aria-pressed="true"] { background: rgba(232, 184, 74, .14); color: var(--gold-2); box-shadow: inset 0 0 0 1px rgba(232, 184, 74, .55); }
.chip .count { font-size: .75rem; min-width: 22px; height: 22px; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(255, 255, 255, .08); padding-inline: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card {
  --cut: 20px;
  position: relative; display: flex; flex-direction: column; padding: 1px; background: var(--line);
  color: var(--text); transition: transform .45s var(--ease), background .35s, filter .35s;
}
.card:hover { transform: translateY(-6px); background: linear-gradient(160deg, rgba(255, 226, 154, .9), rgba(185, 132, 42, .5) 40%, var(--line) 75%); color: var(--text); filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .45)); }
.card-inner { display: flex; flex-direction: column; height: 100%; background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-3); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .5s; }
.card:hover .card-media img { transform: scale(1.06); }
.card-media .badge { position: absolute; top: 12px; inset-inline-start: 12px; }
.card-media .badge.new { inset-inline-start: auto; inset-inline-end: 12px; }
.card-body { padding: 18px 20px 6px; flex: 1; }
.card-body .en { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.card-body h3 { font-size: 1.25rem; margin: 2px 0 6px; }
.card-body p { color: var(--muted); font-size: .92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-progress { padding: 14px 20px 0; }
.card-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 20px 18px; margin-top: 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: .85rem; }

/* Progress bar */
.progress { position: relative; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.progress span {
  position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; width: 0;
  background: var(--gold-grad); transition: width 1.4s var(--ease);
}
.progress span::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: shimmer 2.6s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress-label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.progress-label b { color: var(--text); }

/* Empty states */
.empty {
  --cut: 22px;
  text-align: center; padding: 48px 24px; background: var(--surface); color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.empty .empty-icon { width: 64px; height: 64px; margin: 0 auto 14px; opacity: .8; }
.empty h3 { color: var(--text); font-size: 1.3rem; margin-bottom: 6px; }
.empty p { max-width: 460px; margin: 0 auto 20px; }

/* ==========================================================================
   Game page
   ========================================================================== */
.game-hero { position: relative; isolation: isolate; overflow: hidden; margin-top: calc(var(--header-h) * -1); padding-top: calc(var(--header-h) + 36px); padding-bottom: 56px; }
.game-hero-bg { position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center; filter: blur(28px) saturate(1.2); opacity: .45; transform: scale(1.1); }
.game-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(8, 13, 28, .4), var(--bg) 92%); }
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--faint); margin-bottom: 26px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--gold-2); }
.game-layout { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: start; }
.game-layout > * { min-width: 0; }   /* never let wide content push the column past the screen */
.game-cover { --cut: 26px; padding: 1px; background: var(--gold-grad); filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .6)); animation: float-in 1s var(--ease) both; }
.game-cover .inner { aspect-ratio: 2 / 3; overflow: hidden; background: var(--surface); }
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
@keyframes float-in { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.game-title .en { font-size: .85rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); font-weight: 700; display: block; }
.game-title h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 900; margin: 4px 0 10px; }
.game-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.game-desc { color: #cfd6ea; font-size: 1.08rem; max-width: 720px; }
.game-progress { max-width: 520px; margin: 22px 0; }
.game-progress .progress { height: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 26px 0 30px; max-width: 760px; }
.stat {
  --cut: 12px;
  padding: 14px 16px; background: rgba(17, 26, 51, .75); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(6px);
}
.stat .k { display: block; font-size: .78rem; color: var(--faint); font-weight: 700; }
.stat .v { display: block; font-size: 1.05rem; font-weight: 800; color: var(--text); }
.download-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.download-note { color: var(--faint); font-size: .85rem; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 28px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; padding: 12px 18px; border: 0; background: none; cursor: pointer; color: var(--muted); font-weight: 800; font-size: 1.02rem; white-space: nowrap;
}
.tab::after { content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--gold-grad); transform: scaleX(0); transition: transform .35s var(--ease); }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { color: var(--gold-2); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab-panel { animation: fade .45s var(--ease); }
.tab-panel[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Numbered steps */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 14px; }
.steps li {
  --cut: 14px;
  counter-increment: step; position: relative; padding: 18px 20px; padding-inline-start: 74px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.steps li::before {
  content: counter(step); position: absolute; inset-inline-start: 18px; top: 16px;
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: var(--gold-grad); color: #1a1205; font-weight: 900; font-size: 1.1rem;
}

/* Changelog timeline */
.timeline { position: relative; padding-inline-start: 28px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 6px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--gold), transparent); }
.release { position: relative; margin-bottom: 28px; }
.release::before { content: ""; position: absolute; inset-inline-start: -28px; top: 9px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--gold); }
.release h3 { font-size: 1.15rem; margin: 0 0 4px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.release time { color: var(--faint); font-size: .85rem; font-weight: 600; }
.release ul, .issues { margin: 6px 0 0; padding-inline-start: 20px; color: #cfd6ea; }
.release li, .issues li { margin-bottom: 4px; }
.issues { list-style: none; padding: 0; display: grid; gap: 10px; }
.issues li {
  --cut: 12px;
  padding: 14px 18px; padding-inline-start: 48px; position: relative; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.issues li::before { content: "!"; position: absolute; inset-inline-start: 16px; top: 14px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(242, 165, 70, .16); color: var(--warn); font-weight: 900; font-size: .85rem; }

/* Gallery + lightbox */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.shot {
  --cut: 14px;
  position: relative; display: block; padding: 0; border: 0; cursor: zoom-in; background: var(--surface); aspect-ratio: 16 / 9; overflow: hidden;
}
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), filter .4s; }
.shot::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s; }
.shot:hover img { transform: scale(1.06); filter: brightness(1.1); }
.shot:hover::after { box-shadow: inset 0 0 0 2px var(--gold); }

.lightbox {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 64px 72px;
  background: rgba(3, 6, 15, .94); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .3s;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); transform: scale(.96); transition: transform .4s var(--ease); }
.lightbox.open img { transform: none; }
.lightbox .icon-btn { position: absolute; background: rgba(255, 255, 255, .08); }
.lightbox .icon-btn[hidden] { display: none; }
.lb-close { top: 16px; inset-inline-end: 16px; }
.lb-prev { inset-inline-start: 16px; top: 50%; translate: 0 -50%; }
.lb-next { inset-inline-end: 16px; top: 50%; translate: 0 -50%; }
[dir="rtl"] .lb-prev svg, [dir="rtl"] .lb-next svg, [dir="rtl"] .flip-rtl { transform: scaleX(-1); }
.lb-count { position: absolute; bottom: 18px; left: 50%; translate: -50% 0; color: var(--muted); font-size: .9rem; direction: ltr; }

/* ==========================================================================
   Content pages (install, FAQ, about, request)
   ========================================================================== */
.page-hero { padding-block: 64px 24px; position: relative; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 900; margin: 6px 0 10px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-hero p { color: var(--muted); font-size: 1.15rem; max-width: 680px; }
.prose { max-width: 820px; }
.prose h2 { font-size: 1.6rem; margin-top: 1.6em; color: #fff; }
.prose h3 { font-size: 1.2rem; margin-top: 1.4em; color: var(--gold-2); }
.prose ul, .prose ol { padding-inline-start: 22px; }
.prose li { margin-bottom: 6px; }
.panel { --cut: 20px; padding: 26px 28px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.callout { --cut: 14px; display: flex; gap: 14px; padding: 16px 20px; margin: 20px 0; background: rgba(232, 184, 74, .08); box-shadow: inset 0 0 0 1px rgba(232, 184, 74, .3); }
.callout svg { width: 24px; height: 24px; flex: none; color: var(--gold); margin-top: 3px; }
.callout p { margin: 0; }
.callout.info { background: rgba(135, 150, 255, .08); box-shadow: inset 0 0 0 1px rgba(135, 150, 255, .3); }
.callout.info svg { color: var(--soon); }
/* Prominent warning (e.g. a required in-game setting) */
.callout.warn { background: rgba(242, 165, 70, .12); box-shadow: inset 0 0 0 2px rgba(242, 165, 70, .7); font-size: 1.05rem; line-height: 1.7; }
.callout.warn svg { color: var(--warn); width: 28px; height: 28px; }
.callout.warn strong { color: var(--warn); }
.game-title .callout.warn { margin: 6px 0 18px; }

/* Game page: info cards (requirements, compatibility, credits, notes) */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
.info-card { --cut: 14px; padding: 18px 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.info-card h3 { margin: 0 0 10px; font-size: 1.05rem; color: var(--gold-2); }
.info-card ul { margin: 0; padding-inline-start: 18px; color: #cfd6ea; display: grid; gap: 6px; }

/* Screenshot placeholder tiles (until real screenshots are added) */
.shot-placeholder { cursor: default; display: grid; place-items: center; background: repeating-linear-gradient(135deg, var(--surface) 0 14px, var(--surface-2) 14px 28px); }
.shot-placeholder span { color: var(--faint); font-weight: 700; font-size: .9rem; padding: 6px 12px; background: rgba(3, 6, 15, .55); border-radius: 6px; }

/* Install guide: one row per game, linking to that game's own steps */
.install-list { display: grid; gap: 18px; max-width: 980px; }
.install-item {
  --cut: 18px;
  display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: center; padding: 16px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text);
  transition: transform .45s var(--ease), box-shadow .35s;
}
.install-item:hover { color: var(--text); transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(232, 184, 74, .55), 0 20px 40px -20px rgba(0, 0, 0, .6); }
.install-cover { --cut: 12px; aspect-ratio: 2 / 3; overflow: hidden; background: var(--surface-3); }
.install-cover img { width: 100%; height: 100%; object-fit: cover; }
.install-body { min-width: 0; }
.install-body .en { display: block; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.install-body h2 { font-size: 1.4rem; margin: 2px 0 8px; }
.install-body p { color: #cfd6ea; margin: 0 0 12px; }
.install-body code { overflow-wrap: anywhere; }
.install-go { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-2); font-weight: 800; }
.install-go svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.install-item:hover .install-go svg { transform: translateX(4px); }
[dir="rtl"] .install-item:hover .install-go svg { transform: translateX(-4px) scaleX(-1); }
#install { scroll-margin-top: var(--header-h); }

/* FAQ accordion */
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq details { --cut: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .3s, background .3s; }
.faq details[open] { background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(232, 184, 74, .4); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 24px; font-weight: 800; font-size: 1.12rem; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .plus { position: relative; width: 22px; height: 22px; flex: none; }
.faq summary .plus::before, .faq summary .plus::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 2px; background: var(--gold); translate: -50% -50%; transition: rotate .35s var(--ease); }
.faq summary .plus::after { rotate: 90deg; }
.faq details[open] .plus::after { rotate: 0deg; }
.faq .answer { padding: 0 24px 22px; color: #cfd6ea; }
.faq .answer p:last-child { margin-bottom: 0; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.values { display: grid; gap: 14px; }
.value { --cut: 14px; display: flex; gap: 16px; padding: 18px 20px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.value svg { width: 28px; height: 28px; color: var(--gold); flex: none; margin-top: 2px; }
.value h3 { font-size: 1.05rem; margin: 0 0 2px; }
.value p { margin: 0; color: var(--muted); font-size: .95rem; }

/* 404 */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding-block: 60px; }
.notfound .big {
  font-size: clamp(7rem, 24vw, 14rem); font-weight: 900; line-height: 1; direction: ltr;
  color: transparent; -webkit-text-stroke: 2px var(--gold); position: relative; display: inline-block;
  animation: wobble 6s ease-in-out infinite;
}
.notfound .big::after { content: attr(data-text); position: absolute; inset: 0; color: rgba(232, 184, 74, .1); -webkit-text-stroke: 0; transform: translate(8px, 8px); z-index: -1; }
@keyframes wobble { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-10px); } }
.notfound h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 10px 0; }
.notfound p { color: var(--muted); max-width: 480px; margin: 0 auto 26px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(12, 19, 38, .6), var(--bg)); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-block: 48px 32px; }
.footer-top h4 { font-size: .75rem; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer-top ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-top a { color: var(--muted); }
.footer-top a:hover { color: var(--gold-2); }
.footer-about p { color: var(--muted); font-size: .95rem; max-width: 380px; margin-top: 14px; }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 20px 28px; display: grid; gap: 6px; color: var(--faint); font-size: .85rem; }
.footer-bottom .disclaimer { color: var(--muted); font-weight: 700; }
.footer-bottom a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

/* Support link icon */
.gh-link { display: inline-flex; align-items: center; gap: 8px; }
.gh-link svg { width: 18px; height: 18px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1020px) {
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .header-tools { margin-inline-start: auto; }
  .game-layout { grid-template-columns: 220px 1fr; gap: 32px; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  :root { --header-h: 64px; }
  .container { padding-inline: 16px; }
  .rail { padding-inline: 16px; margin-inline: -16px; scroll-padding-inline: 16px; gap: 16px; }
  .section { padding-block: 44px; }
  .hero { min-height: 0; }
  .hero-content { padding-block: 48px 64px; }
  .hero-stats { gap: 18px; }
  .hero-stat + .hero-stat { padding-inline-start: 18px; }
  .brand-sub { display: none; }
  .rank-num { font-size: 7rem; margin-inline-end: -16px; }
  .poster { width: 160px; }
  .poster-info { padding: 12px; }
  .poster-info .ar { font-size: 1rem; }
  .game-layout { grid-template-columns: 1fr; }
  .game-cover { width: 180px; }
  .btn-lg { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .search { max-width: none; }
  .lightbox { padding: 56px 8px; }
  .lb-prev, .lb-next { top: auto; bottom: 10px; translate: none; }
  .steps li { padding-inline-start: 66px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .install-item { grid-template-columns: 76px 1fr; gap: 16px; padding: 12px; align-items: start; }
  .install-body h2 { font-size: 1.15rem; }
  .install-body p { font-size: .95rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal, .rise { opacity: 1; transform: none; }
}

/* English mode: the Arabic name under the big hero title keeps a readable size */
html[lang="en"] .hero h1 .latin { font-size: .3em; }

/* Phones: the text covers the whole hero, so keep the pattern extra faint */
@media (max-width: 680px) { .hero-pattern { opacity: .6; } }
/* Letter-spacing adds space after the last letter; pull it back so the label lines up under the title */
[dir="rtl"] .hero h1 .latin { margin-right: -.5em; }
