html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #111;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    flex-direction: column;
}

.top-bar {
    width: 100%;
    height: 20vh; 
    background: linear-gradient(135deg, #2b1810 0%, #170d08 100%);
    border-bottom: 5px solid #a31c1c;
    display: flex;
    align-items: center;
    justify-content: center; /* Centrerer hele menuen på PC */
    padding: 0 30px;
    box-sizing: border-box;
    box-shadow: inset 0 -8px 20px rgba(0,0,0,0.9), 0 5px 15px rgba(0,0,0,0.5);
    cursor: default;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* Container til dropdowns, knapper og tekstvisning */
.song-guide-section {
    display: flex;
    flex-direction: row; 
    align-items: center;
    gap: 12px; 
    max-width: 1200px; /* Forhindrer elementerne i at flyve ud til siderne på PC */
    width: 100%;
    justify-content: center;
    flex-wrap: wrap; 
}

#song-select {
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 6px;
    border: 2px solid #d4af37;
    background-color: #222;
    color: #fff;
    font-weight: bold;
    outline: none;
    cursor: pointer;
}

/* GENEREL TEKSTVISNING / KARAOKE */
.karaoke-container {
    color: rgba(255, 255, 255, 0.5); 
    font-size: clamp(16px, 2.2vw, 24px);
    text-align: right;
    background: rgba(0,0,0,0.5);
    padding: 8px 16px;
    border-radius: 8px;
    border-left: 4px solid #d4af37;
    min-height: 35px;
    line-height: 1.4;
    font-weight: 500;
}

/* Det ord der skal spilles LIGE NU */
.karaoke-word.highlight {
    color: #ffd700 !important; 
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    display: inline-block;
    transform: scale(1.05); 
    transition: all 0.1s ease;
}

.karaoke-word {
    color: #ffffff;
    margin: 0 2px;
    display: inline-block;
}

/* KLAVER-CONTAINER */
.piano-container {
    display: flex;
    width: 100vw;
    height: 80vh; 
    position: relative;
    background: #0a0a0a;
    padding: 0 4px 24px 4px;
    box-sizing: border-box;
    touch-action: none;
}

.key {
    flex: 1;
    height: 100%;
    background: linear-gradient(to bottom, #ffffff 0%, #fcfcfc 10%, #f0f0f0 85%, #d6d6d6 100%);
    border: 1px solid #b5b5b5;
    border-right: 2px solid #9c9c9c;
    border-radius: 0 0 7px 7px;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    box-shadow: inset 0 4px 6px rgba(255,255,255,0.8), 0 4px 4px rgba(0,0,0,0.15);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.key.show-label::after {
    content: attr(data-note);
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: bold;
    color: #999;
}

.key.black {
    background: linear-gradient(to bottom, #444 0%, #222 15%, #050505 100%);
    height: 58%;
    position: absolute;
    z-index: 2;
    border: 1px solid #000;
    border-bottom: 4px solid #1a1a1a;
    border-radius: 0 0 5px 5px;
    box-shadow: 3px 5px 10px rgba(0,0,0,0.65), inset 0 2px 3px rgba(255,255,255,0.2);
}

.key.active {
    background: linear-gradient(to bottom, #d6d6d6 0%, #bfbfbf 100%) !important;
    box-shadow: inset 0 6px 12px rgba(0,0,0,0.25), 0 2px 2px rgba(0,0,0,0.1);
}
.key.black.active {
    background: linear-gradient(to bottom, #333 0%, #151515 100%) !important;
    height: 57.5%;
}

.key.guide-active {
    background: linear-gradient(to bottom, #a0c4ff 0%, #64b5f6 100%) !important;
    box-shadow: 0 0 15px #64b5f6, inset 0 4px 6px rgba(255,255,255,0.6);
}
.key.black.guide-active {
    background: linear-gradient(to bottom, #1e88e5 0%, #1565c0 100%) !important;
    box-shadow: 0 0 15px #1565c0;
}

/* =========================================================================
   RESPONSIV MOBIL OPTIMERING
   ========================================================================= */
@media screen and (max-width: 1000px) {
    .top-bar {
        height: 30vh !important; 
        flex-direction: column;
        padding: 0px !important;
        gap: 0px !important;
    }

    .song-guide-section {
        width: 100%;
        flex-direction: row !important; 
        gap: 6px !important;
    }

    #theme-select, #song-select {
        flex: 1 1 auto;
        max-width: 140px;
        padding: 4px 6px !important;
        font-size: 12px !important;
        height: 28px !important;
        margin: 0 !important;
    }

    #autoplay-btn, #record-btn, #play-recorded-btn {
        flex: 1 1 auto;
        padding: 4px 8px !important;
        font-size: 11px !important;
        font-weight: bold !important;
        border-radius: 4px !important;
        margin: 0 !important;
        height: 28px !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .karaoke-container, #song-display {
        width: 95% !important;
        min-height: auto !important;
        height: 22px !important;
        font-size: 12px !important;
        padding: 2px 6px !important;
        margin-top: 2px !important;
        white-space: nowrap !important;
        overflow: hidden;
        text-align: center;
    }

    .piano-container {
        height: 70vh !important;
    }
}
