/* color pallete

#1f363d
#40798c
#f4f9e9

*/

* {
    font-family: "Outfit", sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 1.5rem;
}

nav {
    height: 100px;
    background: #1f363d;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.links-container {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
}

nav a {
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #f4f9e9;
    transition: 0.25s;
}

nav a:hover {
    background: #40798c;
}

nav .home-link {
    margin-right: auto;
}

label img {
    height: 50px;
}

label img:hover {
    cursor: pointer;
}

#sidebarActive {
    display: none;
}

.open-sidebar-button,
.close-sidebar-button {
    display: none;
}

@media screen and (max-width: 992px) {
    .links-container {
        flex-direction: column;
        align-items: flex-start;
        position: fixed;
        top: 0;
        right: -100%;
        z-index: 10;
        width: 300px;
        background: #1f363d;
        box-shadow: -5px 0 5px rgba(0, 0, 0, 0.25);
        transition: 0.75s ease-out;
    }

    nav a {
        box-sizing: border-box;
        height: auto;
        width: 100%;
        padding: 20px 30px;
        justify-content: flex-start;
    }

    .open-sidebar-button,
    .close-sidebar-button {
        padding: 20px;
        display: block;
    }

    #sidebarActive:checked~.links-container {
        right: 0;
    }

    #sidebarActive:checked~#overlay {
        background: black;
        opacity: 0.5;
        height: 100%;
        width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 9;
        transition: 0.75s ease-out;
    }
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.text {
    justify-content: center;
    padding: 1rem;
}

.title {
    text-align: center;
    color: #1f363d;
}

.text p {
    text-align: center;
}

.games {
    width: auto;
    height: auto;
    display: grid;
    grid-template-rows: auto;
    grid-auto-rows: clamp(9rem, 15vw, 20rem);
    grid-template-columns: 1fr 1fr;
}

@media screen and (min-width: 992px) {
    .games {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.game {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 5rem;
    height: clamp(9rem, 15vw, 20rem);
    overflow: hidden;
    color: white;
    cursor: pointer;
    border: 5px solid #1f363d;
}

/* dark overlay effect */
.game::before {
    content: "";
    position: absolute;
    inset: 0;
    /* covers whole box */
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.game-title,
.game-btn {
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.game-btn {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    color: white;
    text-decoration: none;
    font-weight: bold;
}

.game:hover::before {
    opacity: 1;
    /* darkens background */
}

.game:hover .game-title,
.game:hover .game-btn {
    opacity: 1;
    /* fades text/link in */
}

.rps {
    background: url(rps-game.png);
    background-size: cover;
    background-position: center center;
}

.wordle {
    background: url(wordle-game.png);
    background-size: cover;
    background-position: center center;
}

.tictacttoe {
    background: url(tictactoe-game.png);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}