#momu-music-player {
    position: fixed;
    z-index: 9999;
    user-select: none;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    touch-action: none; /* Prevent scroll while dragging */
}

/* --- Collapsed State (Ball) --- */
.music-ball {
    width: 48px;
    height: 48px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.music-ball:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: rgba(30, 30, 30, 0.9);
}

.music-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    transition: opacity 0.3s ease;
}

.music-ball.playing .music-icon {
    opacity: 0;
}

.visualizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.music-ball.playing .visualizer {
    opacity: 1;
}

.bar {
    width: 3px;
    background: #00e5ff;
    border-radius: 2px;
    animation: bounce 1s infinite ease-in-out;
}

.bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.bar:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.bar:nth-child(3) { height: 80%; animation-delay: 0.4s; }

@keyframes bounce {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1); }
}

/* --- Expanded State (Panel) --- */
.music-panel {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 280px;
    height: 80px; /* Compact height */
    border-radius: 20px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#momu-music-player.expanded .music-ball {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
}

#momu-music-player.expanded .music-panel {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.panel-blur-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: -1;
}

.panel-content {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    box-sizing: border-box;
}

.track-info-container {
    width: 100%;
    overflow: hidden;
    margin-bottom: 8px;
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.track-title-scroll {
    white-space: nowrap;
    display: inline-block;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    /* animation: scroll-text 10s linear infinite; Only if needed, simpler to just truncate for now or improve later */
}

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

.control-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, color 0.2s;
}

.control-btn:hover {
    color: #00e5ff;
}

.control-btn:active {
    transform: scale(0.9);
}

.play-btn svg {
    width: 28px;
    height: 28px;
}

.progress-container {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    width: 0%; /* Dynamic */
    position: absolute;
    left: 0;
    pointer-events: none; /* Let container handle clicks */
    background: linear-gradient(to right, #00e5ff, #0099ff);
}

.progress-container::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.progress-handle {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    right: -5px;
    top: -3px;
    box-shadow: 0 0 5px rgba(0,0,0,0.3);
    transform: scale(0);
    transition: transform 0.2s;
}

.progress-container:hover .progress-handle {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    transition: all 0.2s;
}

.close-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.close-btn svg {
    width: 14px;
    height: 14px;
}
