* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;
    height: 100vh;
    background-image: url('./img/desert.jpg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

@font-face {
    font-display: swap;
    font-family: 'Luckiest Guy';
    font-style: normal;
    font-weight: 400;
    src: url('../fonts/luckiest-guy-v23-latin-regular.woff2') format('woff2');
}

.title {
    font-family: 'Luckiest Guy';
    text-shadow: 4px 4px #A0220A;
    color: #ed9046;
    font-size: 38px;
    letter-spacing: 2px;
    /* background-color: rgb(0, 0, 0, 0.7); */
    padding: 10px;
    border-radius: 8px;
}

#canvasWrapper {
    position: relative;
    width: 720px;
    height: 480px;
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    display: block;
}

#startFrame,
#gameOverImage,
#youWon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    opacity: 1;
    border-radius: 8px;
    overflow: hidden;
    transition: opacity 0.5s ease;
    background-color: rgb(0, 0, 0, 0.7);
}

#startFrame.fade-out {
    opacity: 0;
    pointer-events: none;
}

#startFrame img,
#gameOverImage img,
#youWon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

#gameOverImage,
#youWon {
    display: none;
}

#gameOverImage img {
    object-fit: contain;
}

#muteIconContainer,
#full,
#home,
.impressum-container {
    position: absolute;
    top: 16px;
    right: 150px;
    z-index: 20;
    width: 46px;
    height: 46px;
    padding: 14px;
    background-color: #ffc107;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid black;
    border-radius: 50%;
}

.impressum-container {
    right: 28px;
}

.impressum-container img {
    width: 26px;
    height: 26px;
    cursor: pointer;
}

#full {
    right: 90px;
}

#home {
    left: 90px;
    display: none;
}

#fullScreen,
#smallScreen,
#home img {
    width: 30px;
    cursor: pointer;
}

#muteIcon {
    cursor: pointer;
    width: 32px;
    height: 32px;
}

#startBtn,
#replayBtn {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    width: 156px;
}

#startBtn button,
#replayBtn button {
    width: 100%;
    padding: 10px 20px;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 3px;
    border: 2px solid black;
    border-radius: 8px;
    background-color: #ffc107;
    color: #000;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}

#replayBtn,
#smallScreen {
    display: none;
}

#startBtn button:hover,
#replayBtn button:hover {
    background-color: #ff9800;
}

#gameKeys {
    display: flex;
    justify-content: space-evenly;
    gap: 16px;
    margin-top: 12px;
    background-color: rgb(0, 0, 0, 0.6);
    padding: 10px;
    border-radius: 10px;
    font-family: 'Luckiest Guy';
    letter-spacing: 1px;
    font-size: 18px;
    color: #ed9046;
    z-index: 100;
    text-shadow: 2px 2px #a0220a;
}

#landscape-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    color: #ffc107;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 1.5em;
    padding: 20px;
    font-family: 'Luckiest Guy';
}

#landscape-popup img {
    width: 120px;
    margin-top: 20px;
    background-color: #ffc107;
    border-radius: 50%;
}

#mobile-controls {
    position: absolute;
    bottom: 12px;
    width: 100%;
    display: none;
    z-index: 9999;
    pointer-events: none;
}

.left-container,
.right-container,
.up-container,
.throw-container {
    display: flex;
    position: absolute;
    z-index: 20;
    width: 56px;
    height: 56px;
    padding: 14px;
    background-color: #ffc107;
    justify-content: center;
    align-items: center;
    border: 2px solid black;
    border-radius: 50%;
    pointer-events: auto;
}

.left-container {
    bottom: 12px;
    left: 12px;
}

.right-container {
    bottom: 12px;
    left: 82px;
}

.up-container {
    bottom: 12px;
    right: 82px;
}

.throw-container {
    bottom: 12px;
    right: 12px;
}

.left-container img,
.right-container img {
    width: 56px;
    margin-right: 4px;
    cursor: pointer;
}

.up-container img {
    width: 56px;
    cursor: pointer;
}

.throw-container img {
    width: 40px;
    cursor: pointer;
}

.impr-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Luckiest Guy';
    font-size: large;
    letter-spacing: 1.1px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    background-color: rgb(0, 0, 0, 0.9);
    color: #ffc107;
    box-shadow: 0 0 5px 5px #ffc107;
    padding: 24px;
    border-radius: 8px;
    margin: 8px;
    z-index: 99999;
    display: none;

    .impr-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    #close {
        font-size: 32px;
        cursor: pointer;
        transition: .15s;
    }

    #close:hover {
        color: #ED6A36;
    }
}

.mail-to {
    color: #ED6A36;
}

@media screen and (max-width: 720px) {
    #canvasWrapper {
        width: 100vw;
        height: 100vh;
    }

    #gameKeys,
    .title {
        display: none;
    }
}

@media screen and (max-height: 480px) {
    #canvasWrapper {
        width: 100vw;
        height: 100vh;
    }

    .title {
        display: none;
    }
}

@media screen and (max-width: 720px) and (orientation: landscape) {

    #gameKeys,
    .title {
        display: none;
    }

    #mobile-controls {
        display: block;
    }

    .left-container,
    .right-container,
    .up-container,
    .throw-container {
        display: flex;
    }
}

@media screen and (min-width: 720px) and (max-width: 1024px) {

    #mobile-controls .left-container,
    #mobile-controls .right-container,
    #mobile-controls .up-container,
    #mobile-controls .throw-container {
        width: 72px;
        height: 72px;
    }

    #mobile-controls .left-container {
        left: 24px;
    }

    #mobile-controls .right-container {
        left: 108px;
    }

    #mobile-controls .up-container {
        right: 108px;
    }

    #mobile-controls .throw-container {
        right: 24px;
    }
}