* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.search-container {
    display: flex;
    gap: 0.5rem;
    max-width: 300px;
    width: 100%;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    placeholder-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Category Navigation */
.category-nav {
    background: white;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    overflow-x: auto;
}

.category-container {
    display: flex;
    gap: 0.5rem;
    min-width: min-content;
}

.category-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-weight: 500;
}

.category-btn:hover, .category-btn.active {
    background: #6366F1;
    border-color: #6366F1;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Stats Container */
.stats-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem;
    background: white;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: #6366F1;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #374151;
    text-align: center;
}

/* Featured Games */
.featured-section {
    padding: 2rem 1rem;
    background: white;
}

.featured-games {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Games Section */
.games-section {
    padding: 2rem 1rem;
    background: #f9fafb;
}

.filter-info {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #6b7280;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* Game Card Styles */
.game-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.15);
}

.game-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.game-info {
    padding: 1rem;
}

.game-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.game-description {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e0e7ff;
    color: #6366F1;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(99, 102, 241, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #6366F1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    border-radius: 16px;
    width: 95%;
    max-width: 900px;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #6b7280;
}

.close-btn:hover {
    color: #374151;
}

.modal-body {
    flex: 1;
    padding: 0;
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Footer */
.footer {
    background: #374151;
    color: white;
    text-align: center;
    padding: 2rem 1rem;
}

.footer-content p {
    margin-bottom: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        font-size: 1.5rem;
    }

    .search-container {
        max-width: 100%;
    }

    .category-container {
        justify-content: flex-start;
        padding-bottom: 0.5rem;
    }

    .stats-container {
        gap: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .game-image {
        height: 150px;
    }

    .modal-content {
        margin: 5% auto;
        width: 98%;
        height: 85vh;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: 1fr;
    }

    .featured-games {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.3rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card {
    animation: fadeIn 0.5s ease-out;
}

/* Touch-friendly buttons */
@media (hover: none) and (pointer: coarse) {
    .category-btn, .game-card, .load-more-btn {
        transform: none !important;
    }
    
    .category-btn:active, .load-more-btn:active {
        background: #4f46e5;
    }
    
    .game-card:active {
        transform: scale(0.98);
    }
}