body {
  margin:0;
  font-family:Arial;
  direction: rtl;
  background:#635555;
  color:white;
  overflow:auto; /* ✅ تم الإصلاح */
}

/* 🔝 TOP BAR */
#topBar {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between; /* ✅ ترتيب صح */
  padding: 0 20px;
  position: relative;
  background: linear-gradient(90deg,#0f9b8e,#4cc9b0,#ff9e3d,#0f9b8e);
}

/* ☰ زر الجوال */
#menuToggle {
  display: none;
  font-size: 26px;
  cursor: pointer;
  color: white;
}

/* 🔥 المنيو */
#mainMenu {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* عناصر المنيو */
#mainMenu span {
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: 0.3s;
}

#mainMenu span:hover {
  background: rgba(255,255,255,0.15);
}

#mainMenu .active {
  border: 1px solid white;
}

/* 🔍 البحث */
.search-wrapper {
  position: relative;
}

#searchBox {
  width: 200px;
  padding: 10px 40px 10px 15px;
  border-radius: 25px;
  border: none;
  outline: none;
  background: #e6e6e6;
  font-size: 14px;
  color: #333;
}

/* 🔍 أيقونة */
.search-wrapper::before {
  content: "🔍";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}

/* 🎮 الألعاب */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* ✅ ثابت */
  gap: 15px;
  padding: 15px;
}

/* تابلت */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* جوال */
@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* الكارد */
.card {
  background:#1e1e1e;
  border-radius:10px;
  overflow:hidden;
  cursor:pointer;
  transition:0.3s;
}

.card:hover {
  transform: scale(1.05);
}

.card img {
  width:100%;
}

.card h3 {
  margin:0;
  padding:6px;
  font-size:18px;
  text-align:center;
}

/* 📱 الجوال */
@media (max-width: 768px) {

  #menuToggle {
    display: block;
  }

  #mainMenu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 10px;
  background: linear-gradient(180deg, #0f9b8e, #4cc9b0, #ff9e3d);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);    padding: 10px;
    border-radius: 10px;
    z-index: 999;
    width: 200px;
  }

  #mainMenu.show {
    display: flex;
  }

  #mainMenu span {
    padding: 10px;
    border-bottom: 1px solid #333;
  }

  #searchBox {
    width: 120px;
  }
}

/* جوال صغير */
@media (max-width: 480px) {
  #searchBox {
    width: 100px;
  }
}