/* style/game-rules.css */

/* Custom Colors */
:root {
    --color-background: #08160F;
    --color-card-bg: #11271B;
    --color-text-main: #F2FFF6;
    --color-text-secondary: #A7D9B8;
    --color-btn-gradient-start: #2AD16F;
    --color-btn-gradient-end: #13994A;
    --color-glow: #57E38D;
    --color-gold: #F2C14E;
    --color-border: #2E7A4E;
    --color-divider: #1E3A2A;
    --color-deep-green: #0A4B2C;
}

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

.page-game-rules__section {
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

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

.page-game-rules__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 0 60px 0; /* Small top padding, more bottom padding */
    background-color: var(--color-background);
}

.page-game-rules__hero-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin-bottom: 30px;
    border-radius: 8px;
}

.page-game-rules__hero-content {
    text-align: center;
    max-width: 900px;
    padding: 0 20px;
}

.page-game-rules__main-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    color: var(--color-gold);
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.page-game-rules__description {
    font-size: 1.15rem;
    color: var(--color-text-secondary);
    margin-bottom: 30px;
}

.page-game-rules__section-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--color-text-main);
    text-align: center;
    margin-bottom: 40px;
    font-weight: bold;
    line-height: 1.3;
}

.page-game-rules p {
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

.page-game-rules__image-content {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 30px auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

.page-game-rules__btn-primary,
.page-game-rules__btn-secondary,
.page-game-rules__card-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 30px;
    border-radius: 50px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
    font-size: 1.05rem;
    box-sizing: border-box;
    max-width: 100%;
}

.page-game-rules__btn-primary {
    background: linear-gradient(180deg, var(--color-btn-gradient-start) 0%, var(--color-btn-gradient-end) 100%);
    color: #ffffff; /* White text on green button */
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(var(--color-glow-rgb, 87, 227, 141), 0.4);
}

.page-game-rules__btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(var(--color-glow-rgb, 87, 227, 141), 0.6);
}

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

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

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

.page-game-rules__game-card {
    background-color: var(--color-card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    border: 1px solid var(--color-border);
}

.page-game-rules__card-title {
    font-size: 1.6rem;
    color: var(--color-text-main);
    margin-bottom: 15px;
    font-weight: bold;
    line-height: 1.4;
}

.page-game-rules__card-image {
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--color-divider);
}

.page-game-rules__game-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 20px;
}

.page-game-rules__card-link {
    background: var(--color-deep-green);
    color: var(--color-text-main);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    margin-top: auto; /* Push to bottom */
    border: 1px solid var(--color-border);
}

.page-game-rules__card-link:hover {
    background: var(--color-glow);
    color: var(--color-background);
}

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

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

.page-game-rules__faq-item {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    color: var(--color-text-main);
}

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

.page-game-rules__faq-question:hover {
    background-color: rgba(var(--color-glow-rgb, 87, 227, 141), 0.1);
}

.page-game-rules__faq-item[open] .page-game-rules__faq-question {
    background-color: var(--color-deep-green);
    color: var(--color-gold);
}

.page-game-rules__faq-qtext {
    flex-grow: 1;
}

.page-game-rules__faq-toggle {
    font-size: 1.5rem;
    line-height: 1;
    margin-left: 15px;
    color: var(--color-gold);
}

.page-game-rules__faq-item[open] .page-game-rules__faq-toggle {
    color: var(--color-text-main);
}

.page-game-rules__faq-answer {
    padding: 0 25px 20px 25px;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
}

.page-game-rules__faq-answer p {
    margin-bottom: 0;
}

/* Details element specific styling */
.page-game-rules__faq-item summary::-webkit-details-marker {
    display: none;
}

.page-game-rules__faq-item summary {
    list-style: none;
}

.page-game-rules__final-cta-section {
    text-align: center;
    padding: 80px 0;
    background-color: var(--color-background);
}

.page-game-rules__final-cta-section .page-game-rules__description {
    max-width: 800px;
    margin: 0 auto 30px auto;
}

/* Utility for RGB conversion */
:root {
    --color-glow-rgb: 87, 227, 141;
    --color-gold-rgb: 242, 193, 78;
}

/* Responsive styles */
@media (max-width: 1024px) {
    .page-game-rules__hero-section {
        padding: 10px 0 50px 0;
    }

    .page-game-rules__main-title {
        font-size: clamp(2rem, 5vw, 3rem);
    }

    .page-game-rules__description {
        font-size: 1rem;
    }

    .page-game-rules__section-title {
        font-size: clamp(1.8rem, 4vw, 2.5rem);
    }

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

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

    .page-game-rules__hero-section {
        padding: 10px 0 40px 0;
    }

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

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

    .page-game-rules__main-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        margin-bottom: 15px;
    }

    .page-game-rules__description {
        font-size: 0.95rem;
        margin-bottom: 25px;
    }

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

    .page-game-rules__section-title {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
        margin-bottom: 30px;
    }

    .page-game-rules p {
        font-size: 0.9rem;
    }

    .page-game-rules__image-content {
        margin: 20px auto;
    }

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

    .page-game-rules__btn-primary,
    .page-game-rules__btn-secondary,
    .page-game-rules__card-link {
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        word-wrap: break-word !important;
        padding: 12px 20px;
        font-size: 1rem;
        margin: 0 auto;
    }

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

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

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

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

    .page-game-rules__card-link {
        font-size: 0.85rem;
        padding: 8px 15px;
    }

    .page-game-rules__faq-section {
        padding: 50px 0;
    }

    .page-game-rules__faq-list {
        margin-top: 30px;
        padding: 0 15px;
    }

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

    .page-game-rules__faq-toggle {
        font-size: 1.3rem;
    }

    .page-game-rules__faq-answer {
        padding: 0 20px 15px 20px;
        font-size: 0.85rem;
    }

    .page-game-rules__final-cta-section {
        padding: 50px 0;
    }

    /* Mobile image responsiveness */
    .page-game-rules img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        display: block !important;
    }
    
    .page-game-rules__section,
    .page-game-rules__container,
    .page-game-rules__game-card {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding-left: 15px;
        padding-right: 15px;
        overflow: hidden !important;
    }
    
    .page-game-rules__hero-section,
    .page-game-rules__general-rules-section,
    .page-game-rules__specific-rules-section,
    .page-game-rules__fair-play-security-section,
    .page-game-rules__responsible-gaming-section,
    .page-game-rules__dispute-resolution-section,
    .page-game-rules__faq-section,
    .page-game-rules__final-cta-section {
        padding-left: 0;
        padding-right: 0;
    }
    
    .page-game-rules__container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-game-rules__hero-section {
        padding-top: 10px !important; /* body already handles --header-offset */
    }
}

@media (max-width: 480px) {
    .page-game-rules__main-title {
        font-size: clamp(1.6rem, 8vw, 2.2rem);
    }

    .page-game-rules__section-title {
        font-size: clamp(1.4rem, 7vw, 1.8rem);
    }

    .page-game-rules__btn-primary,
    .page-game-rules__btn-secondary {
        padding: 10px 15px;
        font-size: 0.95rem;
    }

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

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