* {
    -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;
}

/* ---------- 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: 10px;
    margin-bottom: -20px;
    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;
}

.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) {
    #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;
    }
}
