* {
    -webkit-tap-highlight-color: transparent;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.514);
}

/* ---------- BODY ---------- */
body {
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: url(assets/BG.png) no-repeat center center;
    background-size: cover;
    background-color: black;
    box-sizing: border-box;
    text-align: center;
}

/* iOS PWA spacing for notch/Dynamic Island */
@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: max(20px, env(safe-area-inset-top));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Additional spacing for iOS PWA when in standalone mode */
@media (display-mode: standalone) {
    body {
        padding-top: max(40px, calc(env(safe-area-inset-top) + 20px));
    }
}

/* iOS background expansion */
@media screen and (max-width: 768px) {
    /* Detect iOS devices */
    @supports (-webkit-touch-callout: none) {
        body {
            /* Avoid iOS fixed background bugs */
            background-attachment: scroll;
            background-position: center center;
            background-size: cover;
            background-repeat: no-repeat;
        }
        
        /* Use stable viewport height on iOS 16+ */
        @supports (height: 100svh) {
            body { min-height: 100svh; }
        }
        
        /* Portrait mode */
        @media (orientation: portrait) {
            body { 
                background-position: center center; 
                background-size: cover; 
            }
        }
        
        /* Landscape mode - expand to edges */
        @media (orientation: landscape) {
            body {
                background-position: center center;
                background-size: cover;
                padding-left: max(0px, env(safe-area-inset-left));
                padding-right: max(0px, env(safe-area-inset-right));
                margin-left: 0;
                margin-right: 0;
            }
            
            .musicplayer-wrapper {
                padding-left: max(20px, calc(env(safe-area-inset-left) + 10px));
                padding-right: max(20px, calc(env(safe-area-inset-right) + 10px));
            }
        }
    }
}

/* ---------- FONT ---------- */
@font-face {
    font-family: MKWorld;
    src: url(assets/font/RacersDelight.otf);
}

/* ---------- HEADINGS ---------- */
h1 {
    color: white;
    font-family: MKWorld;
    font-size: 175%;
    font-weight: normal;
}

h2, h3, label, button {
    color: white;
    font-family: MKWorld;
    font-weight: normal;
}

h4, h5 {
    color: white;
    font-family: MKWorld;
    font-weight: normal;
    margin-top: -1px;
}

#nextBtn i {
  margin-left: 0px;
  transition: margin-left 0.15s ease;
}

#nextBtn:hover i {
  margin-left: 10px;
}

#prevBtn i {
  margin-right: 0px;
  transition: margin-right 0.15s ease;
}

#prevBtn:hover i {
  margin-right: 10px;
}

audio {
    opacity: 0;
}

.audio-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
    font-family: MKWorld;
    color: rgb(172, 172, 172);
    font-weight: normal;
}

.audio-player .progress-container {
    width: 100%;
}

.audio-player button {
    background: #444;
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.audio-player button:hover {
    background-color: #505050;
    transform: scale(1.05);
}

.progress-container {
    flex-grow: 1;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
}

#timeRemaining {
    color: white;
    font-family: MKWorld;
    margin-bottom: 5px;
    font-size: 14px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: #ff0000;
    border-radius: 3px;
}

.button-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

#game {
    min-height: 1.2em;
    visibility: hidden;
}

.hidden {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ---------- FOOTER ---------- */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: left;
    padding: 6px;
    margin-bottom: -15px;
    color: white;
    opacity: 20%;
    font-family: MKWorld;
    font-weight: normal;
    pointer-events: none;
}

/* ---------- MUSIC PLAYER ---------- */
article.musicplayer {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    max-width: 750px;
    width: 700px;
    border-radius: 2rem;
    background: rgb(41, 41, 41);
    padding: 1.5rem;
    height: 275px;
}

/* ---------- ALBUM ART ---------- */
.musicplayer img#artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15%;
    transition: transform 0.3s ease;
}

.artwork-wrapper {
    width: 275px;
    height: 275px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    justify-content: center; 
    align-items: center;
}

.MK64-img {
    transform: translateX(-50px);
}

/* ---------- METADATA BOX ---------- */
.metadata-box {
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 350px;
    height: 275px;
    padding: 20px;
    box-sizing: border-box;
}

.metadata-box h1,
.metadata-box h3,
.metadata-box h5 {
    text-align: center;
    word-wrap: break-word;
    margin: 5px 0;
}

/* ---------- METADATA ---------- */
#metadata {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
}

/* ---------- VOLUME ---------- */
.volume-control-horizontal {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* iOS Safari specific adjustments when volume slider is hidden */
body.ios-safari .metadata-box {
    margin-bottom: 15px; /* Adjust spacing when volume slider is hidden */
    height: 245px; /* Make metadata box shorter when volume slider is hidden */
}

body.ios-safari .audio-player {
    gap: 15px; /* Increase gap between elements when volume slider is hidden */
}

.volume-control-horizontal input[type="range"] {
    width: 200px;
    height: 6px;
    background: #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.volume-control-horizontal input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #555;
    border-radius: 50%;
    cursor: pointer;
}

.volume-control-horizontal input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #555;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* ---------- DROPDOWN BUTTON ---------- */
.dropdown-toggle {
    position: absolute; /* of relative t.o.v. parent */
    top: 84%;           /* pas aan afhankelijk van waar je hem wilt */
    right: 5%;           /* of left: 0; afhankelijk van positie */
    transform: translateY(-50%); /* center horizontaal en verticaal */
    width: 40px;        /* cirkelbreedte */
    height: 40px;       /* cirkelhoogte */
    border-radius: 50%; /* maakt het een cirkel */
    background-color: #3e3e3e00;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;    /* grootte van de gear */
    z-index: 20;
    transition: transform 0.3s ease;
}

.dropdown-toggle.open {
    transform: translateY(-50%) rotate(180deg);
}

/* ---------- DROPDOWN MENU ---------- */
.dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translateY(-50%);
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background-color: #292929;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 999;
}

/* ---------- SWITCH ---------- */
.switch {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-family: MKWorld;
    color: white;
    cursor: pointer;
    line-height: 200%;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    width: 40px;
    height: 18px;
    background-color: #ccc;
    border-radius: 34px;
    transition: 0.4s;
}

.slider::before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
}

.switch input:checked + .slider {
    background-color: #2196F3;
}

.switch input:checked + .slider::before {
    transform: translateX(22px);
}

/* ---------- SKIP BUTTON RECTANGLE ---------- */
.floating-btn {
    background: rgb(41, 41, 41);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.floating-btn:hover {
    background-color: #505050;
    transform: scale(1.05);
}

.audio-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.progress-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.progress-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.audio-player .progress-container {
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
    min-width: 0;
    height: 8px;
    border-radius: 10px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls button {
    font-size: 16px;
    padding: 0px 24px;
    border-radius: 8px;
    cursor: pointer;
    box-sizing: border-box;
    min-height: 45px;
    width: 80px;
}

.musicplayer-wrapper {
    display: flex;
    flex-direction: row;
    gap: 100px;
    justify-content: center;
    align-items: flex-start;
}

/* ---------- TRACKLIST CONTAINER ---------- */
.tracklist-container {
    width: 500px;
    max-height: 500px;
    overflow-y: auto;
    background: #1f1f1f;
    padding: 15px;
    border-radius: 15px;
    font-family: MKWorld;
    color: rgb(151, 151, 151);
    scrollbar-width: none;
    -ms-overflow-style: none;
    height: auto;
    margin: 0 auto;
    align-items: center;
}

.tracklist-container h2 {
    text-align: center;
    margin-bottom: 15px;
}

.cd-category {
    margin: 0 0 10px 0;
}
.cd-category:last-child {
    margin-bottom: 0;
}

.cd-btn {
    width: 100%;
    text-align: left;
    background: #333;
    color: white;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    border-radius: 8px;
    margin-bottom: 5px;
    font-family: MKWorld;
    transition: background 0.2s;
    font-size: 18px;
}

.cd-btn:hover {
    background: #444;
}

.cd-tracks {
    list-style: none;
    padding-left: 10px;       /* verwijder extra padding links */
    margin: 0 auto;        /* center de container zelf horizontaal */
    flex-direction: column; /* verticale lijst behouden */
    align-items: center;    /* center de li-items horizontaal */
    max-height: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.cd-tracks.open {
  max-height: 7500px;
}

.cd-btn.highlight {
    background-color: #555; /* iets lichter dan normaal #333 */
}

.cd-tracks li {
    position: relative;       /* nodig voor absolute children */
    padding: 5px 28px 5px 8px; /* ruimte rechts voor de knop */
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    transition: background 0.2s;
    word-wrap: break-word;
}

.cd-tracks li:hover {
    background: #555555;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}

.cd-tracks li.active {
    background: #006aff;
    color: white;
}

.cd-tracks li.active .track-text {
    animation: pulseScaleVar 0.3s ease forwards;
}

@keyframes pulseScaleVar {
    0%,100% { --scale: 1; }
    50% { --scale: 1.03; }
}

i {
    font-size: 20px;
}

.track-text {
    display: inline-block;
    overflow: hidden;
    white-space: clip;
    max-width: 100%;
    flex-grow: 1;
    margin-right: 26px;
    --scale: 1;
    transition: transform 0.2s ease-in;
}

.cd-tracks li:hover .track-text {
    transform: translateX(5px) scale(var(--scale));
}

.cd-tracks li.excluded {
    color: #666 !important;
    background-color: #222 !important;
    text-decoration: line-through;
}

.exclude-btn {
    position: absolute;
    right: 8px;             /* altijd rechts in het li */
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background-color: rgb(59, 59, 59);
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    font-family: MKWorld;
    transition: background 0.2s ease; /* geen transform */
}

/* knop hover bij actieve track */
.exclude-btn:hover {
    background-color: #ff0000;
}

/* blauw bij excluded track */
.cd-tracks li.excluded .exclude-btn {
    background-color: #00aaff;
}

/* knop hover bij excluded track */
.cd-tracks li.excluded .exclude-btn:hover {
    background-color: #0088cc;
}

/* tekst van excluded track niet klikbaar */
.cd-tracks li.excluded .track-text {
    text-decoration: line-through;
}


/* ---------- MEDIA QUERIES ---------- */
/* Mobiel: onder elkaar */
/* ========== MOBIEL: max-width 700px ========== */
@media screen and (max-width: 700px) {
    /* Make footer not sticky on mobile */
    footer {
        position: relative;
        margin-top: 40px;
        margin-bottom: 0;
        text-align: center;
        padding: 4px; /* Decrease spacing on mobile too */
    }
    
    /* Mobile scroll fade effect at top */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
        z-index: 1000;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    /* Enhanced fade for iOS safe area */
    @supports (padding-top: env(safe-area-inset-top)) {
        body::before {
            height: calc(env(safe-area-inset-top) + 40px);
            background: linear-gradient(
                to bottom,
                rgba(0,0,0,0.85) 0%,
                rgba(0,0,0,0.6) calc(env(safe-area-inset-top) + 10px),
                rgba(0,0,0,0.3) calc(env(safe-area-inset-top) + 25px),
                transparent 100%
            );
        }
    }
    
    /* Show fade when scrolled */
    body.scrolled::before {
        opacity: 1;
    }

    #skipBtnMobile {
        position: relative;
    }

    .cd-tracks li:hover .track-text {
        transform: translateX(0px) scale(var(--scale));
    }

    @keyframes pulseScaleVar {
        0%,100% { --scale: 1; }
        50% { --scale: 1; }
}

    #nextBtn:hover i {
        margin-left: 0px;
    }
    #prevBtn:hover i {
        margin-right: 0px;
    }

    .controls button {
        transition: transform 0.1s ease-in-out, background-color 0.1s ease-in-out;
        background-color: #444; /* voorkom dat het lichter wordt */
    }
    .cd-btn {
        transition: transform 0.1s ease-in-out, background-color 0.1s ease-in-out;
    }

    .controls button:hover {
        background-color: #444; /* forceer dat er geen kleurverandering komt */
    }

    .cd-btn.flash {
        animation: flashColor 0.2s forwards;
    }

    @keyframes flashColor {
        0%, 50% { background-color: #444; }
        100% { background-color: #333; }
    }

    .cd-btn.highlight {
        background-color: #333;
    }

    .cd-btn:hover {
        background-color: #333;
    }

    .cd-tracks li {
        padding: 10px 8px;    /* voor consistente spacing */
    }

    .dropdown {
        width: 385px;
        scale: 0.85;
    }

    .slider {
        scale: 1.15;
    }

    .dropdown-content {
        gap: 6px;
    }

    .switch {
        font-size: 14px;
    }

    article.musicplayer {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 90%;
        max-width: 300px;
        height: auto;
    }

    .artwork-wrapper {
        width: 250px;
        height: 250px;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .artwork-wrapper img#artwork {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .volume-control-horizontal {
        margin-top: 25px;
    }

    .audio-player {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        align-items: center;
    }

    .audio-player .progress-container {
        width: 100%;
        max-width: 350px;
        box-sizing: border-box;
    }

    .musicplayer img#artwork {
        width: 250px;
        height: 250px;
        flex-shrink: 0;
    }

    .metadata-box {
        width: 100%;
        max-width: 300px;
        padding: 10px;
        box-sizing: border-box;
    }

    #metadata {
        align-items: center;
        text-align: center;
    }

    #metadata h1 {
        font-size: 25px;
        word-break: break-word;
    }

    #metadata h3 {
        font-size: 1rem;
        line-height: 1.2rem;
        word-break: break-word;
        text-align: center;
        margin: 5px 0;
    }

    .controls button {
        font-size: 16px;
        padding: 10px 20px;
        border-radius: 8px;
        cursor: pointer;
        min-width: 10px;
        min-height: 45px;
    }

    .dropdown-toggle {
        position: absolute;
        top: 63%;
        right: 5px;
        transform: translateY(-50%);
    }

    .progress-wrapper,
    .progress-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .musicplayer-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .tracklist-container {
        width: 90%;
        max-width: 300px;
        order: 2;
    }

    .cd-btn {
        font-size: 15px;
        height: 40px;
    }
}

/* ========== TABLET / iPad: 701px - 1024px ========== */
@media screen and (min-width: 701px) and (max-width: 1024px) {
    .musicplayer-wrapper {
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
        justify-content: center;
    }

    article.musicplayer {
        flex-direction: column;
        max-width: 350px;
        flex-shrink: 0;
        height: 580px;
    }

    .tracklist-container {
        width: 100%;
        max-width: 300px;
        order: 0;
    }

    .dropdown-toggle {
        top: 65%;
        right: 5px;
    }
}

/* ========== DESKTOP: 1025px - 1400px ========== */
@media screen and (min-width: 1025px) and (max-width: 1400px) {
    .dropdown {
        width: 385px;
    }

    .dropdown-content {
        gap: 6px;
    }

    .switch {
        font-size: 14px;
    }

    article.musicplayer {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 90%;
        max-width: 300px;
        height: auto;
        flex-shrink: 0;
    }

    .artwork-wrapper {
        width: 250px;
        height: 250px;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .artwork-wrapper img#artwork {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .volume-control-horizontal {
        margin-top: 25px;
    }

    .audio-player {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        align-items: center;
    }

    .audio-player .progress-container {
        width: 100%;
        max-width: 350px;
        box-sizing: border-box;
    }

    .musicplayer img#artwork {
        width: 250px;
        height: 250px;
        flex-shrink: 0;
    }

    .metadata-box {
        width: 100%;
        max-width: 300px;
        padding: 10px;
        box-sizing: border-box;
    }

    #metadata {
        align-items: center;
        text-align: center;
    }

    #metadata h1 {
        font-size: 25px;
        word-break: break-word;
    }

    #metadata h3 {
        font-size: 1rem;
        line-height: 1.2rem;
        word-break: break-word;
        text-align: center;
        margin: 5px 0;
    }

    .controls button {
        font-size: 16px;
        padding: 10px 20px;
        border-radius: 8px;
        cursor: pointer;
        min-width: 10px;
        min-height: 45px;
    }

    .dropdown-toggle {
        position: absolute;
        top: 63%;
        right: 0px;
        transform: translateY(-50%);
    }

    .progress-wrapper,
    .progress-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .musicplayer-wrapper {
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
        justify-content: center;
    }

    .tracklist-container {
        width: 90%;
        max-width: 300px;
    }

    .cd-btn {
        font-size: 15px;
        height: 40px;
    }
}

/* ============================================================
   ENHANCED PLAYER — New Feature Styles
   ============================================================ */

/* ---------- TOAST NOTIFICATION ---------- */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: rgba(30,30,30,0.95);
    color: #fff;
    font-family: MKWorld;
    font-weight: normal;
    padding: 10px 22px;
    border-radius: 24px;
    border: 1px solid #ff0000;
    box-shadow: 0 4px 20px rgba(255,0,0,0.3);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- EXTRA CONTROLS ROW ---------- */
.extra-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
    position: relative;
}

.extra-btn {
    background: #333;
    border: none;
    color: #aaa;
    padding: 7px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-family: MKWorld;
    transition: background 0.15s, color 0.15s, transform 0.1s;
}
.extra-btn:hover {
    background: #505050;
    color: #fff;
    transform: scale(1.08);
}
.extra-btn.active {
    color: #ff3333;
}

/* Loop states */
.extra-btn.loop-off { color: #555; }
.extra-btn.loop-all { color: #ff9900; }
.extra-btn.loop-one { color: #ff3333; }

/* ---------- MUTE BUTTON ---------- */
.volume-control-horizontal {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}
.mute-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 15px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    transition: color 0.15s;
}
.mute-btn:hover, .mute-btn.muted { color: #ff3333; }

/* ---------- TABS ---------- */
.tracklist-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.tab-btn {
    flex: 1;
    background: #222;
    border: 1px solid #444;
    color: #888;
    font-family: MKWorld;
    font-weight: normal;
    font-size: 13px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.tab-btn:hover { background: #333; color: #fff; }
.tab-btn.active { background: #ff0000; color: #fff; border-color: #ff0000; }

/* ---------- SEARCH BAR ---------- */
.search-bar-wrapper {
    margin-bottom: 8px;
}
.search-bar {
    width: 100%;
    box-sizing: border-box;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    font-family: MKWorld;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}
.search-bar:focus { border-color: #ff0000; }
.search-bar::placeholder { color: #555; font-family: MKWorld; }

/* ---------- FAV BUTTON ON TRACKS ---------- */
.fav-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 5px;
    margin-left: 4px;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.1s;
}
.fav-btn:hover { color: #ff3333; transform: scale(1.2); }
.fav-btn.active { color: #ff3333; }

/* Make li flex for icon alignment */
.cd-tracks li {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cd-tracks li .track-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cd-tracks li .fav-btn { order: 2; }
.cd-tracks li .exclude-btn { order: 3; margin-left: 2px; }

/* ---------- FAVORITES EMPTY / PLAYLISTS EMPTY ---------- */
.empty-state {
    text-align: center;
    color: #555;
    font-family: MKWorld;
    padding: 24px 0;
}
.empty-state i { font-size: 28px; margin-bottom: 10px; }
.empty-state p { font-size: 13px; line-height: 1.5; }

/* ---------- PLAYLIST MANAGER ---------- */
.playlist-header {
    margin-bottom: 10px;
    text-align: center;
}
.new-playlist-btn {
    background: #ff0000;
    border: none;
    color: #fff;
    font-family: MKWorld;
    font-weight: normal;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.new-playlist-btn:hover { background: #cc0000; }

.playlist-item {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.playlist-item-name {
    flex: 1;
    font-family: MKWorld;
    color: #fff;
    font-size: 14px;
    font-weight: normal;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.playlist-item-count {
    font-family: MKWorld;
    color: #666;
    font-size: 12px;
    white-space: nowrap;
}
.playlist-item-btns {
    display: flex;
    gap: 4px;
}
.pl-btn {
    background: #333;
    border: none;
    color: #aaa;
    padding: 5px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.15s, color 0.15s;
}
.pl-btn:hover { background: #505050; color: #fff; }
.pl-btn.pl-play:hover { background: #00aa00; color: #fff; }
.pl-btn.pl-delete:hover { background: #aa0000; color: #fff; }

/* ---------- PLAYLIST TRACK VIEW ---------- */
.playlist-track-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.back-btn {
    background: #333;
    border: none;
    color: #fff;
    font-family: MKWorld;
    font-weight: normal;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.back-btn:hover { background: #555; }
#playlistViewName {
    font-family: MKWorld;
    color: #ff3333;
    font-size: 15px;
}
.add-track-results {
    background: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}
.add-track-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-bottom: 1px solid #2a2a2a;
    font-family: MKWorld;
    color: #ccc;
    font-size: 12px;
    font-weight: normal;
}
.add-track-result-item:last-child { border-bottom: none; }
.add-track-btn {
    background: #ff0000;
    border: none;
    color: #fff;
    font-family: MKWorld;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: background 0.15s;
}
.add-track-btn:hover { background: #cc0000; }
.add-track-btn:disabled { background: #444; color: #666; cursor: default; }

.pl-track-remove {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}
.pl-track-remove:hover { color: #ff3333; }

/* ---------- PLAYLIST PICKER (add-to-playlist popup) ---------- */
.playlist-picker {
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 10px;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    min-width: 180px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}
.playlist-picker-header {
    font-family: MKWorld;
    color: #aaa;
    font-size: 13px;
    font-weight: normal;
    margin-bottom: 8px;
    text-align: center;
}
.picker-pl-btn {
    display: block;
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #fff;
    font-family: MKWorld;
    font-weight: normal;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 6px;
    transition: background 0.15s;
    text-align: left;
}
.picker-pl-btn:hover { background: #ff0000; }
.playlist-picker-close {
    width: 100%;
    background: none;
    border: none;
    color: #666;
    font-family: MKWorld;
    font-weight: normal;
    font-size: 12px;
    cursor: pointer;
    margin-top: 4px;
    padding: 4px;
}
.playlist-picker-close:hover { color: #fff; }

/* ---------- MODAL ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.modal-box {
    background: #1a1a1a;
    border: 1px solid #ff0000;
    border-radius: 14px;
    padding: 28px 28px 20px;
    min-width: 280px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(255,0,0,0.25);
}
.modal-box h2 { margin-top: 0; margin-bottom: 16px; color: #fff; font-family: MKWorld; font-weight: normal; }
.modal-input {
    width: 100%;
    box-sizing: border-box;
    background: #2a2a2a;
    border: 1px solid #555;
    color: #fff;
    font-family: MKWorld;
    font-size: 15px;
    padding: 10px 14px;
    border-radius: 8px;
    outline: none;
    margin-bottom: 16px;
}
.modal-input:focus { border-color: #ff0000; }
.modal-btns { display: flex; gap: 10px; justify-content: center; }
.modal-btn {
    flex: 1;
    padding: 9px 0;
    border: none;
    border-radius: 8px;
    font-family: MKWorld;
    font-weight: normal;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.modal-btn.confirm { background: #ff0000; color: #fff; }
.modal-btn.confirm:hover { background: #cc0000; }
.modal-btn.cancel { background: #333; color: #aaa; }
.modal-btn.cancel:hover { background: #555; color: #fff; }

/* ---------- SHORTCUT HINT IN SETTINGS ---------- */
.shortcut-hint {
    font-family: MKWorld;
    color: #888;
    font-size: 12px;
    line-height: 1.7;
    text-align: left;
    font-weight: normal;
}
.shortcut-hint b { color: #ccc; }

/* ---------- TAB CONTENT ---------- */
.tab-content { }

/* ---------- MOBILE: stack extra controls ---------- */
@media screen and (max-width: 700px) {
    .extra-controls { gap: 6px; }
    .extra-btn { padding: 8px 14px; font-size: 15px; }
    .tracklist-tabs { gap: 4px; }
    .tab-btn { font-size: 12px; padding: 7px 5px; }
}
