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

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'zabars', Arial, Helvetica, sans-serif;
    background-image: url('img/5_background/desert.png');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 720px;
    max-height: 480px;
}

#canvas-container:fullscreen {
    max-width: unset;
    max-height: unset;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#ui .head-bar img {
    filter: brightness(100) invert(100%) sepia(10%) saturate(100%) hue-rotate(340deg) brightness(100%);
}

.head-bar {
    display: flex;
    flex-direction: row;
    justify-content: end;
    padding-top: 10px;
    padding-right: 10px;
    gap: 15px;
    pointer-events: auto !important;
}

.head-bar img {
    cursor: pointer;
}

img {
    height: 30px;
    width: 30px;
    overflow-clip-margin: content-box;
    overflow: clip;
}

h1 {
    font-size: 64px;
    letter-spacing: 3px;
    text-shadow: 4px, 4px, 8px rgba(0, 0, 0, 6);
}

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

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

#canvas-container {
    position: relative;
    width: 100vw;
    max-width: 720px;
    aspect-ratio: 720 / 480;
    margin: 0 auto;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img/9_intro_outro_screens/start/startscreen_2.png');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 5;
}

.menu-top-right {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 15px;
    z-index: 9999;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.3);
    padding: 6px;
    height: 25px;
    width: 25px;
    border: none;
    cursor: pointer;
}

.icon-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.7);
}

#canvas-container:fullscreen .menu-top-right {
    position: fixed;
}

.startGameButtonContainer {
    display: flex;
    align-items: start;
    justify-content: center;
    padding-bottom: 15px;
    height: 100%;
    width: 100%;
}

.start-game-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 36px;
    font-size: 26px;
    font-weight: bold;
    background-color: #e67e22;
    color: white;
    border: 3px solid white;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0px 6px 0px #d35400, 0px 10px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.1s ease;
}

.start-game-btn:hover {
    background-color: #f39c12;
    transform: translateY(-2px);
    box-shadow: 0px 8px 0px #d35400, 0px 12px 24px rgba(0, 0, 0, 0.4);
}

.start-game-btn:active {
    transform: translateY(4px);
    box-shadow: 0px 2px 0px #d35400, 0px 4px 10px rgba(0, 0, 0, 0.4);
}

.menu-bottom-buttons {
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    gap: 15px;
}

.menu-sub-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    border: 1px solid #bdc3c7;
    border-radius: 6px;
    cursor: pointer;
}

.menu-sub-btn:hover {
    background: #34495e;
}

.close-btn {
    margin-top: 15px;
    padding: 8px 20px;
    background-color: #c0392b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.close-btn:hover {
    background-color: #e74c3c;
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    padding-top: 50px;
    z-index: 10;
}

#game-container:has(#game-over-screen:not(.d-none)) #mobile-controls {
    display: none !important;
}

.end-img {
    width: 60%;
    height: 60%;
    margin-bottom: 24px;
}

.end-buttons-container {
    display: flex;
    position: absolute;
    bottom: 90px;
    gap: 30px;
}

.end-btn {
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    background-color: #ffc107;
    border: 2px solid #fff;
    border-radius: 8px;
    color: #000;
    transition: all 0.2s ease;
    z-index: 1000 !important;
}

.end-btn:hover {
    background-color: #f8f9fa;
    transform: scale(1.05);
}

#turn-device-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #2c3e50;
    color: white;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
}