.page-game-bai {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background-color: #F4F7FB; /* Background color from custom config */
}

.page-game-bai__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Hero Section */
.page-game-bai__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 10px; /* Small top padding, assuming body handles header offset */
  text-align: center;
  min-height: 500px;
  overflow: hidden;
  background-color: #2F6BFF;
  padding-bottom: 50px;
}

.page-game-bai__hero-image {
  width: 100%;
  max-height: 600px; /* Limit height for desktop */
  overflow: hidden;
}

.page-game-bai__hero-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: center;
  aspect-ratio: 16/9;
}

.page-game-bai__hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin-top: 30px;
  padding: 0 20px;
}

.page-game-bai__main-title {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 15px;
  line-height: 1.2;
}

.page-game-bai__hero-description {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: #f0f0f0;
  margin-bottom: 30px;
}

.page-game-bai__cta-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.page-game-bai__btn-primary,
.page-game-bai__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
  box-sizing: border-box;
  max-width: 100%;
}

.page-game-bai__btn-primary {
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  color: #ffffff;
  border: 2px solid transparent;
}

.page-game-bai__btn-primary:hover {
  background: linear-gradient(180deg, #2F6BFF 0%, #4A8BFF 100%);
  box-shadow: 0 4px 15px rgba(47, 107, 255, 0.4);
}

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

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

.page-game-bai__section {
  padding: 60px 0;
  background-color: #F4F7FB;
}

.page-game-bai__section--introduction {
  background-color: #F4F7FB;
}

.page-game-bai__section--popular-games {
  background-color: #F4F7FB;
}

.page-game-bai__section--benefits {
  background-color: #2F6BFF; /* Dark background from brand color */
  color: #ffffff; /* White text for dark background */
}

.page-game-bai__section--guide {
  background-color: #F4F7FB;
}

.page-game-bai__section--faq {
  background-color: #F4F7FB;
}

.page-game-bai__section--cta-bottom {
  background-color: #2F6BFF;
  color: #ffffff;
  padding: 80px 0;
}

.page-game-bai__section-title {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  color: #1F2D3D;
  text-align: center;
  margin-bottom: 40px;
  font-weight: 700;
  line-height: 1.3;
}

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

.page-game-bai__section-description {
  font-size: 1.1rem;
  text-align: center;
  max-width: 800px;
  margin: -20px auto 40px auto;
  color: #555555;
}

.page-game-bai__section-description--white {
  color: #e0e0e0;
}

.page-game-bai__content-area {
  font-size: 1rem;
  line-height: 1.7;
  color: #333333;
  text-align: justify;
}

.page-game-bai__text-block p {
  margin-bottom: 1.2em;
}

/* Games Grid */
.page-game-bai__games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-game-bai__game-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  color: #333333;
}

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

.page-game-bai__card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.page-game-bai__card-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1F2D3D;
  margin: 20px 20px 10px 20px;
}

.page-game-bai__card-title a {
  color: #1F2D3D;
  text-decoration: none;
}

.page-game-bai__card-title a:hover {
  color: #2F6BFF;
}

.page-game-bai__card-description {
  font-size: 0.95rem;
  color: #555555;
  padding: 0 20px;
  flex-grow: 1;
  margin-bottom: 20px;
}

.page-game-bai__game-card .page-game-bai__btn-primary,
.page-game-bai__game-card .page-game-bai__btn-secondary {
  margin: 0 20px 20px 20px;
  width: calc(100% - 40px);
}

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

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

.page-game-bai__benefit-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 30px 20px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #ffffff;
}

.page-game-bai__benefit-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 20px;
}

.page-game-bai__benefit-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 10px;
}

.page-game-bai__benefit-description {
  font-size: 0.95rem;
  color: #e0e0e0;
}

.page-game-bai__cta-center {
  text-align: center;
  margin-top: 50px;
}

/* Guide Section */
.page-game-bai__guide-steps {
  display: flex;
  flex-direction: column;
  gap: 60px;
  margin-top: 40px;
}

.page-game-bai__guide-step {
  display: flex;
  align-items: center;
  gap: 40px;
}

.page-game-bai__guide-step:nth-child(even) {
  flex-direction: row-reverse;
}

.page-game-bai__step-image {
  width: 50%;
  height: auto;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.page-game-bai__step-content {
  width: 50%;
}

.page-game-bai__step-title {
  font-size: 1.8rem;
  color: #1F2D3D;
  margin-bottom: 15px;
  font-weight: 700;
}

.page-game-bai__step-content p {
  font-size: 1rem;
  color: #555555;
  margin-bottom: 20px;
}

/* FAQ Section */
details.page-game-bai__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  background: #fff;
}
details.page-game-bai__faq-item summary.page-game-bai__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
}
details.page-game-bai__faq-item summary.page-game-bai__faq-question::-webkit-details-marker {
  display: none;
}
details.page-game-bai__faq-item summary.page-game-bai__faq-question:hover {
  background: #f5f5f5;
}
.page-game-bai__faq-qtext {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: #1F2D3D;
}
.page-game-bai__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: #666;
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}
details.page-game-bai__faq-item .page-game-bai__faq-answer {
  padding: 0 20px 20px;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: #333333;
}

.page-game-bai__faq-answer p {
  margin-bottom: 1em;
}

.page-game-bai__faq-answer .page-game-bai__btn-secondary {
  margin-top: 10px;
}

/* CTA Bottom Section */
.page-game-bai__cta-bottom-content {
  text-align: center;
  max-width: 900px;
}

/* General Image Styling */
.page-game-bai img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-game-bai__main-title {
    font-size: clamp(2rem, 4.5vw, 3rem);
  }
  .page-game-bai__hero-description {
    font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  }
  .page-game-bai__section-title {
    font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  }
  .page-game-bai__guide-step {
    flex-direction: column;
    gap: 30px;
  }
  .page-game-bai__guide-step:nth-child(even) {
    flex-direction: column;
  }
  .page-game-bai__step-image,
  .page-game-bai__step-content {
    width: 100%;
  }
}

@media (max-width: 849px) {
  .page-game-bai__hero-image img {
    object-fit: contain !important; /* Prevent cropping on smaller screens */
    aspect-ratio: unset !important; /* Allow aspect ratio to adjust freely */
    height: auto !important;
    max-height: 400px;
  }
  .page-game-bai__hero-section {
    padding-top: 10px; /* Ensure small top padding, not header offset */
  }
}

@media (max-width: 768px) {
  .page-game-bai__container {
    padding: 0 15px;
  }
  .page-game-bai__section {
    padding: 40px 0;
  }
  .page-game-bai__main-title {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }
  .page-game-bai__hero-description {
    font-size: clamp(0.9rem, 4vw, 1.1rem);
  }
  .page-game-bai__cta-buttons {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 15px;
  }
  .page-game-bai__btn-primary,
  .page-game-bai__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    font-size: 0.95rem !important;
    padding: 12px 20px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    box-sizing: border-box !important;
  }

  /* Product Grid for mobile: 2 columns */
  .page-game-bai__games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    overflow-x: hidden; /* Prevent horizontal scroll for the grid */
  }

  .page-game-bai__game-card {
    margin-bottom: 0;
  }

  .page-game-bai__card-image {
    height: 150px;
  }

  .page-game-bai__card-title {
    font-size: 1.1rem;
    margin: 15px 15px 8px 15px;
  }

  .page-game-bai__card-description {
    font-size: 0.85rem;
    padding: 0 15px;
    margin-bottom: 15px;
  }
  
  .page-game-bai__game-card .page-game-bai__btn-primary,
  .page-game-bai__game-card .page-game-bai__btn-secondary {
    margin: 0 15px 15px 15px;
    width: calc(100% - 30px);
  }

  .page-game-bai__benefits-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-game-bai__benefit-item {
    padding: 25px 15px;
  }

  .page-game-bai__benefit-icon {
    width: 60px;
    height: 60px;
  }

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

  .page-game-bai__guide-steps {
    gap: 40px;
  }

  .page-game-bai__step-title {
    font-size: 1.5rem;
    text-align: center;
  }
  .page-game-bai__step-content p {
    text-align: center;
  }
  .page-game-bai__step-content .page-game-bai__btn-secondary,
  .page-game-bai__step-content .page-game-bai__btn-primary {
    margin: 10px auto 0 auto;
    display: block;
    width: fit-content;
  }

  details.page-game-bai__faq-item summary.page-game-bai__faq-question { padding: 15px; }
  .page-game-bai__faq-qtext { font-size: 15px; }
  details.page-game-bai__faq-item .page-game-bai__faq-answer { padding: 0 15px 15px; }

  .page-game-bai__cta-bottom-content {
    padding: 0 15px;
  }

  /* General Image & Container Mobile Adaptation */
  .page-game-bai img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }

  .page-game-bai__section,
  .page-game-bai__card,
  .page-game-bai__container,
  .page-game-bai__content-area,
  .page-game-bai__text-block,
  .page-game-bai__hero-section,
  .page-game-bai__hero-content,
  .page-game-bai__cta-bottom-content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden;
  }
  .page-game-bai__text-block p {
    text-align: left;
  }
  .page-game-bai__section-title,
  .page-game-bai__section-description {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Ensuring content area images are not too small */
.page-game-bai__content-area img,
.page-game-bai__text-block img,
.page-game-bai__guide-step img {
  min-width: 200px;
  min-height: 200px;
}

/* Text colors for different backgrounds */
.page-game-bai__dark-bg {
  color: #ffffff; /* Deep blue background, so white text */
}

.page-game-bai__light-bg {
  color: #333333; /* White/light gray background, so dark text */
}

/* Ensure contrast for specific elements */
.page-game-bai__hero-description,
.page-game-bai__section-description--white {
  color: #e0e0e0; /* Slightly off-white for better contrast on blue */
}

.page-game-bai__btn-primary {
  color: #ffffff;
}

.page-game-bai__btn-secondary {
  color: #2F6BFF;
}

.page-game-bai__faq-qtext {
  color: #1F2D3D;
}

.page-game-bai__faq-answer p {
  color: #333333;
}