:root {
    --main-color: #11A84E;
    --auxiliary-color: #22C768;
    --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
    --card-bg-color: #11271B;
    --background-color: #08160F;
    --text-main-color: #F2FFF6;
    --text-secondary-color: #A7D9B8;
    --border-color: #2E7A4E;
    --glow-color: #57E38D;
    --gold-color: #F2C14E;
    --divider-color: #1E3A2A;
    --deep-green-color: #0A4B2C;
}

.page-game-rules {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-main-color); /* #F2FFF6 */
    background-color: var(--background-color); /* #08160F */
}

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

.page-game-rules__section {
    padding: 60px 0;
    text-align: center;
}

.page-game-rules__hero-section {
    position: relative;
    padding-top: 10px; /* Small top padding, body handles header offset */
    padding-bottom: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden; /* Ensure no overflow */
    width: 100%; /* Ensure hero section takes full width */
}

.page-game-rules__hero-image-wrapper {
    width: 100%;
    max-height: 675px; /* Limit height for hero image */
    overflow: hidden;
}

.page-game-rules__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    filter: brightness(0.7); /* Slightly darken image for text contrast */
}

.page-game-rules__hero-content {
    position: relative; /* Not absolute, to flow below image */
    text-align: center;
    padding: 40px 20px;
    max-width: 900px;
    margin-top: -150px; /* Pull content up slightly over the darkened part of the image */
    z-index: 1; /* Ensure content is above image */
}

.page-game-rules__main-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem); /* Responsive font size */
    color: var(--text-main-color); /* #F2FFF6 */
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.2;
}

.page-game-rules__intro-text {
    font-size: 1.1rem;
    color: var(--text-secondary-color); /* #A7D9B8 */
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

.page-game-rules__cta-buttons--centered {
    margin-top: 40px;
}

.page-game-rules__btn-primary,
.page-game-rules__btn-secondary,
.page-game-rules__btn-download,
.page-game-rules__card-link {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-sizing: border-box;
    white-space: normal; /* Allow text wrapping */
    word-wrap: break-word; /* Allow text wrapping */
    max-width: 100%; /* Ensure responsiveness */
}

.page-game-rules__btn-primary {
    background: var(--button-gradient); /* linear-gradient(180deg, #2AD16F 0%, #13994A 100%) */
    color: var(--text-main-color); /* #F2FFF6 */
    border: 2px solid transparent;
}

.page-game-rules__btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(34, 199, 104, 0.4);
}

.page-game-rules__btn-secondary {
    background: none;
    color: var(--main-color); /* #11A84E */
    border: 2px solid var(--main-color); /* #11A84E */
}

.page-game-rules__btn-secondary:hover {
    background: var(--main-color); /* #11A84E */
    color: var(--text-main-color); /* #F2FFF6 */
    transform: translateY(-2px);
}

.page-game-rules__section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem); /* Responsive font size */
    color: var(--text-main-color); /* #F2FFF6 */
    margin-bottom: 20px;
    font-weight: bold;
    line-height: 1.3;
}

.page-game-rules__section-description {
    font-size: 1.1rem;
    color: var(--text-secondary-color); /* #A7D9B8 */
    margin-bottom: 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.page-game-rules__content-block {
    text-align: left;
    max-width: 900px;
    margin: 0 auto;
}

.page-game-rules__sub-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--gold-color); /* #F2C14E */
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: bold;
}

.page-game-rules__content-block p {
    color: var(--text-secondary-color); /* #A7D9B8 */
    margin-bottom: 15px;
}

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

.page-game-rules__game-card {
    background-color: var(--card-bg-color); /* #11271B */
    border: 1px solid var(--border-color); /* #2E7A4E */
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-game-rules__game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.page-game-rules__card-image {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    display: block;
}

.page-game-rules__card-title {
    font-size: 1.5rem;
    color: var(--gold-color); /* #F2C14E */
    padding: 20px 20px 0;
    margin-bottom: 10px;
}

.page-game-rules__card-content {
    padding: 0 20px 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-game-rules__card-content p {
    color: var(--text-secondary-color); /* #A7D9B8 */
    margin-bottom: 15px;
    flex-grow: 1;
}

.page-game-rules__card-link {
    color: var(--auxiliary-color); /* #22C768 */
    text-decoration: none;
    font-weight: bold;
    align-self: flex-start;
    padding: 8px 15px;
    border: 1px solid var(--auxiliary-color);
    border-radius: 5px;
}

.page-game-rules__card-link:hover {
    background-color: var(--auxiliary-color); /* #22C768 */
    color: var(--background-color); /* #08160F */
}

.page-game-rules__faq-section {
    background-color: var(--deep-green-color); /* #0A4B2C */
    padding: 80px 0;
}

.page-game-rules__faq-list {
    max-width: 900px;
    margin: 40px auto 0;
    text-align: left;
}

.page-game-rules__faq-item {
    background-color: var(--card-bg-color); /* #11271B */
    border: 1px solid var(--divider-color); /* #1E3A2A */
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.page-game-rules__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-main-color); /* #F2FFF6 */
    font-weight: bold;
    list-style: none; /* For details/summary */
}

.page-game-rules__faq-question::-webkit-details-marker {
    display: none; /* For details/summary */
}

.page-game-rules__faq-toggle {
    font-size: 1.5rem;
    color: var(--auxiliary-color); /* #22C768 */
    margin-left: 15px;
    transition: transform 0.3s ease;
}

.page-game-rules__faq-item[open] .page-game-rules__faq-toggle {
    transform: rotate(45deg); /* Rotate for 'x' or '-' effect */
}

.page-game-rules__faq-answer {
    padding: 0 20px 20px;
    font-size: 1rem;
    color: var(--text-secondary-color); /* #A7D9B8 */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.page-game-rules__faq-item[open] .page-game-rules__faq-answer {
    max-height: 500px; /* Adjust as needed for content */
    transition: max-height 0.5s ease-in;
}

/* Fallback for JS-driven FAQ if not using <details> */
.page-game-rules__faq-item.active .page-game-rules__faq-answer {
    max-height: 500px; /* Adjust as needed for content */
    transition: max-height 0.5s ease-in;
}
.page-game-rules__faq-item.active .page-game-rules__faq-toggle {
    transform: rotate(45deg);
}


.page-game-rules__contact-info {
    max-width: 700px;
    margin: 40px auto;
    text-align: left;
    background-color: var(--card-bg-color); /* #11271B */
    border: 1px solid var(--border-color); /* #2E7A4E */
    border-radius: 12px;
    padding: 30px;
}

.page-game-rules__contact-info p {
    font-size: 1.1rem;
    color: var(--text-main-color); /* #F2FFF6 */
    margin-bottom: 10px;
}

.page-game-rules__contact-link {
    color: var(--auxiliary-color); /* #22C768 */
    text-decoration: none;
    font-weight: bold;
}

.page-game-rules__contact-link:hover {
    text-decoration: underline;
}

/* --- Responsive Styles --- */
/* Mobile first approach, then desktop overrides */
@media (max-width: 768px) {
    .page-game-rules {
        font-size: 16px;
        line-height: 1.6;
    }

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

    .page-game-rules__hero-content {
        padding: 20px 15px;
        margin-top: -80px; /* Adjust for smaller screens */
    }

    .page-game-rules__main-title {
        font-size: 2rem !important; /* Force smaller title on mobile */
        margin-bottom: 15px;
    }

    .page-game-rules__intro-text,
    .page-game-rules__section-description,
    .page-game-rules__content-block p,
    .page-game-rules__contact-info p,
    .page-game-rules__faq-answer {
        font-size: 1rem !important;
    }

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

    .page-game-rules__btn-primary,
    .page-game-rules__btn-secondary,
    .page-game-rules__btn-download,
    .page-game-rules__card-link {
        max-width: 100% !important;
        width: 100% !important;
        padding: 12px 20px !important;
        font-size: 1rem !important;
    }

    .page-game-rules__section {
        padding: 40px 0;
    }

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

    .page-game-rules__card-image {
        height: 180px;
    }

    .page-game-rules__card-title {
        font-size: 1.3rem;
    }

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

    /* Mobile specific image, video, button responsiveness - MUST HAVE !important */
    .page-game-rules img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    .page-game-rules video,
    .page-game-rules__video {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    .page-game-rules__section,
    .page-game-rules__card,
    .page-game-rules__container,
    .page-game-rules__hero-section,
    .page-game-rules__hero-image-wrapper,
    .page-game-rules__hero-content,
    .page-game-rules__game-card,
    .page-game-rules__faq-item,
    .page-game-rules__contact-info,
    .page-game-rules__video-section,
    .page-game-rules__video-container,
    .page-game-rules__video-wrapper,
    .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;
        overflow: hidden !important; /* Ensure content doesn't overflow */
    }
    .page-game-rules__video-section {
        padding-top: 10px !important; /* body already handles --header-offset */
    }
}

/* Desktop specific adjustments if needed */
@media (min-width: 769px) {
    .page-game-rules__hero-content {
        margin-top: -150px; /* Reset for desktop */
    }
}