:root {
  --bg: #07060f;
  --bg-soft: #0d0b1c;
  --card: #141129;
  --card-2: #1a1633;
  --line: rgba(139, 92, 246, 0.18);
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --gold: #f5c542;
  --green: #34d399;
  --red: #f87171;
  --text: #f4f2ff;
  --muted: #9d97c4;
  --grad: linear-gradient(135deg, #8b5cf6, #ec4899);
  --grad-2: linear-gradient(135deg, #22d3ee, #8b5cf6);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --radius: 18px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', 'Cairo', 'Noto Kufi Arabic', Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--violet), var(--pink));
  border-radius: 6px;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}
.glow-1 { width: 480px; height: 480px; background: var(--violet); top: -120px; right: -100px; }
.glow-2 { width: 420px; height: 420px; background: var(--cyan); bottom: -120px; left: -120px; }
.glow-3 { width: 380px; height: 380px; background: var(--pink); top: 40%; left: 30%; opacity: 0.12; }

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 6, 15, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { font-size: 28px; filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.6)); }
.brand-name {
  font-weight: 900;
  font-size: 20px;
  color: var(--text);
  letter-spacing: 1px;
}
.brand-name span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; transition: color 0.2s; }
.nav-links a:hover { color: var(--cyan); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(236, 72, 153, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(236, 72, 153, 0.5); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-cart { background: rgba(139, 92, 246, 0.12); border: 1px solid var(--line); color: var(--text); padding: 11px 18px; }
.btn-cart:hover { background: rgba(139, 92, 246, 0.25); }
.btn-cart span {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 90px 20px 60px;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 40px;
  border: 1px solid var(--line);
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 26px;
  animation: floatY 3s ease-in-out infinite;
}

.hero-title { font-size: clamp(36px, 6vw, 62px); font-weight: 900; line-height: 1.25; margin-bottom: 20px; }
.hero-title span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(236, 72, 153, 0.35));
}

.hero-sub { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0 auto 34px; line-height: 1.8; }

.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 60px;
}
.hstat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 10px;
  backdrop-filter: blur(6px);
}
.hstat b { display: block; font-size: 26px; font-weight: 900; background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hstat span { color: var(--muted); font-size: 13px; }

section { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 70px 20px; }

.section-title { text-align: center; font-size: clamp(26px, 4vw, 38px); font-weight: 900; margin-bottom: 8px; }
.section-title span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 38px; font-size: 16px; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.game-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 14px;
  text-align: center;
  transition: all 0.25s;
  cursor: pointer;
}
.game-tile:hover { transform: translateY(-5px); border-color: var(--violet); box-shadow: 0 12px 35px rgba(139, 92, 246, 0.25); }
.game-tile .g-icon { font-size: 40px; filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5)); }
.game-tile h3 { font-size: 16px; margin-top: 10px; }
.game-tile p { color: var(--muted); font-size: 12px; margin-top: 4px; }

.filter-tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 26px; }
.filter-btn {
  padding: 10px 20px;
  border-radius: 40px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { border-color: var(--violet); color: var(--text); }
.filter-btn.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 20px rgba(236, 72, 153, 0.35); }

.search-wrap { max-width: 520px; margin: 0 auto 30px; }
.search-wrap input {
  width: 100%;
  padding: 14px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12); }
.search-wrap input::placeholder { color: var(--muted); }

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.product-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  cursor: pointer;
  transition: all 0.25s;
  overflow: hidden;
}
.product-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 3px;
  background: var(--grad);
  opacity: 0.6;
}
.product-card:hover { transform: translateY(-6px); border-color: var(--violet); box-shadow: var(--shadow); }

.pc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.pc-icon { font-size: 40px; filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5)); }
.pc-img { display: block; width: 100%; height: 160px; object-fit: cover; border-radius: 12px; border: 1px solid rgba(139, 92, 246, 0.25); margin-bottom: 12px; }
.pm-img { width: 100%; height: 220px; object-fit: cover; border-radius: 14px; border: 1px solid rgba(139, 92, 246, 0.35); margin: 10px 0 14px; }
.pm-img-empty { display: flex; align-items: center; justify-content: center; font-size: 56px; background: rgba(139, 92, 246, 0.08); }
.pc-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 30px;
  background: rgba(245, 197, 66, 0.14);
  color: var(--gold);
  border: 1px solid rgba(245, 197, 66, 0.35);
}
.pc-platform { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.product-card h3 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.product-card .pc-desc { color: var(--muted); font-size: 13px; line-height: 1.7; margin-bottom: 16px; min-height: 44px; }
.pc-price { font-size: 20px; font-weight: 900; background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent; margin-bottom: 2px; }
.pc-price-suffix { color: var(--muted); font-size: 12px; }
.pc-from { color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.pc-cta { text-align: center; color: var(--cyan); font-weight: 800; font-size: 14px; }

.empty-msg { text-align: center; color: var(--muted); font-size: 18px; padding: 40px 0; }

.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.how-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  position: relative;
  transition: all 0.25s;
}
.how-card:hover { transform: translateY(-5px); border-color: var(--cyan); }
.how-num {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 14px;
  box-shadow: 0 8px 22px rgba(236, 72, 153, 0.4);
}
.how-card h3 { font-size: 17px; margin-bottom: 8px; }
.how-card p { color: var(--muted); font-size: 13px; line-height: 1.7; }

.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-list details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.faq-list summary { font-weight: 700; cursor: pointer; font-size: 16px; list-style: none; display: flex; align-items: center; gap: 10px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list details[open] summary { color: var(--cyan); }
.faq-list p { color: var(--muted); margin-top: 12px; line-height: 1.8; font-size: 14px; }

.footer { position: relative; z-index: 1; border-top: 1px solid var(--line); background: rgba(13, 11, 28, 0.6); margin-top: 40px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 46px 20px 26px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; }
.footer h3 { margin-bottom: 12px; font-size: 18px; }
.footer p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a, .footer-social a { color: var(--muted); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.footer-links a:hover, .footer-social a:hover { color: var(--cyan); }
.footer-social { display: flex; flex-direction: column; gap: 10px; }
.copyright { text-align: center; color: var(--muted); font-size: 13px; padding: 18px; border-top: 1px solid var(--line); }

/* ====== Overlays / Modals ====== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 3, 12, 0.8);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay.open { display: flex; animation: fadeIn 0.25s; }

.modal {
  width: min(520px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
  animation: popIn 0.3s;
}
.modal h3 { font-size: 22px; font-weight: 900; margin-bottom: 6px; }
.pm-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 30px;
  background: rgba(245, 197, 66, 0.14);
  color: var(--gold);
  border: 1px solid rgba(245, 197, 66, 0.35);
  margin-bottom: 12px;
}
.pm-desc { color: var(--muted); font-size: 14px; line-height: 1.8; margin-bottom: 18px; }

.price-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.price-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  transition: all 0.2s;
}
.price-opt:hover { border-color: var(--cyan); }
.price-opt.selected { border-color: var(--pink); background: rgba(236, 72, 153, 0.1); box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2); }
.price-opt .qty { font-weight: 800; font-size: 16px; }
.price-opt .amount { font-weight: 900; font-size: 18px; background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.price-opt .per { color: var(--muted); font-size: 12px; }

.pm-note { color: #f0c674; font-size: 13px; background: rgba(245, 197, 66, 0.08); border: 1px dashed rgba(245, 197, 66, 0.3); padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; line-height: 1.7; }
.pm-steps { color: var(--muted); font-size: 13px; margin-bottom: 18px; line-height: 1.8; }
.pm-steps::before { content: '✅ خطوات: '; color: var(--green); font-weight: 800; }

.modal-close {
  position: absolute;
  top: 16px; left: 16px;
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ====== Cart Drawer ====== */
#cart-overlay { justify-content: flex-end; align-items: stretch; padding: 0; }
.cart-drawer {
  width: min(420px, 100vw);
  height: 100%;
  background: linear-gradient(160deg, var(--card-2), var(--card));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s;
  padding: 22px;
}
.cart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.cart-head h3 { font-size: 20px; font-weight: 900; }
.cart-items { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.cart-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.ci-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ci-top b { font-size: 14px; }
.ci-top .ci-icon { font-size: 24px; }
.ci-details { display: flex; justify-content: space-between; align-items: center; }
.ci-qty-control { display: flex; align-items: center; gap: 10px; }
.ci-qty-control button {
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
}
.ci-qty-control button:hover { border-color: var(--cyan); color: var(--cyan); }
.ci-line-price { font-weight: 800; font-size: 15px; background: var(--grad-2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ci-remove {
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: color 0.2s;
}
.ci-remove:hover { color: var(--red); }
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 4px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  margin-top: 14px;
}
.cart-total b { font-size: 22px; font-weight: 900; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ====== Checkout ====== */
.checkout h3 { text-align: center; }
.checkout-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.checkout label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}
.lbl-small { color: #777; font-weight: 400; }
.checkout input, .checkout textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.checkout input:focus, .checkout textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14); }

.co-summary {
  background: rgba(34, 211, 238, 0.06);
  border: 1px dashed rgba(34, 211, 238, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  margin: 6px 0 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.9;
}
.co-summary b { color: var(--cyan); }
.co-error { color: var(--red); font-size: 13px; text-align: center; margin-top: 10px; min-height: 18px; }

.btn-waffy {
  background: linear-gradient(135deg, #0a2540 0%, #125d98 50%, #0a2540 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(18, 93, 152, 0.35);
}
.btn-waffy:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(18, 93, 152, 0.55); }
.btn-waffy:disabled, .btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }
.checkout .btn + .btn { margin-top: 12px; }

.waffy-pay-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(18, 93, 152, 0.08);
}
.waffy-pay-hint {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
}
#waffy-iframe { width: 100%; min-height: 420px; border-radius: 12px; overflow: hidden; background: #fff; }
#waffy-iframe iframe { width: 100%; min-height: 420px; border: none; display: block; }
.waffy-pay-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}

#toast {
  position: fixed;
  bottom: 24px;
  right: 50%;
  transform: translateX(50%) translateY(80px);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 40px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 14px;
  z-index: 400;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: var(--shadow);
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

/* ====== Animations ====== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes slideIn { from { transform: translateX(60px); } to { transform: translateX(0); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ====== Responsive ====== */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  section { padding: 50px 16px; }
  .hero { padding: 60px 16px 40px; }
  #cart-overlay { justify-content: flex-end; }
  #product-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 24px 18px 28px; }
}

/* ====== Mobile (phones) ====== */
@media (max-width: 600px) {
  .hero-title { font-size: clamp(30px, 9vw, 44px); }
  .hero-badge { font-size: 12px; }
  .hero-stats { gap: 12px; }
  .hstat b { font-size: 22px; }
  .hstat span { font-size: 12px; }
  .btn-lg { padding: 14px 22px; font-size: 15px; width: 100%; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .products-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .game-tile { padding: 16px 10px; }
  .game-tile h3 { font-size: 14px; }
  .game-tile p { font-size: 12px; }
  .carid { padding: 14px; }
  .filter-tabs { overflow-x: auto; flex-wrap: nowrap; gap: 8px; padding-bottom: 8px; }
  .filter-btn { flex-shrink: 0; padding: 9px 14px; font-size: 13px; }
  .cart-drawer { width: 100vw; padding: 18px 14px; }
  .checkout input, .checkout textarea { font-size: 16px; }
  .pm-img { height: 180px; }
  .pc-img { height: 150px; }
  .modal h3 { font-size: 19px; }
  .pm-desc { font-size: 13px; }
  .promo-hero { padding: 12px; gap: 10px; flex-direction: column; text-align: center; }
  #waffy-pay-box { padding: 12px; }
}