body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background-color: #2c3e50;
    font-family: 'Arial', sans-serif;
}

h1 {
    color: #ffca28;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.canvas-container {
    position: relative;
    width: 720px;
    height: 480px;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.overlay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 100;
}

.overlay-screen img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 999;
}

#game-over img {
    width: 720px;
    height: 480px;
    object-fit: contain;
    position: relative;
}

#game-won {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 999;
}

#game-won img {
    width: 720px;
    height: 480px;
    object-fit: contain;
    position: relative;
}

.game-btn {
    position: absolute;
    z-index: 101;
    padding: 15px 30px;
    font-size: 24px;
    background-color: #f7bd10;
    border: none;
    bottom: 30%;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.game-btn:hover {
    background-color: #ffd54f;
    transform: scale(1.1);
}

.controls-container {
    position: relative;
    z-index: 101;
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.control-key {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.key {
    background-color: #4a4a4a;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}

.control-buttons {
    position: absolute;
    top: 55px;
    left: 20px;
    z-index: 102;
    padding: 2px;
}

.impressum-container {
    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: 1000;
}

.impressum-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
}

.impressum-btn {
    bottom: 15% !important;
    background-color: #ffd54f !important;
    font-size: 18px !important;
}

#mute {
    width: 30px;
    height: 30px;
    cursor: pointer;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    padding: 12px;
    transition: all 0.2s ease;
}

#mute:hover {
    transform: scale(1.1);
    filter: brightness(1.2);
}

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

#orientation-hint {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #2c3e50;
    color: #ffca28;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    text-align: center;
    z-index: 9999;
}

.mobile-controls {
    display: none !important;
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 10px;
}

.d-pad {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
}

.action-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.control-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.control-button img {
    width: 30px;
    height: 30px;
    pointer-events: none;
}

.control-button:active {
    background-color: rgba(255, 255, 255, 0.5);
    transform: scale(0.95);
}

@media screen and (orientation: landscape) and (max-width: 932px) {
    body {
        margin: 0;
        padding: 0;
        height: 100vh;
        width: 100vw;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    .canvas-container {
        width: 100%;
        height: 100%;
        margin: 0;
        position: relative;
    }

    canvas {
        width: 100%;
        height: 100%;
    }

    h1 {
        display: none;
    }

    .mobile-controls {
        display: flex !important;
        justify-content: space-between;
        pointer-events: none;
    }

    .d-pad, .action-buttons {
        pointer-events: auto;
    }

    .control-button {
        width: 50px;
        height: 50px;
    }

    .d-pad {
        bottom: 20px;
        left: 20px;
    }

    .action-buttons {
        bottom: 20px;
        right: 20px;
    }

    * {
        user-select: none;
        -webkit-user-select: none;
    }

    .control-buttons {
        top: 45px;
        left: 10px;
    }

    #game-over, #game-won {
        width: 100vw;
        height: 100vh;
    }

    #game-over img, #game-won img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .game-btn {
        bottom: 10%;
        padding: 10px 20px;
        font-size: 18px;
    }

    .controls-container {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(0, 0, 0, 0.5);
        padding: 10px;
        border-radius: 10px;
        margin: 0;
        z-index: 105;
    }

    #start-button {
        z-index: 106;
        bottom: auto;
        top: 50%;
        transform: translateY(-50%);
    }

    .impressum-btn {
        bottom: auto !important;
        font-size: 16px !important;
        padding: 8px 16px !important;
        top: 62% !important;
        transform: translateY(-50%) !important;
        z-index: 106;
    }
}

@media screen and (orientation: portrait) {
    #orientation-hint {
        display: flex !important;
    }
    
    .canvas-container, 
    #game-won,
    #game-over,
    h1,
    .controls-container {
        display: none !important;
    }

    .mobile-controls {
        display: none !important;
    }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    .control-button {
        width: 40px;
        height: 40px;
    }

    .d-pad, .action-buttons {
        bottom: 10px;
    }
}

@media screen and (orientation: landscape) and (max-height: 400px) {
    .control-button {
        width: 35px;
        height: 35px;
    }

    .d-pad {
        left: 10px;
    }

    .action-buttons {  
        right: 10px;
    }
}