/* ===================================================================
   mini player — compact, non-blocking, audio-reactive
   =================================================================== */
.mini-player {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 10px 0 6px;
    color: #e9e6dd;
    background: rgba(12, 12, 15, 0.72);
    border: 1px solid rgba(233, 230, 221, 0.12);
    border-radius: 999px;
    font-family: 'Space Grotesk', sans-serif;
    text-transform: lowercase;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.38);
    transition: width .34s cubic-bezier(.22, 1, .36, 1), padding .34s cubic-bezier(.22, 1, .36, 1), gap .34s cubic-bezier(.22, 1, .36, 1), border-color .25s ease, box-shadow .25s ease;
    overflow: hidden;
}

.mini-player::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    max-width: 0;
    opacity: 0;
    transform: translate(-4px, -50%);
    color: #e9e6dd;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .22s ease, transform .34s cubic-bezier(.22, 1, .36, 1), max-width .34s cubic-bezier(.22, 1, .36, 1);
}

.mini-player.is-pristine {
    width: 154px;
    gap: 0;
    padding: 0 6px 0 16px;
    cursor: pointer;
}

.mini-player.is-pristine::before {
    content: "play music";
    max-width: 92px;
    opacity: 1;
    transform: translate(0, -50%);
}

.mini-player,
.mini-player * {
    box-sizing: border-box;
}

.mini-player:hover,
.mini-player:focus-within {
    border-color: rgba(183, 178, 255, 0.42);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.48), 0 0 20px rgba(183, 178, 255, 0.12);
}

.mini-player.is-playing {
    border-color: rgba(183, 178, 255, 0.3);
}

/* seek hairline along the very bottom edge of the pill */
.mp-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 12px;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 4;
}

.mp-progress::-webkit-slider-runnable-track {
    height: 2px;
    margin-top: 10px;
    background: rgba(233, 230, 221, 0.14);
}

.mp-progress::-moz-range-track {
    height: 2px;
    background: rgba(233, 230, 221, 0.14);
}

.mp-progress::-moz-range-progress {
    height: 2px;
    background: #b7b2ff;
}

.mp-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8px;
    height: 8px;
    margin-top: -3px;
    border-radius: 50%;
    background: #b7b2ff;
    border: none;
    opacity: 0;
    transition: opacity .2s ease;
}

.mini-player:hover .mp-progress::-webkit-slider-thumb {
    opacity: 1;
}

.mp-progress::-moz-range-thumb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b7b2ff;
    border: none;
}

/* play / pause toggle */
.mp-toggle {
    flex: none;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e9e6dd;
    background: transparent;
    border: 1px solid rgba(233, 230, 221, 0.28);
    border-radius: 50%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: transform .34s cubic-bezier(.22, 1, .36, 1), color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.mini-player.is-pristine .mp-toggle {
    transform: translateX(102px);
}

.mp-toggle:hover,
.mp-toggle:focus-visible {
    color: #b7b2ff;
    border-color: #b7b2ff;
    box-shadow: 0 0 12px rgba(183, 178, 255, 0.35);
    outline: none;
}

.mini-player.is-playing .mp-toggle {
    color: #b7b2ff;
    border-color: #b7b2ff;
}

.mp-pause,
.mini-player.is-playing .mp-play {
    display: none;
}

.mini-player.is-playing .mp-pause {
    display: block;
}

/* live waveform */
.mp-wave {
    flex: none;
    width: 104px;
    height: 26px;
    display: block;
    opacity: 1;
    transition: width .34s cubic-bezier(.22, 1, .36, 1), opacity .22s ease, transform .34s cubic-bezier(.22, 1, .36, 1);
}

/* now-playing meta */
.mp-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    width: 84px;
    flex: none;
    line-height: 1.14;
    opacity: 1;
    transition: width .34s cubic-bezier(.22, 1, .36, 1), opacity .22s ease, transform .34s cubic-bezier(.22, 1, .36, 1);
}

.mp-title {
    position: relative;
    font-size: 0.74rem;
    color: #f4f2ea;
    white-space: nowrap;
    overflow: hidden;
}

.mp-title__t {
    display: inline-block;
    will-change: transform;
}

.mp-title.is-scroll .mp-title__t {
    animation: mpMarquee var(--mp-dur, 8s) ease-in-out infinite alternate;
}

@keyframes mpMarquee {
    0%, 16% { transform: translateX(0); }
    84%, 100% { transform: translateX(calc(var(--mp-over, 0) * -1px)); }
}

.mp-artist {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.04em;
    color: #77746d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* prev / next / volume — revealed on hover or focus */
.mp-extra {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width .28s ease, opacity .2s ease;
}

.mini-player.is-pristine .mp-wave,
.mini-player.is-pristine .mp-meta,
.mini-player.is-pristine .mp-extra {
    width: 0;
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
}

.mini-player.is-pristine .mp-progress {
    opacity: 0;
    pointer-events: none;
}

.mini-player:hover .mp-extra,
.mini-player:focus-within .mp-extra {
    max-width: 160px;
    opacity: 1;
}

.mp-btn {
    flex: none;
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a7a49b;
    background: transparent;
    border: 1px solid rgba(233, 230, 221, 0.16);
    border-radius: 50%;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: color .18s ease, border-color .18s ease;
}

.mp-btn:hover,
.mp-btn:focus-visible {
    color: #b7b2ff;
    border-color: #b7b2ff;
    outline: none;
}

.mp-vol {
    display: flex;
    align-items: center;
    width: 54px;
}

.mp-vol input {
    width: 100%;
    height: 14px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
}

.mp-vol input:focus-visible {
    outline: none;
}

.mp-vol input::-webkit-slider-runnable-track {
    height: 2px;
    background: rgba(233, 230, 221, 0.28);
    border-radius: 2px;
}

.mp-vol input::-moz-range-track {
    height: 2px;
    background: rgba(233, 230, 221, 0.28);
    border-radius: 2px;
}

.mp-vol input::-moz-range-progress {
    height: 2px;
    background: #b7b2ff;
}

.mp-vol input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 9px;
    height: 9px;
    margin-top: -3.5px;
    border-radius: 50%;
    background: #e9e6dd;
    border: none;
}

.mp-vol input::-moz-range-thumb {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #e9e6dd;
    border: none;
}

/* hidden data + state (playlist source lives here, never shown) */
.mp-tracks,
.mp-state,
.mini-player audio {
    display: none !important;
}

@media (max-width: 600px) {
    .mini-player {
        left: 12px;
        bottom: 12px;
        gap: 8px;
        height: 42px;
        padding: 0 12px 0 6px;
    }

    .mp-wave {
        width: 58px;
    }

    .mp-meta {
        width: 72px;
    }

    /* touch has no hover — keep prev/next reachable, drop volume (use system) */
    .mp-extra {
        max-width: 60px;
        opacity: 1;
    }

    .mp-vol {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mini-player,
    .mini-player *,
    .mini-player *::before,
    .mini-player *::after {
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}
