:root {
  --brand: #6366f1;
  --brand-2: #8b5cf6;
  --brand-gradient: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  
  /* الوضع الليلي - Bento Grid */
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-2: #334155;
  --muted: #94a3b8;
  --text: #f8fafc;
  --text-strong: #ffffff;
  
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  --input-bg: #0f172a;
  --input-border: #334155;
  --input-focus: rgba(99, 102, 241, 0.25);
}

body.light-mode {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --muted: #64748b;
  --text: #334155;
  --text-strong: #0f172a;
  --input-bg: #f8fafc;
  --input-border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 12px 20px -5px rgba(0, 0, 0, 0.08);
}

body {
  font-family: "Cairo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Navbar */
.navbar {
  background: var(--panel) !important;
  border-bottom: 1px solid var(--input-border);
  box-shadow: var(--shadow);
}
.navbar-brand { color: var(--text-strong) !important; }

/* Bento Cards (تعوض الـ card-glass القديمة) */
.bento-card {
  background: var(--panel);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  position: relative;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(99, 102, 241, 0.4);
}

/* صورة الألعاب */
.game-poster-wrap {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.game-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.game-poster-wrap:hover .game-poster { transform: scale(1.05); }

/* نصوص وإضافات البطاقة */
.game-card-body { padding: 1rem; }
.game-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Inputs & Buttons */
.form-control, .form-select {
  background: var(--input-bg);
  color: var(--text-strong);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--input-focus);
  background: var(--input-bg);
  color: var(--text-strong);
}

.btn-primary {
  background: var(--brand-gradient);
  border: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(99, 102, 241, 0.3);
}

/* Bottom Sheet Modal للموبايل (تصميم عصري) */
.modal-content {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--input-border);
  border-radius: 20px;
}
.modal-header { border-bottom-color: var(--input-border); }
.modal-footer { border-top-color: var(--input-border); }

@media (max-width: 768px) {
  .modal-dialog.bottom-sheet {
    display: flex;
    align-items: flex-end;
    min-height: 100%;
    margin: 0;
  }
  .modal-dialog.bottom-sheet .modal-content {
    border-radius: 24px 24px 0 0;
    border: none;
    border-top: 1px solid var(--input-border);
  }
}

/* =========================================
   مكونات الأدمن والخصائص الفرعية (لم يتم حذف شيء)
   ========================================= */

/* أزرار الفلترة */
.type-filter-btn {
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 18px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--muted);
  transition: all 0.2s ease;
}
.type-filter-btn.active {
  background: var(--brand-gradient);
  color: #fff;
  border-color: transparent;
}

/* بطاقة اللعبة المخفية */
.bento-card.card-hidden {
  border-style: dashed !important;
  border-color: #ef4444 !important;
  opacity: 0.8;
}

/* زر إخفاء/إظهار اللعبة للأدمن */
.btn-toggle-eye {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.btn-toggle-eye.is-hidden { background: #ef4444; border-color: #ef4444; }

/* زر المفضلة */
.btn-wishlist {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  z-index: 10;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

/* الشارات (Badges) */
.badge-special-floating {
  position: absolute;
  top: 10px;
  inset-inline-end: 45px;
  z-index: 3;
}
.badges-type-floating {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 2;
  display: flex;
  gap: 5px;
}
.badge-hidden-floating {
  position: absolute;
  bottom: 10px;
  inset-inline-end: 10px;
  z-index: 3;
}

/* أزرار Special Product للأدمن */
.btn-special-product {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}
.btn-special-product:hover { background: #f59e0b; color: #fff; }

/* Subcategories Items */
.subcat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--panel-2);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}
.subcat-item.offer-hidden {
  opacity: 0.6;
  border: 1px dashed #ef4444;
}

/* السعر في المودال */
.price-usd-tag {
  background: var(--input-bg);
  color: var(--text-strong);
  font-weight: 800;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--brand);
}

/* رأس نافذة الألعاب داخل المودال */
.modal-game-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--panel-2);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
.modal-game-img {
  width: 60px; height: 60px;
  border-radius: 10px;
  object-fit: cover;
}