:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --text-dark: #333333;
  --text-light: #ffffff;
  --button-register: #C30808;
  --button-login: #C30808;
  --button-font-color: #FFFF00; /* For register/login buttons specifically */
  --header-offset: 120px; /* Default if not set by shared.css body padding */
}

/* Base styles for the page content, ensuring dark text on light body background */
.page-game-bai {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Default text color for light background */
  background-color: var(--secondary-color); /* Assuming body background is light */
}

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

/* Hero Section */
.page-game-bai__hero-section {
  padding-top: 10px; /* Rely on body padding for header offset, only small top padding here */
  padding-bottom: 40px;
  background-color: var(--secondary-color); /* Light background for hero */
}

.page-game-bai__hero-container {
  max-width: 1170px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 40px 16px;
  gap: 24px;
}

.page-game-bai__hero-content {
  flex: 1 1 45%;
  min-width: 300px;
  color: var(--text-dark); /* Ensure dark text on light hero background */
}

.page-game-bai__main-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem); /* Responsive font size for H1 */
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--primary-color); /* Brand color for H1 */
}

.page-game-bai__hero-description {
  font-size: 1.125rem;
  margin-bottom: 30px;
  color: var(--text-dark);
}

.page-game-bai__cta-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap; /* Ensure buttons wrap on smaller screens */
}

.page-game-bai__btn-primary,
.page-game-bai__btn-secondary {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-align: center;
  box-sizing: border-box; /* Crucial for responsive buttons */
  max-width: 100%; /* Crucial for responsive buttons */
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-game-bai__btn-primary {
  background-color: var(--button-register); /* Custom color for register */
  color: var(--button-font-color); /* Custom font color for register/login */
  border: 2px solid var(--button-register);
}

.page-game-bai__btn-primary:hover {
  background-color: #e00b0b; /* Slightly darker red */
  border-color: #e00b0b;
}

.page-game-bai__btn-secondary {
  background-color: var(--button-login); /* Custom color for login */
  color: var(--button-font-color); /* Custom font color for register/login */
  border: 2px solid var(--button-login);
}

.page-game-bai__btn-secondary:hover {
  background-color: #e00b0b; /* Slightly darker red */
  border-color: #e00b0b;
}

.page-game-bai__hero-image {
  flex: 1 1 45%;
  text-align: center;
  min-width: 300px;
}

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

/* General Container */
.page-game-bai__container {
  max-width: 1170px;
  margin: 0 auto;
  padding: 40px 16px;
  box-sizing: border-box;
}

/* Section Titles and Descriptions */
.page-game-bai__section-title {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 20px;
}

.page-game-bai__section-description {
  font-size: 1.125rem;
  color: var(--text-dark);
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px;
}

/* Intro Section */
.page-game-bai__intro-section {
  background-color: var(--secondary-color); /* Light background */
  padding: 60px 0;
}

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

.page-game-bai__feature-item {
  text-align: center;
  padding: 20px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.page-game-bai__feature-item:hover {
  transform: translateY(-5px);
}

.page-game-bai__icon-box-media {
  width: 240px; /* Keep square for desktop */
  height: 240px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--primary-color);
}

.page-game-bai__icon-box-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%; /* Ensure image itself is circular */
  display: block;
}

.page-game-bai__feature-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 10px;
  font-weight: 600;
}

.page-game-bai__feature-text {
  font-size: 1rem;
  color: var(--text-dark);
}

/* Game List Section */
.page-game-bai__game-list-section {
  background-color: var(--primary-color); /* Dark background */
  color: var(--text-light); /* Light text for dark background */
  padding: 60px 0;
}

.page-game-bai__game-list-section .page-game-bai__section-title,
.page-game-bai__game-list-section .page-game-bai__section-description {
  color: var(--text-light); /* Ensure light text on dark background */
}

.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: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

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

.page-game-bai__game-card-content {
  padding: 20px;
  color: var(--text-dark);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.page-game-bai__game-card-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.page-game-bai__game-card-title a {
  color: var(--primary-color); /* Link color */
  text-decoration: none;
}

.page-game-bai__game-card-title a:hover {
  text-decoration: underline;
}

.page-game-bai__game-card-text {
  font-size: 0.95rem;
  margin-bottom: 15px;
  flex-grow: 1;
}

.page-game-bai__game-card-button {
  width: 100%;
  padding: 12px 0;
  font-size: 1rem;
  max-width: 100%; /* Ensure responsive */
  white-space: normal;
  word-wrap: break-word;
}

/* CTA Middle Section */
.page-game-bai__cta-middle-section {
  padding: 80px 0;
  background-color: var(--secondary-color); /* Light background */
}

.page-game-bai__cta-middle-content {
  text-align: center;
}

.page-game-bai__cta-middle-content .page-game-bai__section-title {
  color: var(--primary-color);
}

.page-game-bai__cta-middle-content .page-game-bai__section-description {
  color: var(--text-dark);
  margin-bottom: 50px;
}

.page-game-bai__large-cta-button {
  padding: 18px 40px;
  font-size: 1.25rem;
  background-color: var(--button-register); /* Custom color */
  color: var(--button-font-color); /* Custom font color */
  border: 2px solid var(--button-register);
}

.page-game-bai__large-cta-button:hover {
  background-color: #e00b0b;
  border-color: #e00b0b;
}

/* FAQ Section */
.page-game-bai__faq-section {
  padding: 60px 0;
  background-color: var(--secondary-color); /* Light background */
}

.page-game-bai__faq-list {
  max-width: 800px;
  margin: 40px auto 0;
}

.page-game-bai__faq-item {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-game-bai__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  background-color: #f9f9f9;
  user-select: none;
  list-style: none; /* For details tag */
}

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

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

.page-game-bai__faq-qtext {
  flex-grow: 1;
}

.page-game-bai__faq-toggle {
  font-size: 1.5rem;
  margin-left: 15px;
  transition: transform 0.3s ease;
}

.page-game-bai__faq-item[open] .page-game-bai__faq-toggle {
  transform: rotate(45deg); /* Rotate for 'x' or '-' effect */
}

.page-game-bai__faq-answer {
  padding: 0 25px 20px;
  font-size: 1rem;
  color: var(--text-dark);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.page-game-bai__faq-item[open] .page-game-bai__faq-answer {
  max-height: 500px; /* Arbitrary large value for smooth expansion */
  padding-top: 15px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .page-game-bai {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-game-bai__container {
    padding: 20px 15px !important; /* Mobile padding for general containers */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Universal content section responsive styles */
  .page-game-bai__hero-section,
  .page-game-bai__intro-section,
  .page-game-bai__game-list-section,
  .page-game-bai__cta-middle-section,
  .page-game-bai__faq-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important; /* Prevent horizontal scroll */
  }

  /* HERO Section */
  .page-game-bai__hero-section {
    padding-top: 10px !important; /* Small top padding */
    padding-bottom: 20px !important;
  }
  .page-game-bai__hero-container {
    flex-direction: column;
    padding: 20px 15px;
    gap: 20px;
  }
  .page-game-bai__hero-content,
  .page-game-bai__hero-image {
    flex: 1 1 100%;
    min-width: unset;
  }
  .page-game-bai__main-title {
    font-size: 2.2rem; /* Adjust H1 size for mobile */
    text-align: center;
  }
  .page-game-bai__hero-description {
    font-size: 1rem;
    text-align: center;
  }
  .page-game-bai__cta-buttons {
    flex-direction: column;
    gap: 10px;
  }
  .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-left: 15px;
    padding-right: 15px;
  }
  .page-game-bai__hero-main-image {
    max-width: 100% !important;
    height: auto !important;
    width: 100% !important;
  }

  /* Intro Section - Module 1 */
  .page-game-bai__intro-section {
    padding: 40px 0;
  }
  .page-game-bai__features-grid {
    grid-template-columns: 1fr; /* Single column for features */
    gap: 20px;
  }
  .page-game-bai__icon-box-media {
    width: 200px; /* Still square for mobile, smaller */
    height: 200px;
    border-width: 3px;
  }
  .page-game-bai__feature-title {
    font-size: 1.3rem;
  }
  .page-game-bai__feature-text {
    font-size: 0.95rem;
  }

  /* Game List Section */
  .page-game-bai__game-list-section {
    padding: 40px 0;
  }
  .page-game-bai__game-cards-grid {
    grid-template-columns: 1fr; /* Single column for game cards */
    gap: 20px;
  }
  .page-game-bai__game-card-image {
    height: 180px; /* Adjust image height for mobile cards */
  }
  .page-game-bai__game-card-title {
    font-size: 1.2rem;
  }
  .page-game-bai__game-card-text {
    font-size: 0.9rem;
  }
  .page-game-bai__game-card-button {
    padding: 10px 0;
    font-size: 0.95rem;
  }

  /* CTA Middle Section */
  .page-game-bai__cta-middle-section {
    padding: 50px 0;
  }
  .page-game-bai__cta-middle-content .page-game-bai__section-title {
    font-size: 2rem;
  }
  .page-game-bai__cta-middle-content .page-game-bai__section-description {
    font-size: 1rem;
    margin-bottom: 30px;
  }
  .page-game-bai__large-cta-button {
    padding: 15px 30px;
    font-size: 1.1rem;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* FAQ Section */
  .page-game-bai__faq-section {
    padding: 40px 0;
  }
  .page-game-bai__faq-list {
    margin-top: 20px;
  }
  .page-game-bai__faq-question {
    font-size: 1rem;
    padding: 15px 20px;
  }
  .page-game-bai__faq-answer {
    font-size: 0.95rem;
    padding: 0 20px 15px;
  }
}