/* iOsamai Arabic translations: one stylesheet for the public pages and the editor. */
:root {
  --bg: #0d0f13;
  --bg-2: #12151b;
  --surface: #181c24;
  --surface-2: #1f2430;
  --line: #2a303d;
  --text: #eceef2;
  --muted: #9aa3b2;
  --accent: #2fa69b;          /* the green of the "تعريب" tab */
  --accent-2: #46c9bc;
  --accent-ink: #062b27;
  --gold: #f2b84b;
  --danger: #e5604f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Readex Pro", "Segoe UI", Tahoma, system-ui, sans-serif;
  --max: 1180px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px);
  background: rgba(13, 15, 19, .78); border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 19px; }
.brand:hover { text-decoration: none; }
.brand img { height: 38px; width: auto; }
.brand img.wordmark { height: 30px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); line-height: 1.2; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; }
.nav a { color: var(--muted); padding: 8px 12px; border-radius: 10px; font-size: 15px; }
.nav a:hover, .nav a.active { color: var(--text); background: var(--surface); text-decoration: none; }
.lang-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px;
  padding: 7px 12px; font: 600 14px var(--font); cursor: pointer;
}
.lang-btn:hover { border-color: var(--accent); }
.menu-btn { display: none; }

/* ---------- buttons, badges ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border-radius: 12px; padding: 11px 20px; border: 1px solid transparent;
  font: 600 15px var(--font); cursor: pointer; transition: transform .15s, background .15s, border-color .15s; color: var(--text);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: var(--surface); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn svg { width: 18px; height: 18px; flex: none; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.ok { background: rgba(47, 166, 155, .16); color: var(--accent-2); }
.badge.soon { background: rgba(242, 184, 75, .15); color: var(--gold); }
.badge.nexus { background: rgba(249, 115, 22, .14); color: #fb923c; border: 1px solid rgba(251, 146, 60, .45); gap: 5px; padding: 2px 10px 2px 8px; }
.badge.nexus:hover { background: #f97316; color: #fff; border-color: #f97316; text-decoration: none; }
.badge.nexus img { width: 15px; height: 15px; }
.btn img.nx { width: 20px; height: 20px; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); opacity: .32; filter: saturate(1.1); }
.hero-bg div { background-size: cover; background-position: center; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(47, 166, 155, .22), transparent 60%),
              linear-gradient(180deg, rgba(13, 15, 19, .55), var(--bg) 92%);
}
.hero .wrap { position: relative; z-index: 1; padding: 86px 0 70px; text-align: center; }
.hero-tab {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; padding: 4px 16px;
  border-radius: 0 0 0 14px; margin-bottom: 18px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .85);
}
html[dir="ltr"] .hero-tab { border-radius: 0 0 14px 0; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -.01em; }
.hero h1 span { color: var(--accent-2); }
.hero p.lead { font-size: clamp(16px, 2.2vw, 20px); color: #c9ced8; max-width: 640px; margin: 0 auto 28px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.stats { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 38px; }
.stat {
  background: rgba(24, 28, 36, .8); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 22px; min-width: 140px;
}
.stat b { display: block; font-size: 26px; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 14px; }

/* ---------- sections ---------- */
section.block { padding: 64px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 30px; }
.section-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- filters ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; min-width: 240px;
}
.search input { background: none; border: 0; color: var(--text); font: 15px var(--font); padding: 10px 0; width: 100%; outline: none; }
.search svg { width: 18px; height: 18px; color: var(--muted); }
.chip {
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 7px 16px;
  font: 500 14px var(--font); cursor: pointer;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- game grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(47, 166, 155, .6); box-shadow: var(--shadow); }
.card .cover { aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .cover img { transform: scale(1.04); }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 19px; line-height: 1.35; }
.card h3 a { color: var(--text); }
.card h3 a::after { content: ""; position: absolute; inset: 0; }   /* whole card clickable */
.card p { margin: 0; color: var(--muted); font-size: 14.5px; }
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.card .nexus-link { position: relative; z-index: 2; }
.empty { color: var(--muted); text-align: center; padding: 40px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; counter-reset: s; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step::before {
  counter-increment: s; content: counter(s); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: rgba(47, 166, 155, .16); color: var(--accent-2); font-weight: 700; margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 18px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.about .text { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.about .text p { margin: 0 0 10px; color: #cfd4dd; }
.links { display: grid; gap: 10px; }
.links a {
  display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; color: var(--text); font-weight: 500;
}
.links a:hover { border-color: var(--accent); text-decoration: none; }
.links a svg { width: 20px; height: 20px; flex: none; color: var(--accent-2); }
.links a small { color: var(--muted); font-weight: 400; margin-inline-start: auto; direction: ltr; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 0; }

/* ---------- game page ---------- */
.g-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.g-hero .bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(26px) brightness(.45); }
.g-hero .wrap { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; gap: 34px; align-items: center; padding: 46px 0; }
.g-hero .cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .08); }
.g-hero h1 { margin: 6px 0 6px; font-size: clamp(28px, 4vw, 42px); line-height: 1.2; }
.g-hero .sub { color: #cfd4dd; margin: 0 0 18px; font-size: 17px; }
.g-hero .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.g-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; padding: 44px 0 64px; align-items: start; }
.panel, .about .text, .links a { overflow-wrap: anywhere; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 22px; }
.panel h2 { margin: 0 0 12px; font-size: 21px; }
.panel ul, .panel ol { margin: 0; padding-inline-start: 22px; }
.panel li { margin: 5px 0; }
.panel p { margin: 0; color: #cfd4dd; }
.panel .note { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: rgba(242, 184, 75, .1); color: #f3d79a; font-size: 15px; }
.facts { list-style: none; padding: 0 !important; margin: 0; }
.facts li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0 !important; }
.facts li:last-child { border-bottom: 0; }
.facts span { color: var(--muted); }
.facts b { font-weight: 600; text-align: end; }
bdi.lat { color: #dfe7f1; }
code, .ltr { direction: ltr; unicode-bidi: isolate; }
code { background: var(--bg-2); border-radius: 6px; padding: 1px 6px; font-size: 13.5px; word-break: break-all; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery button { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--bg-2); aspect-ratio: 16 / 9; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery button:hover img { transform: scale(1.05); }
.sticky { position: sticky; top: 86px; }
.dl-box .btn { width: 100%; justify-content: center; margin-bottom: 10px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(5, 6, 8, .94); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 10px; box-shadow: var(--shadow); }
.lightbox button {
  position: absolute; background: rgba(255, 255, 255, .08); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%;
  font-size: 24px; cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, .18); }
.lb-close { top: 18px; inset-inline-end: 18px; }
.lb-prev { inset-inline-start: 18px; }
.lb-next { inset-inline-end: 18px; }
.lb-count { position: absolute; bottom: 18px; color: var(--muted); font-size: 14px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } * { transition: none !important; } }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .g-hero .wrap, .g-body, .about { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .hero-bg { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .nav { display: none; position: absolute; top: 66px; inset-inline: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; padding: 10px 16px; }
  .nav.open { display: flex; }
  .menu-btn { display: inline-flex; margin-inline-start: auto; background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 7px 10px; cursor: pointer; }
  .brand small { display: none; }
  .hero .wrap { padding: 60px 0 50px; }
  .search { min-width: 0; flex: 1 1 100%; }
  section.block { padding: 46px 0; }
}

/* brand buttons (About links) */
.socials { gap: 12px; }
.socials a.sbtn {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; border: 0;
  background: var(--b); color: #fff; font-weight: 600; font-size: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
  transition: transform .15s, filter .15s;
}
.socials a.sbtn:hover { transform: translateY(-2px); filter: brightness(1.08); text-decoration: none; }
.socials a.sbtn img { width: 26px; height: 26px; flex: none; background: #fff; border-radius: 7px; padding: 2px; }
.socials a.sbtn .bi { width: 24px; height: 24px; flex: none; color: #fff; }
.socials a.sbtn i { margin-inline-start: auto; font-style: normal; opacity: .85; }
