:root {
    --primary-color: #017439;
    --secondary-color: #FFFFFF;
    --register-button-color: #C30808;
    --login-button-color: #C30808;
    --background-color: #FFFFFF;
    --register-login-font-color: #FFFF00;
    --dark-text-color: #333333;
    --light-text-color: #FFFFFF;
    --border-color: #e0e0e0;
}

.page-game-rules {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark-text-color);
    background-color: var(--background-color);
}

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

/* Hero Section */
.page-game-rules__hero-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    color: var(--light-text-color);
    text-align: center;
    overflow: hidden;
    padding-top: var(--header-offset, 120px);
    padding-bottom: 60px;
}

.page-game-rules__hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

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

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

.page-game-rules__hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 20px;
}

.page-game-rules__main-title {
    font-size: 3.5em;
    margin-bottom: 20px;
    color: var(--light-text-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.page-game-rules__intro-text {
    font-size: 1.2em;
    margin-bottom: 30px;
    line-height: 1.8;
    color: var(--light-text-color);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

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

.page-game-rules__cta-buttons--center {
  margin-top: 30px;
}

.page-game-rules__btn-primary,
.page-game-rules__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    white-space: normal;
    word-wrap: break-word;
    box-sizing: border-box;
    max-width: 100%;
}

.page-game-rules__btn-primary {
    background-color: var(--register-button-color);
    color: var(--register-login-font-color);
    border: 2px solid var(--register-button-color);
}

.page-game-rules__btn-primary:hover {
    background-color: #A30606; /* Darken #C30808 */
    border-color: #A30606;
}

.page-game-rules__btn-secondary {
    background-color: transparent;
    color: var(--light-text-color);
    border: 2px solid var(--light-text-color);
}

.page-game-rules__btn-secondary:hover {
    background-color: var(--light-text-color);
    color: var(--primary-color);
}

.page-game-rules__content-section,
.page-game-rules__principles-section,
.page-game-rules__video-section,
.page-game-rules__specific-rules-section,
.page-game-rules__account-section,
.page-game-rules__transaction-section,
.page-game-rules__promotions-section,
.page-game-rules__faq-section,
.page-game-rules__conclusion-section {
    padding: 60px 0;
}

.page-game-rules__section-title {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}

.page-game-rules__sub-title {
    font-size: 1.8em;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.page-game-rules__paragraph {
    margin-bottom: 20px;
    line-height: 1.7;
    font-size: 1.1em;
}

/* Background colors */
.page-game-rules__dark-section {
    background-color: var(--primary-color);
    color: var(--light-text-color);
}

.page-game-rules__dark-section .page-game-rules__section-title,
.page-game-rules__dark-section .page-game-rules__sub-title {
    color: var(--light-text-color);
}

.page-game-rules__light-bg {
    background-color: var(--background-color);
    color: var(--dark-text-color);
}

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

.page-game-rules__grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

/* Card Styles */
.page-game-rules__card {
    background-color: var(--secondary-color);
    color: var(--dark-text-color);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 30px;
    text-align: left;
    transition: transform 0.3s ease;
    height: 100%; /* Ensure cards in grid have equal height */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.page-game-rules__dark-section .page-game-rules__card {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light-text-color);
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-game-rules__dark-section .page-game-rules__card .page-game-rules__card-title {
    color: var(--light-text-color);
}

.page-game-rules__card:hover {
    transform: translateY(-5px);
}

.page-game-rules__card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.page-game-rules__card-title {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.page-game-rules__card-text {
    font-size: 1em;
    line-height: 1.6;
    flex-grow: 1;
}

/* Video Section */
.page-game-rules__video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: 10px;
    margin-bottom: 30px;
}

.page-game-rules__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    cursor: pointer;
}

.page-game-rules__video-section .page-game-rules__cta-buttons {
  margin-top: 30px;
}

/* Specific Game Rules */
.page-game-rules__game-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.page-game-rules__game-card {
    background-color: var(--secondary-color);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.page-game-rules__game-card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

.page-game-rules__game-card-title {
    font-size: 1.6em;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.page-game-rules__game-card-title a {
  color: var(--primary-color);
  text-decoration: none;
}

.page-game-rules__game-card-title a:hover {
  text-decoration: underline;
}

.page-game-rules__game-card-text {
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-game-rules__list {
    list-style: disc inside;
    margin-bottom: 20px;
    padding-left: 0;
}

.page-game-rules__list li {
    margin-bottom: 8px;
    font-size: 1em;
}

.page-game-rules__list--bullet {
  list-style-type: disc;
  padding-left: 20px;
}

.page-game-rules__btn-link {
    display: inline-block;
    margin-top: auto; /* Push button to bottom */
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.page-game-rules__btn-link:hover {
    background-color: #005f2e; /* Darken #017439 */
}

.page-game-rules__image-wrapper {
    text-align: center;
}

.page-game-rules__image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* FAQ Section */
.page-game-rules__faq-list {
    margin-top: 30px;
}

.page-game-rules__faq-item {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.page-game-rules__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    background-color: #f9f9f9;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.page-game-rules__faq-question:hover {
    background-color: #f0f0f0;
}

.page-game-rules__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    transition: transform 0.3s ease;
}

.page-game-rules__faq-item.active .page-game-rules__faq-toggle {
    transform: rotate(45deg);
}

.page-game-rules__faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 25px;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: var(--secondary-color);
}

.page-game-rules__faq-item.active .page-game-rules__faq-answer {
    max-height: 1000px !important; /* Sufficiently large to show content */
    padding: 15px 25px;
}

.page-game-rules__faq-answer p {
    margin: 0;
    padding-bottom: 10px;
    color: var(--dark-text-color);
}

/* Conclusion Section */
.page-game-rules__conclusion-section {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-game-rules__main-title {
        font-size: 2.8em;
    }

    .page-game-rules__intro-text {
        font-size: 1.1em;
    }

    .page-game-rules__grid-3-cols,
    .page-game-rules__game-rules-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-game-rules {
        font-size: 16px;
        line-height: 1.6;
    }

    .page-game-rules__hero-section {
        min-height: 400px;
        padding-top: var(--header-offset, 120px) !important;
        padding-bottom: 40px;
    }

    .page-game-rules__main-title {
        font-size: 2.2em;
    }

    .page-game-rules__intro-text {
        font-size: 1em;
    }

    .page-game-rules__cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .page-game-rules__btn-primary,
    .page-game-rules__btn-secondary,
    .page-game-rules a[class*="button"],
    .page-game-rules a[class*="btn"] {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 20px !important;
        font-size: 1em !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        box-sizing: border-box !important;
    }

    .page-game-rules__cta-buttons,
    .page-game-rules__button-group,
    .page-game-rules__btn-container {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        flex-wrap: wrap !important;
        gap: 10px;
    }

    .page-game-rules__section-title {
        font-size: 2em;
    }

    .page-game-rules__sub-title {
        font-size: 1.5em;
    }

    .page-game-rules__grid-2-cols {
        grid-template-columns: 1fr;
    }

    .page-game-rules__card {
        padding: 20px;
    }

    .page-game-rules__game-card {
        padding: 20px;
    }

    .page-game-rules__video-wrapper {
        padding-bottom: 56.25% !important; /* 16:9 Aspect Ratio */
        height: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .page-game-rules__video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-game-rules__image,
    .page-game-rules__card-image,
    .page-game-rules__game-card-image,
    .page-game-rules__hero-image {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
    }

    .page-game-rules__image-wrapper,
    .page-game-rules__card-image-wrapper,
    .page-game-rules__game-card-image-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .page-game-rules__faq-question {
        font-size: 1.1em;
        padding: 15px 20px;
    }

    .page-game-rules__faq-answer {
        padding: 0 20px;
    }

    .page-game-rules__faq-item.active .page-game-rules__faq-answer {
        padding: 15px 20px;
    }

    .page-game-rules__content-section,
    .page-game-rules__principles-section,
    .page-game-rules__video-section,
    .page-game-rules__specific-rules-section,
    .page-game-rules__account-section,
    .page-game-rules__transaction-section,
    .page-game-rules__promotions-section,
    .page-game-rules__faq-section,
    .page-game-rules__conclusion-section {
        padding: 40px 0;
    }

    .page-game-rules__container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .page-game-rules__main-title {
        font-size: 1.8em;
    }

    .page-game-rules__section-title {
        font-size: 1.8em;
    }

    .page-game-rules__sub-title {
        font-size: 1.3em;
    }
}