/* ============================================================================
   Fraxtal · Reproductor global persistente (mundo 2026)
   Barra inferior fija que aparece cuando suena algo. Hereda los tokens de
   landing.css (--amber, --cyan, --cream, --line, --glass, --display, --ease).
   ========================================================================== */

.fxp {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: none;                 /* oculto hasta que se carga un track */
    align-items: center;
    gap: 18px;
    padding: 10px max(16px, env(safe-area-inset-left)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
    background: rgba(12, 11, 9, .72);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    backdrop-filter: blur(22px) saturate(150%);
    border-top: 1px solid var(--line);
    box-shadow: 0 -18px 50px -28px rgba(0, 0, 0, .9);
    color: var(--cream);
    transform: translateY(110%);
    transition: transform .45s var(--ease);
    will-change: transform;
}
.fxp.is-visible {
    display: flex;
}
.fxp.is-shown {
    transform: translateY(0);
}

/* ---- Bloque izquierdo: carátula + meta del now-playing -------------------- */
.fxp__now {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    flex: 1 1 220px;
}
.fxp__cover {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, #1a140e, #0d0b08);
    box-shadow: 0 10px 26px -14px rgba(212, 165, 116, .6);
}
.fxp__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.fxp__cover.is-playing::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(212, 165, 116, .5);
    border-radius: inherit;
    box-shadow: 0 0 0 1px rgba(212, 165, 116, .25), 0 0 22px -4px rgba(212, 165, 116, .7);
    animation: fxpGlow 2.4s ease-in-out infinite;
    pointer-events: none;
}
@keyframes fxpGlow {
    0%, 100% { opacity: .55; }
    50%      { opacity: 1; }
}
.fxp__meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fxp__title {
    font-family: var(--display);
    font-weight: 600;
    font-size: .96rem;
    line-height: 1.2;
    color: var(--cream);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fxp__artist {
    font-family: var(--body);
    font-size: .78rem;
    color: var(--cream-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Centro: transporte + barra de progreso ------------------------------ */
.fxp__center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 2 1 420px;
    min-width: 0;
    max-width: 620px;
}
.fxp__controls {
    display: flex;
    align-items: center;
    gap: 14px;
}
.fxp__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    padding: 6px;
    margin: 0;
    cursor: pointer;
    color: var(--cream-dim);
    border-radius: 50%;
    transition: color .25s var(--ease), transform .25s var(--ease);
}
.fxp__btn:hover { color: var(--cream); transform: translateY(-1px); }
.fxp__btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.fxp__btn:disabled { opacity: .35; cursor: default; transform: none; }
.fxp__btn svg { width: 20px; height: 20px; display: block; }

.fxp__btn--play {
    width: 44px;
    height: 44px;
    padding: 0;
    color: #1a120a;
    background: linear-gradient(120deg, var(--amber), #c79462);
    box-shadow: 0 10px 30px -12px rgba(212, 165, 116, .9);
}
.fxp__btn--play:hover { color: #1a120a; transform: translateY(-1px) scale(1.04); }
.fxp__btn--play svg { width: 22px; height: 22px; }

/* mostrar play / pausa según estado del audio */
.fxp__btn--play .ico-pause { display: none; }
.fxp.is-playing .fxp__btn--play .ico-play { display: none; }
.fxp.is-playing .fxp__btn--play .ico-pause { display: block; }

/* progreso */
.fxp__progress {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}
.fxp__time {
    font-family: var(--display);
    font-size: .72rem;
    color: var(--cream-dim);
    font-variant-numeric: tabular-nums;
    min-width: 38px;
    text-align: center;
    flex-shrink: 0;
}
.fxp__bar {
    position: relative;
    flex: 1 1 auto;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
}
.fxp__bar-track {
    position: relative;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: rgba(232, 220, 196, .14);
    overflow: hidden;
}
.fxp__bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--amber), var(--cyan));
}
.fxp__bar-buffer {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: 999px;
    background: rgba(232, 220, 196, .12);
}
.fxp__bar-knob {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--cream);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity .2s var(--ease);
    pointer-events: none;
}
.fxp__bar:hover .fxp__bar-knob,
.fxp__bar.is-dragging .fxp__bar-knob { opacity: 1; }

/* ---- Derecha: volumen + cola --------------------------------------------- */
.fxp__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 220px;
    justify-content: flex-end;
}
.fxp__volume {
    display: flex;
    align-items: center;
    gap: 8px;
}
/* icono de volumen = botón de mute/unmute */
.fxp__vol-btn { cursor: pointer; }
.fxp__vol-btn .ico-vol-muted { display: none; }
.fxp__volume.is-muted .ico-vol-on { display: none; }
.fxp__volume.is-muted .ico-vol-muted { display: block; color: var(--amber-soft); }
.fxp__vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 92px;
    height: 4px;
    border-radius: 999px;
    background: rgba(232, 220, 196, .14);
    outline: none;
    cursor: pointer;
}
.fxp__vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cream);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
    cursor: pointer;
}
.fxp__vol-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--cream);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
    cursor: pointer;
}

/* ---- Cola (queue) -------------------------------------------------------- */
.fxp__queue-wrap { position: relative; }
.fxp__queue {
    position: absolute;
    right: 0;
    bottom: calc(100% + 14px);
    width: min(340px, 86vw);
    max-height: min(58vh, 440px);
    overflow-y: auto;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(15, 13, 11, .94);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
    box-shadow: 0 28px 70px -24px rgba(0, 0, 0, .95);
    opacity: 0;
    transform: translateY(8px) scale(.98);
    transform-origin: bottom right;
    pointer-events: none;
    transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.fxp__queue.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.fxp__queue-head {
    font-family: var(--display);
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--amber-soft);
    padding: 8px 10px 10px;
}
.fxp__qitem {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    background: none;
    text-align: left;
    color: var(--cream-dim);
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s var(--ease), color .2s var(--ease);
}
.fxp__qitem:hover { background: rgba(232, 220, 196, .05); color: var(--cream); }
.fxp__qitem:focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
.fxp__qitem.is-current { color: var(--cream); background: rgba(212, 165, 116, .08); }
.fxp__qcover {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: linear-gradient(135deg, #1a140e, #0d0b08);
}
.fxp__qcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fxp__qmeta { min-width: 0; flex: 1 1 auto; }
.fxp__qtitle {
    font-family: var(--display);
    font-weight: 500;
    font-size: .88rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fxp__qartist {
    font-size: .74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .8;
}
.fxp__qeq {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: none;
    align-items: flex-end;
    gap: 2px;
    color: var(--amber);
}
.fxp__qitem.is-current .fxp__qeq { display: flex; }
.fxp__qeq span {
    width: 3px;
    background: currentColor;
    border-radius: 2px;
    animation: fxpEq 1s ease-in-out infinite;
}
.fxp__qeq span:nth-child(1) { height: 40%; animation-delay: -.2s; }
.fxp__qeq span:nth-child(2) { height: 100%; animation-delay: -.5s; }
.fxp__qeq span:nth-child(3) { height: 60%; animation-delay: 0s; }
@keyframes fxpEq {
    0%, 100% { transform: scaleY(.4); }
    50%      { transform: scaleY(1); }
}

/* ---- Botón de play en listas (alimenta al player) ------------------------ */
.fxp-track-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--glass);
    color: var(--amber-soft);
    cursor: pointer;
    transition: transform .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.fxp-track-btn:hover {
    transform: translateY(-1px) scale(1.05);
    border-color: rgba(212, 165, 116, .5);
    background: rgba(212, 165, 116, .12);
    color: var(--cream);
}
.fxp-track-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.fxp-track-btn svg { width: 18px; height: 18px; }
.fxp-track-btn .ico-pause { display: none; }
.fxp-track-btn.is-playing { color: var(--amber); border-color: rgba(212, 165, 116, .5); }
.fxp-track-btn.is-playing .ico-play { display: none; }
.fxp-track-btn.is-playing .ico-pause { display: inline-flex; }

/* empuja el contenido para que la barra no tape el final de la página */
body.fxp-active { padding-bottom: 86px; }

/* ---- Responsive: móvil compacto (carátula + título + play) --------------- */
@media (max-width: 720px) {
    .fxp {
        gap: 10px;
        padding-top: 8px;
        flex-wrap: wrap;
    }
    .fxp__now { flex: 1 1 auto; order: 1; }
    .fxp__right { flex: 0 0 auto; order: 2; gap: 4px; }
    .fxp__volume { display: none; }              /* el volumen se oculta en móvil */
    .fxp__center {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        flex-direction: row;
        gap: 12px;
    }
    .fxp__controls { order: 2; }
    .fxp__progress { order: 1; flex: 1 1 auto; }
    /* en móvil el transporte completo (prev/play/next) vive en el centro a 100%;
       el mini-play se mantiene oculto para NO duplicar el botón de play */
    .fxp__mini-play { display: none; }
    body.fxp-active { padding-bottom: 116px; }
}
@media (min-width: 721px) {
    .fxp__mini-play { display: none; }
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .fxp { transition: none; }
    .fxp__cover.is-playing::after,
    .fxp__queue,
    .fxp__qeq span { animation: none; transition: none; }
}
