/* Base styles for the Game Bài page */
.page-game-bai {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light backgrounds */
  background-color: #f5f5f5; /* A subtle background, assuming body has var(--secondary-color) which is white */
}

/* Color contrast classes */
.page-game-bai__dark-bg {
  background-color: #017439; /* Main brand color */
  color: #ffffff; /* White text for dark background */
}

.page-game-bai__light-bg {
  background-color: #ffffff; /* Auxiliary color / white background */
  color: #333333; /* Dark text for light background */
}

/* Hero Section */
.page-game-bai__hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 10px; /* Small top padding, assuming body handles var(--header-offset) */
  padding-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.page-game-bai__hero-image-wrapper {
  width: 100%;
  max-height: 600px;
  overflow: hidden;
}

.page-game-bai__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.page-game-bai__hero-content {
  position: relative;
  z-index: 10;
  max-width: 900px;
  margin-top: 30px;
  padding: 0 15px;
}

.page-game-bai__main-title {
  font-size: 3.2em;
  font-weight: 700;
  margin-bottom: 20px;
  color: #FFFF00; /* Register/Login font color for contrast on dark green */
  line-height: 1.2;
}

.page-game-bai__description {
  font-size: 1.15em;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* General Section Styling */
.page-game-bai__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.page-game-bai__section-title {
  font-size: 2.5em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
  color: #017439; /* Main brand color for titles on light backgrounds */
}

.page-game-bai__dark-bg .page-game-bai__section-title {
  color: #ffffff; /* White for titles on dark backgrounds */
}

.page-game-bai__text-block {
  font-size: 1.05em;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: justify;
}

/* CTA Buttons */
.page-game-bai__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 30px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.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: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  text-align: center;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-game-bai__btn-primary {
  background-color: #C30808; /* Register/Login color */
  color: #FFFF00; /* Register/Login font color */
  border: 2px solid #C30808;
}

.page-game-bai__btn-primary:hover {
  background-color: #e02a2a;
  border-color: #e02a2a;
}

.page-game-bai__btn-secondary {
  background-color: transparent;
  color: #FFFF00; /* Register/Login font color for contrast on dark green */
  border: 2px solid #FFFF00;
}

.page-game-bai__btn-secondary:hover {
  background-color: #FFFF00;
  color: #C30808;
}

.page-game-bai__btn-small {
  padding: 10px 20px;
  font-size: 0.95em;
}

/* Popular Games Section */
.page-game-bai__game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.page-game-bai__game-card {
  background-color: #017439;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
  color: #ffffff;
}

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

.page-game-bai__game-card-title {
  font-size: 1.6em;
  font-weight: 600;
  margin-bottom: 10px;
  color: #FFFF00; /* Highlight title */
  padding: 0 15px;
}

.page-game-bai__game-card-description {
  font-size: 0.95em;
  margin-bottom: 20px;
  flex-grow: 1;
  padding: 0 15px;
}

/* Why Choose Section */
.page-game-bai__features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.page-game-bai__feature-item {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333333;
}

.page-game-bai__feature-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 20px;
  border-radius: 5px; /* Slightly rounded for feature images */
}

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

.page-game-bai__feature-description {
  font-size: 0.95em;
  line-height: 1.5;
}

/* How To Play Section */
.page-game-bai__step-list {
  list-style: none;
  padding: 0;
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.page-game-bai__step-item {
  background-color: #017439;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  color: #ffffff;
  text-align: center;
}

.page-game-bai__step-title {
  font-size: 1.5em;
  font-weight: 600;
  margin-bottom: 15px;
  color: #FFFF00;
}

.page-game-bai__step-description {
  font-size: 0.95em;
  margin-bottom: 20px;
}

/* Tips Section */
.page-game-bai__tips-list {
  list-style: none;
  padding: 0;
  margin-top: 30px;
}

.page-game-bai__tips-list li {
  background-color: #f0f0f0;
  border-left: 5px solid #017439;
  padding: 15px 20px;
  margin-bottom: 15px;
  border-radius: 5px;
  font-size: 1.05em;
  color: #333333;
}

.page-game-bai__tips-list li strong {
  color: #017439;
}

/* FAQ Section */
.page-game-bai__faq-list {
  margin-top: 30px;
}

.page-game-bai__faq-item {
  background-color: #017439;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-game-bai__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  font-size: 1.15em;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  background-color: #017439;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  list-style: none; /* For details/summary */
}

.page-game-bai__faq-question::-webkit-details-marker {
  display: none;
}

.page-game-bai__faq-item[open] .page-game-bai__faq-question {
  background-color: #005a2d; /* Slightly darker green when open */
}

.page-game-bai__faq-item[open] .page-game-bai__faq-toggle {
  content: '-';
}

.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); /* Change '+' to 'x' visually */
}

.page-game-bai__faq-answer {
  padding: 15px 25px 20px;
  font-size: 1em;
  line-height: 1.6;
  color: #e0e0e0;
  background-color: #005a2d;
}

/* Bottom CTA */
.page-game-bai__cta-bottom-section {
  text-align: center;
  padding-top: 50px;
  padding-bottom: 50px;
}

.page-game-bai__cta-bottom-section .page-game-bai__section-title {
  color: #017439;
}

.page-game-bai__cta-bottom-section .page-game-bai__description {
  color: #555555;
}

/* Global image responsiveness for content area */
.page-game-bai img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-game-bai__main-title {
    font-size: 2.8em;
  }
  .page-game-bai__section-title {
    font-size: 2.2em;
  }
  .page-game-bai__hero-image-wrapper {
    max-height: 500px;
  }
}

@media (max-width: 768px) {
  /* HERO Section */
  .page-game-bai__hero-section {
    padding-bottom: 30px;
  }
  .page-game-bai__hero-image-wrapper {
    max-height: 350px;
  }
  .page-game-bai__hero-content {
    margin-top: 20px;
  }
  .page-game-bai__main-title {
    font-size: 1.8em !important;
    margin-bottom: 15px;
  }
  .page-game-bai__description {
    font-size: 1em;
    margin-bottom: 20px;
  }
  .page-game-bai__cta-buttons {
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
  }
  .page-game-bai__btn-primary,
  .page-game-bai__btn-secondary,
  .page-game-bai a[class*="button"],
  .page-game-bai 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: 12px 20px;
    font-size: 1em;
  }
  .page-game-bai__cta-buttons,
  .page-game-bai__button-group,
  .page-game-bai__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;
  }

  /* General Sections */
  .page-game-bai__container {
    padding: 30px 15px;
  }
  .page-game-bai__section-title {
    font-size: 1.8em;
    margin-bottom: 25px;
  }
  .page-game-bai__text-block {
    font-size: 0.95em;
    text-align: left;
  }

  /* Image Responsiveness */
  .page-game-bai img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-game-bai__section,
  .page-game-bai__card,
  .page-game-bai__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Game Grid */
  .page-game-bai__game-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-game-bai__game-card-image {
    height: 180px;
  }

  /* Features Grid */
  .page-game-bai__features-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  /* How To Play Steps */
  .page-game-bai__step-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Tips List */
  .page-game-bai__tips-list li {
    font-size: 1em;
    padding: 12px 15px;
  }

  /* FAQ Section */
  .page-game-bai__faq-question {
    font-size: 1em;
    padding: 15px 20px;
  }
  .page-game-bai__faq-answer {
    font-size: 0.9em;
    padding: 10px 20px 15px;
  }
}

@media (max-width: 480px) {
  .page-game-bai__main-title {
    font-size: 1.5em !important;
  }
  .page-game-bai__section-title {
    font-size: 1.5em;
  }
  .page-game-bai__hero-image-wrapper {
    max-height: 250px;
  }
}