@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    background: linear-gradient(135deg, #020024, #090979, #00d4ff);
    color: white;
    font-family: 'Press Start 2P', cursive;
    text-align: center;
    padding: 20px;
    overflow-x: hidden;
    overflow-y: auto;
    animation: neonBackground 5s infinite alternate ease-in-out;
}

/* Moving Background Stars */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://png.pngtree.com/png-vector/20230120/ourmid/pngtree-neon-square-frame-clipart-png-image_6568438.png');
    opacity: 0.2;
    z-index: -1;
    animation: moveStars 20s linear infinite;
}

@keyframes moveStars {
    0% { background-position: 0 0; }
    100% { background-position: -1000px 1000px; }
}

/* Floating Header */
header {
    margin-bottom: 30px;
    animation: floatUpDown 3s infinite ease-in-out;
}

/* Glitch Effect for Header */
.glow-text {
    font-size: 2rem;
    text-transform: uppercase;
    text-shadow: 0 0 5px #00eaff, 0 0 10px #00eaff, 0 0 15px #00eaff, 0 0 20px #ff00ff;
    animation: glitch 1.5s infinite alternate;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

/* Pulsing Search Bar */
#searchBar {
    margin-top: 15px;
    padding: 12px;
    width: 80%;
    max-width: 400px;
    font-size: 1rem;
    border: 2px solid #00eaff;
    background: black;
    color: white;
    text-align: center;
    outline: none;
    border-radius: 25px;
    box-shadow: 0 0 10px #00eaff;
    animation: glowPulse 3s infinite alternate ease-in-out;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1000px;
    margin: auto;
}

/* Game Card with Rotating Neon Border */
.game-card {
    position: relative;
    border: 2px solid #00eaff;
    padding: 10px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    cursor: pointer;
    animation: rotateGlow 5s linear infinite;
}

@keyframes rotateGlow {
    0% { box-shadow: 0 0 10px #00eaff; }
    50% { box-shadow: 0 0 20px #ff00ff; }
    100% { box-shadow: 0 0 10px #00eaff; }
}

.game-card:hover {
    transform: scale(1.1);
}

/* Floating Game Images */
.game-card img {
    width: 100%;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    animation: floatUpDown 3s infinite ease-in-out;
}

@keyframes floatUpDown {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

/* Pulsing Game Titles */
.game-title {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    color: black;
    font-weight: bold;
    animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px #00eaff; }
    100% { box-shadow: 0 0 20px #ff00ff; }
}

/* Footer */
footer {
    margin-top: 40px;
    font-size: 0.8rem;
    color: #00eaff;
    text-shadow: 0 0 5px #00eaff;
}

/* Glowing Buttons with Smooth Effects */
.neon-button {
    position: relative;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    background: linear-gradient(90deg, #00eaff, #ff00ff);
    color: white;
    text-transform: uppercase;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 0 10px #00eaff, 0 0 20px #ff00ff;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

/* Button Hover Effect (Now Static, No Movement) */
.neon-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px #00eaff, 0 0 30px #ff00ff;
}

/* No Moving Shadows When Clicked */
.neon-button:active {
    transform: scale(1);
}

/* Fix for Back to Games List & Fullscreen Button Positioning */
.button-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    position: relative;
    z-index: 2; /* Ensures it stays above the game */
}


@keyframes waveGlow {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Glowing Links */
a {
    color: #00eaff;
    text-decoration: none;
    transition: text-shadow 0.3s;
}

a:hover {
    text-shadow: 0 0 10px #00eaff, 0 0 20px #ff00ff;
}
