/* ==========================================================================
   REPRODUCTOR GLOBAL BEATLATIN — Apple Music Style
   Única fuente de verdad: oscuro, claro, móvil, shield, video preview
   Tokens --bl-player-* en style.css (:root)
   Menú ⋯ compartido en beatlatin-context-menu/css/context-menu.css
   ========================================================================== */

.bl-player-edd-slot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* --- Shell --- */
.sticky-audio-player {
    position: fixed;
    bottom: 22px;
    /* Centrado en el área de contenido (a la derecha del sidebar flotante) */
    left: calc(50vw + var(--bl-sidebar-footprint, 256px) / 2);
    z-index: 9999;
    width: min(620px, calc(100% - 32px));
    max-width: 620px;
    height: 56px;
    min-height: 56px;
    font-family: var(--bl-font);
    /* Glass Apple Music (chrome-player): saturate(220%) blur(16px) + sombra 0 10px 40px */
    background: var(--bl-player-glass, rgba(38, 38, 40, 0.6));
    border: 1px solid var(--bl-border-strong);
    border-radius: 1000px;
    box-shadow: 0 10px 40px var(--bl-player-glass-shadow, rgba(0, 0, 0, 0.45));
    backdrop-filter: saturate(220%) blur(16px);
    -webkit-backdrop-filter: saturate(220%) blur(16px);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(40px);
    transition:
        opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar fijo (sin colapso): el player ya no necesita reposicionarse */

@media (max-width: 1024px) {
    .sticky-audio-player {
        left: 50%;
    }
}

.sticky-audio-player.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- Grid layout --- */
.player-container {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    height: 56px;
    min-height: 56px;
    padding: 0 18px;
    box-sizing: border-box;
}

/* --- Left controls --- */
.player-left {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: max-content;
    height: 56px;
    padding-right: 4px;
}

.control-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 32px;
    font-size: 15px;
    line-height: 1;
    background: transparent;
    border: none;
    color: var(--bl-player-icon);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.control-icon:hover {
    color: var(--bl-player-icon-hover);
    transform: scale(1.06);
}

/* Play/pause: fixed box so center never shifts */
.play-pause-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--bl-player-icon-hover);
    cursor: pointer;
    flex-shrink: 0;
}

.play-pause-icons {
    position: relative;
    display: block;
    width: 32px;
    height: 32px;
}

.play-pause-icons i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 25px;
    line-height: 1;
    color: var(--bl-player-icon-hover);
}

/* --- Center: cover + track + progress --- */
.player-center {
    display: grid;
    /* Apple Music mini-player artwork: 32px */
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: 25px 4px;
    align-items: center;
    align-content: center;
    column-gap: 12px;
    row-gap: 4px;
    width: 100%;
    min-width: 0;
    height: 42px;
}

.player-cover-link {
    --bl-player-cover-size: 32px;
    --bl-player-cover-radius: 6px;
    /* Misma foto DJ (transparente) → gris suave como featured */
    --bl-featured-photo-bg: #3a3a3c;
    grid-row: 1 / 3;
    flex-shrink: 0;
    width: var(--bl-player-cover-size);
    height: var(--bl-player-cover-size);
    border-radius: var(--bl-player-cover-radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bl-featured-photo-bg);
    border: none;
    box-shadow: none;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
    transition: none;
}

.player-cover-link:hover {
    transform: none;
    border-color: transparent;
}

.player-cover-link.is-disabled {
    pointer-events: none;
}

.player-cover,
.player-cover-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    border-radius: var(--bl-player-cover-radius, 6px);
    background: var(--bl-featured-photo-bg, #3a3a3c);
}

.player-cover-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bl-muted-soft);
    font-size: 14px;
}

.player-cover-link.has-cover .player-cover-fallback,
.player-cover-link:not(.has-cover) .player-cover {
    display: none;
}

.player-track-block {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-width: 0;
    height: 25px;
    line-height: 25px;
    overflow: hidden;
}

.player-artist {
    display: none;
}

/* --- Marquee --- */
.player-info-meta.marquee-fade-container {
    position: relative;
    width: 100%;
    min-width: 0;
    height: 25px;
    line-height: 25px;
    overflow: hidden;
    cursor: default;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.marquee-text-scroller {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    width: 100%;
    min-width: 0;
    height: 25px;
    line-height: 25px;
    white-space: nowrap;
    overflow: hidden;
    will-change: auto;
}

.marquee-text-scroller.is-marquee {
    justify-content: flex-start;
    width: max-content;
    min-width: max-content;
    overflow: visible;
    animation: blMarqueeScroll 18s linear infinite;
    will-change: transform;
}

.player-title,
.marquee-cloned {
    flex: 0 0 auto;
    color: var(--bl-player-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 25px;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none !important;
    cursor: default;
    pointer-events: none;
}

a.player-title,
a.player-title:hover,
a.player-title:focus,
a.player-title:active,
a.marquee-cloned,
a.marquee-cloned:hover,
.player-title:hover,
.player-title:focus {
    color: var(--bl-player-text);
    text-decoration: none !important;
    cursor: default;
}

.player-title.is-disabled,
a.player-title.is-disabled,
a.player-title[aria-disabled="true"] {
    cursor: default;
    pointer-events: none;
}

.marquee-text-scroller.is-marquee .player-title,
.marquee-text-scroller.is-marquee .marquee-cloned {
    width: auto;
    min-width: max-content;
    text-align: left;
    overflow: visible;
    text-overflow: clip;
}

.marquee-cloned {
    display: none;
}

.marquee-text-scroller.is-marquee .marquee-cloned {
    display: block;
}

.player-info-meta.marquee-fade-container:hover .marquee-text-scroller.is-marquee {
    animation-play-state: paused;
}

@keyframes blMarqueeScroll {
    0%, 8% {
        transform: translate3d(0, 0, 0);
    }
    92%, 100% {
        transform: translate3d(calc(-50% - 24px), 0, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .marquee-text-scroller.is-marquee {
        animation: none;
        justify-content: center;
        width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    .marquee-text-scroller.is-marquee .marquee-cloned {
        display: none;
    }

    .marquee-text-scroller.is-marquee .player-title {
        width: 100%;
        min-width: 0;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* --- Progress --- */
.progress-row {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
    width: 100%;
    height: 4px;
    gap: 6px;
    min-width: 0;
}

.player-time {
    width: 0;
    min-width: 0;
    opacity: 0;
    overflow: hidden;
    color: var(--bl-player-time, rgba(255, 255, 255, 0.88));
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: opacity 0.18s ease, width 0.18s ease, min-width 0.18s ease;
}

#current-time {
    text-align: right;
}

#total-time {
    text-align: left;
}

.sticky-audio-player.is-progress-hover .player-time {
    width: 42px;
    min-width: 42px;
    opacity: 1;
}

.sticky-audio-player.is-progress-hover .player-track-block {
    filter: blur(5px);
    opacity: 0.28;
}

.progress-container {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    overflow: hidden;
    cursor: pointer;
    transition: height 0.15s ease, background 0.15s ease;
}

.progress-container:hover {
    height: 4px;
    background: rgba(255, 255, 255, 0.24);
}

.progress-filled {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* --- Right: volume + options --- */
.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: max-content;
    height: 56px;
    padding-left: 2px;
}

.player-volume-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 56px;
}

.player-volume-toggle {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--bl-player-icon);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.player-volume-toggle:hover,
.player-volume-wrap.is-open .player-volume-toggle {
    background: var(--bl-icon-hover-bg);
    color: var(--bl-player-icon-hover);
}

.volume-icon {
    font-size: 15px;
    color: currentColor;
}

.player-volume-popover {
    position: absolute;
    right: 0;
    bottom: 42px;
    width: 118px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(28, 28, 30, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(22px) saturate(170%);
    -webkit-backdrop-filter: blur(22px) saturate(170%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.16s ease, visibility 0.16s ease, transform 0.16s ease;
}

.player-volume-wrap.is-open .player-volume-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#volume-slider {
    display: block;
    width: 100%;
    accent-color: #ffffff;
    opacity: 0.86;
    cursor: pointer;
}

/* --- Options menu --- */
.bl-options-menu-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 56px;
}

button#bl-player-options-btn.bl-track-options-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: none;
    outline: none;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: var(--bl-player-icon);
    line-height: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

button#bl-player-options-btn.bl-track-options-btn .bl-ellipsis-icon {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

button#bl-player-options-btn.bl-track-options-btn:hover,
.bl-options-menu-container.active button#bl-player-options-btn.bl-track-options-btn {
    background: var(--bl-icon-hover-bg);
    color: var(--bl-player-icon-hover);
}

/* Menús del player — posición y animación; glass/lista en context-menu.css */
.bl-options-menu-container .bl-context-menu-glass {
    position: absolute;
    right: 0;
    bottom: 44px;
    min-width: var(--bl-ctxmenu-min-width, 185px);
    z-index: 9999999;
    display: none;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.bl-options-menu-container .bl-context-menu-glass.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* --- Video preview --- */
#global-video-wrapper {
    position: fixed;
    top: calc(100vh - 300px);
    left: calc(100vw - 520px);
    width: 290px;
    height: auto;
    min-height: 0;
    max-height: 165px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.24),
        0 2px 6px rgba(0, 0, 0, 0.12);
    z-index: 9998;
    overflow: hidden;
    cursor: move;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(40px) scale(0.8) rotateX(-15deg);
    transition: opacity 0.7s, visibility 0.7s, transform 0.7s;
    perspective: 1000px;
}

#global-video-wrapper.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1) rotateX(0deg);
}

#global-video-wrapper.ui-draggable-dragging {
    transition: none;
    height: auto;
}

#global-video-engine {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

#close-video-preview {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s, border-color 0.2s;
}

#close-video-preview:hover {
    background: #D90C0C;
    border-color: #D90C0C;
}

/* ==========================================================================
   MODO CLARO
   ========================================================================== */

[data-theme="light"] .sticky-audio-player {
    /* Glass Apple Music claro: rgba(245,245,247,.55) — #f5f5f78c */
    background: var(--bl-player-glass, rgba(245, 245, 247, 0.55));
    border-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 10px 40px var(--bl-player-glass-shadow, rgba(0, 0, 0, 0.18));
}

[data-theme="light"] .sticky-audio-player .player-cover-link,
[data-theme="light"] .sticky-audio-player .player-cover,
[data-theme="light"] .sticky-audio-player .player-cover-fallback {
    --bl-featured-photo-bg: #e6e6ea;
    background: var(--bl-featured-photo-bg, #e6e6ea) !important;
    border: none !important;
    box-shadow: none !important;
}

[data-theme="light"] .sticky-audio-player,
[data-theme="light"] .sticky-audio-player .player-title,
[data-theme="light"] .sticky-audio-player .player-artist {
    color: var(--bl-text);
}

[data-theme="light"] .sticky-audio-player .player-left button,
[data-theme="light"] .sticky-audio-player .player-left .control-icon,
[data-theme="light"] .sticky-audio-player #player-prev,
[data-theme="light"] .sticky-audio-player #player-next,
[data-theme="light"] .sticky-audio-player #player-playpause,
[data-theme="light"] .sticky-audio-player .play-pause-btn,
[data-theme="light"] .sticky-audio-player .player-volume-toggle,
[data-theme="light"] .sticky-audio-player #bl-player-options-btn,
[data-theme="light"] .sticky-audio-player .player-left button i,
[data-theme="light"] .sticky-audio-player .play-pause-icons i {
    color: var(--bl-player-icon) !important;
}

[data-theme="light"] .sticky-audio-player .player-left button:hover,
[data-theme="light"] .sticky-audio-player .player-left button:focus,
[data-theme="light"] .sticky-audio-player .control-icon:hover,
[data-theme="light"] .sticky-audio-player .play-pause-btn:hover,
[data-theme="light"] .sticky-audio-player .player-volume-toggle:hover,
[data-theme="light"] .sticky-audio-player #bl-player-options-btn:hover,
[data-theme="light"] .sticky-audio-player .player-left button:hover i,
[data-theme="light"] .sticky-audio-player .play-pause-icons i {
    color: var(--bl-player-icon-hover) !important;
}

[data-theme="light"] .sticky-audio-player .player-control-btn,
[data-theme="light"] .sticky-audio-player .play-pause-btn {
    color: rgba(29, 29, 31, 0.72);
}

[data-theme="light"] .sticky-audio-player .player-control-btn:hover,
[data-theme="light"] .sticky-audio-player .play-pause-btn:hover {
    color: #1d1d1f;
}

[data-theme="light"] .sticky-audio-player .player-title,
[data-theme="light"] .sticky-audio-player .marquee-cloned {
    color: var(--bl-player-text) !important;
}

[data-theme="light"] .sticky-audio-player .player-volume-popover {
    background: rgba(245, 245, 247, 0.9);
    border-color: rgba(0, 0, 0, 0.10);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .sticky-audio-player #volume-slider {
    accent-color: #1d1d1f;
}

[data-theme="light"] .sticky-audio-player .progress-container {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .sticky-audio-player .progress-container:hover {
    background: rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .sticky-audio-player .progress-filled {
    background: rgba(29, 29, 31, 0.82);
}

[data-theme="light"] .sticky-audio-player .player-time {
    color: rgba(29, 29, 31, 0.72) !important;
}

[data-theme="light"] .sticky-audio-player.is-progress-hover .player-time {
    color: rgba(29, 29, 31, 0.88) !important;
    opacity: 1 !important;
}

[data-theme="light"] #global-video-wrapper {
    border-color: rgba(0, 0, 0, 0.10);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.10),
        0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Transición suave al cambiar tema */
html[data-theme] .sticky-audio-player,
html[data-theme] #global-video-wrapper {
    transition:
        background 0.28s ease,
        background-color 0.28s ease,
        color 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease;
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme] .sticky-audio-player,
    html[data-theme] #global-video-wrapper {
        transition: none;
    }
}

/* --- Mobile: mini-player Apple (cover | título centrado | play | next) --- */
@media (max-width: 1024px) {
    .sticky-audio-player {
        width: calc(100% - 24px);
        max-width: none;
        bottom: 14px;
        height: 64px;
        min-height: 64px;
        overflow: hidden;
        border: 0;
        border-radius: 1000px;
        /* Mismo glass Apple; la variable cambia sola con el tema */
        background: var(--bl-player-glass, rgba(38, 38, 40, 0.6));
    }

    .sticky-audio-player::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        display: block;
        min-width: 100%;
        min-height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: inherit;
        box-shadow:
            inset 0.5px 0.5px rgba(255, 255, 255, 0.9),
            inset 0.5px -0.5px rgba(255, 255, 255, 0.9),
            inset -0.5px 0.5px rgba(255, 255, 255, 0.9),
            inset -0.5px -0.5px rgba(255, 255, 255, 0.9);
        opacity: 0.1;
        pointer-events: none;
    }

    .player-container {
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        gap: 8px;
        height: 64px;
        min-height: 64px;
        padding: 0 10px;
    }

    .player-center {
        order: 1;
        flex: 1 1 auto;
        display: flex;
        align-items: center;
        gap: 14px;
        min-width: 0;
        height: 100%;
        grid-template-columns: none;
        grid-template-rows: none;
        column-gap: 0;
        row-gap: 0;
    }

    .player-left {
        order: 2;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 2px;
        flex: 0 0 auto;
        height: auto;
        min-width: auto;
        padding-right: 0;
        margin-left: 6px;
    }

    .player-right {
        display: none !important;
    }

    #player-prev {
        display: none !important;
    }

    .progress-row {
        display: none !important;
    }

    .player-artist {
        display: none !important;
    }

    .player-cover-link {
        grid-row: auto;
        flex: 0 0 40px;
        width: 40px !important;
        height: 40px !important;
        --bl-player-cover-size: 40px;
        border-radius: 8px !important;
    }

    .player-track-block {
        grid-column: auto;
        grid-row: auto;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0;
        min-width: 0;
        height: 100%;
        line-height: 1.2;
        text-align: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        pointer-events: auto;
    }

    .player-info-meta.marquee-fade-container {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 20px;
        line-height: 20px;
        text-align: center;
        cursor: pointer;
        pointer-events: auto;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .player-info-meta.marquee-fade-container:has(.is-marquee) {
        justify-content: flex-start;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 88%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, #000 10%, #000 88%, transparent 100%);
    }

    .marquee-text-scroller {
        justify-content: center !important;
        align-items: center;
        width: 100%;
        height: 20px;
        line-height: 20px;
        text-align: center;
        cursor: pointer;
        pointer-events: none;
    }

    .marquee-text-scroller.is-marquee {
        justify-content: flex-start !important;
        width: max-content;
        min-width: max-content;
        text-align: left;
    }

    .player-title,
    .marquee-cloned {
        display: block;
        width: auto;
        max-width: 100%;
        height: 20px;
        line-height: 20px;
        margin: 0 auto;
        font-size: 13px;
        font-weight: 600;
        text-align: center !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        pointer-events: none;
    }

    .marquee-text-scroller.is-marquee .player-title,
    .marquee-text-scroller.is-marquee .marquee-cloned {
        display: inline-block;
        width: auto;
        max-width: none;
        margin: 0;
        text-align: left !important;
        text-overflow: clip;
    }

    .control-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .play-pause-btn,
    .play-pause-icons {
        width: 36px;
        height: 36px;
    }

    .play-pause-icons i {
        font-size: 22px;
    }

    .player-volume-wrap {
        display: none;
    }

    .bl-options-menu-container .bl-context-menu-glass {
        right: 12px;
        bottom: 72px;
        min-width: 190px;
    }

    #global-video-wrapper {
        top: auto;
        left: 50%;
        bottom: 105px;
        cursor: default;
        transform: translateX(-50%) translateY(40px) scale(0.8);
    }

    #global-video-wrapper.is-active {
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@media (max-width: 1024px) and (prefers-contrast: more) {
    .sticky-audio-player {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* ==========================================================================
   Now Playing full-screen (móvil)
   ========================================================================== */

.bl-now-playing {
    position: fixed;
    inset: 0;
    z-index: 100050;
    display: flex;
    flex-direction: column;
    background: #1f1f1f;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition:
        opacity 0.28s ease,
        transform 0.28s ease,
        visibility 0.28s ease;
}

.bl-now-playing[hidden] {
    display: none !important;
}

.bl-now-playing.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Atmósfera suave de la carátula sobre fondo sólido BeatLatin */
.bl-now-playing__bg {
    position: absolute;
    inset: 0;
    background-color: #1f1f1f;
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0.28;
    filter: blur(40px) saturate(1.2);
    transform: scale(1.2);
    pointer-events: none;
}

.bl-now-playing__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(31, 31, 31, 0.55) 0%,
        rgba(31, 31, 31, 0.82) 42%,
        #1f1f1f 78%
    );
}

.bl-now-playing__sheet {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: max(10px, env(safe-area-inset-top)) 22px max(22px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    background: transparent;
}

.bl-now-playing__grab {
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 28px;
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.55);
}

.bl-now-playing__chevron {
    width: 36px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

.bl-now-playing__art-wrap {
    position: relative;
    width: min(78vw, 340px);
    aspect-ratio: 1;
    margin: 12px auto 28px;
    border-radius: 12px;
    overflow: hidden;
    background: #3a3a3c;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.bl-now-playing__art {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bl-now-playing__art-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 42px;
}

.bl-now-playing__info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.bl-now-playing__text {
    flex: 1 1 auto;
    min-width: 0;
}

.bl-now-playing__title-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 6%, #000 94%, transparent 100%);
}

.bl-now-playing__title-scroller {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
    width: 100%;
    white-space: nowrap;
}

.bl-now-playing__title-scroller.is-marquee {
    width: max-content;
    min-width: max-content;
    animation: blNpMarquee 16s linear infinite;
}

.bl-now-playing__title,
.bl-np-title-clone {
    flex: 0 0 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.bl-now-playing__title-scroller.is-marquee .bl-now-playing__title,
.bl-now-playing__title-scroller.is-marquee .bl-np-title-clone {
    text-overflow: clip;
    max-width: none;
}

@keyframes blNpMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .bl-now-playing__title-scroller.is-marquee {
        animation: none;
    }
}

.bl-now-playing__artist {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.25;
}

.bl-now-playing__icon-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.bl-now-playing__icon-btn:hover,
.bl-now-playing__icon-btn:focus,
.bl-now-playing__icon-btn:active {
    background: transparent !important;
    color: #ffffff;
}

.bl-now-playing__icon-btn .bl-ellipsis-icon,
.bl-now-playing__icon-btn svg {
    display: block;
    width: 28px;
    height: 28px;
    color: inherit;
    fill: currentColor;
}

/* Menú contextual abierto desde Now Playing (portal fixed) */
body > .bl-context-menu-glass.bl-np-menu-portal,
.bl-context-menu-glass.bl-np-menu-portal {
    position: fixed !important;
    z-index: 10000001 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    right: auto !important;
    bottom: auto !important;
    min-width: var(--bl-ctxmenu-min-width, 185px);
    pointer-events: auto !important;
}

.bl-now-playing__progress {
    margin-bottom: 10px;
}

.bl-now-playing__bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
    overflow: hidden;
    cursor: pointer;
    touch-action: none;
}

.bl-now-playing__bar-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    border-radius: inherit;
    background: rgba(255, 235, 220, 0.92);
    transform: scaleX(0);
    transform-origin: left center;
    pointer-events: none;
}

.bl-now-playing__times {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.bl-now-playing__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
    margin-top: 18px;
}

.bl-now-playing__ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.bl-now-playing__ctrl--play {
    width: 64px;
    height: 64px;
    font-size: 34px;
}

body.bl-now-playing-open {
    overflow: hidden;
}

[data-theme="light"] .bl-now-playing {
    background: #f5f5f7;
}

[data-theme="light"] .bl-now-playing__bg::after {
    background: linear-gradient(
        180deg,
        rgba(245, 245, 247, 0.5) 0%,
        rgba(245, 245, 247, 0.82) 42%,
        #f5f5f7 78%
    );
}

[data-theme="light"] .bl-now-playing__title,
[data-theme="light"] .bl-np-title-clone {
    color: #1d1d1f;
}

[data-theme="light"] .bl-now-playing__artist,
[data-theme="light"] .bl-now-playing__times,
[data-theme="light"] .bl-now-playing__grab {
    color: rgba(29, 29, 31, 0.55);
}

[data-theme="light"] .bl-now-playing__chevron {
    background: rgba(29, 29, 31, 0.28);
}

[data-theme="light"] .bl-now-playing__icon-btn {
    color: rgba(29, 29, 31, 0.75);
}

[data-theme="light"] .bl-now-playing__ctrl {
    color: #1d1d1f;
}

[data-theme="light"] .bl-now-playing__bar {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .bl-now-playing__bar-fill {
    background: rgba(29, 29, 31, 0.75);
}

@media (min-width: 1025px) {
    .bl-now-playing {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bl-now-playing {
        transition: none;
    }
}

/* ==========================================================================
   PROTECCIÓN FA + SHIELD HELLO ELEMENTOR (carga al final del módulo)
   ========================================================================== */

.sticky-audio-player i.fas,
.sticky-audio-player i.fa-solid,
.sticky-audio-player .player-left button i,
.sticky-audio-player .play-pause-icons i,
.sticky-audio-player .player-volume-toggle i {
    font-family: "Font Awesome 6 Free" !important;
    font-style: normal !important;
    font-weight: 900 !important;
}

.sticky-audio-player button,
.sticky-audio-player [type="button"],
.sticky-audio-player [type="submit"],
.sticky-audio-player .player-left button,
.sticky-audio-player .player-left [type="button"],
.sticky-audio-player .player-left .player-btn,
.sticky-audio-player .player-left .control-icon,
.sticky-audio-player #player-prev,
.sticky-audio-player #player-next,
.sticky-audio-player #player-playpause,
.sticky-audio-player .play-pause-btn,
.sticky-audio-player .player-volume-toggle,
.sticky-audio-player .player-volume-toggle[type="button"],
.sticky-audio-player #bl-player-options-btn,
.sticky-audio-player #bl-player-options-btn[type="button"] {
    font-family: var(--bl-font) !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--bl-player-icon) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: 1 !important;
    text-align: center !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 0.2s ease, background 0.2s ease, opacity 0.2s ease, transform 0.2s ease !important;
}

.sticky-audio-player .player-left button:hover,
.sticky-audio-player .player-left button:focus,
.sticky-audio-player .player-left button:active,
.sticky-audio-player .player-left .player-btn:hover,
.sticky-audio-player .player-left .player-btn:focus,
.sticky-audio-player .player-left .player-btn:active,
.sticky-audio-player .player-left .control-icon:hover,
.sticky-audio-player .player-left .control-icon:focus,
.sticky-audio-player .player-left .control-icon:active,
.sticky-audio-player #player-playpause:hover,
.sticky-audio-player #player-playpause:focus,
.sticky-audio-player #player-playpause:active,
.sticky-audio-player .play-pause-btn:hover,
.sticky-audio-player .play-pause-btn:focus,
.sticky-audio-player .play-pause-btn:active {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--bl-player-icon-hover) !important;
    transform: scale(1.06);
}

.sticky-audio-player .player-left button i,
.sticky-audio-player .play-pause-icons i,
.sticky-audio-player #player-prev i,
.sticky-audio-player #player-next i {
    color: var(--bl-player-icon-hover) !important;
}

.sticky-audio-player .player-left button:hover i,
.sticky-audio-player .player-left button:focus i,
.sticky-audio-player .player-left button:active i,
.sticky-audio-player .play-pause-icons i,
.sticky-audio-player #player-prev:hover i,
.sticky-audio-player #player-next:hover i {
    color: var(--bl-player-icon-hover) !important;
}

.sticky-audio-player .play-pause-icons {
    background: transparent !important;
}

.sticky-audio-player .play-pause-icons i {
    transform: translate(-50%, -50%);
}

.sticky-audio-player #player-prev,
.sticky-audio-player #player-next {
    transform: none !important;
}

.sticky-audio-player #player-prev:hover,
.sticky-audio-player #player-next:hover,
.sticky-audio-player #player-prev:focus,
.sticky-audio-player #player-next:focus,
.sticky-audio-player #player-prev:active,
.sticky-audio-player #player-next:active {
    transform: none !important;
}

.sticky-audio-player .play-pause-btn:hover,
.sticky-audio-player .play-pause-btn:focus,
.sticky-audio-player .play-pause-btn:active {
    transform: none !important;
}

.sticky-audio-player .player-left button:hover .play-pause-icons i {
    transform: translate(-50%, -50%) scale(1.06);
}

.sticky-audio-player .player-volume-toggle,
.sticky-audio-player .player-volume-toggle:hover,
.sticky-audio-player .player-volume-toggle:focus,
.sticky-audio-player .player-volume-toggle:active,
.sticky-audio-player .player-volume-wrap.is-open .player-volume-toggle {
    background: transparent !important;
    background-color: transparent !important;
    color: var(--bl-player-icon) !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.sticky-audio-player .player-volume-toggle:hover,
.sticky-audio-player .player-volume-wrap.is-open .player-volume-toggle {
    color: var(--bl-player-icon-hover) !important;
    transform: scale(1.04);
}

.sticky-audio-player .player-volume-toggle i,
.sticky-audio-player .player-volume-toggle svg,
.sticky-audio-player .player-volume-toggle:hover i,
.sticky-audio-player .player-volume-toggle:hover svg,
.sticky-audio-player .player-volume-wrap.is-open .player-volume-toggle i,
.sticky-audio-player .player-volume-wrap.is-open .player-volume-toggle svg {
    color: currentColor !important;
    fill: currentColor !important;
}

/* Móvil — solo ocultar anterior; next queda visible (layout Apple) */
@media (max-width: 1024px) {
    .sticky-audio-player #player-prev,
    #sticky-audio-player #player-prev {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        min-width: 0 !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
        opacity: 0 !important;
    }

    .sticky-audio-player #player-next,
    #sticky-audio-player #player-next {
        display: inline-flex !important;
        visibility: visible !important;
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        overflow: visible !important;
    }

    .sticky-audio-player .player-cover-link {
        width: 40px !important;
        height: 40px !important;
        border-radius: 8px !important;
    }

    .sticky-audio-player .player-artist {
        display: none !important;
    }
}
