/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a1a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.08);
    --border-card-hover: rgba(255, 255, 255, 0.18);
    --text-primary: #f0f0f5;
    --text-secondary: rgba(240, 240, 245, 0.55);
    --accent-1: #6c5ce7;
    --accent-2: #00cec9;
    --accent-3: #fd79a8;
    --accent-4: #fdcb6e;
    --gradient-hero: linear-gradient(135deg, #6c5ce7 0%, #00cec9 50%, #fd79a8 100%);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 16px 48px rgba(108, 92, 231, 0.15);
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== Particle Canvas ===== */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ===== Container ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Header ===== */
header {
    text-align: center;
    padding: 60px 0 40px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.logo-icon {
    font-size: 3rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin-bottom: 32px;
    letter-spacing: 0.01em;
}

/* ===== Search Bar ===== */
.search-bar {
    position: relative;
    max-width: 480px;
    margin: 0 auto 24px;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.search-bar input {
    width: 100%;
    padding: 14px 20px 14px 52px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    outline: none;
    transition: all var(--transition-medium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.search-bar input:focus {
    border-color: var(--accent-1);
    background: rgba(108, 92, 231, 0.08);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.12);
}

.search-bar input:focus ~ .search-icon,
.search-bar input:focus + .search-icon {
    color: var(--accent-1);
}

/* ===== Filter Chips ===== */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.chip {
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.chip.active {
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.3);
}

/* ===== Games Grid ===== */
main {
    padding-bottom: 40px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

/* ===== Game Card ===== */
.game-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 28px 24px 24px;
    cursor: pointer;
    transition: all var(--transition-medium);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 0;
    transform: translateY(20px);
    animation: cardIn 0.5s ease-out forwards;
}

@keyframes cardIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent, var(--gradient-hero));
    opacity: 0;
    transition: opacity var(--transition-medium);
}

.game-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-card-hover);
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-6px);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card:active {
    transform: translateY(-2px);
    transition-duration: 0.1s;
}

.card-icon {
    font-size: 2.8rem;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.5;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-players {
    background: rgba(108, 92, 231, 0.15);
    color: #a29bfe;
}

.badge-category {
    background: rgba(0, 206, 201, 0.15);
    color: #55efc4;
}

.card-arrow {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.game-card:hover .card-arrow {
    background: var(--accent-1);
    color: #fff;
    transform: translateX(4px);
}

.card-arrow svg {
    width: 16px;
    height: 16px;
}

/* ===== Loading ===== */
.loading-indicator {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.loading-indicator p {
    font-size: 1.1rem;
    font-weight: 300;
    margin-top: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--accent-1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== No Results ===== */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.no-results-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 16px;
}

.no-results p {
    font-size: 1.1rem;
    font-weight: 300;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 40px 0 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 20px;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 300;
}

footer strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    header {
        padding: 40px 0 28px;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .game-card {
        padding: 22px 20px 20px;
    }

    .logo-icon {
        font-size: 2.4rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 24px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .filter-chips {
        gap: 8px;
    }

    .chip {
        padding: 6px 14px;
        font-size: 0.82rem;
    }
}
