html,
body {
    height: 100%;
    margin: 0;
    padding: 0;

}

body {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    align-items: center;
    background: transparent;
}

html {
    background: url('img/background desert.jpg') center center / cover no-repeat;
    background-attachment: fixed;
}

canvas {
    width: auto;
    height: auto;
    max-width: 100vw;
    max-height: 100vh;
    display: block;
    object-fit: contain;
}

canvas:fullscreen {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

h1 {
    font-family: "Sancreek", serif;
    font-weight: 400;
    font-style: normal;
    font-size: 60px;
    color: white;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000;
    filter: drop-shadow(0 8px 20px rgba(69, 34, 32, 36.7));
}

.loadingoverlay {
    background-color: rgba(0, 0, 0, 0.8);
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
}

.loadingoverlaycontent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: rgb(238, 160, 95);
    height: 600px;
    width: 710px;
}

.animationloading {
    height: 250px;
    width: 100%;
}

#game-container {
    position: relative;
    width: fit-content;
    display: inline-block;
}

#game-container:fullscreen {
    width: 100vw;
    height: 100vh;
}

#game-container:fullscreen canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#game-container:fullscreen #mobile-controls {
    position: absolute;
    inset: 0;
}

#mobile-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#left-controls{
    display: none;
}

#right-controls{
    display: none;
}

#top-controls{
    display: none;
}

#mobile-controls button {
    pointer-events: all;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    padding: 5px;
}

#mobile-controls img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#mobile-controls button:active {
    transform: scale(0.9);
}

.left-controls {
    position: absolute;
    bottom: 30px;
    left: 20px;
    display: flex;
    gap: 15px;
}

img{
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    touch-action: manipulation;
}

canvas {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

.right-controls {
    position: absolute;
    bottom: 30px;
    right: 20px;
}

.top-controls {
    position: absolute;
    top: 30px;
    right: 30px;
    display: flex;
    gap: 10px;
}

#mobile-controls button {
    pointer-events: all;
}

@media only screen and (max-width: 900px) and (min-width: 760px) {
    body {
        justify-content: center;
    }
}

@media only screen and (max-width: 760px) {
    canvas {
        width: 100%;
        height: 100%;
    }

    body {
        justify-content: center;
    }
}