

body {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: url('./img/mostafaelturkey36-desert-5112222_1920.png');
    font-family: 'zabars', Arial, Helvetica, sans-serif;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
}

h1 {
    font-size: 80px;
    letter-spacing: 5px;
    text-shadow: 1px 1px 4px black;
}

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

.game-area {
    position: relative;
    width: min(720px, 100%, calc((100vh - 16px) * 1.5));
    width: min(720px, 100%, calc((100dvh - 16px) * 1.5));
}

.start-screen {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 5%;
    background-image: url('./img/9_intro_outro_screens/start/startscreen_julio.png');
    background-size: cover;
    background-position: center;
    aspect-ratio: 3 / 2;
}

.start-buttons,
.end-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.end-buttons {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 5%;
    justify-content: center;
}

.game-button {
    display: inline-block;
    padding: 8px 26px;
    font-family: inherit;
    font-size: 26px;
    letter-spacing: 2px;
    text-decoration: none;
    color: #7a1f05;
    background: linear-gradient(#ffe600, #ffa000);
    border: 3px solid #b5360e;
    border-radius: 14px;
    box-shadow: 0 4px 0 #8a2a08;
    cursor: pointer;
}

.game-button.big {
    font-size: 36px;
    padding: 10px 44px;
}

.game-button:hover {
    filter: brightness(1.1);
}

.game-button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #8a2a08;
}

.dialog-backdrop {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.55);
}

.dialog {
    position: relative;
    max-width: 80%;
    padding: 20px 28px;
    background-color: #fff3d6;
    border: 4px solid #b5360e;
    border-radius: 16px;
    color: #5a1f08;
    text-align: center;
    max-height: 90%;
    overflow-y: auto;
}

.dialog h2 {
    margin-top: 0;
}

.dialog table {
    margin: 0 auto 12px;
    text-align: left;
}

.dialog td {
    padding: 4px 14px;
}

.close-button {
    position: absolute;
    top: 8px;
    right: 8px;
    font-family: inherit;
    font-size: 18px;
    color: #7a1f05;
    background: none;
    border: none;
    cursor: pointer;
}

.press-key {
    margin: 0;
    font-size: 32px;
    letter-spacing: 3px;
    color: #ffe600;
    text-shadow: 2px 2px 0 #8a2a08;
    animation: blink 1.2s infinite;
}

.settings-button img {
    display: block;
    width: 32px;
    height: 32px;
}

.settings-button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 12px;
    font-size: 16px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.dialog-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dialog .game-button {
    font-size: 20px;
}

.game-button.settings-button {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px;
}

.d-none {
    display: none !important;
}

.touch-controls {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 3%;
    padding: 0 3%;
    justify-content: space-between;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

.touch-group {
    display: flex;
    gap: 12px;
}

.game-button.touch-button {
    pointer-events: auto;
    box-sizing: border-box;
    min-width: 56px;
    height: 56px;
    padding: 0 12px;
    font-size: 24px;
    touch-action: none;
}

.rotate-hint {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background-color: #000;
    color: #ffe600;
    font-size: 28px;
    text-align: center;
}

.loading-screen {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    color: #ffe600;
    font-size: 32px;
    letter-spacing: 3px;
}

.tap-hint {
    display: none;
}

@media (pointer: coarse) {
    .key-hint {
        display: none;
    }

    .tap-hint {
        display: inline;
    }
}

@media (max-width: 1024px),
(pointer: coarse) {
    .touch-controls {
        display: flex;
    }
}

@media (max-width: 1024px) and (orientation: portrait) {
    .rotate-hint {
        display: flex;
    }
}

@keyframes blink {
    50% {
        opacity: 0.2;
    }
}

@font-face {
    font-family: 'zabars';
    src: url('fonts/Zabars.ttf') format('truetype');
    font-display: swap;
}

:fullscreen h1 {
    display: none;
}

:fullscreen .game-area {
    width: min(100vw, calc(100vh * 1.5));
}

:fullscreen body {
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background: #000;
}

:-webkit-full-screen h1 {
    display: none;
}

:-webkit-full-screen .game-area {
    width: min(100vw, calc(100vh * 1.5));
}

:-webkit-full-screen body {
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background: #000;
}

@media only screen and (max-width: 720px) {

    h1 {
        display: none;
    }

    .game-button {
        font-size: 18px;
        padding: 6px 14px;
    }
}

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

    h1 {
        display: none;
    }

    .game-button {
        font-size: 18px;
        padding: 6px 14px;
    }

    .game-button.big {
        font-size: 24px;
        padding: 8px 28px;
    }
}