:root {
    --player-pill-bg: rgba(255, 255, 255, 0.08);
    --player-pill-border: rgba(255, 255, 255, 0.10);
    --player-pill-active-bg: rgba(255, 255, 255, 0.96);
    --player-pill-active-text: #111111;
    --player-track-bg: rgba(255, 255, 255, 0.03);
    --player-track-hover: rgba(255, 255, 255, 0.06);
    --player-track-active: rgba(255, 255, 255, 0.11);
    --player-track-border: rgba(255, 255, 255, 0.09);
    --player-muted: rgba(255, 255, 255, 0.68);
    --player-soft: rgba(255, 255, 255, 0.52);
}

.playlist {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.playlist-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.playlist-head-main {
    min-width: 0;
    flex: 1 1 auto;
}

.playlist-kicker {
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--player-soft);
    margin-bottom: 8px;
}

.playlist-title {
    font-size: 1rem;
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    word-break: break-word;
}

.playlist-status {
    font-size: 12px;
    line-height: 1;
    color: var(--player-soft);
    white-space: nowrap;
    padding-top: 18px;
    flex-shrink: 0;
}

.playlist-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 16px 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.playlist-tabs::-webkit-scrollbar {
    display: none;
}

.playlist-tab {
    appearance: none;
    border: 1px solid var(--player-pill-border);
    background: var(--player-pill-bg);
    color: #fff;
    border-radius: 999px;
    padding: 9px 13px;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
    scroll-snap-align: start;
    flex: 0 0 auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

.playlist-tab:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.playlist-tab.is-active {
    background: var(--player-pill-active-bg);
    color: var(--player-pill-active-text);
    border-color: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.playlist-viewport {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y;
    padding: 0 10px 12px;
}

#playlistItems,
.playlist-items {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.20) transparent;
    -webkit-overflow-scrolling: touch;
}

#playlistItems::-webkit-scrollbar,
.playlist-items::-webkit-scrollbar {
    width: 8px;
}

#playlistItems::-webkit-scrollbar-thumb,
.playlist-items::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.track {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 11px 14px;
    border-radius: 16px;
    color: #fff;
    background: transparent;
    border: 1px solid transparent;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
    cursor: pointer;
}

.track+.track {
    margin-top: 4px;
}

.track:hover {
    background: var(--player-track-hover);
    border-color: rgba(255, 255, 255, 0.08);
}

.track.active {
    background: var(--player-track-active);
    border-color: var(--player-track-border);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.track-name {
    min-width: 0;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-meta {
    font-size: 13px;
    color: var(--player-muted);
    white-space: nowrap;
    text-align: right;
}

.deck {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    padding: 16px 16px 16px;
}

.np-label {
    font-size: 13px;
    color: var(--player-soft);
    text-align: center;
    margin-bottom: 8px;
}

.np-title {
    font-size: clamp(1.1rem, 1.5vw, 1.7rem);
    font-weight: 800;
    line-height: 1.18;
    text-align: center;
    color: #fff;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.seek {
    width: 100%;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    outline: none;
    margin-top: 4px;
}

.seek::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.seek::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.92);
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    margin-bottom: 16px;
}

.time {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.86);
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
}

.ctrl {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    line-height: 1;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, opacity 180ms ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ctrl:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.ctrl.play {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.96);
    color: #0f0f10;
    border-color: rgba(255, 255, 255, 0.98);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
}

.ctrl.play:hover {
    background: #ffffff;
}

#playerBannerWrap {
    margin-top: auto;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
    flex: 0 0 auto;
}

#playerBannerWrap img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.18);
}

@media (max-width: 1180px) {
    .playlist-head {
        padding: 15px 14px 8px;
    }

    .playlist-tabs {
        padding: 10px 14px 8px;
    }

    .playlist-viewport {
        padding: 0 8px 12px;
    }

    .track {
        padding: 10px 12px;
    }

    .track-name {
        font-size: 14px;
    }

    .track-meta {
        font-size: 12px;
    }

    .deck {
        padding: 14px;
    }
}

@media (max-width: 980px) {
    .playlist-head {
        padding: 14px 14px 8px;
    }

    .playlist-kicker {
        font-size: 10px;
    }

    .playlist-title {
        font-size: 0.98rem;
    }

    .playlist-status {
        font-size: 11px;
        padding-top: 16px;
    }

    .playlist-tabs {
        padding: 8px 14px 8px;
        gap: 7px;
    }

    .playlist-tab {
        padding: 9px 12px;
        font-size: 11px;
    }

    .playlist-viewport {
        padding: 0 8px 12px;
    }

    #playlistItems,
    .playlist-items {
        min-height: 0;
        max-height: 260px;
    }

    .track {
        padding: 10px 12px;
        border-radius: 15px;
    }

    .track+.track {
        margin-top: 3px;
    }

    .track-name {
        font-size: 14px;
    }

    .track-meta {
        font-size: 12px;
    }

    .np-title {
        font-size: 1.05rem;
        margin-bottom: 14px;
    }

    .controls {
        gap: 10px;
        flex-wrap: nowrap;
    }

    .ctrl {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .ctrl.play {
        width: 48px;
        height: 48px;
    }

    #playerBannerWrap {
        display: block;
        margin-top: 14px;
    }

    #playerBannerWrap img {
        width: 100%;
        height: auto;
        max-height: 180px;
        aspect-ratio: 16 / 7;
        object-fit: contain;
    }
}

@media (max-width: 640px) {
    .playlist-head {
        padding: 12px 12px 8px;
    }

    .playlist-tabs {
        padding: 8px 12px 8px;
    }

    .playlist-viewport {
        padding: 0 6px 10px;
    }

    #playlistItems,
    .playlist-items {
        max-height: 240px;
    }

    .track {
        padding: 10px 11px;
        border-radius: 14px;
    }

    .track-name {
        font-size: 13px;
    }

    .track-meta {
        font-size: 11px;
    }

    #playerBannerWrap img {
        max-height: 160px;
        aspect-ratio: 16 / 7;
        object-fit: contain;
    }
}