@font-face {
    font-family: myFont;
    src: url('fonts/Arbutus-Regular.ttf');
}

html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: url('img/background_desert2.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    font-family: myFont, 'Open Sans', 'Helvetica Neue', sans-serif;
}

footer {
    position: absolute;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ffb3b3;
}

a {
    text-decoration: none;
    color: rgb(249, 81, 9);
    padding-top: 16px;
}

a:hover {
    color: #e68900;
    transform: scale(1.1);
}

.hidden {
    display: none !important;
}

main {
    padding: 24px;
    text-align: center;
}

#backBtn {
    position: absolute;
    top: 16px;
    left: 16px;
    background: beige;
    padding: 12px;
    border-radius: 36px;
}

#content {
    display: inline-block;
    position: relative;
    text-align: center;
}

#content:fullscreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100vw;
}

canvas {
    background-color: black;
    border: 6px solid white;
    display: block;
}

#content:fullscreen canvas,
canvas:fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: none;
    margin: 0;
    padding: 0;
}

#start-screen,
#end-screen {
    background: rgba(0, 0, 0, 0.8);
    border: 6px solid white;
    display: flex;
    justify-content: center;
    position: absolute;
    top: 166px;
    left: 0;
    width: 720px;
    height: 480px;
    z-index: 10;
    transition: opacity 1s ease-in;
}

#start-screen {
    align-items: center;
    background-image: url('./img/9_intro_outro_screens/start/startscreen_1.png');
    background-position: center;
    background-size: cover;
    opacity: 1;
}

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

#end-screen {
    align-items: end;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in;
}

#end-screen.show {
    opacity: 1;
    pointer-events: auto;
}

#end-screen.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

#content:fullscreen #start-screen,
#content:fullscreen #end-screen,
#content:fullscreen #pause-overlay,
#content:fullscreen #settings-overlay {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: none;
}

#fullscreen-btn,
#sound-btn,
#pause-btn {
    background: rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 18px;
    width: 48px;
    height: 48px;
    position: absolute;
    transition: transform 0.2s, background 0.2s;
    z-index: 20;
}

#fullscreen-btn:hover,
#sound-btn:hover,
#pause-btn:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: scale(1.1);
}

#sound-btn {
    top: 180px;
    left: 20px;
}

#fullscreen-btn {
    top: 180px;
    right: 20px;
}

#pause-btn {
    top: 240px;
    right: 20px;
}

#content:fullscreen #fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
}

#content:fullscreen #sound-btn {
    top: 20px;
    left: 20px;
}

#content:fullscreen #pause-btn {
    top: 80px;
    right: 20px;
}

#pause-overlay {
    background: rgba(0, 0, 0, 0.6);
    border: 6px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 166px;
    left: 0;
    width: 720px;
    height: 480px;
    z-index: 15;
}

#pause-overlay.hidden {
    display: none;
}

#pause-overlay button {
    background: #ff9800;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 12px 24px;
    margin: 12px;
    transition: transform 0.2s, background 0.2s;
}

#pause-overlay button:hover {
    background: #e68900;
    transform: scale(1.05);
}

#content:fullscreen #pause-overlay {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: none;
}

h1 {
    font-size: 64px;
}

.instructions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    font-size: 18px;
    padding: 0 16px;
    width: 698px;
}

/* Settings Overlay */
#settings-overlay {
    background: rgba(0, 0, 0, 0.6);
    /* halbtransparenter Hintergrund */
    border: 6px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 166px;
    left: 0;
    width: 720px;
    height: 480px;
    z-index: 20;
}

#settings-overlay.hidden {
    display: none;
}

#settings-overlay h2 {
    color: white;
    margin-bottom: 20px;
}

#settings-overlay label {
    color: white;
    font-size: 18px;
}

#settings-overlay input[type="range"] {
    width: 60%;
    margin-top: 10px;
}

/* Buttons im Settings Overlay */
#settings-overlay button {
    background: #ff9800;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 20px;
    padding: 12px 24px;
    margin-top: 20px;
    transition: transform 0.2s, background 0.2s;
}

#settings-overlay button:hover {
    background: #e68900;
    transform: scale(1.05);
}

/* Vollbild-Anpassung
#content:fullscreen #settings-overlay {
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: none;
} */

@media (max-width: 1366px) {
    .instructions {
        display: none;
    }
}

@media (max-width: 750px) {

    canvas,
    #start-screen,
    #end-screen {
        width: 500px;
        height: 100%;
    }
}

@media screen and (max-width: 932px) and (orientation: landscape),
screen and (max-height: 680px) and (orientation: landscape) {

    h1,
    #fullscreen-btn,
    footer {
        display: none;
    }

    #sound-btn,
    #pause-btn {
        top: 20px;
    }

    canvas,
    #canvas-container,
    #start-screen,
    #end-screen,
    #pause-overlay,
    #settings-overlay {
        width: 100vw;
        height: 100vh;
        top: 0;
        border: none;
    }
}