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


/* ── Base ── */

body {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-image: url("img/Westernbackground.png");
    background-size: cover;
    background-repeat: no-repeat;    
    background-attachment: fixed;
    font-family: Zabra;
    margin: 0;
}

h1 {
    font-size: 60px;
    letter-spacing: 2px;
}

canvas {
    background-color: black;
    display: block;
}


/* ── Utility ── */

.hidden {
    display: none !important;
}


/* ── Game Wrapper ── */

#game-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
}


/* ── Orientation Warning ── */

#orientation-warning {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #f5c518;
    font-family: Zabra;
    font-size: 24px;
    text-align: center;
    padding: 20px;
}


/* ── Hauptmenü-Overlay ── */

#menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#menu-buttons {
    position: absolute;
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 2%;
    pointer-events: all;
    white-space: nowrap;
}

#btn-hamburger {
    position: absolute;
    top: 3%;
    right: 2%;
    width: calc(var(--cw) * 0.055);
    height: calc(var(--cw) * 0.055);
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: calc(var(--cw) * 0.025);
    cursor: pointer;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

#btn-hamburger:hover {
    background: rgba(0, 0, 0, 0.75);
}


/* ── Menü-Buttons (Start Game / How to Play / Zurück) ── */

.menu-btn {
    padding: calc(var(--cw) * 0.015) calc(var(--cw) * 0.028);
    min-width: calc(var(--cw) * 0.19);
    height: calc(var(--cw) * 0.065);
    background: #f5c518;
    color: black;
    border: none;
    border-radius: calc(var(--cw) * 0.012);
    font-family: Zabra;
    font-size: calc(var(--cw) * 0.028);
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.menu-btn:hover {
    background: #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
}


/* ── Impressum-Overlay ── */

#impressum-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15%;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 5;
}

#impressum-box {
    background: rgba(0, 0, 0, 0.88);
    border-radius: 1.5%;
    padding: 2% 4%;
    width: 90%;
    max-height: 78%;
    overflow-y: auto;
    pointer-events: all;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #f5c518 rgba(255, 255, 255, 0.1);
}

#impressum-box h2 {
    color: #f5c518;
    font-family: Zabra;
    font-size: calc(var(--cw) * 0.032);
    letter-spacing: 2px;
    text-align: center;
    margin: 0 0 1.5% 0;
}

#impressum-box p {
    color: white;
    font-family: Zabra;
    font-size: calc(var(--cw) * 0.022);
    letter-spacing: 1px;
    line-height: 1.8;
    margin: 0 0 1% 0;
    text-align: center;
}

#impressum-box .highlight {
    color: #f5c518;
}


/* ── How to Play-Overlay ── */

#howtoplay-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#howtoplay-box {
    background: rgba(0, 0, 0, 0.80);
    border-radius: 1.5%;
    padding: 5% 8%;
    text-align: center;
    width: 65%;
    box-sizing: border-box;
}

#howtoplay-box h2 {
    color: #f5c518;
    font-family: Zabra;
    font-size: calc(var(--cw) * 0.038);
    letter-spacing: 2px;
    margin: 0 0 8% 0;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
}

#howtoplay-box ul {
    list-style: none;
    padding: 0;
    margin: 0 0 5% 0;
}

#howtoplay-box ul li {
    color: white;
    font-family: Zabra;
    font-size: calc(var(--cw) * 0.026);
    letter-spacing: 2px;
    margin-bottom: 5%;
    line-height: 1.6;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
}

#howtoplay-box ul li:last-child {
    margin-bottom: 0;
}


/* ── Mobile Controls ── */

#mobile-controls {
    position: absolute;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 16px 16px 16px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 100;
}

#controls-left,
#controls-right {
    display: flex;
    gap: 12px;
    pointer-events: all;
}

.mobile-btn {
    width: calc(var(--cw) * 0.1);
    height: calc(var(--cw) * 0.1);
    font-size: calc(var(--cw) * 0.028);
    font-family: Zabra;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 50%;
    border: none;
    background: rgba(245, 197, 24, 0.75);
    color: black;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.mobile-btn:active {
    background: rgba(255, 215, 0, 0.95);
    transform: scale(0.93);
}


/* ── Responsive: Touchgeräte ── */

@media (hover: none) and (pointer: coarse) {
    body {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin: 0;
    }

    h1 {
        display: none;
    }

    canvas {
        width: 100vw;
        height: calc(100vw * 9 / 16);
        max-height: 100vh;
        max-width: calc(100vh * 16 / 9);
        display: block;
    }
}

/* Hochkant-Warnung */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
    #orientation-warning {
        display: flex;
    }
}


/* ── Responsive Breakpoints (Canvas-Größe wächst mit dem Viewport) ── */



/* ── Endscreen ── */

.endscreen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4%;
}

.endscreen-img {
    width: 70%;
    max-height: 65%;
    object-fit: contain;
}

.endscreen-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3%;
    width: 100%;
}