/* Base styles for the page */
.page-game-bai {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background-color: #ffffff; /* Explicitly set body background as light */
}

.page-game-bai__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.page-game-bai__section-title {
  font-size: 2.5em;
  color: #017439;
  text-align: center;
  margin-bottom: 30px;
  font-weight: bold;
}

.page-game-bai__paragraph {
  font-size: 1.1em;
  line-height: 1.8;
  margin-bottom: 20px;
  color: #333333;
}

/* Hero Section */
.page-game-bai__hero-section {
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  padding-bottom: 60px;
  background-color: #017439; /* Dark background */
  color: #ffffff; /* Light text */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-game-bai__hero-section .page-game-bai__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.page-game-bai__hero-image-wrapper {
  margin-bottom: 30px;
  width: 100%;
  max-width: 1200px; /* Constrain image width */
}

.page-game-bai__hero-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-game-bai__hero-content {
  max-width: 900px;
}

.page-game-bai__main-title {
  font-size: 3em;
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  max-width: 100%; /* Ensure H1 doesn't overflow */
}

.page-game-bai__lead-text {
  font-size: 1.3em;
  margin-bottom: 40px;
  color: #f0f0f0;
}

.page-game-bai__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%;
}

.page-game-bai__btn-primary,
.page-game-bai__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
  box-sizing: border-box;
  text-align: center;
  max-width: 100%; /* Ensure button doesn't overflow */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word;
}

.page-game-bai__btn-primary {
  background-color: #C30808; /* Register color */
  color: #ffffff; /* Changed from #FFFF00 for contrast */
  border: 2px solid #C30808;
}

.page-game-bai__btn-primary:hover {
  background-color: #e02020;
  transform: translateY(-3px);
}

.page-game-bai__btn-secondary {
  background-color: transparent;
  color: #ffffff;
  border: 2px solid #ffffff;
}

.page-game-bai__btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

/* Intro Section */
.page-game-bai__intro-section {
  padding: 60px 0;
  background-color: #ffffff; /* Light background */
  color: #333333; /* Dark text */
}

/* Popular Games Section */
.page-game-bai__popular-games-section {
  padding: 60px 0;
  background-color: #017439; /* Dark background */
  color: #ffffff; /* Light text */
}

.page-game-bai__popular-games-section .page-game-bai__section-title,
.page-game-bai__popular-games-section .page-game-bai__paragraph {
  color: #ffffff;
}

.page-game-bai__game-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-game-bai__game-card {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-game-bai__game-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.page-game-bai__game-card-image {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

.page-game-bai__game-card-title {
  font-size: 1.5em;
  font-weight: bold;
  margin: 20px 20px 10px;
  color: #ffffff;
}

.page-game-bai__game-card-link {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-game-bai__game-card-link:hover {
  color: #FFFF00; /* Yellow for hover, but not main text */
}

.page-game-bai__game-card-description {
  font-size: 1em;
  margin: 0 20px 20px;
  flex-grow: 1;
  color: #f0f0f0;
}

.page-game-bai__btn-play-now {
  margin: 0 20px 20px;
  align-self: flex-start;
  width: calc(100% - 40px);
}

/* Why Choose GI8 Section */
.page-game-bai__why-choose-gi8-section {
  padding: 60px 0;
  background-color: #ffffff;
  color: #333333;
}

.page-game-bai__features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.page-game-bai__feature-item {
  text-align: center;
  padding: 25px;
  background-color: #f9f9f9;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.page-game-bai__feature-image {
  width: 100%;
  max-width: 250px;
  height: auto;
  object-fit: contain;
  margin: 0 auto 20px;
  display: block; /* Ensure it respects max-width */
}

.page-game-bai__feature-title {
  font-size: 1.4em;
  font-weight: bold;
  margin-bottom: 15px;
  color: #017439;
}

/* Strategy Section */
.page-game-bai__strategy-section {
  padding: 60px 0;
  background-color: #017439;
  color: #ffffff;
}

.page-game-bai__strategy-section .page-game-bai__section-title,
.page-game-bai__strategy-section .page-game-bai__paragraph {
  color: #ffffff;
}

.page-game-bai__strategy-list {
  list-style: none;
  padding: 0;
  margin-top: 40px;
}

.page-game-bai__strategy-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-left: 5px solid #FFFF00; /* Yellow accent */
  padding: 25px;
  margin-bottom: 20px;
  border-radius: 8px;
}

.page-game-bai__strategy-item-title {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 10px;
  color: #FFFF00; /* Yellow text for title */
}

.page-game-bai__cta-buttons--centered {
  margin-top: 40px;
}

/* How To Play Section */
.page-game-bai__how-to-play-section {
  padding: 60px 0;
  background-color: #ffffff;
  color: #333333;
}

.page-game-bai__steps-list {
  list-style: none;
  padding: 0;
  counter-reset: step-counter;
  margin-top: 40px;
}

.page-game-bai__step-item {
  background-color: #f9f9f9;
  padding: 30px;
  margin-bottom: 25px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  padding-left: 80px;
}

.page-game-bai__step-item::before {
  counter-increment: step-counter;
  content: "Bước " counter(step-counter);
  position: absolute;
  left: 25px;
  top: 30px;
  background-color: #017439;
  color: #ffffff;
  font-weight: bold;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
}

.page-game-bai__step-title {
  font-size: 1.4em;
  font-weight: bold;
  margin-bottom: 10px;
  color: #017439;
}

/* FAQ Section */
.page-game-bai__faq-section {
  padding: 60px 0;
  background-color: #017439;
  color: #ffffff;
}

.page-game-bai__faq-section .page-game-bai__section-title {
  color: #ffffff;
}

.page-game-bai__faq-list {
  margin-top: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-game-bai__faq-item {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  color: #ffffff;
}

.page-game-bai__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  color: #ffffff;
  list-style: none; /* For <summary> tag */
}

.page-game-bai__faq-question::-webkit-details-marker {
  display: none; /* Hide default marker for <summary> */
}

.page-game-bai__faq-question::marker {
  display: none; /* Hide default marker for <summary> */
}

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

.page-game-bai__faq-item[open] .page-game-bai__faq-toggle {
  transform: rotate(45deg);
}

.page-game-bai__faq-answer {
  padding: 0 25px 20px;
  font-size: 1.1em;
  color: #f0f0f0;
}

/* Final CTA Section */
.page-game-bai__final-cta-section {
  padding: 60px 0;
  background-color: #ffffff;
  color: #333333;
  text-align: center;
}

.page-game-bai__final-cta-section .page-game-bai__cta-buttons {
  margin-top: 40px;
}

/* Dark/Light Background Helpers */
.page-game-bai__dark-section {
  background-color: #017439;
  color: #ffffff;
}

.page-game-bai__dark-section .page-game-bai__section-title,
.page-game-bai__dark-section .page-game-bai__paragraph,
.page-game-bai__dark-section .page-game-bai__game-card-title {
  color: #ffffff;
}

.page-game-bai__light-bg {
  background-color: #ffffff;
  color: #333333;
}

.page-game-bai__light-bg .page-game-bai__section-title,
.page-game-bai__light-bg .page-game-bai__paragraph {
  color: #017439; /* For titles on light bg */
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-game-bai__main-title {
    font-size: 2.5em;
  }
  .page-game-bai__lead-text {
    font-size: 1.2em;
  }
  .page-game-bai__section-title {
    font-size: 2em;
  }
  .page-game-bai__game-cards-grid,
  .page-game-bai__features-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-game-bai {
    font-size: 16px;
    line-height: 1.6;
  }
  .page-game-bai__container {
    padding: 0 15px !important; /* Important for mobile content area */
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* HERO 主图区域 */
  .page-game-bai__hero-section {
    padding-top: 10px !important;
    padding-bottom: 40px !important;
  }
  .page-game-bai__hero-image-wrapper {
    margin-bottom: 20px !important;
  }
  .page-game-bai__hero-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-game-bai__main-title {
    font-size: 2em !important;
    margin-bottom: 15px !important;
  }
  .page-game-bai__lead-text {
    font-size: 1em !important;
    margin-bottom: 30px !important;
  }
  .page-game-bai__cta-buttons {
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 15px !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  .page-game-bai__btn-primary,
  .page-game-bai__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    padding: 12px 20px !important;
    font-size: 1em !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* 通用图片与容器 */
  .page-game-bai img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  .page-game-bai__section,
  .page-game-bai__card,
  .page-game-bai__container,
  .page-game-bai__game-card,
  .page-game-bai__feature-item,
  .page-game-bai__step-item,
  .page-game-bai__faq-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Popular Games Section (grid) */
  .page-game-bai__game-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .page-game-bai__game-card-image {
    height: 180px !important; /* Adjust for mobile */
  }
  .page-game-bai__game-card-title {
    font-size: 1.3em !important;
  }
  .page-game-bai__btn-play-now {
    width: calc(100% - 30px) !important; /* Adjust padding */
    margin: 0 15px 15px !important;
  }

  /* Why Choose GI8 Section (grid) */
  .page-game-bai__features-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .page-game-bai__feature-image {
    max-width: 200px !important;
  }

  /* Strategy Section */
  .page-game-bai__strategy-item {
    padding: 20px !important;
  }
  .page-game-bai__strategy-item-title {
    font-size: 1.2em !important;
  }

  /* How To Play Section */
  .page-game-bai__step-item {
    padding-left: 70px !important;
  }
}