* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    position: relative;
    background-image: url('img/background/desert.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

h1 {
    color: rgb(175, 105, 39);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
    font-size: 48px;
    font-family: 'Comic Sans MS', sans-serif;
}

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

.game-container {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

 .legal-notice-container {
            text-align: center;
            margin-top: 20px;
        }

        .legal-notice-btn {
            padding: 10px 25px;
            background: linear-gradient(135deg, #e0cc73 0%, #df8817 100%);
            color: white;
            border: none;
            border-radius: 25px;
            font-size: 14px;
            font-weight: bold;
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            text-decoration: none;
            display: inline-block;
        }

        .legal-notice-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        }

        .legal-notice-btn:active {
            transform: translateY(0);
        }

/* ========================================
   ROTATE SCREEN OVERLAY
   ======================================== */
.rotate-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.rotate-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.phone-icon {
    font-size: 80px;
    animation: shake 1s infinite;
}

.rotate-arrow {
    font-size: 60px;
    margin: 20px 0;
    animation: rotate 2s infinite;
}

.rotate-content h2 {
    font-size: 28px;
    margin: 20px 0 10px 0;
}

.rotate-content p {
    font-size: 18px;
    opacity: 0.9;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-15deg); }
    75% { transform: rotate(15deg); }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   MOBILE TOP CONTROLS (Start & Sound)
   ======================================== */
.mobile-top-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    gap: 8px;
    z-index: 20;
}

.top-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.top-btn:active {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(0.95);
}

/* ========================================
   MOBILE CONTROLS (Bewegung & Aktionen)
   ======================================== */
.mobile-controls {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    padding: 0 15px;
    display: none;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    z-index: 10;
}

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

/* Buttons */
.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:active {
    background-color: rgba(0, 0, 0, 0.9);
    transform: scale(0.95);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Smartphones */
@media only screen and (max-width: 720px) {
    canvas {
        width: 100%;
    }
}

/* Smartphones */
@media only screen and (max-width: 480px) {
    canvas {
        height: 100vh;
    }
}

/* Kleine Smartphones (bis 480px) */
@media (max-width: 480px) {
    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .controls-left,
    .controls-right {
        gap: 10px;
    }

    .mobile-controls {
        bottom: 10px;
        padding: 0 10px;
    }

    .top-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

/* Mittelgroße Geräte (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .control-btn {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }

    .top-btn {
        width: 42px;
        height: 42px;
        font-size: 19px;
    }
}

/* Tablets und größere Displays (über 768px) */
@media (min-width: 769px) {
    .control-btn {
        width: 80px;
        height: 80px;
        font-size: 24px;
    }

    .controls-left,
    .controls-right {
        gap: 15px;
    }

    .mobile-controls {
        bottom: 20px;
        padding: 0 20px;
    }

    .top-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

/* Landscape Modus auf kleinen Geräten */
@media (max-height: 500px) and (orientation: landscape) {
    .control-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }

    .mobile-controls {
        bottom: 8px;
    }

    .controls-left,
    .controls-right {
        gap: 16px;
    }

    .top-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .mobile-top-controls {
        top: 5px;
        right: 5px;
        gap: 5px;
    }
}

/* ========================================
   TOUCH-GERÄTE (Mobile & Tablets)
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Mobile Controls ANZEIGEN auf Touch-Geräten */
    .mobile-controls,
    .mobile-top-controls {
        display: flex !important;
    }

    body {
        background-image: none;
        background-color: #000;
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    h1 {
        display: none;
    }

    .game-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
    }

    canvas {
        position: absolute;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        object-fit: fill;
    }

    /* Portrait Modus - Zeige Rotate Screen */
    @media (orientation: portrait) {
        .rotate-screen {
            display: flex !important;
        }

        .game-container {
            display: none !important;
        }
    }

    /* Landscape Modus - Zeige Spiel */
    @media (orientation: landscape) {
        .rotate-screen {
            display: none !important;
        }

        .game-container {
            display: block !important;
        }
    }
}

/* ========================================
   DESKTOP mit Hover-Unterstützung
   ======================================== */
@media (hover: hover) and (pointer: fine) {
    /* Mobile Controls AUSBLENDEN auf Desktop */
    .mobile-controls,
    .mobile-top-controls {
        display: none !important;
    }

    .rotate-screen {
        display: none !important;
    }
}