/* تحميل خط Winky Sans */
@font-face {
  font-family: 'ShareTech';
  src: url('https://imad.click/fonts/ShareTech-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

/* خلفية وأساسيات */
body {
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  font-family: 'ShareTech', sans-serif;
}

/* البطاقة الوصفية */
.description-card {
  grid-column: span 8;       /* تأخذ عرض 6 أعمدة (كل الشبكة) */
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 20px 30px;
  font-size: clamp(12px, 1.8vw, 16px);
  color: #707070;
  line-height: 1.3;
  text-align: center;
  margin-top: 25px;       /* مسافة تحتها قبل البطاقات الأخرى */
}

/* ✅ تكبير البطاقة عند التمرير */
.description-card:hover {
  transform: scale(1.01);
}

/* شبكة الألعاب */
.category-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr); /* 8 على الكمبيوتر */
  gap: 25px;
  justify-items: center;

  max-width: auto;       /* تحديد أقصى عرض للشبكة */
  margin: 160px auto;      /* توسيط الشبكة عموديًا وأفقيًا */
  padding: 0 175px;         /* مسافة فارغة يمين ويسار */
  box-sizing: border-box;  /* حتى يشمل الحشو داخل العرض الكلي */
}

/* بطاقة اللعبة */
.category-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
  background: rgba(255, 255, 255, 0.15);
  text-align: center;
}

.category-card:hover {
  transform: scale(1.05);
}

/* صورة اللعبة */
.category-card img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  transition: transform 0.3s ease;
}

/* تأثير تكبير الصورة عند التمرير */
.category-card:hover img {
  transform: scale(1.08);
}

/* عنوان اللعبة بأسفل الصورة */
.category-card .game-title {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 6px 8px;
  font-size: clamp(10px, 1.95vw, 14px);
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  text-transform: bold;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  box-sizing: border-box;
}

/* زر Play يظهر عند التمرير */
.category-card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 50px; /* حجم الأيقونة */
  height: 50px;
  background: url('https://imad.click/images/play-icon-white.webp') no-repeat center center;
  background-size: contain;
  opacity: 0;
  transition: all 0.3s ease;
}

/* عند تمرير الماوس تظهر الأيقونة مع تكبير */
.category-card:hover::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}


/* أنيميشن اهتزاز ناعم لاسم اللعبة */
@keyframes title-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  50% { transform: translateX(2px); }
  75% { transform: translateX(-1.5px); }
  100% { transform: translateX(0); }
}

/* تفعيل الاهتزاز عند تمرير الماوس */
.category-card:hover .game-title {
  animation: title-shake 0.6s ease-in-out;
}



/* استجابة للأجهزة اللوحية (تابلت: من 601px حتى 1024px) */
@media (min-width: 601px) and (max-width: 1024px) {
  .description-card {
    grid-column: span 4;
    padding: 15px 15px;
    font-size: clamp(13px, 1.8vw, 17px);
    margin-top: 45px; /* لا نكرر margin-top */
  }

  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 160px auto;
    padding: 0 25px;
  }

  .category-card::after {
    width: 30px;
    height: 30px;
  }

  .category-card .game-title {
    font-size: clamp(9px, 1.95vw, 12px);
  }
}

/* استجابة للهواتف (أقل من 600px) */
@media (max-width: 600px) {
  .description-card {
    grid-column: span 3;
    padding: 10px 10px;
    font-size: clamp(13px, 1.8vw, 18px);
    margin-top: 40px; /* غيّرناها بدل القيم السالبة */
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 100px auto; /* غيّرنا المسافة */
    padding: 0 15px;   /* قللنا البادينغ عشان الهاتف */
  }

  .category-card::after {
    width: 25px;
    height: 25px;
  }

  .category-card .game-title {
    font-size: clamp(12px, 1.95vw, 18px);
  }
}

