/* Определяем дополнительные переменные для отступов, если они не определены в основных стилях */
.top-games-section {
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --border-radius-md: 15px;
  --border-radius-lg: 20px;
  --shadow-md: 0 8px 25px rgba(0,0,0,0.1);
  --shadow-lg: 0 15px 35px rgba(0,0,0,0.15);
}

/* Уникальные стили для сетки лучших игр на главной странице */
.top-games-section .hero-games-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

/* Общие стили для всех карточек игр с наложением */
.top-games-section .game-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  height: 100%;
}

/* Стили для карточек-ссылок */
.top-games-section .game-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.top-games-section .game-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.top-games-section .game-card-link:visited {
  color: inherit;
}

.top-games-section .game-card-link:focus {
  outline: 2px solid rgba(255, 215, 0, 0.8);
  outline-offset: 2px;
}

.top-games-section .game-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.top-games-section .game-card .game-image {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.top-games-section .game-card .game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-games-section .game-card .game-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0) 100%);
}

.top-games-section .game-card .game-info-wrapper {
  padding: var(--spacing-lg);
  color: white;
}

.top-games-section .game-card .game-title {
  font-size: 1.3rem;
  margin-bottom: var(--spacing-xs);
  color: white;
  text-shadow: 0 0 5px rgba(255,215,0,0.7), 0 0 10px rgba(255,215,0,0.4); /* Золотая тень */
  letter-spacing: 0.5px;
  -webkit-text-fill-color: unset;
}

.top-games-section .game-card .game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
  margin-top: var(--spacing-xs);
}

.top-games-section .game-card .game-rating {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  z-index: 3;
  border-radius: 50px;
  padding: 8px 12px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.top-games-section .game-card .developer-info,
.top-games-section .game-card .platforms-info {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  margin-top: var(--spacing-xs);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.top-games-section .game-card .developer-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}

.top-games-section .game-card .developer-link:hover {
  color: white;
  border-bottom-color: white;
}

.top-games-section .genre-tag {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(5px);
  color: white;
  padding: 5px 12px;
  border-radius: var(--border-radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-block;
}

.top-games-section .genre-tag:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-2px);
}

.genre-tag:hover {
  background: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-2px);
}

/* Стили для первой игры - на весь экран */
.top-games-section .game-card-hero {
  grid-column: span 12;
  height: 500px;
}

.top-games-section .game-card-hero .game-title {
  font-size: 2rem;
  text-shadow: 0 0 10px rgba(255,215,0,0.9), 0 0 15px rgba(255,215,0,0.5); /* Усиленная золотая тень для главной игры */
}

.top-games-section .game-card-hero .game-info-wrapper {
  padding: var(--spacing-xl); /* Ещё больший отступ для топ-1 игры */
}

/* Добавляем индикатор топ-1 для героической карточки */
.top-games-section .game-card-hero::before {
  content: "TOP 1";
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  background: linear-gradient(135deg, #ff7a18, #af002d);
  color: white;
  padding: 8px 15px;
  border-radius: 50px;
  font-weight: 700;
  z-index: 3;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

/* Стили для игр во второй строке (2 игры) */
.top-games-section .game-card-large {
  grid-column: span 6;
  height: 350px;
}

.top-games-section .game-card-large::before {
  content: attr(data-rank);
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  background: linear-gradient(135deg, #764ba2, #667eea);
  color: white;
  padding: 6px 12px;
  border-radius: 50px;
  font-weight: 700;
  z-index: 3;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  font-size: 0.85rem;
}

.top-games-section .game-card-large .game-title {
  font-size: 1.5rem;
}

/* Стили для игр в третьей строке (3 игры) */
.top-games-section .game-card-medium {
  grid-column: span 4;
  height: 300px;
}

.top-games-section .game-card-medium::before {
  content: attr(data-rank);
  position: absolute;
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  background: linear-gradient(135deg, #7f7fd5, #86a8e7);
  color: white;
  padding: 5px 10px;
  border-radius: 50px;
  font-weight: 700;
  z-index: 3;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  font-size: 0.8rem;
}

.top-games-section .game-card-medium .game-title {
  font-size: 1.2rem;
}

/* Стили для игр в четвертой строке (4 игры) */
.top-games-section .game-card-small {
  grid-column: span 3;
  height: 250px;
}

.top-games-section .game-card-small .game-title {
  font-size: 1.1rem;
}

/* Изменяем внешний вид рейтинга */
.top-games-section .game-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-weight: 700;
  font-size: 0.9rem;
  width: auto;
}

.top-games-section .rating-excellent {
  background: linear-gradient(135deg, #02aab0, #00cdac);
  color: white;
}

.top-games-section .rating-good {
  background: linear-gradient(135deg, #00b4db, #0083b0);
  color: white;
}

.top-games-section .rating-average {
  background: linear-gradient(135deg, #f2994a, #f2c94c);
  color: white;
}

.top-games-section .rating-poor {
  background: linear-gradient(135deg, #eb3349, #f45c43);
  color: white;
}

/* Адаптивность для маленьких экранов */
@media (max-width: 1400px) {
	.top-games-section .game-card-small {
		grid-column: span 4;
		height: 250px;
	}
}

@media (max-width: 1200px) {
  .top-games-section .game-card-hero {
    height: 450px;
  }
  
  .top-games-section .game-card-large {
    grid-column: span 6;
    height: 300px;
  }
  
  .top-games-section .game-card-medium {
    grid-column: span 6;
    height: 280px;
  }
  
  .top-games-section .game-card-small {
	grid-column: span 6;
	height: 280px;
  }
  
  .top-games-section .game-card-hero .game-info-wrapper {
    padding: var(--spacing-lg);
  }
}

@media (max-width: 992px) {
  .top-games-section .game-card-hero {
    height: 400px;
  }
  
  .top-games-section .game-card-hero .game-title {
    font-size: 1.7rem;
  }
}

@media (max-width: 768px) {
  .top-games-section .hero-games-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }
  
  .top-games-section .game-card-hero {
    height: 370px;
    grid-column: span 1;
  }
  
  .top-games-section .game-card-hero .game-title {
    font-size: 1.5rem;
  }
  
  .top-games-section .game-card-large,
  .top-games-section .game-card-medium,
  .top-games-section .game-card-small {
    grid-column: span 1;
    height: 250px;
  }
  
  .top-games-section .game-card .game-info-wrapper {
    padding: var(--spacing-md);
  }
}

@media (max-width: 480px) {
  .top-games-section .game-card-hero {
    height: 320px;
  }
  
  .top-games-section .game-card-hero .game-title {
    font-size: 1.3rem;
  }
  
  .top-games-section .game-card-large,
  .top-games-section .game-card-medium,
  .top-games-section .game-card-small {
    height: 220px;
  }
  
  .top-games-section .game-card .game-info-wrapper {
    padding: var(--spacing-sm);
  }
  
  .top-games-section .game-card .game-rating,
  .top-games-section .game-card::before {
    font-size: 0.8rem;
    padding: 5px 8px;
  }
}