/* Base styles for the Game Bai page */
.page-game-bai {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333333; /* Default text color for light backgrounds */
    background-color: #f8f8f8; /* Light background for the page content area */
}

/* Container for consistent content width */
.page-game-bai__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* Section titles */
.page-game-bai__section-title {
    font-size: 36px;
    font-weight: 700;
    color: #017439; /* Brand primary color for titles */
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.2;
}

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

/* Text blocks */
.page-game-bai__text-block {
    font-size: 18px;
    margin-bottom: 20px;
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-game-bai__text-block--white {
    color: #ffffff;
}

/* Primary Button */
.page-game-bai__btn-primary {
    display: inline-block;
    background-color: #C30808; /* Custom color for Register/Login */
    color: #FFFF00; /* Custom font color for Register/Login */
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-game-bai__btn-primary:hover {
    background-color: #a30606;
    transform: translateY(-2px);
}

/* Secondary Button */
.page-game-bai__btn-secondary {
    display: inline-block;
    background-color: transparent;
    color: #017439; /* Brand primary color */
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    border: 2px solid #017439;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-game-bai__btn-secondary:hover {
    background-color: #017439;
    color: #ffffff;
    transform: translateY(-2px);
}

/* Button for playing games */
.page-game-bai__btn-play {
    display: inline-block;
    background-color: #017439;
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.3s ease;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
}

.page-game-bai__btn-play:hover {
    background-color: #005a2e;
}

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

.page-game-bai__cta-buttons--center {
    justify-content: center;
}

/* Image styles */
.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, body handles header offset */
    color: #ffffff;
    text-align: center;
    overflow: hidden;
}

.page-game-bai__hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.page-game-bai__hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Default for desktop */
}

.page-game-bai__hero-content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 100px 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.page-game-bai__main-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem); /* Responsive H1 font size */
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

.page-game-bai__description {
    font-size: 20px;
    margin-bottom: 30px;
    max-width: 800px;
    line-height: 1.5;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

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

/* Why Choose Section */
.page-game-bai__why-choose-section {
    padding: 60px 0;
    background-color: #017439; /* Brand primary color */
    color: #ffffff;
}

.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 {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.page-game-bai__feature-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #FFFF00; /* Contrast color for feature titles */
}

.page-game-bai__feature-item p {
    font-size: 16px;
    color: #f0f0f0;
}

/* Popular Games Section */
.page-game-bai__popular-games-section {
    padding: 60px 0;
}

.page-game-bai__games-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: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
}

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

.page-game-bai__game-title {
    font-size: 22px;
    font-weight: 600;
    margin: 20px 15px 10px;
    color: #017439;
}

.page-game-bai__game-title a {
    color: #017439;
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-game-bai__game-title a:hover {
    color: #C30808; /* Hover color */
}

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

.page-game-bai__game-card .page-game-bai__btn-play {
    margin: 0 15px 20px;
}

/* How to Play Section */
.page-game-bai__how-to-play-section {
    padding: 60px 0;
    background-color: #017439;
    color: #ffffff;
}

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

.page-game-bai__step-item {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    position: relative;
}

.page-game-bai__step-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #C30808;
    color: #FFFF00;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    border: 3px solid #017439;
}

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

.page-game-bai__step-item p {
    font-size: 16px;
    color: #f0f0f0;
}

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

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

.page-game-bai__security-text {
    flex: 1;
}

.page-game-bai__security-text .page-game-bai__section-title {
    text-align: left;
    margin-bottom: 20px;
}

.page-game-bai__security-text .page-game-bai__text-block {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.page-game-bai__security-text .page-game-bai__btn-primary {
    margin-top: 20px;
    display: inline-block;
}

.page-game-bai__security-image {
    flex: 1;
    text-align: center;
}

.page-game-bai__security-image img {
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Promotions Section */
.page-game-bai__promotions-section {
    padding: 60px 0;
    background-color: #017439;
    color: #ffffff;
}

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

.page-game-bai__promo-card {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.page-game-bai__promo-card p {
    font-size: 16px;
    color: #f0f0f0;
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-game-bai__promo-card .page-game-bai__btn-secondary {
    border-color: #FFFF00;
    color: #FFFF00;
}

.page-game-bai__promo-card .page-game-bai__btn-secondary:hover {
    background-color: #FFFF00;
    color: #017439;
}

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

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

.page-game-bai__tip-item {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.page-game-bai__tip-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #017439;
}

.page-game-bai__tip-item p {
    font-size: 16px;
    color: #555555;
}

/* CTA Banner Section */
.page-game-bai__cta-banner-section {
    padding: 60px 0;
    background-color: #017439;
    color: #ffffff;
}

.page-game-bai__cta-banner-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.page-game-bai__cta-banner-text {
    flex: 1;
}

.page-game-bai__cta-banner-text .page-game-bai__section-title {
    text-align: left;
    margin-bottom: 20px;
}

.page-game-bai__cta-banner-text .page-game-bai__text-block {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
}

.page-game-bai__cta-banner-image {
    flex: 1;
    text-align: center;
}

.page-game-bai__cta-banner-image img {
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

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

/* --- Mobile Responsiveness --- */
@media (max-width: 1024px) {
    .page-game-bai__hero-content {
        padding: 80px 15px;
        min-height: 400px;
    }
    .page-game-bai__main-title {
        font-size: clamp(2rem, 4.5vw, 3rem);
    }
    .page-game-bai__description {
        font-size: 18px;
    }
    .page-game-bai__section-title {
        font-size: 32px;
    }
    .page-game-bai__features-grid,
    .page-game-bai__games-grid,
    .page-game-bai__steps-grid,
    .page-game-bai__promo-cards-grid,
    .page-game-bai__tips-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
    .page-game-bai__security-content,
    .page-game-bai__cta-banner-content {
        flex-direction: column;
        text-align: center;
    }
    .page-game-bai__security-text .page-game-bai__section-title,
    .page-game-bai__security-text .page-game-bai__text-block,
    .page-game-bai__cta-banner-text .page-game-bai__section-title,
    .page-game-bai__cta-banner-text .page-game-bai__text-block {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    .page-game-bai__security-text .page-game-bai__btn-primary {
        display: block;
        margin: 20px auto 0;
    }
}

@media (max-width: 768px) {
    /* General mobile styles */
    .page-game-bai {
        font-size: 16px;
        line-height: 1.6;
    }
    .page-game-bai__container {
        padding: 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* HERO Main Image and content */
    .page-game-bai__hero-section {
        padding-top: 10px; /* Small top padding for mobile */
    }
    .page-game-bai__hero-image img {
        object-fit: contain !important; /* Prevent cropping on mobile */
        aspect-ratio: unset !important; /* Allow natural aspect ratio */
        height: auto !important; /* Ensure height adjusts */
    }
    .page-game-bai__hero-content {
        padding: 60px 15px;
        min-height: 300px;
    }
    .page-game-bai__main-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem); /* Smaller H1 for mobile */
        margin-bottom: 15px;
        max-width: 100%;
        text-align: center;
    }
    .page-game-bai__description {
        font-size: 16px;
        margin-bottom: 20px;
        max-width: 100%;
    }

    /* CTA Buttons */
    .page-game-bai__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
        padding-left: 15px;
        padding-right: 15px;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        flex-wrap: wrap !important;
    }
    .page-game-bai__btn-primary,
    .page-game-bai__btn-secondary,
    .page-game-bai__btn-play,
    .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;
    }

    /* Section Titles */
    .page-game-bai__section-title {
        font-size: 28px;
        margin-bottom: 30px;
        text-align: center;
        max-width: 100%;
    }

    /* Text Blocks */
    .page-game-bai__text-block {
        font-size: 16px;
        text-align: left;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    /* Feature Grid / Games Grid / Steps Grid / Promo Grid / Tips Grid */
    .page-game-bai__features-grid,
    .page-game-bai__games-grid,
    .page-game-bai__steps-grid,
    .page-game-bai__promo-cards-grid,
    .page-game-bai__tips-grid {
        grid-template-columns: 1fr; /* Single column for all grids */
        gap: 20px;
        max-width: 100%;
        overflow-x: hidden;
    }
    .page-game-bai__game-card img {
        
    }

    /* Security and CTA Banner Sections */
    .page-game-bai__security-content,
    .page-game-bai__cta-banner-content {
        flex-direction: column;
        gap: 30px;
    }
    .page-game-bai__security-image,
    .page-game-bai__cta-banner-image {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .page-game-bai__security-text .page-game-bai__section-title,
    .page-game-bai__security-text .page-game-bai__text-block,
    .page-game-bai__cta-banner-text .page-game-bai__section-title,
    .page-game-bai__cta-banner-text .page-game-bai__text-block {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
    .page-game-bai__security-text .page-game-bai__btn-primary {
        display: block;
        margin: 20px auto 0;
    }

    /* FAQ Section */
    details.page-game-bai__faq-item summary.page-game-bai__faq-question { padding: 15px; }
    .page-game-bai__faq-qtext { font-size: 15px; }
}