.page-index-popular-games {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #ffffff; /* Default text color for dark body background */
  background-color: #0a0a0a; /* Ensure consistency with body background */
}

.page-index-popular-games__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Hero Section */
.page-index-popular-games__hero-section {
  position: relative;
  padding: 100px 0;
  padding-top: var(--header-offset, 120px); /* Adjust for fixed header */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  min-height: 600px;
  background: linear-gradient(135deg, #1A2B4C, #0a0a0a);
}

.page-index-popular-games__hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 20px;
}

.page-index-popular-games__hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.page-index-popular-games__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
}

.page-index-popular-games__hero-title {
  font-size: 3.5em;
  color: #FFD700;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
}

.page-index-popular-games__hero-description {
  font-size: 1.3em;
  color: #f0f0f0;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-index-popular-games__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.page-index-popular-games__btn-primary,
.page-index-popular-games__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
  box-sizing: border-box;
  max-width: 100%;
}

.page-index-popular-games__btn-primary {
  background-color: #FFD700;
  color: #1A2B4C;
  border: 2px solid #FFD700;
}

.page-index-popular-games__btn-primary:hover {
  background-color: #e0b800;
  transform: translateY(-3px);
}

.page-index-popular-games__btn-secondary {
  background-color: transparent;
  color: #FFD700;
  border: 2px solid #FFD700;
}

.page-index-popular-games__btn-secondary:hover {
  background-color: #FFD700;
  color: #1A2B4C;
  transform: translateY(-3px);
}

/* General Section Styling */
.page-index-popular-games__overview-section,
.page-index-popular-games__detailed-games-section,
.page-index-popular-games__advantages-section,
.page-index-popular-games__promotions-section,
.page-index-popular-games__mobile-section,
.page-index-popular-games__faq-section,
.page-index-popular-games__cta-bottom {
  padding: 80px 0;
  text-align: center;
}

.page-index-popular-games__dark-bg {
  background-color: #1A2B4C;
  color: #ffffff;
}

.page-index-popular-games__section-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: #FFD700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.page-index-popular-games__section-description {
  font-size: 1.1em;
  color: #f0f0f0;
  max-width: 900px;
  margin: 0 auto 40px auto;
}

/* Game Grid */
.page-index-popular-games__game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index-popular-games__game-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%; /* Ensure cards have consistent height */
  display: flex;
  flex-direction: column;
}

.page-index-popular-games__game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-index-popular-games__game-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
  min-height: 200px; /* Enforce minimum size */
}

.page-index-popular-games__game-card-title {
  font-size: 1.5em;
  color: #FFD700;
  margin-bottom: 10px;
  flex-grow: 1; /* Allow title to take available space */
}

.page-index-popular-games__game-card-title a {
  color: #FFD700;
  text-decoration: none;
}

.page-index-popular-games__game-card-title a:hover {
  text-decoration: underline;
}

.page-index-popular-games__game-card-text {
  font-size: 1em;
  color: #f0f0f0;
}

/* Detailed Games Section */
.page-index-popular-games__game-category {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-bottom: 80px;
  text-align: left;
}

.page-index-popular-games__game-category:last-child {
  margin-bottom: 0;
}

.page-index-popular-games__game-category--reverse {
  flex-direction: row-reverse;
  text-align: right;
}

.page-index-popular-games__game-category-content {
  flex: 1;
}

.page-index-popular-games__category-title {
  font-size: 2em;
  color: #FFD700;
  margin-bottom: 15px;
}

.page-index-popular-games__category-text {
  font-size: 1.1em;
  color: #f0f0f0;
  margin-bottom: 30px;
}

.page-index-popular-games__category-image {
  width: 50%;
  border-radius: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  min-width: 400px; /* Ensure minimum size */
  min-height: 300px; /* Ensure minimum size */
  object-fit: cover;
}

/* Advantages Section */
.page-index-popular-games__advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-index-popular-games__advantage-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.page-index-popular-games__advantage-title {
  font-size: 1.8em;
  color: #FFD700;
  margin-bottom: 15px;
}

.page-index-popular-games__advantage-text {
  font-size: 1em;
  color: #f0f0f0;
}

/* Promotions Section */
.page-index-popular-games__promotion-cards {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 40px;
}

.page-index-popular-games__promotion-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 45%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.page-index-popular-games__promotion-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 15px;
  min-height: 200px; /* Enforce minimum size */
}

.page-index-popular-games__promotion-title {
  font-size: 1.6em;
  color: #FFD700;
  margin-bottom: 10px;
}

.page-index-popular-games__promotion-text {
  font-size: 1em;
  color: #f0f0f0;
  margin-bottom: 20px;
}

/* Mobile Section */
.page-index-popular-games__mobile-content {
  display: flex;
  align-items: center;
  gap: 50px;
  margin-top: 40px;
  text-align: left;
}

.page-index-popular-games__mobile-image {
  width: 45%;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  min-width: 200px; /* Enforce minimum size */
  min-height: 200px; /* Enforce minimum size */
  object-fit: cover;
}

.page-index-popular-games__mobile-text-block {
  flex: 1;
}

.page-index-popular-games__mobile-subtitle {
  font-size: 2em;
  color: #FFD700;
  margin-bottom: 15px;
}

.page-index-popular-games__mobile-description {
  font-size: 1.1em;
  color: #f0f0f0;
  margin-bottom: 30px;
}

/* FAQ Section */
.page-index-popular-games__faq-list {
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.page-index-popular-games__faq-item {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-index-popular-games__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: bold;
  color: #FFD700;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.05);
  transition: background-color 0.3s ease;
}

.page-index-popular-games__faq-question:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.page-index-popular-games__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  transition: transform 0.3s ease;
}

.page-index-popular-games__faq-item.active .page-index-popular-games__faq-toggle {
  transform: rotate(45deg);
}

.page-index-popular-games__faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 25px;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: #f0f0f0;
  background-color: rgba(255, 255, 255, 0.03);
}

.page-index-popular-games__faq-item.active .page-index-popular-games__faq-answer {
  max-height: 1000px !important; /* Sufficiently large to show content */
  padding: 20px 25px;
}

.page-index-popular-games__faq-answer p {
  margin: 0;
  color: #f0f0f0;
}

/* CTA Bottom Section */
.page-index-popular-games__cta-bottom {
  background: linear-gradient(45deg, #FFD700, #e0b800);
  color: #1A2B4C;
  padding: 80px 0;
}

.page-index-popular-games__cta-bottom .page-index-popular-games__section-title {
  color: #1A2B4C;
  text-shadow: none;
}

.page-index-popular-games__cta-bottom .page-index-popular-games__section-description {
  color: #333333;
}

.page-index-popular-games__cta-bottom .page-index-popular-games__btn-primary {
  background-color: #1A2B4C;
  color: #FFD700;
  border-color: #1A2B4C;
}

.page-index-popular-games__cta-bottom .page-index-popular-games__btn-primary:hover {
  background-color: #0d1e3a;
  border-color: #0d1e3a;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-index-popular-games__hero-title {
    font-size: 2.8em;
  }

  .page-index-popular-games__section-title {
    font-size: 2em;
  }

  .page-index-popular-games__game-category {
    flex-direction: column;
    gap: 30px;
  }

  .page-index-popular-games__game-category--reverse {
    flex-direction: column;
  }

  .page-index-popular-games__game-category-content,
  .page-index-popular-games__category-image {
    width: 100%;
    min-width: unset;
  }

  .page-index-popular-games__game-category--reverse .page-index-popular-games__game-category-content {
    text-align: left;
  }

  .page-index-popular-games__mobile-content {
    flex-direction: column;
    gap: 30px;
  }

  .page-index-popular-games__mobile-image {
    width: 80%;
  }
}

@media (max-width: 768px) {
  .page-index-popular-games {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-index-popular-games__hero-section {
    padding: 60px 0;
    padding-top: var(--header-offset, 120px) !important;
  }

  .page-index-popular-games__hero-title {
    font-size: 2em;
  }

  .page-index-popular-games__hero-description {
    font-size: 1em;
  }

  .page-index-popular-games__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-index-popular-games__btn-primary,
  .page-index-popular-games__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    padding: 12px 20px;
  }

  .page-index-popular-games__overview-section,
  .page-index-popular-games__detailed-games-section,
  .page-index-popular-games__advantages-section,
  .page-index-popular-games__promotions-section,
  .page-index-popular-games__mobile-section,
  .page-index-popular-games__faq-section,
  .page-index-popular-games__cta-bottom {
    padding: 50px 0;
  }

  .page-index-popular-games__section-title {
    font-size: 1.8em;
  }

  .page-index-popular-games__section-description {
    font-size: 0.95em;
  }

  .page-index-popular-games__game-grid {
    grid-template-columns: 1fr;
  }

  .page-index-popular-games__game-card-image {
    height: 250px;
    min-height: 200px !important;
  }

  .page-index-popular-games__category-title {
    font-size: 1.6em;
  }

  .page-index-popular-games__category-text {
    font-size: 0.95em;
  }

  .page-index-popular-games__category-image,
  .page-index-popular-games__mobile-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    min-width: unset !important;
    min-height: 200px !important; /* Ensure min height on mobile */
  }

  .page-index-popular-games__promotion-cards {
    flex-direction: column;
    gap: 20px;
  }

  .page-index-popular-games__promotion-card {
    max-width: 100%;
  }

  .page-index-popular-games__promotion-image {
    height: 200px;
    min-height: 200px !important;
  }

  .page-index-popular-games__mobile-text-block,
  .page-index-popular-games__faq-list {
    padding: 0 15px;
  }

  .page-index-popular-games__faq-question {
    font-size: 1.1em;
    padding: 15px 20px;
  }

  .page-index-popular-games__faq-answer {
    padding: 0 20px;
  }

  .page-index-popular-games__faq-item.active .page-index-popular-games__faq-answer {
    padding: 15px 20px;
  }

  /* Ensure all content containers are within bounds */
  .page-index-popular-games__section,
  .page-index-popular-games__card,
  .page-index-popular-games__container,
  .page-index-popular-games__game-category,
  .page-index-popular-games__mobile-content,
  .page-index-popular-games__promotion-card,
  .page-index-popular-games__faq-list {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
  }
  
  .page-index-popular-games img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-index-popular-games video,
  .page-index-popular-games__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-index-popular-games__video-section,
  .page-index-popular-games__video-container,
  .page-index-popular-games__video-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }
  
  .page-index-popular-games__cta-button,
  .page-index-popular-games__btn-primary,
  .page-index-popular-games__btn-secondary,
  .page-index-popular-games a[class*="button"],
  .page-index-popular-games a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-index-popular-games__cta-buttons,
  .page-index-popular-games__button-group,
  .page-index-popular-games__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }
  .page-index-popular-games__cta-buttons {
    flex-direction: column; 
  }
}

@media (max-width: 480px) {
  .page-index-popular-games__hero-title {
    font-size: 1.8em;
  }
  .page-index-popular-games__section-title {
    font-size: 1.6em;
  }
  .page-index-popular-games__category-title {
    font-size: 1.4em;
  }
  .page-index-popular-games__advantage-title,
  .page-index-popular-games__promotion-title,
  .page-index-popular-games__mobile-subtitle {
    font-size: 1.4em;
  }
}