@font-face {
    font-family: 'zabras';
    src: url('./fonts/zabars.ttf') format('truetype');
    /* Chrome 4+, Firefox 3.5, Opera 10+, Safari 3—5 */
}


body {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-image: url('./img/desert.png');
    background-position: center;
    background-repeat: no-repeat;
    font-family: 'zabras', Arial, Helvetica, sans-serif;

}

.turn-device-container {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
    z-index: 999;
    background-color: #F7C274;
    font-size: 40px;
}

.turn-device-container img {
    width: 100px;
    height: 100px;
}



h1 {
    font-size: 64px;
    letter-spacing: 3px;
    text-shadow: 4px 4px 8px rgba(0, 0, 0, 0.5);
    margin-top: 150px;
    z-index: 998;
}

.canvas-container {
    position: relative;
    width: 720px;
    height: 480px;
    aspect-ratio: auto 720 / 480;
}

.startScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 900;
    width: 720px;
    height: 480px;
    object-fit: fill;
}

.gameOverScreen {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 901;
    width: 720px;
    height: 480px;
    background-image: url(./img/desert.png);
    background-size: cover;
    aspect-ratio: auto 720 / 480;
}

.gameOverScreen img {
    object-fit: fill;
    width: 720px;
    height: 480px;
}

.gamelose {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 901;
    width: 720px;
    height: 480px;
    background-image: url(./img/desert.png);
    background-size: cover;
    aspect-ratio: auto 720 / 480;
}

.gamelose img {
    object-fit: fill;
    width: 720px;
    height: 480px;
}

.restart-btn {
    display: block;
    font-size: 40px;
    position: absolute;
    bottom: 0%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid black;
    border-radius: 5px;
    padding: 8px;
    cursor: pointer;
}

.restart-btn:hover {
    color: #FFDE00;
    border: 3px solid #FFDE00;
}

.startButton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    width: 100px;
    height: 100px;
    opacity: 0.5;
}

.startButton:hover {
    cursor: pointer;
    opacity: 1;
}

#hud {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
    width: 100%; /* Ändere die Breite auf 100% */
    max-width: 720px; /* Füge eine maximale Breite hinzu, um es nicht übermäßig zu vergrößern */
    z-index: 999;
    position: absolute;
    top: 0; /* Setze die Position an die obere Kante des Bildschirms */
    left: 50%; /* Zentriere das HUD horizontal */
    transform: translateX(-50%); /* Korrigiere die Positionierung um die Hälfte der eigenen Breite nach links */
    aspect-ratio: auto 720 / 480;
}


.panel {
    display: flex;
    width: 100%;
    height: auto; /* Ändere die Höhe auf automatisch, um sie dynamisch zu halten */
    
}

.top {
    justify-content: flex-end;
    gap: 10px;
    position: absolute;
    top: 0;
}

.bottom {
    justify-content: space-between;
    position: absolute;
    bottom: 0;
}

.panel-wrapper-top {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-wrapper-bottom {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-wrapper-bottom img {
    cursor: pointer;
}

.panel-wrapper-right {
    display: flex;
    gap: 10px;
}

.panel-wrapper-left {
    display: flex;
    gap: 8px;
}

.panel-wrapper-top img {
    height: 30px;
    width: 30px;
    cursor: pointer;
    
}


canvas {
    background-color: black;
    display: block;
    position: absolute;
}

.description-container {
    display: flex;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    gap: 20px;
}

.description-container span {
    white-space: nowrap;
}

/* Smartphones ------ */
@media only screen and (max-width: 720px) {
    .canvas-container {
        width: 100%;   
    }
    
    canvas {
        width: 100%;
    }

    .gameOverScreen img {
        width: 100%;
    }

    .gamelose {
        width: 100%;
    }

    .gamelose img{
        width: 100%;
    }

    #hud{
        width: 100%;
    }

    .startScreen {
        width: 100%;
    }

    .gameOverScreen {
        width: 100%;;
    }
}

@media only screen and (max-height: 480px) {
    canvas {
        height: 100vh;
    }

    .canvas-container {
        height: 100vh;   
    }

    #hud{
        height: 100vh;
    }

    .startScreen {
        height: 100vh;
    }

    .gameOverScreen {
        height: 100vh;
    }

    .gamelose {
        height: 100vh;
    }

    .gamelose img {
        height: 100vh;
    }

    .gameOverScreen img {
        height: 100vh;
    }
}

@media screen and (max-width: 620px) {
    .description-container {
        display: none;
    }

}

@media screen and (min-width: 850px) {
    .panel-wrapper-bottom {
        display: none!important;
    }

}


@media screen and (max-height: 800px) {
    h1 {
        margin-top: 50px;
    }
}

@media screen and (max-height: 700px) {
    h1 {
        display: none;
    }

    .description-container {
        display: none;
    }
}

@media screen and (max-width: 650px) {
    .turn-device-container {
        display: flex;
    }
}