* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

button, #start-game-btn {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html {
    background-image: url('./assets/backgrounds/bg.jpeg');
    background-position: center;
    background-size: cover;
}

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

#game-title {
    text-align: center;
    font-family: Title;
    font-size: 84px;
    letter-spacing: 5px;
    padding-bottom: 24px;
    color: rgb(255, 255, 255);
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}

#device-orientation-msg {
    display: none;
}

#device-orientation-msg.show {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    width: 100vw;
    height: 100vh;
    background-color: black;
}

#orientation-title {
    color: white;
    text-align: center;
    padding: 0 32px;
}

#device-orientation-msg.show #rotate-icon{
    width: 100px;
    height: 100px;
    filter: invert(1);
    animation: rotate-icon 2.5s ease-in-out infinite;
}

@keyframes rotate-icon {
    0%   { transform: rotate(0deg); }
    60%  { transform: rotate(360deg); }
    100% { transform: rotate(360deg); }
}

#game-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 48px;
    position: relative;
}

#game-wrapper.hide {
    display: none;
}

#canvas {
    display: none;
    background-color: black;
}

#canvas.show {
    display: block;
}

#splash-screen, #splash-screen > img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1080px;
    height: 720px;
    max-width: 100vw;
    max-height: 720px;
    position: relative;
}

#splash-screen > img {
    object-fit: cover;
}

#splash-screen.hide {
    display: none;
}

#end-screen {
    display: none;
    align-items: center;
    justify-content: center;
    width: min(1080px, 100vw, calc(100vh * 1080 / 720));
    height: min(720px, 100vh, calc(100vw * 720 / 1080));
    position: relative;
    background-image: url('./assets/img/5_background/complete_background.png');
    background-size: auto 100%;
    background-position: center;
    background-repeat: no-repeat;
}

#end-screen.show {
    display: flex;
}

#end-screen-won,
#end-screen-lost {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#end-screen-won.show,
#end-screen-lost.show {
    display: flex;
}

#end-screen-won img,
#end-screen-lost img {
    max-height: 300px;
    max-width: 90%;
}

@media (max-width: 1080px), (max-height: 880px) {
    #end-screen-won img,
    #end-screen-lost img {
        max-height: 50vh;
    }
}

#start-game-btn {
    position: absolute;
    border: none;
    padding: 18px 24px;
    background-color: #1a1a1ad2;
    color: white;
    font-size: 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s ease-in-out;
}

#start-game-btn:hover {
    background-color: #1a1a1a;
    transition: all .2s ease-in-out;
}

#open-imprint-btn {
    all: unset;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    cursor: pointer;
}

#open-imprint-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#game-setting-buttons {
    display: flex;
    position: absolute;
    top: 12px;
    left: 0;
    right: 0;
    justify-content: center;
    gap: 8px;
    z-index: 10;
}

#game-setting-buttons #restart-btn,
#game-setting-buttons #mute-btn,
#game-setting-buttons #home-btn {
    display: none;
}

#game-setting-buttons.show #restart-btn,
#game-setting-buttons.show #mute-btn,
#game-setting-buttons.show #home-btn {
    display: flex;
}

@media (pointer: coarse), (max-width: 1024px) {
    #fullscreen-btn {
        position: fixed;
        bottom: 8px;
        right: 8px;
        z-index: 20;
    }
}

.is-mobile #fullscreen-btn {
    position: fixed;
    bottom: 8px;
    right: 8px;
    z-index: 20;
}

#game-setting-buttons button {
    width: 48px;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 22px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

#mute-icon,
#restart-btn img,
#fullscreen-btn img,
#home-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: invert(1);
}

#game-setting-buttons button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#mobile-controlls {
    --mobile-btn-size: 52px;
    --mobile-btn-gap: 24px;
    display: none;
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    padding: 0 16px;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

@media (pointer: coarse), (max-width: 1024px) {
    #canvas.show ~ #mobile-controlls {
        display: flex;
    }
}

.is-mobile #canvas.show ~ #mobile-controlls {
    display: flex;
}

.mobile-controlls-group {
    display: flex;
    gap: var(--mobile-btn-gap);
    pointer-events: auto;
}

.mobile-btn {
    width: var(--mobile-btn-size);
    height: var(--mobile-btn-size);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-btn:active {
    background-color: rgba(0, 0, 0, 0.8);
}

.mobile-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

#btn-right img { transform: rotate(180deg); }
#btn-jump img  { transform: rotate(90deg); }
#btn-throw img { filter: none; }

footer {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    width: 100%;
    height: 100px;
}

footer a {
    display: inline-flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    text-decoration: none;
    padding: 12px 16px;
    font-size: 24px;
    border-radius: 8px;
    transition: background-color .2s ease-in-out;
}

footer a:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

#imprint-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    border: none;
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    background: #1a1a1a;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

#imprint-dialog::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

#imprint-dialog h2 {
    font-family: Arial, Helvetica, sans-serif;
    font-style: italic;
    font-variant: small-caps;
    font-size: 36px;
    margin-bottom: 20px;
}

#imprint-dialog h3 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 12px;
}

#imprint-dialog ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#imprint-dialog ul li {
    font-size: 16px;
    line-height: 1.5;
    color: #fff;
}

#imprint-dialog ul a {
    color: #fbb63d;
    text-decoration: none;
}

#imprint-dialog ul a:hover {
    text-decoration: underline;
}

#imprint-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
    width: 30px;
    height: 30px;
}

#imprint-close:hover {
    opacity: 1;
}

#imprint-adress {
    padding-bottom: 32px;
}

#controlls-description {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 1080px;
    padding: 0 16px;
}

#controlls-description span {
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(0, 0, 0, 0.55);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 16px;
}

#controlls-description kbd {
    background-color: #fff;
    color: #1a1a1a;
    font-size: 16px;
    font-weight: bold;
    padding: 2px 7px;
    border-radius: 4px;
    border-bottom: 2px solid #aaa;
}

@media only screen and (min-width: 1081px) and (min-height: 881px) {
    #open-imprint-btn {
        display: none;
    }
    main {
        padding-top: 48px;
    }
}

.is-mobile #open-imprint-btn {
    display: revert;
}

@media only screen and (max-width: 1080px) {
    #game-title, #controlls-description, footer {
        display: none;
    }
    canvas, #splash-screen, #splash-screen > img {
        width: 100%;
    }
}

@media only screen and (max-height: 880px) {
    #game-title, #controlls-description, footer {
        display: none;
    }
    canvas, #splash-screen, #splash-screen > img {
        max-height: 100vh;
        height: 100%;
    }
}

.is-mobile #game-title,
.is-mobile #controlls-description,
.is-mobile footer {
    display: none;
}

.is-mobile canvas,
.is-mobile #splash-screen,
.is-mobile #splash-screen > img {
    width: 100%;
    max-height: 100vh;
    height: 100%;
}
