@font-face {
  font-family: "Cairo";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("../fonts/Cairo-Variable.woff2") format("woff2");
}

:root {
  --font: "Cairo", "Segoe UI", "Noto Sans Arabic", Tahoma, system-ui, sans-serif;
  --bg: #070504;
  --bg-2: #120a07;
  --ink: #fff6e4;
  --ink-2: #f0dcb0;
  --muted: #cbb792;
  --gold: #f3c24a;
  --gold-2: #e0a228;
  --gold-deep: #a86a14;
  --amber: #ffb347;
  --surface: rgba(28, 18, 10, .72);
  --surface-solid: #1a110b;
  --border: rgba(243, 194, 74, .28);
  --border-strong: rgba(255, 214, 130, .5);
  --ring: rgba(243, 194, 74, .55);
  --danger: #ff8d7a;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(243, 194, 74, .12);
  --radius: 22px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(232, 160, 40, .18), transparent 55%),
    radial-gradient(700px 480px at -10% 10%, rgba(120, 50, 10, .35), transparent 50%),
    radial-gradient(circle at 50% 0%, #1a1008, var(--bg) 58%);
}
body::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: -1;
  background: conic-gradient(from 180deg at 70% -10%, rgba(243, 194, 74, .09), transparent 18%, rgba(255, 179, 71, .05), transparent 42%);
  animation: den-drift 36s linear infinite;
  opacity: .8;
}
@keyframes den-drift { to { transform: rotate(1turn); } }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; color: #ffe7a3; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
.container { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
main { flex: 1; padding: 16px 0 56px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.skip {
  position: absolute; inset-inline-start: 12px; top: -60px;
  background: var(--gold); color: #1a1004; padding: 8px 14px; border-radius: 10px; z-index: 100; font-weight: 800;
}
.skip:focus { top: 12px; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  background: color-mix(in srgb, #0b0705 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 12px; min-height: 68px; flex-wrap: wrap; padding: 8px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--ink) !important; text-decoration: none !important; min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(180deg, #fff6d6, #f3c24a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(243, 194, 74, .45), 0 8px 24px -8px rgba(243, 194, 74, .8);
}
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-links a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 700; text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { background: rgba(243, 194, 74, .14); color: var(--gold); }
.nav-tools { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.who-name { font-size: .82rem; color: var(--muted); font-weight: 700; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  height: 40px; min-width: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 .85rem var(--font); cursor: pointer; text-decoration: none !important;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--gold); }
.menu-btn { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 8px 20px; border-radius: 14px;
  font: 800 .95rem var(--font); border: 1px solid transparent; cursor: pointer;
  text-decoration: none !important; white-space: nowrap; transition: transform .2s var(--ease), box-shadow .2s;
}
.btn-primary {
  background: linear-gradient(180deg, #ffe08a, #d3921e);
  color: #1a1004 !important;
  box-shadow: 0 12px 28px -12px rgba(243, 194, 74, .9);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 32px -12px rgba(243, 194, 74, 1); }
.btn-accent { background: linear-gradient(180deg, #ffd08a, #c45a10); color: #1a1004 !important; }
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--ink) !important; border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--gold) !important; }
.btn-danger { background: transparent; color: var(--danger) !important; border-color: rgba(255, 141, 122, .45); }

/* platform install buttons */
.btn-install { width: 100%; white-space: normal; height: auto; min-height: 54px; font-size: 1rem; letter-spacing: .01em; }
.btn-android { background: linear-gradient(135deg, #7ddea0, #1f8f4e); color: #06210f !important; }
.btn-huawei { background: linear-gradient(135deg, #ffd19a, #e15a12); color: #2a1004 !important; }
.btn-ios { background: linear-gradient(135deg, #f7f7f7, #c9cdd4); color: #151515 !important; }
.btn-web, .btn-desktop { background: linear-gradient(135deg, #ffe08a, #c4841e); color: #1a1004 !important; }

.hero {
  display: grid; gap: 22px; justify-items: center; text-align: center;
  padding: 12px 0 8px;
}
.hero-emblem {
  position: relative; width: min(220px, 58vw); aspect-ratio: 1; display: grid; place-items: center;
}
.hero-emblem .mane-glow {
  position: absolute; inset: -18%;
  background: conic-gradient(from 0deg, #f3c24a, #7a3a10, #ffd978, #3a1a08, #f3c24a);
  filter: blur(22px);
  border-radius: 50%;
  animation: spin 18s linear infinite;
  opacity: .7;
}
.hero-emblem img {
  position: relative; width: 100%; height: 100%; border-radius: 28%;
  box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .8), 0 0 0 1px rgba(243, 194, 74, .35);
  z-index: 1;
}
@keyframes spin { to { transform: rotate(1turn); } }
.eyebrow, .kicker {
  margin: 0 0 6px; font-weight: 800; color: var(--gold);
  letter-spacing: .08em; font-size: .85rem;
}
h1 { font-size: clamp(1.7rem, 6vw, 2.8rem); line-height: 1.25; margin: 0 0 10px; }
h1 .gold { background: linear-gradient(180deg, #fff6d6, #f3c24a); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 1.3rem; margin: 0 0 14px; }
h3 { margin: 0 0 6px; font-size: 1.05rem; }
.lead { font-size: 1.05rem; color: var(--ink-2); margin: 0 0 18px; max-width: 44rem; }
.hero .lead { margin-inline: auto; }
.lead.tight, .muted.tight, p.tight { margin-bottom: 8px; }
.muted { color: var(--muted); }
.hero-actions, .detail-actions, .page-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.page-head { justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.block { margin-top: 36px; min-width: 0; max-width: 100%; }
.block-head { margin-bottom: 14px; }
.block-head h2 { margin: 0; }

.search-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0;
  padding: 12px; align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.search-bar input[type="search"] { flex: 2 1 180px; min-width: 0; }
.search-bar select { flex: 1 1 140px; min-width: 0; }
.search-bar .btn { flex: 1 1 100%; }
.search-bar input, .search-bar select,
.stack-form input, .stack-form select, .stack-form textarea {
  width: 100%; min-height: 46px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  font: 600 .95rem var(--font); background: #140d09; color: var(--ink);
}
.stack-form textarea { min-height: 120px; resize: vertical; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; padding: 16px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none !important;
  color: var(--ink); font-weight: 800; min-width: 0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
}
.cat-tile:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 0 24px rgba(243, 194, 74, .18); }
.cat-orb {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.35rem;
  background: radial-gradient(circle at 30% 25%, #ffe7a3, #c4841e 62%, #5a2a0c);
  box-shadow: 0 0 18px rgba(243, 194, 74, .35);
}
.cat-tile span { overflow-wrap: anywhere; font-size: .9rem; }

.app-card, .stage-card, .chart-row, .tips-card, .flash, .empty, .narrow, .admin-card, .meta-grid, .table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  min-width: 0;
}
.app-card { transform-style: preserve-3d; transition: transform .2s var(--ease), box-shadow .2s; }
.app-card a, .stage-card a, .chart-row a {
  display: flex; gap: 12px; padding: 12px; color: inherit; text-decoration: none !important;
  min-width: 0; align-items: flex-start;
}
.app-icon, .detail-icon {
  width: 64px; height: 64px; border-radius: 16px; object-fit: cover;
  background: #2a1a0c; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(243, 194, 74, .2);
}
.detail-icon { width: 88px; height: 88px; border-radius: 22px; }
.app-icon-fallback { display: grid; place-items: center; font-size: 1.6rem; }
.app-card-body { min-width: 0; }
.app-card-body h3 { overflow-wrap: anywhere; }
.app-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }

.stage-card a { display: grid; gap: 12px; padding: 16px; }
.stage-card .stage-visual { display: flex; gap: 14px; align-items: center; min-width: 0; }
.stage-card .app-icon { width: 92px; height: 92px; border-radius: 24px; }
.stage-card h3 { font-size: 1.35rem; }
.pick-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800;
  background: linear-gradient(180deg, #ffe08a, #d3921e); color: #1a1004;
}

.rail {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  min-width: 0; max-width: 100%;
}
.rail .app-card { flex: 0 0 min(280px, 82%); scroll-snap-align: start; }

.charts { display: grid; gap: 8px; }
.chart-row a { align-items: center; }
.chart-rank {
  flex: 0 0 36px; font-weight: 900; font-size: 1.2rem; color: var(--gold); text-align: center;
}
.chart-row:nth-child(1) .chart-rank { color: #ffe7a3; }
.chart-meta { margin-inline-start: auto; color: var(--muted); font-size: .85rem; font-weight: 700; white-space: nowrap; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 999px; font-size: .75rem; font-weight: 800;
  background: rgba(243, 194, 74, .12); color: var(--ink-2); border: 1px solid var(--border);
}
.badge-android { background: rgba(46, 180, 100, .15); color: #b6f5ce; border-color: rgba(46, 180, 100, .35); }
.badge-huawei { background: rgba(225, 90, 18, .18); color: #ffd0a8; border-color: rgba(255, 170, 80, .35); }
.badge-ios { background: rgba(220, 220, 230, .12); color: #e8eaf0; border-color: rgba(200, 200, 210, .3); }
.badge-web, .badge-desktop { background: rgba(243, 194, 74, .14); color: var(--gold); }
.badge-official { background: rgba(243, 194, 74, .22); color: #ffe7a3; border-color: var(--gold-2); }

.chip {
  display: inline-flex; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--ink-2); font-weight: 700; font-size: .86rem; text-decoration: none !important;
}
.chip-on, .chip:hover { background: rgba(243, 194, 74, .16); color: var(--gold); border-color: var(--gold-2); }
.sub-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }

.app-detail { display: grid; gap: 20px; min-width: 0; max-width: 100%; position: relative; }
.app-detail > * { min-width: 0; max-width: 100%; }
.detail-glow {
  position: absolute; inset: -40px -8px auto; height: 260px;
  background-size: cover; background-position: center;
  filter: blur(40px) saturate(1.3);
  opacity: .35; pointer-events: none; z-index: 0;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.detail-top, .detail-actions, .meta-grid, .shots { position: relative; z-index: 1; }
.detail-top { display: flex; gap: 16px; align-items: flex-start; min-width: 0; max-width: 100%; width: 100%; }
.detail-top > div { min-width: 0; flex: 1 1 0; }
.detail-top h1 { overflow-wrap: anywhere; }
.detail-actions { position: sticky; bottom: 8px; z-index: 5; min-width: 0; max-width: 100%; }
.meta-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; padding: 12px; min-width: 0; max-width: 100%;
}
.meta-grid dt { color: var(--muted); font-size: .8rem; font-weight: 700; }
.meta-grid dd { margin: 0; font-weight: 800; }
.shots {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  min-width: 0; max-width: 100%; width: 100%;
}
.shots img {
  height: 280px; width: auto; max-width: 80vw; border-radius: 16px;
  border: 1px solid var(--border); scroll-snap-align: start; background: #111;
  flex: 0 0 auto; object-fit: contain;
}
.tips-card, .flash, .empty, .narrow { padding: 16px 18px; }
.tips-card ol { margin: 8px 0 0; padding-inline-start: 1.2rem; }
.flash { margin-bottom: 16px; }
.flash-ok { background: rgba(46, 180, 100, .16); border-color: rgba(46, 180, 100, .4); }
.flash-err { background: rgba(180, 40, 30, .22); border-color: rgba(255, 141, 122, .4); }
.narrow { max-width: 640px; margin: 0 auto; width: 100%; }
.wide-form { max-width: 760px; }
.stack-form { display: grid; gap: 14px; margin: 16px 0; }
.stack-form label, .stack-form fieldset { display: grid; gap: 6px; font-weight: 700; margin: 0; padding: 0; border: 0; }
.stack-form legend { font-weight: 800; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.check input { width: auto; min-height: 0; margin-top: 6px; flex-shrink: 0; accent-color: var(--gold-2); }
.check span { font-weight: 500; color: var(--ink-2); overflow-wrap: anywhere; }

.prose p { color: var(--ink-2); }
.legal { max-width: 720px; }
.empty { text-align: center; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; min-width: 480px; }
table.data th, table.data td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { font-size: .8rem; color: var(--muted); }

.admin-card { padding: 14px; margin-bottom: 12px; }
.admin-card-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.admin-card-top img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.reject-form { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 100%; }
.reject-form input { flex: 1 1 100%; min-height: 46px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; font: 600 .9rem var(--font); background: #140d09; color: var(--ink); }

.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, #0b0705 80%, transparent);
  padding: 36px 0 22px; margin-top: auto;
}
.footer-grid { display: grid; gap: 22px; }
.footer-grid h4 { margin: 0 0 8px; color: var(--gold); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-grid a, .footer-grid p { color: var(--muted); font-weight: 600; font-size: .93rem; }
.footer-grid p { margin: 0; max-width: 36rem; }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .86rem; flex-wrap: wrap;
}

@media (min-width: 640px) {
  .search-bar .btn { flex: 0 0 auto; width: auto; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-top: 20px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: 240px 1fr; text-align: start; align-items: center;
    justify-items: start; gap: 40px; padding: 28px 0 10px;
  }
  .hero .lead { margin-inline: 0; }
  .hero-emblem { width: 240px; }
  .cat-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .app-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .meta-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: start; }
  .btn-install { width: auto; min-width: 240px; }
}
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; margin-inline-start: auto; }
  .nav-tools { margin-inline-start: 0; }
  .nav { justify-content: flex-start; }
  .nav-links {
    display: none; width: 100%; flex-direction: column;
    background: var(--surface-solid); border: 1px solid var(--border);
    border-radius: 14px; padding: 8px; order: 5;
  }
  .nav.open .nav-links { display: flex; }
  .who-name { display: none; }
  .brand span { font-size: .95rem; }
  .detail-actions .btn { flex: 1 1 100%; white-space: normal; height: auto; text-align: center; }
}
@media (max-width: 390px) {
  .container { width: min(1120px, calc(100% - 24px)); }
  .btn { min-height: 46px; padding: 8px 14px; }
  .shots img { height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-emblem .mane-glow { filter: blur(16px); opacity: .45; }
  body::after { animation: none; }
}
