@font-face {
    font-family: 'Boogaloo';
    font-weight: normal;
    src: url('./fonts/Boogaloo-Regular.ttf');
}

@font-face {
    font-family: 'Peralta';
    src: url('./fonts/Peralta-Regular.ttf');
}

:root {
    margin: 0;
    padding: 0;
}

* {
    box-sizing: border-box;
}

body {
    z-index: 0;
    position: relative;
    font-size: 16px;
    width: 100%;
    height: 100%;
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    user-select: none;
    touch-action: none;
    font-family: 'Boogaloo', sans-serif;
    color: #000000;
}

a {
    text-decoration: none;
    color: #000;
    font-weight: bold;
}

.fullpage {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    min-width: 350px;
    background-color: #000;
    background-image: url('./img/desert.png');
    background-position: center;
    background-size: cover;
}

/* ################################################################################ */
/* ################################################################################ */
/* ################################################################################ */
#loadpage {
    z-index: 2;
    opacity: 1;
    background-color: #f5f6f7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#loadpage.hide {
    opacity: 0;
    left: 101%;
    transition: left 5ms linear 1300ms,
                opacity 1300ms linear 0ms;
}

#loadpage:not(.hide) {
    transition: left 5ms linear 0ms,
                opacity 1300ms linear 5ms;
}

#loadpage h1 {
    margin-block-start: 0;
    margin-block-end: 1rem;
    background-color: #ffffff50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 2px 2px 0px 1px #00000014;
    font-family: 'Peralta', 'Boogaloo', sans-serif;
    font-size: 24px;
}

.gamelist {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.card {
    width: auto;
    padding: 1rem;
    border-radius: 1rem;
    background-color: #ffffff50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: 2px 2px 0px 1px #00000014;
    transition: box-shadow .2s;
}

.card:hover {
    box-shadow: 0 2px 8px 4px #ff000075;
    transition: box-shadow .2s;
}

.card span {
    color: #000;
    font-size: 1.3rem;
    font-weight: bold;
}

.card div img {
    width: 300px;
    height: auto;
    border-radius: 0.6rem;
}

.btnaboutgame {
    margin-top: 1rem;
    margin-bottom: 1rem;
    border: unset;
    background-color: #ffffff50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px;
    border-radius: 8px;
    font-family: 'Peralta', 'Boogaloo', sans-serif;
    font-size: 20px;
    color: #000000;
    cursor: pointer;
    box-shadow: 2px 2px 0px 1px #00000014;
    transition: box-shadow .2s;
}

.btnaboutgame:hover {
    box-shadow: 0 2px 8px 4px #ff000075;
    transition: box-shadow .2s;
}


/* ################################################################################ */
/* ################################################################################ */
/* ################################################################################ */
#gamepage {
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

#fullscreen {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 800px;
    width: 800px;
    max-height: 500px;
    height: 500px;
}

.canvasbox {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

canvas {
    z-index: 0;
    position: relative;
    width: 720px;
    height: 480px;
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 8px 2px #00000075;
    aspect-ratio: 3 / 2;
}

.rahmen {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    border-radius: 1rem;
    opacity: 1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.gamebtn {
    z-index: 4;
    position: relative;
    top: 0;
    width: fit-content;
    height: fit-content;
    cursor: pointer;
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    user-select: none;
}

.btnplay {
    z-index: 4;
    position: relative;
    top: 0;
    width: fit-content;
    height: fit-content;
    cursor: pointer;
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    user-select: none;
}

.gameend {
    z-index: 9;
    position: relative;
    top: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    user-select: none;
}

.gameend img {
    width: 100%;
    height: 100%;
    border-radius: 1rem;
}

.key {
    z-index: 7;
    width: 80px;
    height: 80px;
    position: fixed;
    border-radius: 500px;
    border: 1px solid #00000080;
    background-color: #00000030;
    background-size: cover;
    -webkit-user-select: none; 
    -moz-user-select: none; 
    -ms-user-select: none; 
    user-select: none;
    touch-action: none;
    cursor: pointer;
    background-position: center;
    touch-action: none;
    display: none;
}

.left {
    left: 4%;
    bottom: 4%;
    background-image: url('./img/btn-left.png');
}

.right {
    left: calc(4% + 80px);
    bottom: 4%;
    background-image: url('./img/btn-right.png');
}

.down {
    left: 4%;
    bottom: calc(4% + 80px);
    background-image: url('./img/btn-down.png');
}

.jump {
    right: 4%;
    bottom: 4%;
    background-image: url('./img/btn-jump.png');
}

.throw {
    right: calc(4% + 80px);
    bottom: 4%;
    background-image: url('./img/btn-throw.png');
}

.change {
    right: 4%;
    bottom: calc(4% + 80px);
    background-image: url('./img/btn-starbig.png');
}

/* ################################################################################ */
/* ################################################################################ */
/* ################################################################################ */
#about {
    z-index: 3;
    height: 100vh;
    height: 100dvh;
    padding: 0 8px 0 8px;
    overflow-y: auto;
}

#about h1 {
    width: 100%;
    font-size: 32px;
    font-family: 'Peralta', 'Boogaloo', sans-serif;
    text-align: center;
}

.aboutbox {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.aboutthegame, .aboutcontrols, .aboutsettings {
    padding: 16px;
    max-width: 620px;
    width: 100%;
    background-color: #ffffff50;
    border-radius: 1rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: 2px 2px 0px 1px #00000014;
}

.aboutthegame, .aboutcontrols {
    margin-bottom: 16px;
}

.infotext {
    font-size: 20px;
}

.listbox, .settingbox {
    max-width: 600px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.listrow {
    width: 100%;
    min-height: 40px;
    height: fit-content;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
}

.list {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rowleft {
    justify-content: flex-start;
}

.rowright {
    justify-content: flex-end;
}

.list img {
    height: 40px;
}

.imgbutton {
    cursor: pointer;
}

#fps {
    height: 40px;
}

#bounce {
    height: 40px;
}



/* ################################################################################ */
/* ################################################################################ */
/* ################################################################################ */
@media only screen and (orientation: landscape) and (max-height: 580px) {
    canvas {
        width: auto;
        height: calc(100% - 8px);
        aspect-ratio: 3/2 auto;
    }

    .card div img {
        width: 250px;
        height: auto;
        border-radius: 0.6rem;
    }
    
    .key {
        width: 60px;
        height: 60px;
    }
}

@media only screen and (orientation: portrait) and (max-width: 750px) {
    canvas {
        width: calc(100% - 8px);
        height: auto;
        aspect-ratio: 3/2 auto;
    }

    .key {
        width: 60px;
        height: 60px;
    }
}

@media screen and (orientation: landscape) and (max-width: 750px) and (max-height: 580px) {
    canvas {
        width: auto;
        height: calc(100vh - 8px);
        aspect-ratio: 3/2 auto;
    }

    #fullscreen {
        width: auto;
        height: 90%;
    }
}

@media screen and (orientation: portrait) and (max-width: 750px) and (max-height: 580px) {
    canvas {
        width: auto;
        height: calc(100vh - 8px);
        aspect-ratio: 3/2 auto;
    }

    #fullscreen {
        width: 90%;
        height: auto;
    }
}

@media (pointer: coarse) {
    .key {
        display: block;
        -webkit-user-select: none; 
        -moz-user-select: none; 
        -ms-user-select: none; 
        user-select: none;
        touch-action: none;
    }
}

/* ################################################################################ */
@media screen and (min-width: 350px) and (min-height: 650px) and (orientation: portrait) {
    canvas, .rahmen, .gameend img {
        border-radius: clamp(1rem, -0.1667rem + 5.3333vw, 2.5rem);
    }
}


@media screen and (min-height: 350px) and (min-width: 650px) and (orientation: landscape) {
    canvas, .rahmen, .gameend img {
        border-radius: clamp(1rem, -0.1667rem + 5.3333vh, 2.5rem);
    }
}

@media screen and (orientation: portrait) and (min-width: 800px), screen and (orientation: landscape) and (min-height: 800px) {
    canvas, .rahmen, .gameend img {
        border-radius: 2.5rem;
    }
}

/* ################################################################################ */
/* ################################################################################ */
/* ################################################################################ */
.d-none {
    display: none;
}