body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle, #1a2a3a 0%, #0d1520 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    overflow: hidden;
    touch-action: none; /* Forhindrer uønsket scrolling og zoom på mobil */
}

h1 {
    margin: 5px 0;
    font-size: 24px;
    text-align: center;
    color: #f1f2f6;
}

#fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    z-index: 100;
}

#scoreboard {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 25px;
    border-radius: 10px;
    border: 2px solid #ffffff;
}

.score-red { color: #ff4757; }
.score-blue { color: #2e86de; }

#game-container {
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    border-radius: 12px;
    width: 95%;
    max-width: 800px;
    border: 4px solid #2f3542;
    background: #1e5631;
}

canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Standard mobilknapper under banen (lodret skærm) */
#mobile-controls {
    display: none;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    padding: 0 10px;
    width: 100%;
    box-sizing: border-box;
}

.btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    border-radius: 12px;
    padding: 15px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    flex: 1;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.btn:active {
    background: rgba(255, 255, 255, 0.4);
}

#btn-jump {
    background: rgba(46, 204, 113, 0.3);
    border-color: #2ecc71;
}

#controls-hint {
    margin-top: 10px;
    font-size: 12px;
    color: #a4b0be;
    text-align: center;
}

/* --- DET MAGISKE VANDRETTE LOOK (LANDSCAPE) --- */
@media (max-width: 900px) and (orientation: landscape) {
    h1, #controls-hint {
        display: none; /* Skjul tekst for at spare plads */
    }
    
    body {
        padding: 0;
    }

    #scoreboard {
        font-size: 22px;
        margin-bottom: 4px;
        padding: 2px 15px;
    }

    #game-container {
        width: 100vw;
        height: 80vh;
        max-width: none;
        border: none;
        border-radius: 0;
    }

    canvas {
        width: 100%;
        height: 100%;
        object-fit: contain; /* Sørger for banen passer perfekt */
    }

    /* Flyt knapperne op OVEN PÅ banen */
    #mobile-controls {
        display: flex;
        position: absolute;
        bottom: 10px;
        left: 0;
        width: 100%;
        justify-content: space-between;
        padding: 0 20px;
        pointer-events: none; /* Lad klik gå igennem containeren */
    }

    .btn {
        pointer-events: auto; /* Aktiver klik på selve knapperne */
        background: rgba(255, 255, 255, 0.2); /* Mere gennemsigtige */
        backdrop-filter: blur(3px);
        max-width: 80px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%; /* Runde knapper i hjørnerne */
    }

    /* Placer A og D i venstre side til venstre tommelfinger */
    #btn-left { order: 1; position: absolute; bottom: 10px; left: 20px; }
    #btn-right { order: 2; position: absolute; bottom: 10px; left: 120px; }
    
    /* Placer HOP i højre side til højre tommelfinger */
    #btn-jump { order: 3; position: absolute; bottom: 10px; right: 20px; max-width: 100px; border-radius: 30px; }
}

/* Vis også knapper i stående tilstand på mobiler */
@media (max-width: 768px) and (orientation: portrait) {
    #mobile-controls { display: flex; }
    #controls-hint { display: none; }
}
