/* style/game-rules.css */

/* Variables and basic resets for page-game-rules scope */
.page-game-rules {
    --primary-color: #E53935;
    --secondary-color: #FF5A4F;
    --card-bg: #FFFFFF;
    --page-bg: #F5F7FA;
    --text-main: #333333;
    --border-color: #E0E0E0;
    --button-gradient: linear-gradient(180deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    font-family: 'Roboto', sans-serif; /* Assuming Roboto or similar font */
    color: var(--text-main); /* Default text color for the page */
    line-height: 1.6;
    background-color: var(--page-bg);
}

/* Ensure text in main content is readable against default light background */
.page-game-rules h1,
.page-game-rules h2,
.page-game-rules h3,
.page-game-rules h4,
.page-game-rules p,
.page-game-rules li {
    color: var(--text-main);
}

/* Generic container for content sections */
.page-game-rules__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Section styling */
.page-game-rules__section {
    padding: 60px 0;
    margin-bottom: 20px;
}

.page-game-rules__section:nth-of-type(even) {
    background-color: #fcfcfc; /* Slightly different background for alternating sections */
}

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

.page-game-rules__paragraph {
    font-size: 16px;
    margin-bottom: 20px;
    text-align: justify;
}

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

.page-game-rules__list li {
    margin-bottom: 10px;
}

.page-game-rules__list-item-highlight {
    color: var(--primary-color);
    font-weight: bold;
}

/* HERO Section */
.page-game-rules__hero-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    padding-top: 10px; /* Small top padding, main offset handled by body from shared.css */
    background: var(--page-bg); /* Ensure a background for the section */
}

.page-game-rules__hero-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-game-rules__hero-image {
    width: 100%;
    margin-bottom: 30px;
}

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

.page-game-rules__hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

.page-game-rules__main-title {
    font-size: 42px;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.page-game-rules__intro-text {
    font-size: 18px;
    color: var(--text-main);
    max-width: 800px;
    margin: 0 auto 30px;
}

/* CTA Button Styles */
.page-game-rules__cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: var(--button-gradient);
    color: #ffffff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: bold;
    margin-top: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(229, 57, 53, 0.4);
    border: none;
    cursor: pointer;
}

.page-game-rules__cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(229, 57, 53, 0.6);
}

.page-game-rules__cta-button--small {
    padding: 12px 30px;
    font-size: 16px;
    margin-top: 20px;
}

.page-game-rules__cta-button--large {
    padding: 18px 50px;
    font-size: 20px;
    margin-top: 40px;
}

.page-game-rules__cta-button--full-width {
    width: 100%;
    max-width: 400px; /* Limit max width for full width buttons */
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Card Styles */
.page-game-rules__card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-main); /* Ensure card text is readable */
}

.page-game-rules__card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.page-game-rules__card img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-bottom: 20px;
    border-radius: 4px;
}

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

.page-game-rules__feature-item {
    text-align: center;
}

.page-game-rules__feature-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-game-rules__feature-description {
    font-size: 15px;
    line-height: 1.6;
}

/* Game Category Section */
.page-game-rules__game-category {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px dashed var(--border-color);
}

.page-game-rules__game-category:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.page-game-rules__game-category-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-align: center;
}

.page-game-rules__game-subcategory-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--secondary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Step-by-Step Guide */
.page-game-rules__step-by-step {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.page-game-rules__step-item {
    text-align: center;
}

.page-game-rules__step-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-game-rules__step-description {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

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

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

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

.page-game-rules__promo-item {
    text-align: center;
}

.page-game-rules__promo-title {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.page-game-rules__promo-description {
    font-size: 15px;
    line-height: 1.6;
}

/* Support Section */
.page-game-rules__support-subtitle {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 20px;
}

/* FAQ Section */
details.page-game-rules__faq-item {
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    background: var(--card-bg);
}
details.page-game-rules__faq-item summary.page-game-rules__faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background-color 0.3s ease;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}
details.page-game-rules__faq-item summary.page-game-rules__faq-question::-webkit-details-marker {
    display: none;
}
details.page-game-rules__faq-item summary.page-game-rules__faq-question:hover {
    background: #f8f8f8;
}
.page-game-rules__faq-qtext {
    flex: 1;
    line-height: 1.5;
    text-align: left;
    color: var(--primary-color);
}
.page-game-rules__faq-toggle {
    font-size: 28px;
    font-weight: bold;
    color: var(--secondary-color);
    flex-shrink: 0;
    margin-left: 15px;
    width: 30px;
    text-align: center;
}
details.page-game-rules__faq-item .page-game-rules__faq-answer {
    padding: 0 25px 25px;
    background: #fdfdfd;
    border-radius: 0 0 8px 8px;
    font-size: 16px;
    color: var(--text-main);
}
.page-game-rules__faq-answer p {
    margin: 0;
}

/* Conclusion Section */
.page-game-rules__conclusion-subtitle {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 20px;
}

/* Image styles */
.page-game-rules img {
    max-width: 100%;
    height: auto;
    display: block; /* Ensure images are block level for max-width to work correctly */
    object-fit: cover; /* Maintain aspect ratio and cover container */
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-game-rules__main-title {
        font-size: 36px;
    }
    .page-game-rules__section-title {
        font-size: 28px;
    }
    .page-game-rules__intro-text {
        font-size: 17px;
    }
    .page-game-rules__cta-button {
        padding: 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .page-game-rules__hero-section {
        padding-top: 10px !important; /* Fixed header offset */
        padding-bottom: 40px;
        padding-left: 15px;
        padding-right: 15px;
    }

    .page-game-rules__hero-image img {
        border-radius: 4px;
    }

    .page-game-rules__main-title {
        font-size: 30px;
    }

    .page-game-rules__intro-text {
        font-size: 16px;
    }

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

    .page-game-rules__container,
    .page-game-rules__feature-grid,
    .page-game-rules__step-by-step,
    .page-game-rules__promo-grid {
        padding: 0 15px; /* Adjust padding for mobile containers */
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .page-game-rules__section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .page-game-rules__paragraph,
    .page-game-rules__list li,
    .page-game-rules__feature-description,
    .page-game-rules__step-description,
    .page-game-rules__promo-description {
        font-size: 15px;
    }

    .page-game-rules__feature-grid,
    .page-game-rules__step-by-step,
    .page-game-rules__promo-grid {
        grid-template-columns: 1fr; /* Stack columns on mobile */
        gap: 20px;
    }

    .page-game-rules__game-category-title {
        font-size: 24px;
    }
    .page-game-rules__game-subcategory-title {
        font-size: 20px;
    }

    /* Mobile image responsiveness */
    .page-game-rules img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
    
    /* Mobile button responsiveness */
    .page-game-rules__cta-button,
    .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;
    }
    
    .page-game-rules__button-group {
        display: flex;
        flex-direction: column; /* Stack buttons vertically */
        gap: 15px;
    }

    details.page-game-rules__faq-item summary.page-game-rules__faq-question {
        padding: 15px 20px;
        font-size: 16px;
    }
    .page-game-rules__faq-qtext {
        font-size: 16px;
    }
    .page-game-rules__faq-toggle {
        font-size: 24px;
        width: 24px;
    }
    details.page-game-rules__faq-item .page-game-rules__faq-answer {
        padding: 0 20px 20px;
    }
}

@media (max-width: 480px) {
    .page-game-rules__main-title {
        font-size: 26px;
    }
    .page-game-rules__section-title {
        font-size: 22px;
    }
    .page-game-rules__cta-button--large {
        padding: 15px 30px;
        font-size: 18px;
    }
    details.page-game-rules__faq-item summary.page-game-rules__faq-question {
        font-size: 15px;
    }
    .page-game-rules__faq-qtext {
        font-size: 15px;
    }
}