/* Rules Page Styles */
.rules-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    /* Optimize scrolling performance */
    contain: layout style paint;
    transform: translateZ(0);
}

/* Mobile styles for rules page */
@media (max-width: 768px) {
    .rules-container {
        padding: 10px;
    }
    
    .rules-header {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .rules-header h1 {
        font-size: 2em;
    }
    
    .rule-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .rule-section h2 {
        font-size: 1.3em;
    }
    
    .rule-section p {
        font-size: 14px;
        line-height: 1.5;
    }
    
    .rule-section ul {
        padding-left: 20px;
    }
    
    .rule-section li {
        font-size: 14px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .rules-container {
        padding: 5px;
    }
    
    .rules-header {
        padding: 12px;
    }
    
    .rules-header h1 {
        font-size: 1.5em;
    }
    
    .rule-section {
        padding: 12px;
    }
    
    .rule-section h2 {
        font-size: 1.1em;
    }
    
    .rule-section p,
    .rule-section li {
        font-size: 13px;
    }
}

.rules-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--borderradius);
    box-shadow: var(--shadow);
    /* Optimize rendering */
    will-change: auto;
    transform: translateZ(0);
    contain: layout style paint;
}

.rules-header h1 {
    color: var(--hover);
    font-size: 2.5em;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.rules-header h1 i {
    font-size: 0.8em;
}

.rules-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.rules-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--borderradius);
    padding: 25px;
    box-shadow: var(--shadow);
    /* Optimize performance during scroll */
    will-change: auto;
    transform: translateZ(0);
    contain: layout style paint;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
    .rules-section:hover {
        will-change: transform;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    
    .rules-section:not(:hover) {
        will-change: auto;
    }
}

.rules-section h2 {
    color: var(--hover);
    font-size: 1.5em;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--glass-border);
}

.rules-section h2 i {
    font-size: 0.9em;
}

.rules-list {
    color: var(--fontcolor);
}

.rules-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rules-list li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    padding-left: 25px;
    line-height: 1.6;
    transition: all 0.2s ease;
}

.rules-list li:last-child {
    border-bottom: none;
}

.rules-list li:before {
    content: "•";
    color: var(--hover);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 10px;
    font-size: 1.2em;
}

@media (hover: hover) and (pointer: fine) {
    .rules-list li:hover {
        background: rgba(245, 47, 47, 0.05);
        padding-left: 30px;
        border-radius: 5px;
        transition: all 0.15s ease;
    }
}

.rules-list li strong {
    color: var(--hover);
    font-weight: 600;
}

.rules-footer {
    margin-top: 30px;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--borderradius);
    box-shadow: var(--shadow);
    text-align: center;
    /* Optimize rendering */
    transform: translateZ(0);
    contain: layout style paint;
}

.rules-footer p {
    color: var(--fontcolor);
    margin: 0;
    font-style: italic;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.rules-footer i {
    color: var(--hover);
    font-size: 1.2em;
}

/* Color coding for different rule sections */
.rules-section:nth-child(1) h2 {
    color: #ff6b6b;
}

.rules-section:nth-child(1) .rules-list li:before {
    color: #ff6b6b;
}

.rules-section:nth-child(2) h2 {
    color: #4ecdc4;
}

.rules-section:nth-child(2) .rules-list li:before {
    color: #4ecdc4;
}

.rules-section:nth-child(3) h2 {
    color: #ffe66d;
}

.rules-section:nth-child(3) .rules-list li:before {
    color: #ffe66d;
}

.rules-section:nth-child(4) h2 {
    color: #a8e6cf;
}

.rules-section:nth-child(4) .rules-list li:before {
    color: #a8e6cf;
}

/* Mobile styles */
@media (max-width: 768px) {
    .rules-container {
        padding: 10px;
    }
    
    /* Reduce backdrop-filter on mobile for better performance */
    .rules-header,
    .rules-section,
    .rules-footer {
        backdrop-filter: blur(10px);
    }
    
    .rules-header h1 {
        font-size: 2em;
        flex-direction: column;
        gap: 10px;
    }
    
    .rules-section {
        padding: 20px;
    }
    
    .rules-section h2 {
        font-size: 1.3em;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .rules-list li {
        padding-left: 20px;
        font-size: 0.95em;
    }
    
    .rules-footer p {
        flex-direction: column;
        gap: 5px;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .rules-header h1 {
        font-size: 1.8em;
    }
    
    .rules-section h2 {
        font-size: 1.2em;
    }
    
    .rules-list li {
        font-size: 0.9em;
        padding-left: 18px;
    }
}

/* Optimized animation for section loading - only on initial load */
@media (prefers-reduced-motion: no-preference) {
    .rules-section {
        opacity: 0;
        animation: slideInUp 0.4s ease forwards;
    }

    .rules-section:nth-child(1) { animation-delay: 0.05s; }
    .rules-section:nth-child(2) { animation-delay: 0.1s; }
    .rules-section:nth-child(3) { animation-delay: 0.15s; }
    .rules-section:nth-child(4) { animation-delay: 0.2s; }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* Fallback for reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .rules-section {
        opacity: 1;
        animation: none;
    }
}

/* Optimized hover effects for better interactivity */
@media (hover: hover) and (pointer: fine) {
    .rules-section h2:hover {
        transform: scale(1.01);
        transition: transform 0.15s ease;
    }

    .rules-list li:hover strong {
        color: white;
        text-shadow: 0 0 5px var(--hover);
        transition: color 0.15s ease, text-shadow 0.15s ease;
    }
}

/* Performance optimization for low-end devices */
@media (max-width: 768px) and (max-resolution: 150dpi) {
    .rules-header,
    .rules-section,
    .rules-footer {
        backdrop-filter: none;
        background: rgba(0, 0, 0, 0.8);
    }
    
    /* Disable animations on low-end devices */
    .rules-section {
        animation: none !important;
        opacity: 1 !important;
    }
}
