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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a0a2e 25%, #0a1a3e 50%, #1a0a2e 75%, #0a0a1a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 40px 20px;
    overflow-x: hidden;
}

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

/* Fireworks Canvas */
#fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

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

/* Mouse sparkle effect */
.sparkle {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 9999;
    animation: sparkleAnim 1s ease-out forwards;
}

.sparkle::before,
.sparkle::after {
    content: '';
    position: absolute;
    background: hsl(var(--hue, 50), 100%, 70%);
    border-radius: 50%;
}

.sparkle::before {
    width: 100%;
    height: 100%;
    box-shadow: 0 0 10px hsl(var(--hue, 50), 100%, 70%),
                0 0 20px hsl(var(--hue, 50), 100%, 70%);
}

.sparkle::after {
    width: 4px;
    height: 4px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
}

@keyframes sparkleAnim {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

header {
    text-align: center;
    margin-bottom: 50px;
}

h1 {
    font-size: 3.5rem;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #ff6b6b);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
    margin-bottom: 10px;
    filter: drop-shadow(0 0 20px rgba(255, 107, 107, 0.5));
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    color: #a0a0a0;
    font-size: 1.2rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

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

.game-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    text-decoration: none;
    display: block;
    position: relative;
    backdrop-filter: blur(10px);
}

/* Neon glow border animation */
.game-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
    background-size: 400% 400%;
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    animation: borderGlow 3s linear infinite;
    transition: opacity 0.3s ease;
}

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

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

.game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 30, 0.9);
    border-radius: 18px;
    z-index: -1;
}

.game-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5),
                0 0 50px rgba(255, 0, 128, 0.2),
                0 0 100px rgba(64, 224, 208, 0.1);
}

.game-preview {
    height: 200px;
    position: relative;
    overflow: hidden;
    background: #1a1a2e;
}

.game-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.game-card:hover .game-preview img {
    transform: scale(1.1);
    filter: brightness(1.1);
}

/* Animated shine effect */
.game-preview::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: 2;
    pointer-events: none;
}

.game-card:hover .game-preview::after {
    transform: translateX(100%);
}

/* Gradient overlay for better text contrast */
.game-preview::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    z-index: 1;
    pointer-events: none;
}

.game-info {
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.game-title {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.game-description {
    color: #b0b0b0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.play-button {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 30px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f64f59);
    background-size: 200% 200%;
    color: white;
    border-radius: 25px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: buttonGradient 3s ease infinite;
}

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

.play-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.game-card:hover .play-button::before {
    left: 100%;
}

.game-card:hover .play-button {
    box-shadow: 0 5px 30px rgba(102, 126, 234, 0.6),
                0 0 20px rgba(118, 75, 162, 0.4);
    transform: scale(1.05);
}

/* Floating particles animation */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
    border-radius: 50%;
    animation: float 20s infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(80vh) rotate(90deg) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) rotate(630deg) scale(1);
    }
    100% {
        transform: translateY(-10vh) rotate(720deg) scale(0);
        opacity: 0;
    }
}

.particle:nth-child(1) { left: 5%; animation-delay: 0s; animation-duration: 25s; background: radial-gradient(circle, rgba(255, 107, 107, 0.8), transparent); }
.particle:nth-child(2) { left: 15%; animation-delay: 2s; animation-duration: 30s; background: radial-gradient(circle, rgba(254, 202, 87, 0.8), transparent); }
.particle:nth-child(3) { left: 25%; animation-delay: 4s; animation-duration: 22s; background: radial-gradient(circle, rgba(72, 219, 251, 0.8), transparent); }
.particle:nth-child(4) { left: 35%; animation-delay: 1s; animation-duration: 28s; background: radial-gradient(circle, rgba(255, 159, 243, 0.8), transparent); }
.particle:nth-child(5) { left: 45%; animation-delay: 3s; animation-duration: 24s; background: radial-gradient(circle, rgba(102, 126, 234, 0.8), transparent); }
.particle:nth-child(6) { left: 55%; animation-delay: 5s; animation-duration: 26s; background: radial-gradient(circle, rgba(255, 107, 107, 0.8), transparent); }
.particle:nth-child(7) { left: 65%; animation-delay: 2.5s; animation-duration: 21s; background: radial-gradient(circle, rgba(29, 209, 161, 0.8), transparent); }
.particle:nth-child(8) { left: 75%; animation-delay: 1.5s; animation-duration: 29s; background: radial-gradient(circle, rgba(255, 234, 167, 0.8), transparent); }
.particle:nth-child(9) { left: 85%; animation-delay: 4.5s; animation-duration: 20s; background: radial-gradient(circle, rgba(162, 155, 254, 0.8), transparent); }
.particle:nth-child(10) { left: 95%; animation-delay: 0.5s; animation-duration: 27s; background: radial-gradient(circle, rgba(0, 206, 201, 0.8), transparent); }
.particle:nth-child(11) { left: 10%; animation-delay: 6s; animation-duration: 23s; background: radial-gradient(circle, rgba(255, 118, 117, 0.8), transparent); }
.particle:nth-child(12) { left: 30%; animation-delay: 7s; animation-duration: 31s; background: radial-gradient(circle, rgba(116, 185, 255, 0.8), transparent); }

footer {
    text-align: center;
    margin-top: 60px;
    padding: 30px;
    color: #666;
    font-size: 0.9rem;
    position: relative;
}

footer p {
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
    letter-spacing: 2px;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

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

    .subtitle {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
}
