:root {
    --font-size-h1: 64px;
    --font-size-h3: 32px;
    --font-size-p: 24px;
}

* {
    font-family: 'at01_PixelFont', Arial, Helvetica, sans-serif;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-p);
}

button {
    border: none;
    background-color: transparent;
}

button:hover {
    cursor: pointer;
}

body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: black;
    overflow: hidden;
}

.content {
    width: 100%;
    height: 100%;
    max-width: 940px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-image {
    position: absolute;
    width: 100%;
    min-width: 980px;
    max-width: 1080px;
}


#fullscreen {
    position: relative;
    width: 100%;
    max-width: 720px;
    display: flex;
    justify-content: center;
    z-index: 2;
}

.display-frame {
    position: absolute;
    top: 0;
    z-index: 99;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    aspect-ratio: 288 / 208;
    border: 4px solid black;
    box-shadow: inset 0 0 10px 8px #1b1b1a7e;
    pointer-events: none;
}

canvas {
    background-color: black;
    display: block;
    width: 100%;
    max-height: 100vh;
}

.overlay {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    aspect-ratio: 288 / 208;
    display: flex;
    justify-content: center;
    align-items: center; 
}

.startscreen {
    z-index: 3;
    width: 100%;
    height: 100%;
    background-image: url('img/4.background/2 - Autumn Forest/Background parts/_Complete_static_BG_(288 x 208).png');
    background-repeat: no-repeat;
    background-size: cover;
    background-color: rgb(0, 0, 0);
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: 20px;
    display: grid;
    grid-template-areas:    "headline headline headline"
                            "text text controls"
                            "button button button";
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 0.5fr 3fr 1fr;
    gap: 16px;
    padding: 16px 24px;
}

h1 {
    grid-area: headline;
    font-size: var(--font-size-h1);
    padding: 0 16px;
}

.container .text {
    grid-area: text;
    background-color: white;
    border-radius: 20px;
    padding: 16px 32px;
    font-size: var(--font-size-p);
}

.container .text ul {
    list-style-position: outside;
}

h3 {
    margin-bottom: 8px;
}

.container li {
    margin-bottom: 8px;
}

.container button {
    grid-area: button;
    background-color: rgb(243, 143, 67);
    border-radius: 12px;
    font-size: var(--font-size-h3);
    font-weight: 700;
}

.container button:hover {
    background-color: rgb(232, 113, 69);
    cursor: pointer;;
}



.container .controls {
    grid-area: controls;
    background-color: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 8px;
}

.button-controls {
    display: flex;
    gap: 16px;
    align-items: center;
}

.button-img {
    background-color: rgb(210, 63, 79);
    width: 32px;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--font-size-h3);
    -webkit-user-select: none; /* Safari */        
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+/Edge */
    user-select: none; /* Standard */
}

.endscreen {
    position: absolute;
    top: 0;
    z-index: 4;
    width: 100%;
    height: 100%;
    padding: 16px;
}

.endscreen .container {
    grid-template-areas:    "text text text"
                            "headline headline headline"
                            "button button button";
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr 1fr;
    text-align: center;
}

#game-controls {
    position: absolute;
    top: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 16px;
    pointer-events: none;
}

#game-controls .container {
    background-color: transparent;
}

#game-controls .controls {
    height: fit-content;
}



.ui-controls {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    aspect-ratio: 288 / 208;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: space-between;
}

.ui-controls .settings {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.ui-controls .gamepad {
    display: none;
    justify-content: space-between;
}

.ui-controls .button {
    background-color: rgba(0, 0, 0, 0.6);
    width: 40px;
    max-height: 40px;
    aspect-ratio: 1 / 1;
    border-radius: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    color: white;
}

.ui-controls .buttons {
    display: flex;
    gap: 16px;
}

.d-none {
    display: none;
}

/* Smartphones */
@media only screen  and (max-width: 720px) {
    #fullscreen {
        max-width: 100%;
    }
    body {
        padding: 0;
    }
    canvas {
        width: 100%;
    }
}

/* Smartphones */
@media only screen  and (max-height: 480px) {
    #fullscreen {
        max-width: 100%;
    }
    body {
        padding: 0;
    }
    canvas, .display {
        height: 100vh;
        aspect-ratio: 288 / 208;
    }
}

/* Touchscreens */
@media (hover: none) and (pointer: coarse) {
    .gamepad {
        display: flex !important;
    }
}

@media only screen and (max-width: 980px) {
    .background-image {
        display: none;
    }
}

@media only screen and (max-width: 650px) {
    :root {
        --font-size-h1: 32px;
        --font-size-h3: 20px;
        --font-size-p: 16px; 
    }

    .container {
        grid-template-areas:    
        "headline headline headline"                     
        "text text controls"
        "button button controls";
    }

    .button-img {
        width: 20px;
        height: 20px;
        border-radius: 8px;
    }
}

@media only screen and (max-width: 500px) {
    :root {
        --font-size-h1: 24px;
    }

    .container {
        padding: 8px;
        gap: 8px;
        grid-template-areas:    
        "headline headline headline"                     
        "text text controls"
        "button button controls";
    }

    .container .text {
        padding: 4px 8px;
    }

    .container ul {
        list-style: none;
    }

    .container .controls {
        padding: 4px 8px;
        font-size: 12px;
    }
}

@media only screen and (max-width: 380px) {
    .container .controls {
        gap: 2px;
    }
}

@media only screen and (max-height: 450px) {
    :root {
        --font-size-h1: 32px;
        --font-size-h3: 20px;
        --font-size-p: 16px; 
    }

    .container {
        grid-template-areas:    
        "headline headline headline"                     
        "text text controls"
        "button button controls";
    }

    .button-img {
        width: 20px;
        height: 20px;
        border-radius: 8px;
    }
}
