:root {
  --bg: #120a1a;
  --bg-2: #1b1026;
  --card: #211430;
  --card-2: #2a1a3b;
  --line: rgba(255, 255, 255, 0.09);
  --ink: #f6f0fa;
  --ink-2: #c9bcd6;
  --ink-3: #8f7fa1;
  --pink: #e0559f;
  --pink-2: #c76ba0;
  --violet: #9b5de5;
  --gold: #f2c14e;
  --ok: #34c38f;
  --danger: #ef4f6b;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: "Cairo", "Segoe UI", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* ── شريط التنقل ── */
.nav {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(18, 10, 26, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.brand img { width: 40px; height: 40px; }
.brand small { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); line-height: 1; }
.nav-links { display: flex; gap: 6px; margin-inline-start: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: 14px;
  transition: background .2s, color .2s;
}
.nav-links a:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
@media (max-width: 720px) { .nav-links a:not(.cta) { display: none; } }

/* ── الأزرار ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 14px; border: 0; cursor: pointer;
  font: 700 15px var(--font); color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  box-shadow: 0 10px 28px rgba(224, 85, 159, 0.35);
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(224, 85, 159, 0.45); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: rgba(255, 255, 255, 0.06); box-shadow: none; border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn.gold { background: linear-gradient(135deg, #f7d77c, var(--gold)); color: #2a1a00; box-shadow: 0 10px 28px rgba(242, 193, 78, 0.3); }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: rgba(239, 79, 107, 0.14); color: #ff8aa0; box-shadow: none; border: 1px solid rgba(239, 79, 107, 0.35); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* ── الواجهة ── */
.hero { position: relative; padding: 70px 0 90px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 120%;
  background:
    radial-gradient(600px 380px at 78% 30%, rgba(224, 85, 159, 0.32), transparent 70%),
    radial-gradient(520px 360px at 18% 60%, rgba(155, 93, 229, 0.28), transparent 70%),
    radial-gradient(300px 200px at 60% 90%, rgba(242, 193, 78, 0.12), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; text-align: center; } }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: rgba(242, 193, 78, 0.12); color: var(--gold); font-weight: 700; font-size: 13px;
  border: 1px solid rgba(242, 193, 78, 0.3);
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 195, 143, 0.2); }
.hero h1 { font-size: clamp(36px, 6vw, 62px); line-height: 1.2; margin: 18px 0 14px; font-weight: 900; letter-spacing: -0.5px; }
.hero h1 .grad {
  background: linear-gradient(135deg, #ff8ccf, var(--pink) 40%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 18px; color: var(--ink-2); max-width: 560px; margin: 0 0 28px; }
@media (max-width: 900px) { .hero p.lead { margin-inline: auto; } }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 900px) { .hero-actions { justify-content: center; } }
.hero-meta { display: flex; gap: 26px; margin-top: 30px; color: var(--ink-3); font-size: 14px; flex-wrap: wrap; }
@media (max-width: 900px) { .hero-meta { justify-content: center; } }
.hero-meta b { display: block; color: var(--ink); font-size: 22px; font-weight: 800; }

.hero-art { position: relative; display: grid; place-items: center; min-height: 380px; }
.hero-art .ring {
  position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.08);
  animation: pulse 6s ease-in-out infinite;
}
.hero-art .ring.r1 { width: 300px; height: 300px; }
.hero-art .ring.r2 { width: 400px; height: 400px; animation-delay: -2s; }
.hero-art .ring.r3 { width: 500px; height: 500px; animation-delay: -4s; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .55; } 50% { transform: scale(1.05); opacity: 1; } }
.hero-art img {
  position: relative; width: min(300px, 70vw);
  filter: drop-shadow(0 30px 60px rgba(224, 85, 159, 0.45));
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.bubble {
  position: absolute; padding: 10px 14px; border-radius: 14px; font-size: 13px; font-weight: 700;
  background: rgba(33, 20, 48, 0.88); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.bubble.b1 { top: 12%; right: 0; }
.bubble.b2 { bottom: 14%; left: 0; }
.bubble i { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); display: inline-block; }
@media (max-width: 520px) { .bubble { display: none; } }

/* ── الأقسام ── */
section { padding: 80px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 44px; }
.section-head .kicker { color: var(--pink); font-weight: 800; font-size: 13px; letter-spacing: 1px; }
.section-head h2 { font-size: clamp(26px, 4vw, 38px); margin: 6px 0 10px; font-weight: 900; }
.section-head p { color: var(--ink-2); margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature {
  padding: 26px; border-radius: var(--radius); background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line); transition: transform .2s, border-color .2s;
}
.feature:hover { transform: translateY(-4px); border-color: rgba(224, 85, 159, 0.35); }
.feature .ico {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(224, 85, 159, 0.22), rgba(155, 93, 229, 0.22));
  color: #ff9ad2;
}
.feature .ico svg { width: 24px; height: 24px; }
.feature h3 { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.feature p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

/* ── التحميل ── */
#download { background: linear-gradient(180deg, transparent, rgba(155, 93, 229, 0.07), transparent); }
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 960px) { .dl-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }
.dl {
  position: relative; padding: 28px; border-radius: 22px; border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--card-2), var(--card)); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.dl.featured { border-color: rgba(224, 85, 159, 0.5); }
.dl.featured::after {
  content: "الأكثر تحميلاً"; position: absolute; top: -12px; left: 22px; padding: 2px 12px; border-radius: 999px;
  background: var(--pink); color: #fff; font-size: 12px; font-weight: 800;
}
.dl-top { display: flex; align-items: center; gap: 14px; }
.dl-top .os {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: none;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
}
.dl-top .os svg { width: 30px; height: 30px; }
.dl h3 { margin: 0; font-size: 20px; font-weight: 800; }
.dl .sub { color: var(--ink-3); font-size: 13px; }
.dl .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dl .fact { background: rgba(255, 255, 255, 0.04); border-radius: 12px; padding: 8px 10px; text-align: center; }
.dl .fact b { display: block; font-size: 15px; }
.dl .fact span { font-size: 11.5px; color: var(--ink-3); }
.dl .notes { color: var(--ink-2); font-size: 13.5px; white-space: pre-line; max-height: 110px; overflow: auto; }
.dl .btn { width: 100%; margin-top: auto; }
.dl .sha { font-size: 11px; color: var(--ink-3); direction: ltr; text-align: left; word-break: break-all; }
.dl.empty .btn { opacity: .5; pointer-events: none; }

.steps { margin-top: 36px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--pink); font-weight: 800; }
.step p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* ── النسخ السابقة ── */
.history { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.history table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history th, .history td { padding: 12px 14px; text-align: start; border-bottom: 1px solid var(--line); }
.history th { background: rgba(255, 255, 255, 0.04); color: var(--ink-3); font-weight: 700; font-size: 12.5px; }
.history tr:last-child td { border-bottom: 0; }
.history td a { color: #ff9ad2; font-weight: 700; }
.tag { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(52, 195, 143, 0.15); color: #6fe3b6; }
@media (max-width: 640px) { .history .hide-sm { display: none; } }

/* ── الويب ── */
.web-cta {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 36px; border-radius: 26px; border: 1px solid rgba(242, 193, 78, 0.3);
  background: radial-gradient(500px 200px at 10% 0%, rgba(242, 193, 78, 0.16), transparent), var(--card);
}
.web-cta h3 { margin: 0 0 6px; font-size: 24px; font-weight: 900; }
.web-cta p { margin: 0; color: var(--ink-2); }
@media (max-width: 720px) { .web-cta { grid-template-columns: 1fr; text-align: center; } }

footer { padding: 40px 0; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s, transform .6s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, .reveal { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ── الإدارة ── */
.admin-shell { min-height: 100vh; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel h2 { margin: 0 0 14px; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.input, select, textarea {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25); color: var(--ink); font: 500 14px var(--font); outline: none;
}
.input:focus, select:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(224, 85, 159, 0.2); }
textarea { min-height: 84px; resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1; min-width: 140px; }
.drop {
  display: block;
  border: 2px dashed rgba(255, 255, 255, 0.16); border-radius: 16px; padding: 26px; text-align: center;
  color: var(--ink-2); cursor: pointer; transition: border-color .2s, background .2s;
}
.drop.over, .drop:hover { border-color: var(--pink); background: rgba(224, 85, 159, 0.06); }
.drop b { color: var(--ink); }
.progress { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 12px; display: none; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--violet)); transition: width .15s; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stat b { display: block; font-size: 24px; font-weight: 900; }
.stat span { font-size: 12.5px; color: var(--ink-3); }
.rel { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.rel:last-child { border-bottom: 0; }
.rel .os { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.05); }
.rel .os svg { width: 22px; height: 22px; }
.rel .meta { font-size: 12.5px; color: var(--ink-3); }
.rel .title { font-weight: 800; }
.rel .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) { .rel { grid-template-columns: auto 1fr; } .rel .acts { grid-column: 1 / -1; justify-content: flex-start; } }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(30px); opacity: 0;
  padding: 12px 18px; border-radius: 12px; background: #2b1a3d; border: 1px solid var(--line);
  box-shadow: var(--shadow); font-weight: 700; z-index: 50; transition: .25s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { border-color: rgba(239, 79, 107, 0.5); color: #ff9db0; }
.login-card { width: min(420px, 100% - 32px); margin: 12vh auto 0; text-align: center; }
.login-card img { width: 86px; margin: 0 auto 10px; }
.muted { color: var(--ink-3); font-size: 13px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); font: 700 13px var(--font); cursor: pointer; }
.tabs button.on { background: var(--pink); color: #fff; border-color: transparent; }
