body {
    display: flex;
    height: 100vh;
    justify-content: center;
    align-items: center;
    margin: 0;
    background-image: url('assets/3. Background/underwaterBackground.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

body::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-image: url('assets/3. Background/underwaterBackground.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    filter: brightness(70%);
    z-index: -1;
    /* Hinter den Inhalt legen */
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    /* Schwarzes Overlay mit 50% Opazität */
    z-index: -1;
    /* Hinter den Inhalt legen */
}


@font-face {
    font-family: 'LuckiestGuy';
    src: url('./assets/5.Font/LuckiestGuy-Regular.ttf') format('truetype');
}

h1 {
    font-family: 'LuckiestGuy';
    font-size: 60px;
    color: wheat;
    letter-spacing: 4px;
    -webkit-text-stroke: 0.5px;
    -webkit-text-stroke-color: black;
    margin: -10px;
}

h3 {
    font-family: 'LuckiestGuy';
    font-size: 42px;
    letter-spacing: 2px;
    -webkit-text-stroke: 0.2px;
    -webkit-text-stroke-color: black;
    padding-top: 200px;
    color: white;
}

canvas {
    background-color: black;
    border-radius: 20px;
    box-shadow: 0px 0px 100px rgba(255, 255, 255, 0.564);
    display: block;
}

:fullscreen #menu-overlay {
    width: 100%;
    height: 100vh;
}

:fullscreen #ui-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
}

:fullscreen canvas {
    width: 100%;
    height: 100vh;
}

#rotate-lock {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(199, 197, 197, 0.642);
    z-index: 11;
}

#screen-rotation {
    width: 100%;
    height: 100%;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    letter-spacing: 3px;
    font-family: 'LuckiestGuy';
    text-align: center;
    gap: 20px;
}

#screen-rotation img {
    width: 100px;
}

#menu-overlay {
    height: 480px;
    width: 720px;
    position: fixed;
    background-image: url('assets/3. Background/Dark/2.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
}

#endscreen {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    left: 44%;
    top: 50%;
}

.win-screen {
    flex-direction: row !important;
    top: 58% !important;
    left: 43% !important;
    gap: 20px;
}

#try-again {
    width: 220px;
    height: 70px;
}

#back-to-menu {
    width: 240px;
    height: 170px;
}

.animated-tryagain {
    background-size: 220px 70px;
    background-position: center;
    animation: changeImage 2s infinite;
}

.animated-tryagain:hover {
    transform: scale(1.1);
    cursor: pointer;
}

.animated-menu {
    background-size: 240px 170px;
    background-position: center;
    animation: changeMenu 2s infinite;
}

.animated-menu:hover {
    transform: scale(1.1);
    cursor: pointer;
}


@keyframes changeImage {
    0% {
        background-image: url('assets/6.Botones/Try again/Recurso 15.png');
    }

    25% {
        background-image: url('assets/6.Botones/Try again/Recurso 16.png');
    }

    50% {
        background-image: url('assets/6.Botones/Try again/Recurso 17.png');
    }

    75% {
        background-image: url('assets/6.Botones/Try again/Recurso 18.png');
    }

    100% {
        background-image: url('assets/6.Botones/Try again/Recurso 15.png');
    }
}

@keyframes changeMenu {
    0% {
        background-image: url('assets/6.Botones/Menü/menü-orange.png');
    }

    25% {
        background-image: url('assets/6.Botones/Menü/menü-yellow.png');
    }

    50% {
        background-image: url('assets/6.Botones/Menü/menü-red.png');
    }

    75% {
        background-image: url('assets/6.Botones/Menü/menü-violett.png');
    }

    100% {
        background-image: url('assets/6.Botones/Menü/menü-orange.png');
    }
}


#menu-overlay img:hover {
    cursor: pointer;
    transform: scale(1.1);
}

#start {
    width: 250px;
}

#controls {
    width: 280px;
    height: 220px;
    margin-top: 0px;
}

#instructions {
    width: 600px;
    height: 300px;
    margin: -50px;
}

#instructions:hover {
    cursor: initial !important;
    transform: scale(1) !important;
}

#back {
    width: 80px;
    height: 80px;
    margin-left: -300px;
}

.d_none {
    display: none !important;

}

/* Gemeinsamer Button-Stil */
.btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 12px;
    box-shadow: 0 0 5px #000;
    margin: 5px;
}

button {
    width: 50px;
}

#impressum {
    color: white;
    font-family: 'LuckiestGuy';
    -webkit-text-stroke: 0.5px;
    -webkit-text-stroke-color: black;
}

h4 {
    font-size: 30px;
    color: wheat;
    margin-bottom: -10px;
}

a {
    color: aqua;
    text-decoration: none;
}

a:hover {
    text-decoration: solid underline;
    text-decoration-color: aqua;
}

/* D-Pad links unten */
#dpad {
    position: absolute;
    bottom: 30%;
    left: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

#dpad .horizontal {
    display: flex;
    justify-content: center;
}

#btn-space {
    width: 100px;
}

#actions {
    position: absolute;
    bottom: 30%;
    right: 30%;
    display: flex;
    gap: 10px;
    z-index: 10;
}


#ui-buttons {
    display: flex;
    gap: 10px;
    z-index: 11;
    justify-content: flex-end;
}

.ui-btn {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
}

.ui-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

button,
.gamepad-button,
#dpad,
#actions {
    touch-action: none;
}

#btn-up,
#btn-down,
#btn-left,
#btn-right,
#btn-space,
#btn-d {
    touch-action: none;
}

@media(max-width: 1600px) {
    .win-screen {
        left: 42% !important;
    }
    #endscreen{
        left: 42%;
    }
}

@media(max-width: 1400px) {
    .win-screen {
        left: 40% !important;
    }

    #endscreen {
        left: 41%;
    }
}

@media(max-width: 1200px) {
    #dpad {
        bottom: 25%;
        left: 25%;
    }

    #actions {
        bottom: 25%;
        right: 25%;
    }
}

@media(max-width: 1100px) {
    .win-screen {
        left: 38% !important;
    }
}

@media(max-width: 1050px) {
    #endscreen {
        left: 38%;
    }

    #dpad {
        left: 23%;
    }

    #actions {
        right: 23%;
    }
}

@media(max-width: 900px) {
    .win-screen {
        left: 36% !important;
    }
}

@media(max-width: 800px) {
    #endscreen {
        left: 35%;
    }

    .win-screen {
        left: 34% !important;
    }

}

@media(max-width: 720px) {
    #dpad {
        left: 10%;
    }

    #actions {
        right: 10%;
    }

    #endscreen {
        left: 39%;
    }

    #try-again {
        width: 120px;
        height: 50px;
    }

    .animated-tryagain {
        background-size: 120px 50px;
    }

    #back-to-menu {
        width: 140px;
        height: 130px;
    }

    .animated-menu {
        background-size: 140px 130px;
    }

    #dpad {
        left: 15%;
    }

    #actions {
        right: 15%;
    }
}

@media(max-width: 600px) {
    h1 {
        font-size: 40px;
    }

    h3 {
        font-size: 30px;
    }

    #start {
        width: 200px;
    }

    #controls {
        width: 215px;
        height: 170px;
        margin-top: -50px;
    }

    #instructions {
        width: 450px;
        height: 250px;
        margin-top: -80px;
    }

    #back {
        width: 50px;
        height: 50px;
        margin-left: -200px;
        margin-top: -20px;
    }
}

@media(max-width: 450px) {
    #endscreen {
        left: 33%;
        top: 50%;
    }

    #try-again {
        width: 120px;
        height: 50px;
    }

    .animated-tryagain {
        background-size: 120px 50px;
    }

    #back-to-menu {
        width: 140px;
        height: 130px;
    }

    .animated-menu {
        background-size: 140px 130px;
    }


    #back {
        margin-left: -200px;
    }
}

@media(max-width: 410px) {
    #endscreen {
        left: 27%;
    }

    h1 {
        font-size: 30px;
        -webkit-text-stroke: 0.2px;
        -webkit-text-stroke-color: black;
    }

    h3 {
        font-size: 20px;
        -webkit-text-stroke: 0.2px;
        -webkit-text-stroke-color: black;
    }

    #back {
        margin-left: -175px !important;
    }
}

@media(max-width: 360px) {
    #instructions {
        width: 380px !important;
        height: 200px !important;
    }

    #back {
        margin-left: -150px !important;
    }
}

@media(max-height: 500px) {
    #ui-buttons {
        position: absolute;
        top: 20px;
        right: 20px;
    }

    #dpad {
        bottom: 10% !important;
    }

    #actions {
        bottom: 10% !important;
    }
}

@media(max-height: 450px) {
    #start {
        width: 225px;
    }

    #controls {
        height: 200px;
        width: 250px;
    }

    #instructions {
        width: 450px;
        height: 250px;
        margin-top: -80px;
    }

    #back {
        width: 50px;
        height: 50px;
        margin-left: -200px;
        margin-top: -20px;
    }

    h3 {
        padding-top: 150px;
    }

}

@media(max-height: 440px) {
    #menu-overlay {
        margin-left: -30px;
    }
}

@media(max-height: 430px) {
    #menu-overlay {
        margin-left: -50px;
    }
}

@media(max-height: 380px) {
    h3 {
        padding-top: 80px;
    }

    #menu-overlay {
        margin-left: -70px;
    }

    #try-again {
        width: 120px;
        height: 50px;
    }

    .animated-tryagain {
        background-size: 120px 50px;
    }

    #back-to-menu {
        width: 140px;
        height: 130px;
    }

    .animated-menu {
        background-size: 140px 130px;
    }
}

@media(max-height: 360px) {
    #menu-overlay {
        margin-left: -90px;
    }
}

@media(max-height: 340px) {
    #menu-overlay {
        margin-left: -110px;
    }
}

@media only screen and (max-width: 720px) {
    canvas {
        width: 100%;
    }

    #menu-overlay {
        width: 100%;
    }
}

@media only screen and (max-height: 480px) {

    canvas,
    #menu-overlay {
        height: 100vh;
    }
}