/* variables */
:root {
    --background-color: #383d43;
    --text-color: white;

    --header-font-size: 2rem;
    --footer-font-size: 1rem;

    --menu-item-font-size: 1.5rem;
    --menu-item-padding: 15px;
    --menu-item-margin: 30px;
}


/* CSS reset */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

body {
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

#root, #__next {
    isolation: isolate;
}

/* game styles */
body {
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
    font-family: sans-serif;
    color: var(--text-color);
    min-height: 100dvh;
}

nav ul {
    padding: 0;
    list-style: none;
    display: flex;
    margin-left: 10px;
    font-size: 1rem;

    li {
        padding-left: 20px;
        a {
            text-decoration: none;
            color: white;
        }
    }
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-inline: auto;
}

menu {
    padding: 0;
    list-style: none;
    width: calc(100vw - 10px);

    li {
        background-color: white;
        border-radius: 10px;
        border: 3px solid #9c5528;
        display: block;
        margin: var(--menu-item-margin);

        a {
            cursor: pointer;
            text-align: center;
            user-select: none;
            display: block;
            padding: var(--menu-item-padding);
            text-decoration: none;
            color: black;
            font-size: var(--menu-item-font-size);
        }
    }
}

header {
    &:not(.menu) {
        background-color: #4F565F;
        display: flex;
    }

    width: 100vw;
    padding: 10px 0;

    a {
        text-decoration: none;
        color: white;
    }
}

footer {
    background-color: #4F565F;
    width: 100vw;
    text-align: center;
    padding: 3px 0;
}

h1 {
    text-align: center;
    font-size: var(--header-font-size);
}

h2 {
    text-align: left;
    padding-left: 10px;
    font-size: 1rem;
}

.mk-game {
    margin-inline: auto;
}

.mk-timer {
    margin-top: 33px;
    text-align: center;
    font-size: 1.5rem;
    user-select: none;
}

.mk-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 10px;

    width: 250px;
    height: calc(250px * 1.5);

    padding: 0;
    list-style: none;

    li {
        background-color: white;
        border-radius: 10px;
        border: 3px solid #9c5528;
        cursor: pointer;
        text-align: center;
        user-select: none;
        position: relative;
    }

    span {
        display: inline-block;
        cursor: pointer;
        font-size: 1.5rem;
        line-height: calc(250px * 1.5 / 6 - 10px);
        visibility: hidden;
        color: black;

        &.clicked, &.show {
            visibility: visible;
        }
    }
}

.mk-scoreboard {
    border-collapse: collapse;
    font-size: 1rem;
    text-align: center;

    th, td {
        padding: 10px 20px;
    }

    th {
        border-bottom: 1px solid white;
    }
}

.mk-game-info-box {
    margin: 20px 0;
    font-size: 1rem;
    background: #576d6d;
    border-radius: 10px;
    padding: 15px;
}

@media only screen and (min-width: 600px) {
    menu {
        width: 500px;
    }

    .mk-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: repeat(4, 1fr);
        gap: 20px;

        width: calc(450px * 1.5);
        height: 450px;

        li span {
            font-size: 2rem;
            line-height: calc(450px / 4 - 20px);
        }
    }

    .mk-timer {
        margin-top: 50px;
        font-size: 2rem;
    }
}
