/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Modern CSS APIs */
@supports (display: grid) {
    .container {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Performance optimizations */
* {
    will-change: auto;
}

img {
    content-visibility: auto;
    contain-intrinsic-size: 300px 200px;
}

/* Image loading optimization */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Preload critical images */
.hero {
    background-image: none;
}

/* Optimize image rendering */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

:root {
    --primary-color: #4CAF50;
    --primary-light: #e8f5e9;
    --secondary-color: #2196F3;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --accent-color: #ff9800;
    --text-color: #333;
    --white: #ffffff;
}

body {
    background-color: #f9f9f9;
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #388E3C 100%);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--accent-color);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 25px;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 4px;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.auth-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-login {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-login:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-register {
    background-color: var(--accent-color);
    border: 2px solid var(--accent-color);
    color: var(--white);
}

.btn-register:hover {
    background-color: #f57c00;
    border-color: #f57c00;
}

        /* Hero Section */
        .hero {
            padding: 80px 0;
            background: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9));
            text-align: center;
            position: relative;
            overflow: hidden;
            /* Modern CSS features */
            contain: layout style paint;
            isolation: isolate;
        }
        
        .hero::after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: 
                linear-gradient(45deg, var(--primary-color) 25%, transparent 25%),
                linear-gradient(-45deg, var(--primary-color) 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, var(--primary-color) 75%),
                linear-gradient(-45deg, transparent 75%, var(--primary-color) 75%);
            background-size: 20px 20px;
            background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
            opacity: 0.1;
            z-index: -1;
        }

.hero::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, transparent 20%, var(--primary-light) 20%, var(--primary-light) 80%, transparent 80%, transparent);
    background-size: 10px 10px;
    opacity: 0.3;
    transform: rotate(30deg);
    animation: backgroundMove 60s linear infinite;
}

        @keyframes backgroundMove {
            0% { 
                transform: rotate(30deg) translate3d(0, 0, 0); 
            }
            100% { 
                transform: rotate(30deg) translate3d(-20px, -20px, 0); 
            }
        }

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

        .hero h1 {
            font-size: 56px;
            margin-bottom: 20px;
            color: var(--dark-color);
        }

.hero h1 span {
    color: var(--primary-color);
}

        .hero p {
            font-size: 19px;
            margin-bottom: 30px;
            color: #555;
        }

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

        .btn-primary {
            background-color: var(--primary-color);
            color: var(--white);
            padding: 12px 30px;
            font-size: 18px;
        }

        .btn-primary:hover {
            background-color: #388E3C;
            transform: translate3d(0, -3px, 0);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            /* Modern CSS features */
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .btn-secondary {
            background-color: transparent;
            color: var(--primary-color);
            border: 2px solid var(--primary-color);
            padding: 12px 30px;
            font-size: 18px;
        }

        .btn-secondary:hover {
            background-color: var(--primary-light);
            transform: translate3d(0, -3px, 0);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            /* Modern CSS features */
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

/* Features Section */
.features {
    padding: 80px 0;
    background-color: var(--white);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

        .section-title h2 {
            font-size: 40px;
            color: var(--dark-color);
            margin-bottom: 15px;
        }

.section-title p {
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background-color: var(--light-color);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

        .feature-card:hover {
            transform: translate3d(0, -10px, 0);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
            /* Modern CSS features */
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            will-change: transform, box-shadow;
        }

.feature-icon {
    width: 80px;
    height: 80px;
    background-color: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
    color: var(--primary-color);
}

        .feature-card h3 {
            font-size: 24px;
            margin-bottom: 15px;
            color: var(--dark-color);
        }

/* Games Section */
.games {
    padding: 80px 0;
    background-color: var(--primary-light);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.game-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

        .game-card:hover {
            transform: translate3d(0, -10px, 0);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
            /* Modern CSS features */
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            will-change: transform, box-shadow;
        }

        .game-image {
            height: 200px;
            background: linear-gradient(45deg, #4CAF50, #2196F3);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            font-size: 19px;
        }

        .game-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            /* Modern CSS features */
            content-visibility: auto;
            contain-intrinsic-size: 300px 200px;
            /* Image optimization */
            image-rendering: -webkit-optimize-contrast;
            image-rendering: crisp-edges;
            /* Performance optimization */
            transform: translateZ(0);
            backface-visibility: hidden;
        }
        
        /* Picture element optimization */
        .game-image picture {
            display: block;
            width: 100%;
            height: 100%;
        }

.game-content {
    padding: 20px;
}

        .game-content h3 {
            font-size: 21px;
            margin-bottom: 10px;
            color: var(--dark-color);
        }

.game-content p {
    color: #666;
    margin-bottom: 15px;
}

.btn-download {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-download:hover {
    background-color: #388E3C;
}

/* Registration Steps */
.registration {
    padding: 80px 0;
    background-color: var(--white);
}

.steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 50px;
}

.step {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    text-align: center;
    padding: 30px;
    background-color: var(--primary-light);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

        .step-number {
            width: 50px;
            height: 50px;
            background-color: var(--primary-color);
            color: var(--white);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            font-weight: bold;
            margin: 0 auto 20px;
        }

        .step h3 {
            font-size: 21px;
            margin-bottom: 15px;
            color: var(--dark-color);
        }

/* Footer */
footer {
    background-color: var(--dark-color);
    color: var(--light-color);
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

        .footer-column h3 {
            font-size: 21px;
            margin-bottom: 20px;
            color: var(--white);
        }

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #bbb;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-column ul li a:hover {
    color: var(--white);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
}

        .social-links a:hover {
            background-color: var(--primary-color);
            transform: translate3d(0, -3px, 0);
            /* Modern CSS features */
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            will-change: transform, background-color;
        }

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

        /* Responsive Design */
        @media (max-width: 768px) {
            .header-content {
                flex-direction: column;
                gap: 15px;
            }
            
            nav ul {
                flex-wrap: wrap;
                justify-content: center;
                gap: 10px;
            }
            
            nav ul li {
                margin: 5px;
            }
            
                .hero h1 {
                font-size: 40px;
            }
            
            .hero-buttons {
                flex-direction: column;
                align-items: center;
            }
            
            .features-grid, .games-grid {
                grid-template-columns: 1fr;
            }
        }
        
        /* Modern CSS features for better performance */

        
        @media (prefers-color-scheme: dark) {
            :root {
                --text-color: #ffffff;
                --white: #1a1a1a;
                --light-color: #2a2a2a;
            }
        }

/* Accessibility Improvements */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

a:focus, button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Page-specific styles */
.main-content {
    padding: 50px 0;
    background-color: var(--white);
    min-height: 80vh;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

        .page-header h1 {
            font-size: 40px;
            color: var(--dark-color);
            margin-bottom: 15px;
        }

        .page-header p {
            color: #666;
            font-size: 18px;
        }

.content-section {
    margin-bottom: 40px;
}

        .content-section h2 {
            font-size: 29px;
            color: var(--primary-color);
            margin-bottom: 20px;
            border-bottom: 2px solid var(--primary-light);
            padding-bottom: 10px;
        }

        .content-section h3 {
            font-size: 22px;
            color: var(--dark-color);
            margin-bottom: 15px;
            margin-top: 25px;
        }

.content-section p {
    margin-bottom: 15px;
    color: #555;
}

.content-section ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
    color: #555;
}

.content-section a {
    color: var(--primary-color);
    text-decoration: none;
}

.content-section a:hover {
    text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
