/* General styles for page-game-bai */
.page-game-bai {
  font-family: 'Arial', sans-serif;
  color: var(--text-main, #FFF3E6); /* Using custom color for text */
  background: var(--background-color, #0D0E12); /* Using custom color for background */
  line-height: 1.6;
}

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

.page-game-bai__section-title {
  font-size: 36px;
  font-weight: 700;
  color: var(--glow-color, #FFB04D); /* Using custom color for titles */
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}

.page-game-bai__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--deep-orange-color, #D96800); /* Using custom color for underline */
  border-radius: 2px;
}

.page-game-bai__sub-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-main, #FFF3E6);
  margin-top: 30px;
  margin-bottom: 15px;
}

.page-game-bai p {
  margin-bottom: 15px;
}

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

/* Hero Section */
.page-game-bai__hero-section {
  position: relative;
  padding-top: 10px; /* Small top padding, assuming body has header offset */
  padding-bottom: 60px;
  overflow: hidden;
  display: flex;
  flex-direction: column; /* Ensure image is above content */
  align-items: center;
}

.page-game-bai__hero-image-wrapper {
  width: 100%;
  max-height: 675px; /* Max height for hero image */
  overflow: hidden;
  margin-bottom: 30px; /* Space between image and content */
}

.page-game-bai__hero-image {
  width: 100%;
  height: 675px; /* Display height */
  object-fit: cover;
  object-position: center;
}

.page-game-bai__hero-content {
  text-align: center;
  max-width: 900px;
  padding: 0 15px;
}

.page-game-bai__main-title {
  font-size: clamp(32px, 5vw, 48px); /* Using clamp for H1 font size */
  font-weight: 800;
  color: var(--text-main, #FFF3E6);
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-game-bai__description {
  font-size: 18px;
  color: #E0E0E0;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-game-bai__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Ensure buttons wrap on smaller screens */
  width: 100%; /* Ensure container takes full width */
  max-width: 600px; /* Limit width for desktop */
  margin: 0 auto;
}

.page-game-bai__btn-primary,
.page-game-bai__btn-secondary,
.page-game-bai__btn-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  box-sizing: border-box;
  max-width: 100%; /* Ensure buttons take full width on mobile */
  white-space: normal;
  word-wrap: break-word;
}

.page-game-bai__btn-primary {
  background: linear-gradient(180deg, var(--auxiliary-color, #FFA53A) 0%, var(--deep-orange-color, #D96800) 100%); /* Custom button gradient */
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px rgba(255, 140, 26, 0.4);
}

.page-game-bai__btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 140, 26, 0.6);
}

.page-game-bai__btn-secondary {
  background: transparent;
  color: var(--glow-color, #FFB04D); /* Custom glow color */
  border: 2px solid var(--border-color, #A84F0C); /* Custom border color */
}

.page-game-bai__btn-secondary:hover {
  background: rgba(255, 140, 26, 0.1);
  transform: translateY(-2px);
}

.page-game-bai__btn-play {
  background: linear-gradient(180deg, var(--auxiliary-color, #FFA53A) 0%, var(--deep-orange-color, #D96800) 100%);
  color: #ffffff;
  border: none;
  font-size: 16px;
  padding: 10px 20px;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(255, 140, 26, 0.3);
}

.page-game-bai__btn-play:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(255, 140, 26, 0.5);
}

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

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

.page-game-bai__content-area {
  max-width: 900px;
  margin: 0 auto;
  color: #E0E0E0;
}

/* Games List Section */
.page-game-bai__games-list-section {
  padding: 60px 0;
  background: var(--card-bg-color, #17191F); /* Custom card background */
}

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

.page-game-bai__game-card {
  background: var(--card-bg-color, #17191F);
  border: 1px solid var(--border-color, #A84F0C); /* Custom border color */
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  padding-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-main, #FFF3E6);
}

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

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

.page-game-bai__game-card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--glow-color, #FFB04D);
  margin-bottom: 10px;
  padding: 0 15px;
}

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

/* Benefits Section */
.page-game-bai__benefits-section {
  padding: 60px 0;
}

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

.page-game-bai__benefit-item {
  background: var(--card-bg-color, #17191F);
  border: 1px solid var(--border-color, #A84F0C);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--text-main, #FFF3E6);
}

.page-game-bai__benefit-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.page-game-bai__benefit-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto 20px;
}

.page-game-bai__benefit-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--glow-color, #FFB04D);
  margin-bottom: 15px;
}

/* Tips Section */
.page-game-bai__tips-section {
  padding: 60px 0;
  background: var(--background-color, #0D0E12);
}

.page-game-bai__article-body {
  max-width: 900px;
  margin: 0 auto;
  color: #E0E0E0;
}

.page-game-bai__article-body h3 {
  color: var(--glow-color, #FFB04D);
}

/* FAQ Section */
.page-game-bai__faq-section {
  padding: 60px 0;
  background: var(--card-bg-color, #17191F);
}

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

details.page-game-bai__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid var(--border-color, #A84F0C);
  overflow: hidden;
  background: var(--background-color, #0D0E12);
  color: var(--text-main, #FFF3E6);
}

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: rgba(255, 140, 26, 0.1);
}

.page-game-bai__faq-qtext {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--text-main, #FFF3E6);
}

.page-game-bai__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: var(--glow-color, #FFB04D);
  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: rgba(255, 140, 26, 0.05); /* Slightly lighter background for answer */
  border-radius: 0 0 5px 5px;
  color: #E0E0E0;
}

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

.page-game-bai__faq-answer a {
  color: var(--glow-color, #FFB04D);
  text-decoration: underline;
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-game-bai__hero-image {
    height: 500px;
  }
  .page-game-bai__main-title {
    font-size: clamp(30px, 4.5vw, 42px);
  }
  .page-game-bai__section-title {
    font-size: 32px;
  }
  .page-game-bai__games-grid,
  .page-game-bai__benefits-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  /* General mobile container padding */
  .page-game-bai__container {
    padding: 15px 15px;
  }

  /* HERO Section */
  .page-game-bai__hero-section {
    padding-top: 10px; /* Consistent small top padding */
    padding-bottom: 40px;
  }
  .page-game-bai__hero-image-wrapper {
    margin-bottom: 20px;
  }
  .page-game-bai__hero-image {
    object-fit: contain !important; /* HERO mobile: object-fit: contain */
    aspect-ratio: unset !important; /* HERO mobile: aspect-ratio: unset */
    height: auto !important; /* Allow height to adjust */
    width: 100% !important; /* Ensure image takes full width */
  }
  .page-game-bai__main-title {
    font-size: clamp(28px, 8vw, 36px); /* Adjust clamp for smaller screens */
    margin-bottom: 15px;
  }
  .page-game-bai__description {
    font-size: 16px;
    margin-bottom: 25px;
  }

  /* Buttons and Button Containers */
  .page-game-bai__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    max-width: 100% !important; /* Ensure full width */
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-game-bai__btn-primary,
  .page-game-bai__btn-secondary,
  .page-game-bai__btn-play {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px; /* Ensure padding for button text */
    padding-right: 15px;
  }
  .page-game-bai__cta-center .page-game-bai__btn-primary {
    max-width: 300px !important; /* Keep center CTA button reasonable width */
    margin: 0 auto;
  }

  /* Section Titles */
  .page-game-bai__section-title {
    font-size: 28px;
    margin-bottom: 30px;
  }
  .page-game-bai__sub-title {
    font-size: 20px;
  }

  /* Games Grid */
  .page-game-bai__games-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for games */
    gap: 20px;
    overflow-x: hidden; /* Prevent horizontal scroll */
  }
  .page-game-bai__game-card-image {
    height: 150px; /* Adjust image height for mobile cards */
  }
  .page-game-bai__game-card-title {
    font-size: 18px;
  }
  .page-game-bai__game-card-description {
    font-size: 14px;
  }

  /* Benefits Grid */
  .page-game-bai__benefits-grid {
    grid-template-columns: 1fr; /* Stack benefits vertically */
    gap: 20px;
  }
  .page-game-bai__benefit-item {
    padding: 20px;
  }
  .page-game-bai__benefit-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
  }
  .page-game-bai__benefit-title {
    font-size: 18px;
  }

  /* Article Body (Tips Section) */
  .page-game-bai__article-body {
    padding: 0 10px;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .page-game-bai__article-body p {
    font-size: 15px;
  }
  .page-game-bai__article-body h3 {
    text-align: left;
  }

  /* FAQ Section */
  details.page-game-bai__faq-item summary.page-game-bai__faq-question {
    padding: 15px;
  }
  .page-game-bai__faq-qtext {
    font-size: 16px;
  }
  .page-game-bai__faq-toggle {
    font-size: 20px;
    width: 24px;
  }
  details.page-game-bai__faq-item .page-game-bai__faq-answer {
    padding: 0 15px 15px;
  }

  /* Generic images and containers */
  .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,
  .page-game-bai__games-list-section,
  .page-game-bai__benefits-section,
  .page-game-bai__tips-section,
  .page-game-bai__faq-section,
  .page-game-bai__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}