/* style/game-bai.css */
.page-game-bai {
  font-family: Arial, sans-serif;
  color: #333333; /* Default text color for light background */
  line-height: 1.6;
  background-color: #FFFFFF; /* Explicitly set for clarity, though shared.css might handle body */
}

/* Helper classes for contrast */
.page-game-bai__dark-bg {
  background-color: #017439;
  color: #FFFFFF;
}

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

.page-game-bai__section-title--light,
.page-game-bai__section-description--light {
  color: #FFFFFF;
}

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

/* Buttons */
.page-game-bai__btn-primary,
.page-game-bai__btn-secondary,
.page-game-bai__game-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
  cursor: pointer;
  max-width: 100%; /* Ensure responsiveness */
  box-sizing: border-box;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-game-bai__btn-primary {
  background-color: #017439; /* Main brand color */
  color: #FFFFFF;
  border: 2px solid #017439;
}

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

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

.page-game-bai__btn-secondary:hover {
  background-color: #f0f0f0;
  color: #005a2d;
  border-color: #005a2d;
}

.page-game-bai__game-card-btn {
  background-color: #C30808; /* Login/Register color */
  color: #FFFF00; /* Login/Register font color */
  border: 2px solid #C30808;
  padding: 10px 20px;
  font-size: 15px;
}

.page-game-bai__game-card-btn:hover {
  background-color: #a00606;
  border-color: #a00606;
}

/* Images */
.page-game-bai img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Hero Section */
.page-game-bai__hero-section {
  padding-top: 10px; /* Small top padding, assuming body handles header offset */
  padding-bottom: 40px;
  background-color: #FFFFFF; /* Default light background */
}

.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: #333333;
}

.page-game-bai__hero-title {
  font-size: clamp(2.5rem, 5vw, 3.2rem); /* H1 font size clamp */
  font-weight: bold;
  line-height: 1.2;
  margin-bottom: 15px;
  color: #017439;
  max-width: 600px; /* Limit width for better readability */
}

.page-game-bai__hero-description {
  font-size: 1.1rem;
  margin-bottom: 25px;
  max-width: 600px;
}

.page-game-bai__hero-cta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

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

.page-game-bai__hero-side-image {
  max-width: 600px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* Intro Section */
.page-game-bai__intro-section {
  padding: 60px 0;
  text-align: center;
}

.page-game-bai__section-title {
  font-size: 2.2rem;
  font-weight: bold;
  margin-bottom: 20px;
  color: #017439;
}

.page-game-bai__section-description {
  font-size: 1.1rem;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

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

.page-game-bai__feature-item {
  text-align: center;
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 4px 12px 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;
  height: 240px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #017439;
  box-shadow: 0 0 0 8px rgba(1, 116, 57, 0.2);
}

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

.page-game-bai__feature-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #017439;
}

.page-game-bai__feature-text {
  font-size: 1rem;
  color: #555555;
}

/* Games Section */
.page-game-bai__games-section {
  padding: 60px 0;
  text-align: center;
}

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

.page-game-bai__game-card {
  background-color: #1a1a1a; /* Dark background for card, contrasting with light text */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  color: #FFFFFF;
  text-align: left;
}

.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.4rem;
  font-weight: bold;
  margin: 15px 15px 10px;
}

.page-game-bai__game-card-title a {
  color: #FFFF00; /* Yellow for game titles */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-game-bai__game-card-title a:hover {
  color: #ffe000;
}

.page-game-bai__game-card-text {
  font-size: 1rem;
  margin: 0 15px 20px;
  flex-grow: 1; /* Push button to bottom */
  color: #e0e0e0;
}

.page-game-bai__game-card-btn {
  margin: 0 15px 15px;
  align-self: flex-start; /* Align button to start */
}

.page-game-bai__full-list-cta {
  margin-top: 50px;
}

/* Guide Section */
.page-game-bai__guide-section {
  padding: 60px 0;
  text-align: center;
}

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

.page-game-bai__guide-step {
  background-color: #f9f9f9;
  padding: 25px;
  border-radius: 12px;
  text-align: left;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.page-game-bai__guide-step-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 10px;
  color: #017439;
}

.page-game-bai__guide-step-text {
  font-size: 1rem;
  color: #555555;
}

.page-game-bai__guide-cta {
  margin-top: 50px;
}

/* FAQ Section */
.page-game-bai__faq-section {
  padding: 60px 0;
  text-align: center;
}

.page-game-bai__faq-list {
  max-width: 900px;
  margin: 40px auto 0;
  text-align: left;
}

.page-game-bai__faq-item {
  background-color: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px 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: bold;
  color: #017439;
  cursor: pointer;
  list-style: none; /* Remove default marker for details summary */
}

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

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

.page-game-bai__faq-toggle {
  font-size: 1.5rem;
  line-height: 1;
  margin-left: 15px;
  width: 20px;
  text-align: center;
}

.page-game-bai__faq-answer {
  padding: 0 25px 20px;
  font-size: 1rem;
  color: #555555;
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.page-game-bai__faq-item[open] .page-game-bai__faq-answer {
  max-height: 500px; /* Adjust as needed for content */
  padding-top: 10px;
}

.page-game-bai__faq-answer p {
  margin-bottom: 10px;
}
.page-game-bai__faq-answer p:last-child {
  margin-bottom: 0;
}
.page-game-bai__faq-answer a {
    color: #017439;
    text-decoration: underline;
}
.page-game-bai__faq-answer a:hover {
    color: #005a2d;
}


/* Final CTA Section */
.page-game-bai__cta-final-section {
  padding: 60px 0;
  text-align: center;
}

.page-game-bai__cta-final-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap; /* Allow buttons to wrap */
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-game-bai__hero-container {
    flex-direction: column;
    text-align: center;
  }

  .page-game-bai__hero-content,
  .page-game-bai__hero-image {
    flex: 1 1 100%;
    max-width: 800px;
  }

  .page-game-bai__hero-title,
  .page-game-bai__hero-description {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  
  .page-game-bai__hero-cta {
    justify-content: center;
  }
}

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

  .page-game-bai__content-area {
    padding: 20px 15px !important;
  }

  /* Hero Section */
  .page-game-bai__hero-section {
    padding-top: 10px !important; /* Small top padding, assuming body handles header offset */
    padding-bottom: 20px;
  }

  .page-game-bai__hero-container {
    padding: 20px 15px;
    gap: 15px;
  }

  .page-game-bai__hero-title {
    font-size: clamp(2rem, 8vw, 2.5rem);
    margin-bottom: 10px;
  }

  .page-game-bai__hero-description {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .page-game-bai__hero-cta {
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px;
  }

  /* Buttons general mobile adaptation */
  .page-game-bai__btn-primary,
  .page-game-bai__btn-secondary,
  .page-game-bai__game-card-btn,
  .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; /* Allow text wrapping */
    word-wrap: break-word !important; /* Allow text wrapping */
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-game-bai__hero-cta,
  .page-game-bai__cta-final-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
    flex-direction: column; /* Stack vertically for final CTA too */
  }

  /* Intro Section - Features Grid */
  .page-game-bai__intro-section {
    padding: 30px 0;
  }

  .page-game-bai__section-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
  }

  .page-game-bai__section-description {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .page-game-bai__features-grid {
    grid-template-columns: 1fr; /* Single column */
    gap: 20px;
  }

  .page-game-bai__icon-box-media {
    width: 200px !important; /* Still square */
    height: 200px !important; /* Still square */
    margin-bottom: 10px;
    border-width: 3px;
    box-shadow: 0 0 0 6px rgba(1, 116, 57, 0.15);
  }

  /* Games Section */
  .page-game-bai__games-section {
    padding: 30px 0;
  }

  .page-game-bai__game-list {
    grid-template-columns: 1fr; /* Single column */
    gap: 20px;
  }

  .page-game-bai__game-card {
    text-align: center; /* Center content in cards */
  }

  .page-game-bai__game-card-title {
    font-size: 1.2rem;
    margin: 10px 15px 8px;
  }

  .page-game-bai__game-card-text {
    font-size: 0.95rem;
    margin: 0 15px 15px;
  }

  .page-game-bai__game-card-btn {
    align-self: center; /* Center button in cards */
    width: calc(100% - 30px) !important; /* Adjust for padding */
  }

  .page-game-bai__full-list-cta {
    margin-top: 30px;
  }

  /* Guide Section */
  .page-game-bai__guide-section {
    padding: 30px 0;
  }

  .page-game-bai__guide-steps {
    grid-template-columns: 1fr; /* Single column */
    gap: 20px;
  }

  .page-game-bai__guide-step {
    padding: 20px;
  }

  .page-game-bai__guide-step-title {
    font-size: 1.2rem;
  }

  .page-game-bai__guide-step-text {
    font-size: 0.95rem;
  }

  .page-game-bai__guide-cta {
    margin-top: 30px;
  }

  /* FAQ Section */
  .page-game-bai__faq-section {
    padding: 30px 0;
  }

  .page-game-bai__faq-list {
    margin-top: 20px;
  }

  .page-game-bai__faq-question {
    padding: 15px 20px;
    font-size: 1rem;
  }

  .page-game-bai__faq-toggle {
    font-size: 1.3rem;
  }

  .page-game-bai__faq-answer {
    padding: 0 20px 15px;
    font-size: 0.95rem;
  }

  /* Final CTA Section */
  .page-game-bai__cta-final-section {
    padding: 30px 0;
  }

  .page-game-bai__cta-final-buttons {
    margin-top: 25px;
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px;
  }

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

  /* Exception for circular feature images */
  .page-game-bai__icon-box-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  /* Container padding for mobile */
  .page-game-bai__hero-section,
  .page-game-bai__intro-section,
  .page-game-bai__games-section,
  .page-game-bai__guide-section,
  .page-game-bai__faq-section,
  .page-game-bai__cta-final-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important; /* Prevent horizontal scroll */
  }

  /* Ensure content area itself also has padding for small screens */
  .page-game-bai__content-area {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}