/* =========================================================
   GameZo.io — Professional Design System v3.0
   شامل: الهيدر، الشريط الجانبي، كروت الألعاب، الفوتر
   متوافق: RTL/LTR، موبايل، تابلت، حاسوب
   ========================================================= */

/* ─── 1. متغيرات النظام ─────────────────────────────────── */
:root {
  /* الألوان الأساسية */
  --bg:            #06060f;
  --bg2:           #0c0c1a;
  --surface:       #111128;
  --surface2:      #181830;
  --border:        rgba(255,255,255,0.06);
  --border-glow:   rgba(139,92,246,0.35);

  /* اللون الرئيسي */
  --accent:        #8b5cf6;
  --accent-light:  #a78bfa;
  --accent-glow:   rgba(139,92,246,0.25);
  --accent-deep:   #6d28d9;

  /* التدرجات */
  --grad-accent:   linear-gradient(135deg, #8b5cf6, #ec4899);
  --grad-card:     linear-gradient(180deg, rgba(139,92,246,0.08) 0%, transparent 100%);
  --grad-bg:       radial-gradient(ellipse at 20% 20%, rgba(139,92,246,0.08) 0%, transparent 60%),
                   radial-gradient(ellipse at 80% 80%, rgba(236,72,153,0.05) 0%, transparent 60%);

  /* الشريط الجانبي */
  --sidebar-w:         72px;
  --sidebar-expanded:  265px;
  --sidebar-bg:        #0a0a19;

  /* الخطوط */
  --font:          'Cairo', 'Outfit', sans-serif;

  /* التحولات */
  --ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --transition:    0.35s var(--ease);

  /* ظلال */
  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-hover:  0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px var(--border-glow);
  --shadow-glow:   0 0 30px var(--accent-glow);

  /* النص */
  --text:          #e2e8f0;
  --text-muted:    #94a3b8;
  --text-dim:      #475569;
}

/* ─── 2. ريست وأساسيات ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  background-image: var(--grad-bg);
  background-attachment: fixed;
}

a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

img { display: block; max-width: 100%; }

/* ─── 3. Scrollbar مخصص ─────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 10px; transition: background var(--transition); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── 4. الشريط الجانبي ─────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  z-index: 5000;
  overflow: hidden;
  transition: width var(--transition);
  display: flex;
  flex-direction: column;
}
[dir="rtl"] .sidebar { right: 0; border-right: none; border-left: 1px solid var(--border); }
[dir="ltr"] .sidebar { left: 0; }

.sidebar:hover { width: var(--sidebar-expanded); box-shadow: 4px 0 30px rgba(0,0,0,0.5); }
[dir="rtl"] .sidebar:hover { box-shadow: -4px 0 30px rgba(0,0,0,0.5); }

/* لوغو الشريط الجانبي */
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  min-height: 72px;
}
.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: transform var(--transition);
}
.sidebar:hover .logo-icon { transform: rotate(-5deg) scale(1.05); }
.sidebar-logo .logo-text {
  font-weight: 900;
  font-size: 18px;
  color: #fff;
  opacity: 0;
  white-space: nowrap;
  margin-inline-start: 14px;
  transition: opacity var(--transition);
  letter-spacing: 0.5px;
}
.sidebar-logo .logo-text span { color: var(--accent-light); }
.sidebar:hover .logo-text { opacity: 1; }

/* بحث الشريط الجانبي */
.sidebar-search-container {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-search-form {
  position: relative;
  height: 38px;
}
.sidebar-search-input {
  width: 100%;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #fff;
  padding-inline-start: 36px;
  padding-inline-end: 10px;
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition), border-color var(--transition);
}
.sidebar-search-input:focus { border-color: var(--accent); }
.sidebar:hover .sidebar-search-input { opacity: 1; pointer-events: auto; }
.sidebar-search-btn {
  position: absolute;
  top: 50%;
  inset-inline-start: 10px;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: color var(--transition);
}
.sidebar-search-btn:hover { color: var(--accent); }
.sidebar:not(:hover) .sidebar-search-btn {
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
}
[dir="rtl"] .sidebar:not(:hover) .sidebar-search-btn {
  inset-inline-start: auto;
  inset-inline-end: 50%;
  transform: translate(50%, -50%);
}

/* قائمة الأقسام */
.category-list {
  list-style: none;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding: 8px 0 40px;
  scrollbar-width: none;
}
.category-list::-webkit-scrollbar { display: none; }

.category-list li a {
  display: flex;
  align-items: center;
  padding: 13px 20px;
  color: var(--text-muted);
  white-space: nowrap;
  transition: all var(--transition);
  position: relative;
  border-radius: 0;
  gap: 16px;
}
.category-list li a::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--grad-accent);
  border-radius: 0 4px 4px 0;
  transition: height var(--transition);
}
.category-list li a:hover::before,
.category-list li a.active::before { height: 70%; }
.category-list li a:hover,
.category-list li a.active {
  color: #fff;
  background: rgba(139,92,246,0.08);
}

.cat-icon {
  min-width: 24px;
  font-size: 18px;
  color: var(--accent-light);
  transition: transform var(--transition);
  text-align: center;
}
.category-list li a:hover .cat-icon { transform: scale(1.2); }

.category-list li a span {
  opacity: 0;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s var(--ease);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar:hover .category-list li a span { opacity: 1; }

/* فاصل في القائمة */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
  opacity: 0;
  transition: opacity var(--transition);
}
.sidebar:hover .sidebar-divider { opacity: 1; }

/* ─── 5. شريط التنقل العلوي ─────────────────────────────── */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 72px;
  margin-inline-start: var(--sidebar-w);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(6,6,15,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  transition: margin var(--transition);
}

.nav-left { display: flex; align-items: center; gap: 12px; }

/* لوغو التنقل */
.nav-logo {
  font-weight: 900;
  font-size: 22px;
  color: #fff;
  letter-spacing: -0.5px;
  white-space: nowrap;
  transition: opacity var(--transition);
}
.nav-logo span { color: var(--accent-light); }
.nav-logo:hover { opacity: 0.85; }

/* زر القائمة المحمول */
.mobile-menu-btn {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}
.mobile-menu-btn:hover { background: var(--surface2); border-color: var(--accent); color: var(--accent); }

/* إجراءات التنقل */
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* زر اللغة */
.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 7px 14px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all var(--transition);
}
.lang-btn:hover { border-color: var(--accent); background: rgba(139,92,246,0.1); }

.flag-icon { width: 22px; height: 15px; object-fit: cover; border-radius: 3px; }

/* قائمة منسدلة */
.dropdown-container { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  min-width: 190px;
  display: none;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: fadeSlideDown 0.2s var(--ease);
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dropdown-container.active .dropdown-menu { display: block; }

.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  color: var(--text-muted);
  font-size: 14px;
  transition: all var(--transition);
}
.dropdown-menu a:hover { background: rgba(139,92,246,0.1); color: #fff; padding-inline-start: 22px; }

/* حبة المستخدم */
.user-pill-v9 {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 6px 14px 6px 6px;
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
}
[dir="rtl"] .user-pill-v9 { padding: 6px 6px 6px 14px; }
.user-pill-v9:hover { border-color: var(--accent); }
.user-pill-v9 .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ─── 6. المحتوى الرئيسي ────────────────────────────────── */
.main-content-wrapper {
  margin-inline-start: var(--sidebar-w);
  min-height: calc(100vh - 72px);
  transition: margin var(--transition);
}

.main-content-area { padding: 28px; }

/* ─── 7. شريط الأقسام الدوّار ───────────────────────────── */
.cats-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 36px;
}
.cats-nav-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
}
.cats-nav-btn:hover { background: var(--accent); border-color: var(--accent); transform: scale(1.08); box-shadow: var(--shadow-glow); }

.cats-container {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 4px;
  flex: 1;
  scrollbar-width: none;
}
.cats-container::-webkit-scrollbar { display: none; }

.cat-circle-item {
  flex: 0 0 auto;
  width: 88px;
  text-align: center;
  text-decoration: none;
  transition: transform var(--transition);
}
.cat-circle-item:hover { transform: translateY(-6px); }

.cat-icon-box {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  overflow: hidden;
  font-size: 28px;
  color: var(--accent-light);
  transition: all var(--transition);
  position: relative;
}
.cat-icon-box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--grad-accent);
  opacity: 0;
  transition: opacity var(--transition);
}
.cat-circle-item:hover .cat-icon-box {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
}
.cat-circle-item:hover .cat-icon-box::after { opacity: 0.15; }
.cat-icon-box img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }

.cat-name-label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}
.cat-circle-item:hover .cat-name-label { color: #fff; }

/* ─── 8. رأس القسم ──────────────────────────────────────── */
.category-section { margin-bottom: 48px; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-icon {
  width: 40px;
  height: 40px;
  background: var(--grad-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.section-title {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.3px;
}
.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.see-all-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.see-all-btn:hover {
  background: rgba(139,92,246,0.1);
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateX(3px);
}
[dir="rtl"] .see-all-btn:hover { transform: translateX(-3px); }

/* ─── 9. شبكة الألعاب ───────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
}

/* بطاقة اللعبة */
.game-card {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-hover);
}
.game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-card);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}
.game-card:hover::after { opacity: 1; }

/* غلاف صورة اللعبة */
.thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface2);
  overflow: hidden;
}

.game-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.game-card:hover .game-thumb { transform: scale(1.06); }

/* بادج الإعجابات */
.like-badge {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  background: rgba(0,0,0,0.75);
  color: #fb7185;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(8px);
  z-index: 5;
  transition: transform var(--transition);
}
.game-card:hover .like-badge { transform: scale(1.1); }

/* بادج جديد */
.new-badge {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  background: var(--grad-accent);
  color: #fff;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  z-index: 5;
}

/* أيقونة تشغيل عند الـ Hover */
.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 3;
}
.game-card:hover .play-overlay { opacity: 1; }
.play-overlay-btn {
  width: 52px;
  height: 52px;
  background: var(--grad-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: scale(0.7);
  transition: transform 0.3s var(--ease);
}
.game-card:hover .play-overlay-btn { transform: scale(1); }

/* فيديو معاينة */
.game-video-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  z-index: 2;
  pointer-events: none;
}
.game-card:hover .game-video-preview { opacity: 1; }

/* اسم اللعبة */
.game-title-h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 12px 14px 14px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
  flex: 1;
  display: flex;
  align-items: center;
}
.game-card:hover .game-title-h3 { color: #fff; }

/* ─── 10. قسم "لعبتها مؤخراً" ──────────────────────────── */
.recently-played-section {
  background: linear-gradient(135deg, rgba(139,92,246,0.06) 0%, rgba(236,72,153,0.03) 100%);
  border: 1px solid rgba(139,92,246,0.18);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.recently-played-section::before {
  content: '';
  position: absolute;
  top: -40px;
  inset-inline-end: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.recent-slider {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.recent-slider::-webkit-scrollbar { display: none; }
.recent-item { flex: 0 0 160px; }

/* ─── 11. Pagination ────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 44px;
  flex-wrap: wrap;
  direction: ltr;
}

.page-link {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all var(--transition);
}
.page-link:hover {
  background: rgba(139,92,246,0.12);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}
.page-active {
  background: var(--grad-accent) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 4px 15px var(--accent-glow);
  pointer-events: none;
}
.page-disabled {
  opacity: 0.3;
  pointer-events: none;
}

/* ─── 12. الفوتر ────────────────────────────────────────── */
.site-footer {
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  margin-inline-start: var(--sidebar-w);
  transition: margin var(--transition);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 52px 32px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand .logo-text {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 14px;
  display: block;
}
.footer-brand .logo-text span { color: var(--accent-light); }
.footer-brand p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.75;
  max-width: 280px;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.social-btn {
  width: 38px;
  height: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  transition: all var(--transition);
}
.social-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px var(--accent-glow);
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a {
  color: var(--text-muted);
  font-size: 14px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-col ul li a:hover { color: var(--accent-light); padding-inline-start: 4px; }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p { color: var(--text-dim); font-size: 13px; }
.footer-bottom-links { display: flex; gap: 20px; }
.footer-bottom-links a { color: var(--text-dim); font-size: 13px; transition: color var(--transition); }
.footer-bottom-links a:hover { color: var(--accent-light); }

/* ─── 13. إشعار الكوكيز ────────────────────────────────── */
#cookie-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(130px);
  opacity: 0;
  pointer-events: none;
  width: calc(100% - 48px);
  max-width: 580px;
  background: var(--surface);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 18px 22px;
  z-index: 10001;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  transition: transform 0.45s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s var(--ease);
}
#cookie-notice.cookie-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
#cookie-notice.cookie-hiding {
  transform: translateX(-50%) translateY(130px);
  opacity: 0;
  pointer-events: none;
}
.cookie-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.cookie-text {
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.cookie-text a { color: var(--accent-light); text-decoration: underline; }
.cookie-btn {
  background: var(--grad-accent);
  color: #fff;
  border: none;
  padding: 9px 22px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font);
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.cookie-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px var(--accent-glow); }

/* ─── 14. Overlay الشريط الجانبي للموبايل ──────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 4999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* ─── 15. بطاقة اللعبة الكبيرة (play page) ─────────────── */
.player-box {
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.iframe-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
  overflow: hidden;
}
.game-splash {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.game-splash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
}
.play-btn-circle {
  width: 86px;
  height: 86px;
  background: var(--grad-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: #fff;
  box-shadow: 0 0 40px var(--accent-glow), 0 0 80px var(--accent-glow);
  cursor: pointer;
  transition: transform var(--transition);
  position: relative;
  z-index: 1;
}
.play-btn-circle:hover { transform: scale(1.1); }
.play-btn-circle::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--grad-accent);
  opacity: 0.4;
  animation: pulse-ring 2s infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ─── 16. تأثيرات عامة ──────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.5s var(--ease) both; }

/* Glassmorphism card */
.glass-card {
  background: rgba(17,17,40,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

/* بادجات الحالة */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.badge-accent { background: rgba(139,92,246,0.15); color: var(--accent-light); border: 1px solid rgba(139,92,246,0.3); }
.badge-fire   { background: rgba(251,113,133,0.12); color: #fb7185; border: 1px solid rgba(251,113,133,0.25); }
.badge-new    { background: var(--grad-accent); color: #fff; }

/* Tags */
.game-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: rgba(139,92,246,0.1);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 50px;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
}
.game-tag:hover { background: var(--accent); color: #fff; border-color: var(--accent); transform: translateY(-2px); }

/* ─── 17. الاستجابة للشاشات ─────────────────────────────── */

/* التابلت الكبير 1280px */
@media (max-width: 1280px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

/* التابلت 1024px */
@media (max-width: 1024px) {
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .main-content-area { padding: 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

/* الموبايل الكبير 768px */
@media (max-width: 768px) {
  /* الشريط الجانبي يصبح Drawer */
  .sidebar {
    width: 260px !important;
    inset-inline-start: -270px;
    box-shadow: none;
    transition: inset-inline-start var(--transition), box-shadow var(--transition) !important;
  }
  [dir="rtl"] .sidebar {
    inset-inline-start: auto;
    inset-inline-end: -270px;
  }
  .sidebar.active {
    inset-inline-start: 0 !important;
    box-shadow: 6px 0 40px rgba(0,0,0,0.7) !important;
  }
  [dir="rtl"] .sidebar.active {
    inset-inline-start: auto !important;
    inset-inline-end: 0 !important;
    box-shadow: -6px 0 40px rgba(0,0,0,0.7) !important;
  }
  .sidebar:hover { width: 260px !important; }
  .sidebar .category-list li a span { opacity: 1; }
  .sidebar .sidebar-search-input { opacity: 1; pointer-events: auto; }
  .sidebar .sidebar-logo .logo-text { opacity: 1; }
  .sidebar .sidebar-divider { opacity: 1; }

  /* التنقل العلوي */
  .top-nav { margin-inline-start: 0 !important; padding: 0 16px; }
  .mobile-menu-btn { display: flex; }

  /* المحتوى الرئيسي */
  .main-content-wrapper { margin-inline-start: 0 !important; }
  .main-content-area { padding: 16px; }

  /* الشبكة */
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* الأقسام */
  .cat-circle-item { width: 72px; }
  .cat-icon-box { width: 62px; height: 62px; }
  .cat-name-label { font-size: 11px; }
  .cats-nav-btn { display: none; }
  .cats-container { width: 100%; }

  /* الفوتر */
  .site-footer { margin-inline-start: 0 !important; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-inner { padding: 36px 20px 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* اللغة والمستخدم */
  .lang-btn span, .user-pill-v9 span { display: none; }

  /* Pagination */
  .pagination { gap: 4px; }
  .page-link { min-width: 36px; height: 36px; font-size: 13px; }

  /* كوكيز */
  #cookie-notice { bottom: 12px; width: calc(100% - 24px); }
}

/* الموبايل الصغير 480px */
@media (max-width: 480px) {
  .game-grid { gap: 8px; }
  .section-title { font-size: 17px; }
  .section-icon { width: 34px; height: 34px; font-size: 14px; }
  .nav-logo { font-size: 18px; }
  .game-title-h3 { font-size: 12px; padding: 9px 10px 11px; }
  .recently-played-section { padding: 16px; }
}

/* الشاشات الكبيرة 1600px+ */
@media (min-width: 1600px) {
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .main-content-area { padding: 36px 40px; }
}

/* ─── 18. حالة الـ Active Sidebar (Hover expanded) ─────── */
@media (min-width: 769px) {
  .sidebar:hover ~ .top-nav,
  .sidebar:hover ~ .main-content-wrapper .top-nav { /* no JS needed for hover */ }
}

/* ─── 19. تحسينات إضافية ────────────────────────────────── */

/* بطاقة لعبة المشاهدة (mini-card) */
.mini-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 12px;
}
.mini-card:hover {
  border-color: var(--border-glow);
  background: var(--surface2);
  transform: translateX(4px);
}
[dir="rtl"] .mini-card:hover { transform: translateX(-4px); }
.mini-card img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.mini-card-info { flex: 1; overflow: hidden; }
.mini-card-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-card-sub { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* شريط الأدوات في صفحة اللعب */
.control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface2);
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.ctrl-btn-group { display: flex; gap: 10px; }
.v9-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-family: var(--font);
  transition: all var(--transition);
  font-weight: 600;
}
.v9-btn:hover { border-color: var(--accent); background: rgba(139,92,246,0.1); color: var(--accent-light); }
.v9-btn.fav-active { background: rgba(251,113,133,0.12); border-color: rgba(251,113,133,0.4); color: #fb7185; }

/* بطاقة المعلومات في صفحة اللعب */
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  margin-top: 22px;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  background: rgba(255,255,255,0.02);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}
.meta-item h5 { color: var(--text-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.meta-item p { color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; margin: 0; }
.meta-icon { color: var(--accent-light); width: 18px; text-align: center; }

/* ─── 20. loader / skeleton ─────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
