/* کانتینر اصلی شبکه بازی‌ها */
.games-grid {
  display: grid;
  /* در دسکتاپ: ستون‌های 100 پیکسلی */
  grid-template-columns: repeat(auto-fill, 100px);
  gap: 20px;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

@media screen and (min-width: 1024px) {
  .games-grid {
    padding-left: 0; /* اصلاح padding auto که درست نیست */
    padding-right: 0;
  }
}

/* استایل هر کارت بازی */
.game-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
  cursor: pointer;
  
  /* تنظیم دقیق ابعاد کارت */
  width: 100px;
  height: 100px;
  
  /* استفاده از فلکس برای چیدمان عمودی محتوا */
  display: flex;
  flex-direction: column;
  align-items: center; /* مرکزچین افقی */
  justify-content: flex-start; /* شروع از بالا */
  position: relative;
}

.game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.game-card a {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  height: 100%;
}

/* تصویر بازی */
.card-image {
  width: 100%;
  height: 100%; /* تصویر 70 درصد ارتفاع کارت را بگیرد */
  overflow: hidden;
  background-color: #eee;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.game-card:hover .card-image img {
  transform: scale(1.05);
}

/* اطلاعات زیر عکس */
.card-info {
  height: 30%; /* 30 درصد ارتفاع کارت برای متن */
  width: 100%;
  background-color: #ffffff; /* پس‌زمینه سفید برای متن */

  flex-direction: column;
  justify-content: center; /* مرکزچین عمودی متن */
  align-items: center; /* مرکزچین افقی متن */
  padding: 2px 5px; /* کمی فاصله از لبه‌ها */
  text-align: center;
  overflow: hidden; /* جلوگیری از بیرون زدگی متن */
  
      display: none;

}

.card-info h3 {

  margin: 0;
  font-size: 0.1rem; /* فونت کوچک‌تر برای جا شدن در 30 پیکسل ارتفاع */
  color: #333;
  line-height: 1.1;
  white-space: nowrap; /* جلوگیری از شکستن خط */
  overflow: hidden;
  text-overflow: ellipsis; /* اگر متن طولانی بود، ... بگذارد */
  max-width: 100%;
  
        display: none;

}

.genre-tag {
    
  display: inline-block;
    display: none;

  background-color: #e1f5fe;
  color: #0288d1;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.2rem; /* فونت کوچک‌تر */
  font-weight: bold;
  margin-top: 2px;
}

/* واکنش‌گرا برای موبایل */
@media (max-width: 600px) {
  .games-grid {
    /* دو ستون در موبایل */
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 10px;
    padding-top: 10px;
    
      align-items: center; /* مرکزچین افقی */

  }

  .game-card {
    width: 90%;
    aspect-ratio: 1 / 1;
  }

  .card-image {
    height: 110%; /* ارتفاع بیشتر برای عکس */
  }

  .card-info {
    height: auto; /* ارتفاع خودکار برای متن */
    min-height: 60px;
    padding: 10px;
    
      display: none;

  }

  .card-info h3 {
    font-size: 0.3rem; /* فونت بزرگ‌تر در موبایل */
    white-space: normal; /* اجازه شکستن خط */
    margin-bottom: 5px;
    
      display: none;

  }

  .genre-tag {
    font-size: 0.2rem;
  }
}