@font-face {
    font-family: 'zabras';
    src: url('assets/fonts/zabars.ttf');
}

@font-face {
    font-family: 'ranchers';
    src: url('assets/fonts/ranchers.ttf');
}

body {
    font-family: 'zabras', Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-image: url('assets/img/background.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    touch-action: none;
}

main {
    position: relative;
    width: 720px;
    height: 480px;
    display: block;
}

canvas {
    width: 100%;
    height: 100%;
    background-color: black;
    display: block;
}

.border {
    border: 2px solid black;
    border-radius: 15px;
}

.start-screen {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.start-screen-buttons {
    z-index: 1;
    padding-top: 46px;
    display: flex;
    gap: 24px;
}

.settings-screen {
    position: absolute;
    top: 0;
    display: flex;
    color: #ffcc00;
    z-index: 1;
}

.settings-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 1;
    border-radius: 15px;
}

.settings-content {
    z-index: 1;
    text-align: center;
}

.back-button {
    background-color: rgb(209, 58, 58);
    box-shadow: 0 4px rgb(142, 35, 35);
}

.back-button:active {
    box-shadow: 0 2px rgb(254, 69, 69);
    transform: translateY(2px);
}

.back-button:hover {
    background-color: rgb(254, 69, 69);
}

.key-icon {
    display: flex;
    justify-content: center;
    border-radius: 8px;
    background-color: #ffcc00;
    box-shadow: 0 4px #cc9900;
    margin-bottom: 8px;
    width: 48px;
    height: 48px;
}

.space {
    width: 72px;
}

.keybind-container {
    display: flex;
    gap: 36px;
    justify-content: center;
    align-items: center;
}

.keybind-container div {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 26px;
    font-weight: 300;
    color: black;
}

.game-ui {
    position: absolute;
    right: 15px;
    bottom: 15px;
    display: flex;
    gap: 16px;
    z-index: 1;
}

.game-ui img {
    width: 32px;
    height: 32px;
    cursor: pointer;
}

.game-ui img:hover {
    transform: scale(0.9);
}

.end-game-image {
    width: 70%;
    height: 70%;
}

.end-game-screen {
    position: absolute;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.end-game-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 1;
    border-radius: 15px;
}

.end-game-screen button,
.end-game-screen img {
    z-index: 1;
}

.pause-screen {
    position: absolute;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: end;
    z-index: 1;
}

.pause-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 1;
    border-radius: 15px;
}

.pause-screen-buttons {
    display: flex;
    gap: 24px;
    z-index: 1;
    align-items: end;
    margin-bottom: 144px;
}

.controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    pointer-events: none;
    z-index: 1000;
    touch-action: none;
}

.controls div {
    display: flex;
    gap: 24px;
}

.mobile-btn {
    width: 52px;
    height: 52px;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.1s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

.mobile-btn:active {
    transform: scale(0.9);
    opacity: 0.8;
}

.menu {
    width: 38x;
    height: 38px;
    z-index: 999;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 18px;
}

.menu:hover {
    transform: scale(1.1);
}

.impressum-content {
    position: absolute;
    top: 5px;
    right: 4px;
    z-index: 1;
    overflow-y: scroll;
    height: 98%
}

@media only screen and (max-width: 950px) {
    .key-icon {
        width: 40px;
        height: 40px;
    }

    .space {
        width: 50px;
    }
}

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

    .border {
        border: none;
        border-radius: 0;
    }

    .settings-screen::before {
        border-radius: 0px;
    }

    .end-game-screen::before {
        border-radius: 0px;
    }

    .pause-screen::before {
        border-radius: 0px;
    }

    .keybind-container div {
        font-size: 20px;
    }

    .key-icon {
        width: 38px;
        height: 38px;
    }

    .end-game-image {
        width: 60%;
        height: 60%;
    }

    .game-ui img {
        width: 24px;
        height: 24px;
    }

    .game-ui {
        top: 40px;
    }

    .pause-screen-buttons {
        margin-bottom: 100px;
    }
}

@media only screen and (max-height: 480px) {
    main {
        height: 100vh;
    }
}