/* 전역 미니 플레이어 위젯 — 블랙 & 화이트 모노톤 */
#pl-widget {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99999;
    width: 300px;
    max-width: calc(100vw - 32px);
    background: #1c1c1e;
    color: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
    font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
    font-size: 13px;
    overflow: hidden;
    transition: transform .2s ease, opacity .2s ease;
}
#pl-widget.pl-hidden {
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
}
#pl-widget * { box-sizing: border-box; }

/* ---------- 상단 바 ---------- */
#pl-widget-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
}
#pl-widget-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #2c2c2e center/cover no-repeat;
    flex: 0 0 auto;
}
#pl-widget-info {
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}
#pl-widget-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}
#pl-widget-artist {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #8e8e93;
    font-size: 11px;
    margin-top: 2px;
}

/* ---------- 공통 원형 아이콘 버튼 ---------- */
.pl-icon-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #f2f2f2;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    transition: background .12s ease, color .12s ease;
}
.pl-icon-btn svg { width: 15px; height: 15px; fill: currentColor; }
.pl-icon-btn:hover { background: rgba(255,255,255,.12); }
.pl-icon-btn.is-active { color: #1c1c1e; background: #fff; }
.pl-icon-btn.is-active:hover { background: #eee; }

#pl-widget-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}
#pl-widget-play {
    width: 32px;
    height: 32px;
    background: #fff;
    color: #1c1c1e;
}
#pl-widget-play svg { width: 14px; height: 14px; }
#pl-widget-play:hover { background: #ececec; }

/* ---------- 이어듣기 안내 ---------- */
#pl-widget-resume {
    display: none;
    padding: 8px 12px;
    background: #2b2b2e;
    text-align: center;
    font-size: 12px;
    color: #ddd;
    cursor: pointer;
}
#pl-widget-resume:hover { background: #333; }

/* ---------- 볼륨 ---------- */
#pl-widget-volume-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 12px 12px;
}
#pl-widget-volume-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e93;
}
#pl-widget-volume-icon svg { width: 16px; height: 16px; fill: currentColor; }
#pl-widget-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    flex: 1 1 auto;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(#fff, #fff) no-repeat, #3a3a3d;
    background-size: 80% 100%;
    outline: none;
    cursor: pointer;
}
#pl-widget-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
#pl-widget-volume-slider::-moz-range-thumb {
    width: 13px;
    height: 13px;
    border: none;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
#pl-widget-volume-slider::-moz-range-progress {
    background: #fff;
    height: 4px;
    border-radius: 2px;
}
#pl-widget-volume-slider::-moz-range-track {
    background: #3a3a3d;
    height: 4px;
    border-radius: 2px;
}

/* ---------- 재생목록 헤더 ---------- */
#pl-widget-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,.08);
    cursor: pointer;
}
#pl-widget-list-title-label {
    font-size: 12px;
    font-weight: 600;
    color: #d0d0d5;
}
#pl-widget-list-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}
#pl-widget-list-chevron {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8e8e93;
    transition: transform .18s ease;
}
#pl-widget-list-chevron svg { width: 12px; height: 12px; fill: currentColor; }
#pl-widget-list-chevron.pl-open { transform: rotate(180deg); }

#pl-widget-list {
    display: none;
    max-height: 260px;
    overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,.08);
}
#pl-widget-list.pl-open { display: block; }
.pl-widget-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
}
.pl-widget-list-item:hover { background: rgba(255,255,255,.06); }
.pl-widget-list-item.is-current { background: rgba(255,255,255,.1); }
.pl-widget-list-thumb {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #333 center/cover no-repeat;
    flex: 0 0 auto;
}
.pl-widget-list-text {
    min-width: 0;
    flex: 1 1 auto;
}
.pl-widget-list-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-widget-list-artist {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #8e8e93;
    font-size: 11px;
}

#pl-widget-player-mount {
    width: 1px;
    height: 1px;
    overflow: hidden;
    position: absolute;
    left: -9999px;
}

/* ---------- 최소화 상태의 동그란 런처 ---------- */
#pl-widget-launcher {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99998;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #1c1c1e;
    color: #fff;
    border: none;
    box-shadow: 0 6px 18px rgba(0,0,0,.35);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
#pl-widget-launcher svg { width: 18px; height: 18px; fill: currentColor; }
#pl-widget-launcher.pl-show { display: flex; }
