/* Apex Store — base (كل الصفحات) */
@font-face { font-family: 'Zain'; font-weight: 400; font-display: swap; src: url(../assets/fonts/zain-400-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Zain'; font-weight: 400; font-display: swap; src: url(../assets/fonts/zain-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193, U+2212; }
@font-face { font-family: 'Zain'; font-weight: 700; font-display: swap; src: url(../assets/fonts/zain-700-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Zain'; font-weight: 700; font-display: swap; src: url(../assets/fonts/zain-700-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193, U+2212; }
@font-face { font-family: 'Zain'; font-weight: 800; font-display: swap; src: url(../assets/fonts/zain-800-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Zain'; font-weight: 800; font-display: swap; src: url(../assets/fonts/zain-800-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193, U+2212; }
@font-face { font-family: 'Zain'; font-weight: 900; font-display: swap; src: url(../assets/fonts/zain-900-arabic.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: 'Zain'; font-weight: 900; font-display: swap; src: url(../assets/fonts/zain-900-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2190-2193, U+2212; }

:root {
  --bg: #05070d; --line: rgba(255,255,255,.07); --hair: rgba(255,255,255,.055);
  --fg: #f2f6fb; --muted: #a2adbd; --dim: #687386;
  --s: #38bdf8; --s2: #7dd3fc; --s3: #a5f3fc; --navy: #0a2a66; --blue: #0a6cff;
  --ok: #34d399; --amber: #fbbf24; --rose: #fb7185; --blurple: #5865f2;
  --grad: linear-gradient(100deg, #0a6cff, #38bdf8 50%, #67e8f9);
  --card: linear-gradient(145deg, #111723, #0a0e16);
  --ink: #021026;
  --mono: ui-monospace, 'Cascadia Code', Consolas, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { background: var(--bg); color: var(--fg); font-family: 'Zain', system-ui, sans-serif; font-size: 18px; line-height: 1.6; overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
[hidden] { display: none !important; }
::selection { background: var(--s); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
svg.i.f { fill: currentColor; stroke: none; }
.mono { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.num { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }

/* الخلفية: مربعات خفيفة + ضوء سماوي يتجوّل فيها ويشعل المربعات (نفس TiTans) */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(50% 40% at 50% 0%, rgba(56,189,248,.13), transparent 70%); }
.bg::before, .bg::after { content: ''; position: absolute; inset: 0; background-size: 56px 100px; background-position: center top; }
.bg::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0 0v34'/%3E%3C/svg%3E"); opacity: .06; }
.bg::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' fill='none' stroke='%2338bdf8' stroke-width='1.4'%3E%3Cpath d='M28 66L0 50V16L28 0l28 16v34L28 66zm0 0v34'/%3E%3C/svg%3E"); opacity: .8;
  -webkit-mask-image: radial-gradient(circle, #000, transparent 70%); mask-image: radial-gradient(circle, #000, transparent 70%);
  -webkit-mask-size: 720px 720px; mask-size: 720px 720px; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  animation: bg-roam 18s ease-in-out infinite alternate; }
@keyframes bg-roam {
  0% { -webkit-mask-position: 85% 10%; mask-position: 85% 10%; }
  50% { -webkit-mask-position: 15% 40%; mask-position: 15% 40%; }
  100% { -webkit-mask-position: 70% 90%; mask-position: 70% 90%; }
}

/* هوفر البطاقات (نفس TiTans): ترتفع شوي + توهج سماوي من الأسفل فقط + الأيقونة ترسم نفسها */
.hov { transition: transform .2s ease, box-shadow .2s ease; }
.hov:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 30px 26px -22px rgba(56,189,248,.7); }
.hov:hover .ic svg, .hov:hover .cv-ic svg { animation: ic-draw .7s cubic-bezier(.65,0,.35,1) both; }
@keyframes ic-draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .25; } to { stroke-dasharray: 1; stroke-dashoffset: 0; opacity: 1; } }
main, nav, footer { position: relative; z-index: 1; }

/* الشعار */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 38px; height: 38px; border-radius: 50%; }
.brand b { font-weight: 900; letter-spacing: .14em; font-size: 16px; direction: ltr; white-space: nowrap; }
.brand b span { color: var(--s); }

/* الشريط العلوي */
nav.top { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px clamp(16px, 5vw, 56px); background: rgba(5,7,13,.92); border-bottom: 1px solid var(--line); }
.nav-links { display: flex; gap: 2px; padding: 5px; border-radius: 999px; border: 1px solid rgba(255,255,255,.08); background: #0c111b; }
.nav-links a { padding: 7px 16px; border-radius: 999px; font-size: 16px; font-weight: 700; color: var(--muted); transition: .2s; white-space: nowrap; }
.nav-links a:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.nav-links a.on { color: var(--s); background: rgba(56,189,248,.1); }
.nav-side { display: flex; align-items: center; gap: 8px; }
.nav-side .cur { margin-inline-end: 10px; }
.nav-burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: #0c111b; place-items: center; font-size: 20px; }
.nav-drawer { display: none; }

/* الحساب والعملة في الشريط */
.acc, .cur { position: relative; }
.acc-btn, .cur-btn { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 5px; border-radius: 999px; border: 1px solid rgba(255,255,255,.1); background: #0c111b; font-weight: 800; font-size: 15px; transition: border-color .2s; }
html[dir="rtl"] .acc-btn { padding: 0 5px 0 12px; }
.cur-btn { padding: 0 12px; border-color: transparent; background: transparent; border-radius: 10px; transition: background .2s, border-color .2s; }
.cur-btn:hover, .cur-btn.open { border-color: rgba(255,255,255,.08) !important; background: rgba(255,255,255,.06); }
.acc-btn:hover, .cur-btn:hover, .acc-btn.open, .cur-btn.open { border-color: rgba(56,189,248,.4); }
.acc-btn > svg:last-child, .cur-btn > svg:last-child { font-size: 15px; color: var(--dim); transition: transform .2s; }
.acc-btn.open > svg:last-child, .cur-btn.open > svg:last-child { transform: rotate(180deg); }
.acc-btn b { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc .av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15px; color: var(--ink); background: var(--grad); overflow: hidden; flex-shrink: 0; }
.acc .av img { width: 100%; height: 100%; object-fit: cover; }
.acc-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 70; width: 240px; padding: 6px; border-radius: 16px; background: #0b101a; border: 1px solid rgba(255,255,255,.1); box-shadow: 0 24px 50px -20px rgba(0,0,0,.9); animation: rise .18s ease both; }
.acc-h { display: flex; align-items: center; gap: 10px; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); min-width: 0; }
.acc-h b { display: block; font-size: 15.5px; font-weight: 900; line-height: 1.2; }
.acc-h small { color: var(--dim); font-size: 12px; }
.acc-menu a, .acc-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; font-size: 15.5px; font-weight: 700; color: #d3dbe6; text-align: start; transition: background .15s, color .15s; }
.acc-menu a svg, .acc-menu button svg { font-size: 17px; color: var(--s); }
.acc-menu a:hover, .acc-menu button:hover { background: rgba(255,255,255,.05); color: #fff; }
.acc-menu .out { color: #fda4af; margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.acc-menu .out svg { color: var(--rose); }
.cur-menu { width: 210px; }
.cur-btn b { font-size: 14.5px; letter-spacing: .04em; }
.cur-btn span { color: var(--s); font-weight: 900; }
.cur-menu button.on { background: rgba(56,189,248,.1); color: #fff; }
.cur-menu button.on small { color: var(--s2); }
.cur-menu .flag { width: 26px; height: 18px; border-radius: 4px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.cur-menu small { margin-inline-start: auto; font-size: 12.5px; color: var(--dim); }
.acc-menu button svg.flag { color: inherit; font-size: inherit; }

/* الأزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 13px 26px; border-radius: 14px; font-size: 17.5px; font-weight: 800; border: 1px solid transparent; transition: transform .2s, filter .2s, background .2s, border-color .2s; white-space: nowrap; }
.btn svg { font-size: 19px; }
.btn-sm { padding: 8px 16px; font-size: 15px; border-radius: 11px; }
.btn-sm svg { font-size: 16px; }
.btn-grad { background: var(--grad); color: var(--ink); box-shadow: 0 12px 30px -14px rgba(56,189,248,.8); }
.btn-grad:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn-dark { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); }
.btn-dark:hover { background: rgba(255,255,255,.09); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { transform: translateY(-2px); }
.btn-dc { background: var(--blurple); color: #fff; }
.btn-dc:hover { filter: brightness(1.1); transform: translateY(-2px); }
.btn-danger { background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.3); color: #fecdd3; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; filter: none; }
.ibtn { width: 40px; height: 40px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 18px; flex-shrink: 0; transition: .2s; }
.ibtn.dc { background: var(--blurple); color: #fff; }
.ibtn.dc:hover { filter: brightness(1.12); }
.ibtn.ghost { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); color: var(--muted); }
.ibtn.ghost:hover { color: var(--fg); border-color: rgba(56,189,248,.4); }

/* عناصر تحكم */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 15px; font-weight: 800; color: var(--muted); }
.inp { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.09); outline: none; font-size: 16.5px; transition: border-color .2s, box-shadow .2s; }
select.inp { cursor: pointer; color-scheme: dark; }
.inp:focus { border-color: rgba(56,189,248,.55); box-shadow: 0 0 0 4px rgba(56,189,248,.12); }
.inp.bad { border-color: rgba(251,113,133,.6); box-shadow: 0 0 0 4px rgba(251,113,133,.1); }
.search { position: relative; }
.search svg { position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); color: var(--dim); font-size: 18px; pointer-events: none; }
.search .inp { padding-inline-start: 42px; }
.seg { display: inline-flex; padding: 4px; gap: 3px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.07); flex-wrap: wrap; }
.seg button { padding: 7px 15px; border-radius: 10px; font-size: 15.5px; font-weight: 800; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; transition: .2s; white-space: nowrap; }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--grad); color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 8px; font-size: 13.5px; font-weight: 800; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); color: #d3dbe6; white-space: nowrap; }
.chip.s { color: var(--s2); background: rgba(56,189,248,.1); border-color: rgba(56,189,248,.22); }
.chip svg { font-size: 13px; }
.pill-st { display: inline-flex; align-items: center; gap: 6px; padding: 2px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 800; white-space: nowrap; }
.pill-st i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-st.ok { background: rgba(52,211,153,.13); color: #6ee7b7; }
.pill-st.off { background: rgba(251,113,133,.13); color: #fda4af; }
.pill-st.warn { background: rgba(251,191,36,.13); color: #fcd34d; }
.pill-st.mute { background: rgba(255,255,255,.06); color: var(--muted); }

/* البطاقة العامة */
.panel { position: relative; background: var(--card); border: 1px solid var(--hair); border-radius: 22px; padding: 24px; }

/* الأقسام */
.sec { padding: 80px clamp(16px,6vw,72px); }
.in { max-width: 1200px; margin: 0 auto; }
.head { text-align: center; max-width: 760px; margin: 0 auto 44px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; margin-bottom: 8px; padding: 5px 14px; border-radius: 999px; background: rgba(56,189,248,.08); border: 1px solid rgba(56,189,248,.2); color: var(--s2); }
.head h2 { font-size: clamp(30px,4.2vw,52px); font-weight: 900; line-height: 1.2; text-wrap: balance; }
.head p { color: var(--muted); font-size: clamp(17px,2vw,20px); line-height: 1.7; margin-top: 10px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.sec-h h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 900; }
.sec-h h2::before { content: ''; width: 4px; height: 24px; border-radius: 4px; background: var(--grad); }
.sec-h h2 svg { color: var(--s); font-size: 22px; }
.sec-h a { color: var(--muted); font-size: 15.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; transition: color .2s; }
.sec-h a:hover { color: var(--s); }
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
[data-reveal].shown { opacity: 1; transform: none; }

/* الفوتر */
footer.foot { border-top: 1px solid var(--line); margin-top: 60px; background: rgba(5,7,13,.6); }
.foot-in { max-width: 1200px; margin: 0 auto; padding: 46px clamp(16px,5vw,40px) 30px; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 30px; }
.foot-about p { color: var(--muted); font-size: 15.5px; line-height: 1.7; margin-top: 12px; max-width: 320px; }
.foot-col h4 { font-size: 17px; font-weight: 900; margin-bottom: 12px; }
.foot-col a { display: block; color: var(--muted); font-size: 15.5px; font-weight: 700; padding: 3px 0; transition: color .2s; width: fit-content; }
.foot-col a:hover { color: var(--s); }
.foot-bar { max-width: 1200px; margin: 0 auto; padding: 18px clamp(16px,5vw,40px); border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--dim); font-size: 14.5px; }
.foot-bar b { color: var(--s); }

/* المودال */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 18px; background: rgba(2,4,8,.78); opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-box { width: min(560px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; border-radius: 22px; background: #0b101a; border: 1px solid rgba(255,255,255,.09); box-shadow: 0 40px 80px -30px rgba(0,0,0,.9); transform: translateY(12px) scale(.98); transition: transform .25s; }
.modal.open .modal-box { transform: none; }
.modal-box.wide { width: min(860px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal-h h3 { font-size: 20px; font-weight: 900; display: flex; align-items: center; gap: 9px; }
.modal-h h3 svg { color: var(--s); }
.modal-h .x { margin-inline-start: auto; }
.modal-b { padding: 20px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 30px); opacity: 0; z-index: 100; display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 14px; background: #0b101a; border: 1px solid rgba(56,189,248,.35); box-shadow: 0 20px 50px -20px rgba(0,0,0,.9); font-weight: 800; transition: .3s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { color: var(--s); font-size: 20px; }
.toast.bad { border-color: rgba(251,113,133,.4); } .toast.bad svg { color: var(--rose); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; }

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-burger { display: grid; }
  .nav-drawer.open { display: grid; gap: 4px; position: sticky; top: 67px; z-index: 59; padding: 10px clamp(16px,5vw,56px) 14px; background: #070a12; border-bottom: 1px solid var(--line); }
  .nav-drawer a { padding: 10px 14px; border-radius: 12px; font-weight: 800; color: var(--muted); }
  .nav-drawer a.on { color: var(--s); background: rgba(56,189,248,.08); }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-about { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .sec { padding-block: 56px; }
  .nav-side .btn span { display: none; }
  .nav-side .btn { padding: 9px 12px; }
  .acc-btn b, .acc-btn > svg:last-child, .cur-btn > svg:last-child { display: none; }
  .acc-btn { padding: 0 4px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
