@font-face {
    font-family: "LuckiestGuy";
    src: url("./img/5.Font/Luckiest_Guy/LuckiestGuy-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

body {
    display: flex;
    font-family: "LuckiestGuy", sans-serif;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height:  100vh;
    position: relative;
    margin: 0;
}

body::before {
    background-image: url('img/3. Background/Dark/1.png');
    content: "";
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(8px);
    transform: scale(1.1);
    z-index: -1;
}

h1 {
    color: white;
    background-color: rgb(83, 26, 130);
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 48px;
}

#game-wrapper {
    position: relative;
    width: 960px;
    height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100vw
}

:fullscreen #game-wrapper {
    width: 100vw;
    height: 100vh;
}

body:fullscreen {
    display: block;
}

canvas {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 2%;
}

#start-screen {
    position: absolute;
    inset: 0; 
    background-image: url('./assets/3_game_background.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    border-radius: 2%;

    z-index: 10;

    overflow-y: auto;

    width: 100%;
    height: 100%;
}

#controls-screen,
#start-content,
#legal-notice,
#endscreen,
#impressum {
    position: absolute;
    inset: 0; 
    background-image: url('./assets/3_game_background.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    border-radius: 2%;

    z-index: 10;

    width: 100%;
    height: 100%;
}

#controls-screen img {
    width: 40%;
    height: auto;
    border-radius: 15px;
    max-height: 80px;
}

#controls-screen p, h2 {
    color: white;
}

#controls-screen h2 {
    background-color: rgb(83, 26, 130);
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 36px;
}

#controls-screen div {
    display: flex;
    flex-direction: row;
    gap: 25px;
    width: 40%;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.3); 
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 5px 10px;
    border-radius: 5px;
} 

#play-btn {  
    background-image: url('./img/6.Botones/Start/1.png');    
}

#fullscreen-btn {
    background-image: url('./img/6.Botones/Full Screen/Mesa de trabajo 9.png');
    position: absolute;
    top: 5%;
    right: 5%;
}

#controls-btn, 
#close-controls-btn,
#info-btn,
#return-btn,
#close-legal-btn,
#restart-btn,
#menu-btn,
#close-impressum {
    width: 200px;
    height: 60px;
    font-family: 'LuckiestGuy', sans-serif;
    background-color: rgb(83, 26, 130);
    color: white;
    border-color: white;
    border: 2px solid white;
    font-size: 32px;
    cursor: pointer;
    border-radius: 10px;
}

.start-btn:hover,
#controls-btn:hover,
#info-btn:hover,
#return-btn:hover,
#legal-btn:hover,
#close-legal-btn:hover,
#restart-btn:hover,
#menu-btn:hover,
#close-impressum:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    cursor: pointer;
}

#impressum p,
#legal-notice p,
#start-content p {
    width: 80%;
    text-align: center;
}

#impressum button,
#legal-notice button,
#start-content button {
    margin-bottom: 20px;
}

.start-btn {
    width: 200px;
    height: 80px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    border: none;
    background-color: transparent;

    outline: none;
}

#volume-div {
    position: absolute;
    bottom: 5%;
    left: 5%;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 5px 10px;
    border-radius: 10px;
}

#volume-slider {
    width: 150px;
    height: 25px;
    cursor: pointer;
}

.mobile-d {
    display: none;
}

#d-key-img {
    width: 30% !important; 
    margin-right: 5%;
}

/* Game Description*/

#start-content,
#legal-notice,
#impressum {
    overflow-y: auto;
    margin: 0 auto;
}

#start-content h1 {
    font-size: 40px;
    margin-bottom: 20px;
}

#start-content p {
    font-size: 20px;
    color: white;
    margin-bottom: 30px;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 10px;
    border-radius: 5px;
}

#start-content h2 {
    background-color: rgb(83, 26, 130);
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 5px;
}

#start-content ul {
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 10px;
    color: white;
    list-style-type: none;
    border-radius: 5px;
}

/* Impressum */

#impressum-btn {
    position: absolute;
    bottom: 20%;
    right: 5%;
    width: 200px;
    height: 50px;
    font-family: 'LuckiestGuy', sans-serif;
    color: rgb(83, 26, 130);
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    border-radius: 10px;
}

/* Legal Notice */

#legal-btn {
    position: absolute;
    bottom: 5%;
    right: 5%;
    width: 200px;
    height: 50px;
    font-family: 'LuckiestGuy', sans-serif;
    color: rgb(83, 26, 130);
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    border-radius: 10px;
}

#legal-notice p, h3, li {
    color: white;
}

/* UI Overlay Buttons */

#ui-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

#ui-overlay button {
    pointer-events: auto;
    position: absolute;
    width: 50px;
    height: 50px;
    border: none;
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    cursor: pointer;
}

#pause-btn {
    top: 15px;
    right: 50%;
}

#pause-btn img,
#sound-btn img {
    width: 20px;
    height: 20px;
}

#sound-btn {
    top: 15px;
    right: 40%;
}

/* End Screen */

#endscreen p {
    color: white;
    font-size: 24px;
    margin: 20px 0;
}

/* mobile responsiveness */

@media (max-width: 900px), (max-height: 600px) {

    body {
        margin: 0;
        overflow: hidden;
        justify-content: flex-start;
    }

    #game-wrapper {
        width: 100vw;
        height: 100vh;
    }

    canvas {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    #start-screen h1,
    #controls-screen h2 {
        font-size: 24px;
    }

    #start-screen button {
        width: 125px;
        font-size: 20px;
    }

    #volume-div {        
        left: 10%;
    }

    #legal-btn,
    #impressum-btn {
        right: 10%;
    }

    #fullscreen-btn {
        display: none;
    }

    .mobile-none {
        display: none;
    }

    .mobile-d {
        display: flex;
    }

    p {
        display: flex;
    }

    #controls-screen p {
        width: 100%;
        justify-content: space-between;
    }

    #controls-screen img {
        width: 25%;
    }

    #close-controls-btn{
        position: absolute;
        top: 5%;
        right: 10%;
        width: 125px;
        height: 45px;
        font-size: 20px;
    }

    #start-content,
    #legal-notice,
    #impressum {
        padding: 0;
    }

    #start-content h1,
    #legal-notice h1 {
        font-size: 24px;
    }

    #start-content h2,
    #legal-notice h2,
    #impressum h2 {
        font-size: 20px;
    }

    #start-content p,
    #legal-notice p,
    #legal-notice ul,
    #impressum p {
        font-size: 16px;
        margin-right: 50px;
        margin-left: 50px;
    }

    #start-content button,
    #legal-notice button,
    #impressum button {
        margin-bottom: 25px;
    }

    #endscreen h1 {
        font-size: 24px;
    }

    #endscreen p {
        font-size: 18px;
    }

    #endscreen button {
        width: 125px;
        font-size: 20px;
    }

    #impressum h1 {
        font-size: 24px;
    }

    #impressum p {
        display: inline;
    }
}

/* Rotation hint */

#rotate-hint {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 1);
    z-index: 9999;

    display: none;
    align-items: center;
    justify-content: center;
}

.rotate-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;

    color: black;
    font-family: 'LuckiestGuy', sans-serif;
    text-align: center;
    font-size: 24px;
}

.rotate-box img {
    width: 120px;
    animation: rotatePhone 1.5s infinite ease-in-out;
}

@keyframes rotatePhone {
    0%   { transform: rotate(0deg); }
    50%  { transform: rotate(90deg); }
    100% { transform: rotate(0deg); }
}

/* mobile controlls */

#mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 20;
}

#mobile-controls .row {
    display: flex;
    gap: 15px;
}

#mobile-controls .btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
}

#mobile-controls .action {
    background: rgba(0, 150, 255, 0.7);
}

#mobile-controls button {
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

#mobile-movement {
    position: absolute;
    bottom: 2%;
    left: 2%;
}

#mobile-actions {
    position: absolute;
    bottom: 2%;
    right: 2%;
}

#up-div,
#down-div {
    display: flex;
    flex-direction: column;
    align-items: center;
}