:root {
    --color-primary: #113B7A;
    --color-secondary: #1D5FD1;
    --btn-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
    --card-bg: #10233F;
    --text-main: #F3F8FF;
    --text-secondary: #AFC4E8;
    --border-color: #244D84;
    --color-glow: #4FA8FF;
    --color-gold: #F2C14E;
    --color-divider: #1B3357;
    --color-deep-navy: #08162B; /* This is the body background from shared.css */
}

/* --- Base Styles --- */
.page-tai-xiu {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main); /* Default text color, adjusted by contrast logic */
    background-color: var(--color-deep-navy); /* Body background from shared.css */
}

.page-tai-xiu__article-wrap {
    max-width: 1150px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.page-tai-xiu__section {
    padding: 40px 0;
}

.page-tai-xiu__section-title {
    font-size: 2.5em;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 30px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.page-tai-xiu__section-title--small {
    font-size: 2em;
}

.page-tai-xiu__sub-title {
    font-size: 1.8em;
    color: var(--text-main);
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: bold;
}

.page-tai-xiu p {
    margin-bottom: 1em;
    color: var(--text-secondary);
}

.page-tai-xiu ul,
.page-tai-xiu ol {
    margin-bottom: 1em;
    padding-left: 20px;
    color: var(--text-secondary);
}

.page-tai-xiu li {
    margin-bottom: 0.5em;
    color: var(--text-secondary);
}

.page-tai-xiu a {
    color: var(--color-gold); /* Links in content */
    text-decoration: none;
}

.page-tai-xiu a:hover {
    text-decoration: underline;
}

/* --- Hero Section --- */
.page-tai-xiu__hero-section {
    display: flex;
    flex-direction: column; /* Ensure image is above content */
    align-items: center;
    text-align: center;
    padding-top: 10px; /* Small top padding, body handles header offset */
    background-color: var(--color-deep-navy);
    color: var(--text-main);
    padding-bottom: 40px;
}

.page-tai-xiu__hero-image-wrapper {
    width: 100%;
    max-width: 1200px; /* Max width for the image */
    margin-bottom: 30px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-tai-xiu__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.page-tai-xiu__hero-content {
    max-width: 900px;
    padding: 0 20px;
}

.page-tai-xiu__main-title {
    font-size: clamp(2.5em, 4vw, 3.5em); /* Responsive font size */
    color: var(--color-gold);
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.page-tai-xiu__description {
    font-size: 1.1em;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

/* --- CTA Buttons --- */
.page-tai-xiu__cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.page-tai-xiu__cta-buttons--center {
    margin-top: 30px;
}

.page-tai-xiu__btn {
    display: inline-block;
    padding: 14px 30px;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    max-width: 100%; /* Ensure button adapts to container */
    box-sizing: border-box;
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
}

.page-tai-xiu__btn--primary {
    background: var(--btn-gradient);
    color: var(--text-main); /* White text on dark button */
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-tai-xiu__btn--primary:hover {
    background: linear-gradient(180deg, #1144A6 0%, #2B73F6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-tai-xiu__btn--secondary {
    background-color: transparent;
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-tai-xiu__btn--secondary:hover {
    background-color: var(--color-gold);
    color: var(--color-deep-navy); /* Dark text on gold button */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.page-tai-xiu__btn--small {
    padding: 10px 20px;
    font-size: 0.9em;
}

/* --- Content Sections --- */
.page-tai-xiu__intro-section,
.page-tai-xiu__how-to-play-section,
.page-tai-xiu__strategies-section,
.page-tai-xiu__why-choose-byy88,
.page-tai-xiu__promotions-section,
.page-tai-xiu__faq-section,
.page-tai-xiu__contact-cta {
    background-color: var(--color-deep-navy);
    color: var(--text-secondary);
}

.page-tai-xiu__dark-section {
    background-color: var(--color-deep-navy); /* Deep Navy background */
    color: var(--text-main); /* White text on deep navy */
}

.page-tai-xiu__dark-section .page-tai-xiu__section-title,
.page-tai-xiu__dark-section .page-tai-xiu__sub-title {
    color: var(--text-main); /* Ensure titles are white */
}

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

.page-tai-xiu__feature-card {
    padding: 25px;
    border-radius: 10px;
    background-color: var(--card-bg); /* Card BG color */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-tai-xiu__feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.page-tai-xiu__feature-title {
    font-size: 1.4em;
    color: var(--text-main); /* Main text color for titles */
    margin-bottom: 10px;
    font-weight: bold;
}

.page-tai-xiu__feature-card p {
    color: var(--text-secondary); /* Secondary text color for content */
}

/* --- Promotions Section --- */
.page-tai-xiu__promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.page-tai-xiu__promo-card {
    padding: 25px;
    border-radius: 10px;
    background-color: var(--card-bg); /* Card BG color */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-tai-xiu__promo-title {
    font-size: 1.4em;
    color: var(--text-main);
    margin-bottom: 10px;
    font-weight: bold;
}

.page-tai-xiu__promo-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

.page-tai-xiu__promo-note {
    text-align: center;
    margin-top: 30px;
    font-size: 1.1em;
    color: var(--text-secondary);
}

/* --- FAQ Section --- */
.page-tai-xiu__faq-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color); /* Border color */
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-tai-xiu__faq-question {
    font-size: 1.2em;
    color: var(--text-main);
    font-weight: bold;
    margin-bottom: 10px;
}

.page-tai-xiu__faq-answer {
    font-size: 1em;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Contact CTA Section --- */
.page-tai-xiu__contact-cta {
    padding: 60px 0;
    background-color: var(--color-deep-navy);
    color: var(--text-main);
}

.page-tai-xiu__contact-cta .page-tai-xiu__card {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* --- Images and Figures --- */
.page-tai-xiu__figure {
    margin: 30px 0;
    text-align: center;
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-tai-xiu__figure--center {
    margin-left: auto;
    margin-right: auto;
    display: block; /* Ensure margin auto works */
    max-width: 700px; /* Limit width for figures */
}

.page-tai-xiu__image {
    max-width: 100%;
    height: auto;
    display: block; /* Remove extra space below image */
    border-radius: 8px;
    margin: 0 auto;
}

.page-tai-xiu__figcaption {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-top: 10px;
    font-style: italic;
}

/* --- Responsive Styles (Mobile First Approach) --- */

/* For screens smaller than 768px (Mobile) */
@media (max-width: 768px) {
    /* 1. Top Section Title + Dual CTA */
    .page-tai-xiu__hero-section {
        padding-top: 10px !important; /* Small top padding, body handles header offset */
        padding-bottom: 20px;
    }

    .page-tai-xiu__hero-content {
        padding: 0 15px;
    }

    .page-tai-xiu__main-title {
        font-size: 2.2em; /* Smaller H1 for mobile */
        margin-bottom: 15px;
    }

    .page-tai-xiu__description {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .page-tai-xiu__cta-buttons {
        flex-direction: column; /* Stack buttons vertically */
        gap: 10px;
        padding: 0 15px; /* Add padding to button container */
    }

    /* 4. Buttons and Button Containers */
    .page-tai-xiu__btn {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding: 12px 15px !important;
        font-size: 1em !important;
    }

    .page-tai-xiu__cta-buttons,
    .page-tai-xiu__button-group,
    .page-tai-xiu__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        flex-wrap: wrap !important;
        gap: 10px;
    }

    /* 2. Single Column Long Text Container */
    .page-tai-xiu__article-wrap {
        padding: 0 15px !important; /* Adjust padding for mobile */
    }

    .page-tai-xiu__section {
        padding: 30px 0;
    }

    .page-tai-xiu__section-title {
        font-size: 1.8em; /* Smaller section titles */
        margin-bottom: 20px;
    }

    .page-tai-xiu__section-title--small {
        font-size: 1.5em;
    }

    .page-tai-xiu__sub-title {
        font-size: 1.4em;
        margin-top: 25px;
        margin-bottom: 10px;
    }

    .page-tai-xiu p,
    .page-tai-xiu li {
        font-size: 0.95em;
    }

    .page-tai-xiu__feature-grid,
    .page-tai-xiu__promo-grid {
        grid-template-columns: 1fr; /* Stack cards vertically */
        gap: 20px;
    }

    .page-tai-xiu__feature-card,
    .page-tai-xiu__promo-card,
    .page-tai-xiu__faq-item {
        padding: 20px;
    }

    /* 3. General Images and Figure */
    .page-tai-xiu img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-tai-xiu__section,
    .page-tai-xiu__card,
    .page-tai-xiu__container { /* Ensure all containers holding images are responsive */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
    }

    /* 5. Registration Tutorial and FAQ Block (FAQ here is just text, not collapsible) */
    .page-tai-xiu__faq-question {
        font-size: 1.1em;
    }

    .page-tai-xiu__faq-answer {
        font-size: 0.9em;
    }

    .page-tai-xiu__contact-cta {
        padding: 40px 0;
    }

    .page-tai-xiu__contact-cta .page-tai-xiu__card {
        padding: 30px 15px;
    }
}

/* For screens smaller than 1024px (Tablet) - not explicitly required for all 5 categories but good practice */
@media (max-width: 1024px) {
    .page-tai-xiu__article-wrap {
        padding: 0 30px;
    }
    .page-tai-xiu__hero-content {
        padding: 0 30px;
    }
    .page-tai-xiu__feature-grid,
    .page-tai-xiu__promo-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}