body {
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    background-image: url('img/5_background/mexican-background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    height: 100vh;
    overflow: hidden;    
    font-family: "Kablammo", serif;
    font-weight: 400;
    font-style: normal;
}

h1 {
    font-size: 64px;
}

.gameContainer {
    display: block;
    background-color: transparent;
}

.dpad {
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.horizontal-buttons {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0 5px;
}

button {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 20px;
    cursor: pointer;
}

button:active {
    background: rgba(255, 255, 255, 0.5);
}

.dpad button {
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.dpad button:active {
    background: rgba(255, 255, 255, 0.5);
    color: black;
}

@media screen and (min-width: 769px) {
    .dpad {
        display: none;
    }
}

.restartButton {
    display: none;
    background-color: #FFD40F;
    width: 120px;
    height: 40px;
    border-radius: 32px;
    border: none;
    font-size: 16px;
    cursor: pointer;
    z-index: 2;
}

#buttonContainer {
    display: none;
    gap: 20px;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
}

.restartButton {
    cursor: pointer;
    background-color: #ffb300;
    border: 2px solid #fff;
    border-radius: 8px;
    color: white;
    display: block;
    opacity: 0.9;
}

.restartButton:hover {
    background-color: #ff9100;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#gameContainer {
    position: relative;
    width: 720px;
    height: 480px;
    max-width: calc(100% - 32px);
    background-color: transparent;
    aspect-ratio: 720/480;
}

.startScreen, 
#canvas,
.game {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
}

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

/* Touch-Geräte im Portrait/Landscape-Modus */
@media (pointer: coarse) and (orientation: portrait) {
    #gameContainer {
        transform: rotate(90deg);
        transform-origin: center;
        width: 90vh !important;
        height: 90vw !important;
    }
}

@media (pointer: coarse) and (orientation: landscape) {
    #gameContainer {
        width: 90vw !important;
        height: 90vh !important;
    }
}

#gameContainer.fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
}

canvas {
    display: block;
}

#gameContainer.fullscreen canvas,
#gameContainer.fullscreen .startScreen,
#gameContainer.fullscreen .start-img {
    width: 100%;
    height: 100%;
}

#gameContainer canvas,
.startScreen,
.start-img {
    width: 100%;
    height: 100%;
}

.startScreen {
    display: flex;
    justify-content: center;
    align-items: center;
}

.play-button {
    position: absolute;
    width: 100px;
    height: 100px;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 1;
}

.play-button:hover {
    transform: scale(1.1);
}

.info-button, .fullscreen, .audio {
    position: absolute;
    width: 4.5%;
    height: auto;
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 2;
}

.info-button {
    top: 15%;
    left: 2%;
}

.fullscreen {
    top: 15%;
    left: 8%;
}

.audio {
    top: 15%;
    left: 14%;
}

.info-button:hover,
.fullscreen:hover,
.audio:hover {
    transform: scale(1.1);
}

.info-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #A0DDFC;
    padding: 3%;
    border-radius: 15px;
    z-index: 3;
    width: 40%;
    max-width: 400px;
    min-width: 200px;
}

.info-dialog h2 {
    font-family: "Kablammo", serif;
    text-align: center;
    margin-bottom: 20px;
    font-size: clamp(16px, 3vw, 24px);
}

.info-dialog ul {
    list-style: none;
    padding: 0;
}

.info-dialog li {
    margin: 10px 0;
    font-family: Arial, sans-serif;
    font-size: clamp(12px, 2.5vw, 16px);
    font-weight: bolder;
    justify-content: center;
    display: flex;
}

.info-content{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.btn{
    background-color: #FFD40F;
    width: 120px;
    height: 40px;
    border-radius: 32px;
    border: none;
    font-size: 16px;
    font-weight: bolder;
    cursor: pointer;
}

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

.rotate-message {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    width: 150px;
    height: 150px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
}

.mobile-controls {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 70px;
    box-sizing: border-box;
    pointer-events: none;
}

.mobile-controls img {
    width: 50px;
    height: 50px;
    margin: 0 10px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.bottle-mobil-throw {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    pointer-events: auto;
    align-self: flex-end;
}

.dpad, .bottle-mobil-throw {
    display: none;
}

@media only screen and (max-width: 720px) {
    canvas , .startScreen{
        width: 100%;
    }        
}

@media only screen and (max-height: 480px){
    canvas ,.startScreen{
        height: 100vh;
    }
}

@media (pointer: coarse) and (orientation: portrait) {
    body {
        height: 100vh;
        width: 100vw;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    h1 {
        display: none;
    }

    #gameContainer {
        transform: rotate(90deg);
        transform-origin: center;
        width: 90vh !important;
        height: 90vw !important;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(90deg);
    }

    .dpad, .bottle-mobil-throw {
        display: none;
    }

    .rotate-message {
        display: block;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 1000;
        width: 80%;
        height: 50vh;
        background-color: rgba(0, 0, 0);
        padding: 20px;
        border-radius: 10px;
    }
}

@media (pointer: coarse) and (orientation: landscape) {
    body {
        height: 100vh;
        width: 100vw;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    h1 {
        display: none;
    }

    #gameContainer {
        width: 90vw !important;
        height: 90vh !important;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .rotate-message {
        display: none;
    }

    .dpad, .bottle-mobil-throw {
        display: flex;
    }

    .mobile-controls {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        pointer-events: all;
        z-index: 100;
        bottom: 20px;
    }
}

.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 10px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.impressum-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-family: Arial, sans-serif;
}

.impressum-link:hover {
    text-decoration: underline;
}

.impressum {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.impressum-content {
    background-color: #A0DDFC;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
}

.impressum-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-family: "Kablammo", serif;
}

.impressum-content p {
    margin: 10px 0;
    font-family: Arial, sans-serif;
    line-height: 1.5;
}