/* style/game-rules.css */

:root {
    --primary-color: #113B7A;
    --secondary-color: #1D5FD1;
    --button-gradient: linear-gradient(180deg, #2B73F6 0%, #1144A6 100%);
    --card-bg-color: #10233F;
    --text-main-color: #F3F8FF;
    --text-secondary-color: #AFC4E8;
    --border-color: #244D84;
    --glow-color: #4FA8FF;
    --gold-color: #F2C14E;
    --divider-color: #1B3357;
    --deep-navy-color: #08162B;
    --header-offset-desktop: 120px; /* Placeholder, will be overridden by shared.css body padding-top */
}

.page-game-rules {
    font-family: 'Arial', sans-serif;
    color: var(--text-main-color);
    background-color: var(--card-bg-color); /* Dark background from custom palette */
}

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

/* Hero Section */
.page-game-rules__hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 40px;
    background-color: var(--deep-navy-color);
    position: relative;
    overflow: hidden;
    padding-top: 10px; /* Small top padding, body handles header offset */
}

.page-game-rules__hero-image-wrapper {
    width: 100%;
    max-height: 600px;
    overflow: hidden;
}

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

.page-game-rules__hero-content {
    position: relative;
    z-index: 1;
    padding: 20px;
    max-width: 900px;
    margin-top: -150px; /* Overlap slightly for visual effect, but not text on image */
    background-color: rgba(16, 35, 63, 0.85); /* Card BG with transparency */
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    padding-top: 50px; /* Ensure content is below the overlap */
}

.page-game-rules__main-title {
    font-size: clamp(2em, 3.5vw, 3em);
    color: var(--gold-color);
    margin-bottom: 15px;
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(242, 193, 78, 0.5);
}

.page-game-rules__intro-text {
    font-size: 1.1em;
    color: var(--text-secondary-color);
    margin-bottom: 30px;
    line-height: 1.6;
}

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

.page-game-rules__btn-primary,
.page-game-rules__btn-secondary,
.page-game-rules__btn-tertiary {
    display: inline-block;
    padding: 14px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05em;
    transition: all 0.3s ease;
    box-sizing: border-box;
    white-space: normal;
    word-wrap: break-word;
    max-width: 100%; /* Ensure buttons adapt to width */
}

.page-game-rules__btn-primary {
    background: var(--button-gradient);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(43, 115, 246, 0.4);
}

.page-game-rules__btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(43, 115, 246, 0.6);
}

.page-game-rules__btn-secondary {
    background: transparent;
    color: var(--gold-color);
    border: 2px solid var(--gold-color);
    box-shadow: 0 2px 10px rgba(242, 193, 78, 0.3);
}

.page-game-rules__btn-secondary:hover {
    background: var(--gold-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(242, 193, 78, 0.5);
}

.page-game-rules__btn-tertiary {
    background: var(--secondary-color);
    color: var(--text-main-color);
    border: none;
    padding: 10px 20px;
    font-size: 0.95em;
    margin-top: 15px;
}

.page-game-rules__btn-tertiary:hover {
    background: #1a4abf; /* Slightly darker secondary color */
    transform: translateY(-2px);
}

/* General Section Styles */
.page-game-rules__section-title {
    font-size: 2.5em;
    color: var(--gold-color);
    text-align: center;
    margin-bottom: 20px;
    padding-top: 40px;
    text-shadow: 0 0 8px rgba(242, 193, 78, 0.4);
}

.page-game-rules__section-description {
    font-size: 1.1em;
    color: var(--text-secondary-color);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px auto;
    line-height: 1.6;
}

.page-game-rules__dark-section {
    background-color: var(--deep-navy-color);
    padding: 60px 0;
}

/* Grid for General Rules */
.page-game-rules__grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.page-game-rules__rule-card,
.page-game-rules__responsible-card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 450px; /* Ensure cards have similar height */
}

.page-game-rules__rule-card:hover,
.page-game-rules__responsible-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

.page-game-rules__card-title {
    font-size: 1.6em;
    color: var(--gold-color);
    margin-bottom: 15px;
    line-height: 1.3;
}

.page-game-rules__card-text {
    font-size: 1em;
    color: var(--text-secondary-color);
    line-height: 1.6;
    flex-grow: 1;
}

.page-game-rules__card-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.page-game-rules__card-link:hover {
    color: var(--gold-color);
    text-decoration: underline;
}

/* Specific Game Rules Section */
.page-game-rules__specific-rules-section {
    padding: 60px 0;
    background-color: var(--card-bg-color);
}

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

.page-game-rules__game-rule-item {
    background-color: var(--deep-navy-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    min-height: 550px; /* Ensure items have similar height */
}

.page-game-rules__game-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 25px;
    min-width: 200px;
    min-height: 200px;
}

.page-game-rules__game-title {
    font-size: 1.8em;
    color: var(--gold-color);
    margin-bottom: 15px;
    line-height: 1.3;
}

.page-game-rules__game-description {
    font-size: 1em;
    color: var(--text-secondary-color);
    line-height: 1.6;
    flex-grow: 1;
}

/* Responsible Gaming Section - uses .page-game-rules__dark-section and .page-game-rules__grid-container */
.page-game-rules__responsible-gaming-section {
    padding: 60px 0;
}

/* Terms & FAQ Section */
.page-game-rules__terms-faq-section {
    padding: 60px 0;
    background-color: var(--card-bg-color);
}

.page-game-rules__terms-overview {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
    background-color: var(--deep-navy-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.page-game-rules__terms-image {
    width: 50%;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    min-width: 200px;
    min-height: 200px;
}

.page-game-rules__terms-content {
    width: 50%;
}

.page-game-rules__sub-title {
    font-size: 2em;
    color: var(--gold-color);
    margin-bottom: 20px;
    line-height: 1.3;
}

.page-game-rules__text-content {
    font-size: 1em;
    color: var(--text-secondary-color);
    line-height: 1.6;
    margin-bottom: 25px;
}

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

.page-game-rules__faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.page-game-rules__faq-item {
    background-color: var(--deep-navy-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.page-game-rules__faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--text-main-color);
    transition: background-color 0.3s ease;
}

.page-game-rules__faq-item summary::-webkit-details-marker {
    display: none;
}

.page-game-rules__faq-item summary:hover {
    background-color: rgba(29, 95, 209, 0.2); /* Lighter secondary color for hover */
}

.page-game-rules__faq-qtext {
    flex-grow: 1;
    margin-right: 15px;
}

.page-game-rules__faq-toggle {
    font-size: 1.5em;
    line-height: 1;
    color: var(--gold-color);
}

.page-game-rules__faq-answer {
    padding: 0 25px 20px 25px;
    font-size: 1em;
    color: var(--text-secondary-color);
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.page-game-rules__faq-item[open] .page-game-rules__faq-answer {
    max-height: 500px; /* Arbitrary large enough value */
    padding: 0 25px 20px 25px;
    transition: max-height 0.5s ease-in, padding 0.5s ease-in;
}

/* Contact CTA Section */
.page-game-rules__contact-cta-section {
    text-align: center;
    padding: 60px 0 80px 0;
    background-color: var(--deep-navy-color);
}

/* --- Responsive Styles --- */

/* Tablet and Mobile */
@media (max-width: 1024px) {
    .page-game-rules__container {
        padding: 15px;
    }

    .page-game-rules__main-title {
        font-size: clamp(2em, 4vw, 2.5em);
    }

    .page-game-rules__intro-text,
    .page-game-rules__section-description,
    .page-game-rules__card-text,
    .page-game-rules__game-description,
    .page-game-rules__text-content,
    .page-game-rules__faq-answer p {
        font-size: 0.95em;
    }

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

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

    .page-game-rules__hero-content {
        margin-top: -100px;
        padding: 30px;
    }

    .page-game-rules__terms-overview {
        flex-direction: column;
        text-align: center;
    }

    .page-game-rules__terms-image,
    .page-game-rules__terms-content {
        width: 100%;
    }

    .page-game-rules__terms-image {
        margin-bottom: 20px;
    }

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

    .page-game-rules__btn-primary,
    .page-game-rules__btn-secondary {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Mobile Specific Styles (max-width: 768px) */
@media (max-width: 768px) {
    .page-game-rules {
        font-size: 15px;
        line-height: 1.6;
    }

    .page-game-rules__container {
        padding-left: 15px !important;
        padding-right: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Hero Section */
    .page-game-rules__hero-section {
        padding-bottom: 30px;
        padding-top: 10px !important; /* Small top padding, body handles header offset */
    }

    .page-game-rules__hero-image {
        object-fit: contain; /* Mobile: contain to show full image without cropping */
        height: auto !important;
        max-height: 300px; /* Limit height on small screens */
        max-width: 100% !important;
        width: 100% !important;
    }

    .page-game-rules__hero-content {
        margin-top: -80px; /* Adjust overlap for smaller screens */
        padding: 20px;
        max-width: calc(100% - 30px); /* Account for container padding */
    }

    .page-game-rules__main-title {
        font-size: 1.8em;
        line-height: 1.3;
    }

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

    .page-game-rules__cta-buttons {
        flex-direction: column !important; /* Force column layout */
        gap: 10px;
    }

    .page-game-rules__btn-primary,
    .page-game-rules__btn-secondary,
    .page-game-rules a[class*="button"],
    .page-game-rules 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;
        margin: 0 auto; /* Center buttons */
    }

    /* General Rules Grid */
    .page-game-rules__grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .page-game-rules__rule-card,
    .page-game-rules__responsible-card {
        min-height: auto;
    }

    .page-game-rules__card-image {
        height: auto !important;
        max-height: 250px;
        max-width: 100% !important;
        width: 100% !important;
    }

    .page-game-rules__card-title {
        font-size: 1.4em;
    }

    /* Specific Game Rules Grid */
    .page-game-rules__game-rules-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .page-game-rules__game-rule-item {
        min-height: auto;
    }

    .page-game-rules__game-image {
        height: auto !important;
        max-height: 200px;
        max-width: 100% !important;
        width: 100% !important;
    }

    .page-game-rules__game-title {
        font-size: 1.6em;
    }

    /* Terms Overview */
    .page-game-rules__terms-overview {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .page-game-rules__terms-image {
        width: 100% !important;
        height: auto !important;
        max-height: 250px;
        max-width: 100% !important;
    }

    .page-game-rules__terms-content {
        width: 100% !important;
    }

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

    /* FAQ Section */
    .page-game-rules__faq-item summary {
        font-size: 1em;
        padding: 15px 20px;
    }

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

    /* General images and containers for mobile */
    .page-game-rules img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block;
    }
    
    .page-game-rules__section,
    .page-game-rules__card,
    .page-game-rules__container,
    .page-game-rules__grid-container,
    .page-game-rules__game-rules-grid,
    .page-game-rules__terms-overview {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* No specific winner list or game grid for this page, but general image/container rules apply */

    /* Other content modules (padding adjustments) */
    .page-game-rules__general-rules-section,
    .page-game-rules__specific-rules-section,
    .page-game-rules__responsible-gaming-section,
    .page-game-rules__terms-faq-section,
    .page-game-rules__contact-cta-section {
        padding: 30px 0;
    }
}

/* Ensure images within content areas don't fall below 200px display size */
.page-game-rules__card-image,
.page-game-rules__game-image,
.page-game-rules__terms-image {
    min-width: 200px;
    min-height: 200px;
}

/* Contrast Fixes - although palette is mostly dark, good to have */
.page-game-rules__contrast-fix {
    background: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #e0e0e0 !important;
}

.page-game-rules__text-contrast-fix {
    color: #333333 !important;
    text-shadow: none !important;
}