/* style/game-rules.css */

/* Root variables for colors */
:root {
    --color-primary: #11A84E; /* Main color */
    --color-secondary: #22C768; /* Auxiliary color */
    --color-button-gradient-start: #2AD16F;
    --color-button-gradient-end: #13994A;
    --color-background-main: #08160F; /* Background */
    --color-card-background: #11271B; /* Card BG */
    --color-text-main: #F2FFF6; /* Text Main */
    --color-text-secondary: #A7D9B8; /* Text Secondary */
    --color-border: #2E7A4E; /* Border */
    --color-glow: #57E38D; /* Glow */
    --color-gold: #F2C14E; /* Gold */
    --color-divider: #1E3A2A; /* Divider */
    --color-deep-green: #0A4B2C; /* Deep Green */
}

.page-game-rules {
    background-color: var(--color-background-main);
    color: var(--color-text-main); /* Assuming body background is dark, use light text */
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
}

.page-game-rules__hero-section {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column; /* Image on top, content below */
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: 10px; /* Small top padding as body handles header offset */
    overflow: hidden;
    background-color: var(--color-deep-green); /* A darker green for hero background */
}

.page-game-rules__hero-image-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    margin-bottom: 30px; /* Space between image and content */
}

.page-game-rules__hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 10px;
}

.page-game-rules__hero-content {
    max-width: 900px;
    margin: 0 auto;
    z-index: 1;
    position: relative;
    padding: 20px;
    background-color: rgba(17, 40, 27, 0.8); /* Semi-transparent dark green overlay for text readability */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.page-game-rules__main-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem); /* Responsive font size */
    color: var(--color-gold);
    margin-bottom: 15px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

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

.page-game-rules__cta-buttons {
    display: flex;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
    gap: 20px;
    justify-content: center;
}

.page-game-rules__btn-primary,
.page-game-rules__btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping on desktop */
    box-sizing: border-box;
    text-align: center;
    min-width: 180px;
}

.page-game-rules__btn-primary {
    background: linear-gradient(180deg, var(--color-button-gradient-start) 0%, var(--color-button-gradient-end) 100%);
    color: #ffffff; /* White text for contrast */
    border: 2px solid transparent;
}

.page-game-rules__btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
}

.page-game-rules__btn-secondary {
    background: var(--color-deep-green); /* Darker background from palette */
    color: var(--color-secondary); /* Green text */
    border: 2px solid var(--color-secondary);
}

.page-game-rules__btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
    background: var(--color-secondary); /* Invert colors on hover */
    color: var(--color-deep-green);
}

.page-game-rules__section {
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px 20px;
    background-color: var(--color-card-background); /* Using card background for sections */
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.page-game-rules__section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: var(--color-gold);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

.page-game-rules__section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--color-primary);
    border-radius: 2px;
}

.page-game-rules__content-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.page-game-rules__content-wrapper--reversed {
    flex-direction: row-reverse;
}

.page-game-rules__text-block {
    flex: 1;
    color: var(--color-text-main);
}

.page-game-rules__text-block p {
    margin-bottom: 15px;
    font-size: 1rem;
}

.page-game-rules__sub-title {
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    color: var(--color-secondary);
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 600;
}

.page-game-rules__image-block {
    flex: 0 0 400px; /* Fixed width for image block on desktop */
    max-width: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.page-game-rules__image-item {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* FAQ Section */
.page-game-rules__faq-section {
    background-color: var(--color-deep-green); /* Darker background for contrast */
    color: var(--color-text-main);
}

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

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

.page-game-rules__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text-main);
    cursor: pointer;
    background-color: var(--color-deep-green);
    transition: background-color 0.3s ease;
    user-select: none; /* Prevent text selection on click */
}

.page-game-rules__faq-question:hover {
    background-color: var(--color-primary);
}

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

.page-game-rules__faq-toggle {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--color-secondary);
    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 25px 20px;
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    background-color: var(--color-card-background);
}

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

/* Remove default details/summary marker */
.page-game-rules__faq-item > summary {
    list-style: none;
}
.page-game-rules__faq-item > summary::-webkit-details-marker {
    display: none;
}


/* CTA bottom section */
.page-game-rules__cta-bottom {
    text-align: center;
    background: linear-gradient(135deg, var(--color-deep-green), var(--color-primary));
    padding: 60px 20px;
    margin-bottom: 0;
    border-radius: 0;
}

.page-game-rules__cta-bottom .page-game-rules__section-title {
    color: var(--color-gold);
    margin-bottom: 20px;
}

.page-game-rules__cta-bottom .page-game-rules__description {
    color: var(--color-text-main);
    max-width: 800px;
    margin: 0 auto 30px;
}

/* General link styling */
.page-game-rules a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Mobile responsiveness */
@media (max-width: 1024px) {
    .page-game-rules__content-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .page-game-rules__content-wrapper--reversed {
        flex-direction: column; /* Keep column direction for reversed on mobile */
    }

    .page-game-rules__image-block {
        flex: none;
        max-width: 100%;
        width: 100%;
        margin-top: 30px;
    }
}

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

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

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

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

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

    .page-game-rules__cta-buttons {
        flex-direction: column;
        gap: 15px;
        width: 100%; /* Ensure container fills width */
    }

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

    .page-game-rules__section-title {
        font-size: clamp(1.5rem, 5vw, 2.2rem);
        margin-bottom: 20px;
    }

    .page-game-rules__sub-title {
        font-size: clamp(1.2rem, 4vw, 1.6rem);
    }

    .page-game-rules__content-wrapper {
        gap: 20px;
    }

    /* Images responsiveness for content area */
    .page-game-rules img {
      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__image-block,
    .page-game-rules__hero-image-wrapper { /* Ensure image containers are also responsive */
      max-width: 100% !important;
      width: 100% !important;
      box-sizing: border-box !important;
      padding-left: 15px;
      padding-right: 15px;
      overflow: hidden !important; /* Prevent overflow for image containers */
    }

    /* FAQ specific for mobile */
    .page-game-rules__faq-question {
        padding: 15px 20px;
        font-size: 1rem;
    }

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