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

body {
    background-color: #222;
    color: #fff;
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

header {
    text-align: center;
    padding: 20px;
    width: 100%;
    background-color: #111;
}

header h1 {
    color: #00aaff;
    font-size: 3em;
}

nav {
    margin-top: 10px;
}

.credits-link {
    color: #00aaff;
    text-decoration: none;
    font-size: 1.2em;
    padding: 10px 20px;
    border: 2px solid #00aaff;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.credits-link:hover {
    background-color: #00aaff;
    color: #fff;
    transform: scale(1.05);
}

.games-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 50px 20px;
    width: 100%;
    max-width: 1300px; 
}

.game {
    width: 100%;
    height: 400px;
    background-color: #333;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.game:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.game.game-grassdash {
    background-image: url('./assets/grassdashexample.png');
    background-size: cover;
    background-position: center;
}

.game.game-grassrise {
    background-image: url('./assets/grassriseexample.png');
    background-size: cover;
    background-position: center;
}

.game.game-grassclicker {
    background-image: url('./assets/grassclickerexample.png');
    background-size: cover;
    background-position: center;
}

.game.game-grassno {
    background-image: url('./assets/grassnoexample.png');
    background-size: cover;
    background-position: center;
}

.game.game-tictacgrass {
    background-image: url('./assets/tictacgrassexample.png');
    background-size: cover;
    background-position: center;
}

.game.game-turfwars {
    background-image: url('./assets/turfwarsexample.png');
    background-size: cover;
    background-position: center;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.game-overlay h2 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.game-overlay p {
    font-size: 1.2em;
    margin-bottom: 20px;
    text-align: center;
}

@media (max-width: 1024px) {
    .game {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .game {
        height: 300px;
    }
}

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

    .game {
        width: 100%;
        height: 250px;
    }
}
