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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #f59e0b;
    --dark: #1e293b;
    --dark-light: #334155;
    --light: #f8fafc;
    --gray: #64748b;
    --success: #10b981;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

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

.logo {
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 30px;
    padding: 10px 20px;
    flex: 1;
    max-width: 500px;
    transition: all 0.2s ease;
}

.search-container:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    flex: 1;
    padding: 5px;
    font-family: 'Poppins', sans-serif;
    color: #fff;
}

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

.search-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--primary);
    transition: transform 0.2s ease;
}

.search-btn:hover {
    transform: scale(1.1);
}

.random-game-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.random-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Main Content */
main {
    padding: 40px 0;
}

/* Trending Banner */
.trending-banner {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    border: 2px solid rgba(236, 72, 153, 0.4);
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(236, 72, 153, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(236, 72, 153, 0.3); }
    50% { transform: scale(1.02); box-shadow: 0 12px 40px rgba(236, 72, 153, 0.5); }
}

.trending-icon {
    font-size: 32px;
    animation: fire 1.5s ease-in-out infinite;
}

@keyframes fire {
    0%, 100% { transform: scale(1) rotate(-5deg); }
    50% { transform: scale(1.2) rotate(5deg); }
}

.trending-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.trending-count {
    font-size: 14px;
    background: rgba(236, 72, 153, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--secondary);
    border: 1px solid rgba(236, 72, 153, 0.4);
}

/* Featured Sections */
.featured-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.3);
}

.title-icon {
    font-size: 32px;
}

/* Category Filter */
.category-filter {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(99, 102, 241, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    color: #fff;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
    border-color: var(--primary);
}

.game-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.game-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.game-card:hover .game-thumbnail img {
    transform: scale(1.05);
}

.game-placeholder {
    font-size: 48px;
    color: rgba(99, 102, 241, 0.3);
}

.game-info {
    padding: 15px;
}

.game-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    text-align: center;
    line-height: 1.4;
}

.game-category {
    font-size: 12px;
    color: var(--primary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.add-game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(236, 72, 153, 0.95));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-direction: column;
    gap: 10px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    z-index: 2;
}

.game-card:hover .add-game-overlay {
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: white;
}

.empty-state h2 {
    font-size: 36px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state p {
    font-size: 18px;
    opacity: 0.7;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 40px 0;
    margin-top: 80px;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.footer-content {
    text-align: center;
    color: white;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #fff;
}

.footer-text {
    font-size: 14px;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 22px;
        letter-spacing: 1px;
    }

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

    .game-thumbnail {
        height: 150px;
    }

    .random-game-btn {
        font-size: 11px;
        padding: 10px 18px;
    }

    .header-content {
        justify-content: center;
    }

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

    .category-btn {
        padding: 10px 18px;
        font-size: 12px;
    }

    .trending-banner {
        flex-direction: column;
        padding: 15px 20px;
        gap: 10px;
    }

    .trending-text {
        font-size: 20px;
    }

    .trending-icon {
        font-size: 28px;
    }

    .section-title {
        font-size: 22px;
    }

    .title-icon {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 12px;
    }

    .game-thumbnail {
        height: 130px;
    }

    .game-title {
        font-size: 13px;
    }

    .category-filter {
        gap: 8px;
    }

    .category-btn {
        padding: 8px 14px;
        font-size: 11px;
    }

    main {
        padding: 25px 0;
    }

    .empty-state h2 {
        font-size: 28px;
    }

    .empty-state p {
        font-size: 16px;
    }

    .trending-text {
        font-size: 18px;
    }

    .trending-count {
        font-size: 12px;
        padding: 6px 12px;
    }

    .section-title {
        font-size: 20px;
    }

    .featured-section {
        margin-bottom: 35px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Performance optimization - disable animations on lower-end devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
