@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Space+Grotesk:wght@300..700&display=swap');

input,
button {
    all: unset;
}

* {
    margin: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

html,
body {
    height: 100%;
    margin: 0;
    /* overflow: hidden; */
}

:root {
    font-size: 3.5vmin;
}

body {
    display: flex;
    background: var(--background);
    justify-content: center;
    align-items: center;
    color: var(--primary);
    line-height: 1.5em;
    font-family: 'Space Grotesk';
}

.screen {
    width: 90vmin;

    &:not(.active) {
        display: none;
    }
}

p {
    padding: 0.25em 0em;
}

button {
    display: block;
    width: 100%;
    padding: 0.25em 0em;
    font-weight: normal;
    font-family: 'Space Grotesk';

    &.escape {
        font-size: 1.25rem;
        padding: 0;
        vertical-align: top;
        width: unset;
        &::before {
            background-image: url('./assets/images/backarrow.svg');
            vertical-align: bottom;
        }
    }
    &::before {
        content: '';
        display: inline-block;
        width: 1em;
        height: 1em;
        margin-right: 0.5em;
        background-image: url('./assets/images/arrow.svg');
        background-size: contain;
        visibility: hidden;
    }

    &:hover,
    &:focus {
        /* background: var(--primary);
        color: var(--background); */
        background: rgb(0 0 0 / 0.1);
        &::before {
            visibility: visible;
        }
    }
}

h1 {
    font-size: 4rem;
}

h2 {
    font-size: 2.75rem;
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;

    & > * {
        display: block;
    }
}

h1,
h2 {
    margin-bottom: 0.75em;
    font-family: 'Bebas Neue';
    font-weight: normal;
}

#game.screen {
    align-items: center;
    width: unset;
    height: unset;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    background: white;
}

#background-canvas {
    position: absolute;
    inset: 0 auto auto 0;
    background: white;
    z-index: -1;
}

input {
    width: 100%;
    margin-bottom: 1rem;
}

input[type='range'] {
    margin-top: 0.5em;
    height: 0.2rem;
    display: block;
    border-radius: 100vmax;
    border: 0.5vmin solid rgb(180 180 200);
    &:focus,
    &:hover {
        background: rgb(0 0 0 / 0.1);
    }
}

input[type='button'] {
    padding: 0.5rem 0;
    &:focus,
    &:hover {
        background: rgb(0 0 0 / 0.1);

        &::-webkit-slider-thumb {
            background: blue;
        }
    }
}

::-webkit-slider-thumb {
    appearance: none;
    width: 0.6em;
    height: 1em;
    background: white;
    border: 0.5vmin solid black;
    border-radius: 100vmax;
}

.modal {
    display: none;

    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);

    flex-flow: column nowrap;
    justify-content: center;

    width: 100%;
    height: 100%;

    background: rgb(255 255 255 / 0.3);
    backdrop-filter: blur(0.5em);

    & * {
        display: block;
        text-align: center;
        &::before {
            display: none;
        }
    }
    & h2 {
        margin: 0.5em 0 0.5em 0;
    }
    &.active {
        display: flex;
    }

    &#pause-menu {
        padding: 0 calc(50% - 5em);
    }
    &#quit-menu {
        padding: 0 calc(50% - 5em);
    }
    &#death-menu {
        padding: 0 calc(50% - 5em);
    }
    &#end-menu {
        padding: 0 calc(50% - 8em);
    }
}

#wasdRecent-description {
    font-size: 0.7rem;
    line-height: 1.5em;
    visibility: hidden;
}

input#wasdRecent:is(:hover, :focus) ~ #wasdRecent-description {
    visibility: visible;
}

#level-select {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;

    & > button {
        font-size: 1rem;
        padding: 0.5em 0;
        display: block;
        width: 100%;
        text-align: center;
        &::before {
            display: none;
        }
    }
}
