/* Player 02. Same engine as the others (players/player-func.js), own skin. */

.bras-player-fixed .player_top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
}

.bras-player-spacer { height: 100px; }

#playerBeat {
    display: block;
    background: #f6f6f6;
    height: 100px;
    position: relative;
}

/* max-width, not width: between 1200 and 1320 a fixed width was wider than the
   window and pushed the bar out of the screen */
#playerBeat .container {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    padding-left: 15px;
    padding-right: 15px;
}
@media (min-width: 768px)  { #playerBeat .container { max-width: 750px; } }
@media (min-width: 992px)  { #playerBeat .container { max-width: 970px; } }
@media (min-width: 1200px) {
    #playerBeat .container { max-width: 1320px; }
    #playerBeat .statusStream { max-width: 380px; }
}

.containerAnimation {
    height: 100px;
    width: 100%;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    opacity: 0.3;
    pointer-events: none;
}

/* The rings breathe from the middle out, one after the other */
.animation > div {
    border-radius: 50%;
    border: solid 1px var(--border3);
    left: 50%; top: 50%;
    display: block;
    position: absolute;
    animation: plRing 3s ease-in-out infinite;
    animation-delay: calc(var(--pl-ring, 1) * 0.1s);
}

@keyframes plRing {
    0%, 60%, 100% { opacity: 1; }
    12% { opacity: 0; }
}

.animation > div:nth-child(1)  { width:  80px; height:  80px; margin-left:  -40px; margin-top:  -40px; }
.animation > div:nth-child(2)  { width: 100px; height: 100px; margin-left:  -50px; margin-top:  -50px; }
.animation > div:nth-child(3)  { width: 130px; height: 130px; margin-left:  -65px; margin-top:  -65px; }
.animation > div:nth-child(4)  { width: 170px; height: 170px; margin-left:  -85px; margin-top:  -85px; }
.animation > div:nth-child(5)  { width: 220px; height: 220px; margin-left: -110px; margin-top: -110px; }
.animation > div:nth-child(6)  { width: 290px; height: 290px; margin-left: -145px; margin-top: -145px; }
.animation > div:nth-child(7)  { width: 380px; height: 380px; margin-left: -190px; margin-top: -190px; }
.animation > div:nth-child(8)  { width: 500px; height: 500px; margin-left: -250px; margin-top: -250px; }
.animation > div:nth-child(9)  { width: 680px; height: 680px; margin-left: -340px; margin-top: -340px; }
.animation > div:nth-child(10) { width: 900px; height: 900px; margin-left: -450px; margin-top: -450px; }
.animation > div:nth-child(11) { width:1200px; height:1200px; margin-left: -600px; margin-top: -600px; }

.containerPlayer {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    padding: 0 20px;
    padding-right: calc(50% + 50px);
}

audio#fallplayer {
    position: absolute;
    width: 0; height: 0;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
}

#playerBeat .imgPlayerCapa {
    order: 1;
    flex-shrink: 0;
    width: 54px; height: 54px;
    min-width: 54px; min-height: 54px;
    border-radius: 50%;
    border: solid 3px var(--border3);
    /* Painted before any image arrives, so the frame is never a hole */
    background-color: #e7ebef;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
    z-index: 3;
    margin-left: 0;
    margin-right: -27px;
    box-shadow: 4px 0 12px rgba(0,0,0,0.14);
    transition: box-shadow 0.4s;
}

#playerBeat .imgPlayerCapa::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 30%, rgba(255,255,255,0.32), transparent 55%);
    pointer-events: none;
}

#playerBeat .statusStream {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    overflow: hidden;
    background: #ffffff;
    border-radius: 999px;
    padding: 8px 14px 8px 35px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.08);
    white-space: nowrap;
    position: relative;
    z-index: 2;
    color: var(--border3);
    font-size: 13px;
    font-family: "Montserrat", Arial, Helvetica, sans-serif;
}

#playerBeat .statusStream__track {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}

/* Soft ends: a strip of the pill colour over each side of the title */
#playerBeat .statusStream__track::before,
#playerBeat .statusStream__track::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18px;
    z-index: 2;
    pointer-events: none;
}

#playerBeat .statusStream__track::before {
    left: 0;
    background: linear-gradient(90deg, #ffffff, rgba(255,255,255,0));
}

#playerBeat .statusStream__track::after {
    right: 0;
    background: linear-gradient(270deg, #ffffff, rgba(255,255,255,0));
}

#playerBeat .rf-playing-label2 {
    display: block;
    width: 100%;
    color: #363636;
    opacity: 0.85;
}



#playpause {
    position: absolute !important;
    left: 50% !important;
    top: auto !important;
    transform: translateX(-50%) !important;
    width: 80px; height: 80px;
    min-width: 80px; min-height: 80px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

#playpause .iconPlaying {
    cursor: pointer;
    position: relative;
    display: block;
    z-index: 2;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 50%;
    width: 80px; height: 80px;
    color: #3c3c3c;
    line-height: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

#playpause .iconPlaying svg {
    width: 80px;
    height: 80px;
    display: block;
}

#playpause .iconPlaying.inactive { display: none !important; }

#playpause .iconPlaying,
#playpause .iconVolume { top: auto !important; }

@media (hover: hover) and (pointer: fine) {
    #playpause .iconPlaying:hover {
        transform: scale(1.05);
        opacity: 0.88;
    }
}

/* Volume: the button opens the slider, muting is the slider at zero. The
   placement is marked important because themes still carry rules written for
   older players, and a stray top would throw the button out of the bar. */
#playerBeat .fallplayer-volume {
    position: absolute !important;
    left: calc(100% + 14px) !important;
    right: auto !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    z-index: 6;
}

#playpause .iconVolume {
    cursor: pointer;
    display: block;
    padding: 0;
    color: #ffffff;
    background: #3c3c3c;
    border: 0;
    border-radius: 50%;
    width: 34px; height: 34px;
    line-height: 0;
}

#playpause .iconVolume svg { margin: 0 auto; }

.fallplayer-volume .vol-off,
.fallplayer-volume.is-muted .vol-on { display: none; }
.fallplayer-volume.is-muted .vol-off { display: block; }

#playerBeat .volumeContainer {
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    z-index: 10;
    background: #ffffff;
    box-shadow: 0px 2px 5px rgba(0,0,0,0.1);
    border-radius: 5px;
    width: 28px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

#playerBeat .fallplayer-volume.is-open .volumeContainer {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

#playerBeat #volumeSlider {
    -webkit-appearance: none;
    appearance: none;

    width: 80px;
    height: 8px;

    /* Filled up to the level, empty from there on: the slider is turned a
       quarter, so the filled part is the one at the bottom */
    background: linear-gradient(90deg, #3c3c3c 0 var(--pl-vol, 100%), rgba(0,0,0,0.1) var(--pl-vol, 100%) 100%);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
    display: block;
    transform: rotate(-90deg);
    margin: 0;
}

#playerBeat #volumeSlider::-webkit-slider-runnable-track {
    height: 8px;
    border-radius: 5px;
    background: transparent;
}

#playerBeat #volumeSlider::-moz-range-track {
    height: 8px;
    border-radius: 5px;
    background: transparent;
}

#playerBeat #volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3c3c3c;
    border: solid 1px #3c3c3c;
    box-shadow: 1px 1px 0 rgba(0,0,0,0.1);
    cursor: pointer;
    margin-top: -4px;
}

#playerBeat #volumeSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3c3c3c;
    border: solid 1px #3c3c3c;
    box-shadow: 1px 1px 0 rgba(0,0,0,0.1);
    cursor: pointer;
}

/* Nothing on air */
#playerBeat .bras-player__offline {
    display: none;
    order: 2;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    color: #3c3c3c;
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.08);
}

#playerBeat .bras-player__offline b {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.bras-player.is-offline .imgPlayerCapa,
.bras-player.is-offline .statusStream,
.bras-player.is-offline #playpause { display: none; }

.bras-player.is-offline .bras-player__offline { display: flex; }

.linksPlayrs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    position: absolute;
    left: calc(65% + 55px);
    top: 0;
    height: 100px;
    z-index: 4;
}

.linksPlayrs li.linksPlayrs__apps { display: flex; align-items: center; gap: 4px; }

.bras-player__apps { display: flex; align-items: center; gap: 4px; }

/* The dots only exist on phones, where the apps fold into a panel */
.linksPlayrs .bras-player__more { display: none; }

.bras-player__more .more-close,
.bras-player.is-apps .bras-player__more .more-dots { display: none; }
.bras-player.is-apps .bras-player__more .more-close { display: block; }

.linksPlayrs li { display: inline-block; position: relative; padding: 0 2px; }
.linksPlayrs li a,
.linksPlayrs li button {
    width: 40px;
    height: 40px;
    padding: 0;
    color: #ffffff;
    background: #3c3c3c;
    border: 0;
    border-radius: 50%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition-duration: 0.3s;
    cursor: pointer;
    margin: 0;
}
.linksPlayrs li a:hover,
.linksPlayrs li button:hover { opacity: 0.7; }
.linksPlayrs li a img { vertical-align: middle; opacity: 0.8; }
.linksPlayrs li, .linksPlayrs { border-right: 0 !important; }

/* The cast icon fills in while a device is playing */
.bras-player__cast .cast-on,
.bras-player.is-casting .bras-player__cast .cast-off { display: none; }
.bras-player.is-casting .bras-player__cast .cast-on { display: block; }

/* Connected: the colours swap, so the button reads as active */
.bras-player.is-casting .linksPlayrs .bras-player__cast {
    color: var(--border3);
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

/* Skeleton while the first data does not arrive */
.pl-skeleton {
    position: relative;
    overflow: hidden;
    color: transparent !important;
    background-color: rgba(127, 127, 127, 0.16);
    background-image: none !important;
    border-radius: 999px;
}

.rf-playing-label2.pl-skeleton { min-width: 160px; }

.pl-skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: translateX(-100%);
    animation: plSkeleton 1.4s ease-in-out infinite;
}

@keyframes plSkeleton {
    100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .pl-skeleton::after,
    .animation > div { animation: none; }
}

@media (min-width: 701px) and (max-width: 900px) {

    .linksPlayrs li a,
    .linksPlayrs li button {
        width: 32px;
        height: 32px;
    }
}
@media (max-width: 700px) {
    /* The strip joins the row: cast always visible, apps behind the dots */
    .linksPlayrs {
        position: static;
        grid-column: 4;
        grid-row: 1;
        justify-self: end;
        height: auto;
        margin-left: 0;
        gap: 2px;
    }

    .linksPlayrs li { padding: 0 1px; }

    .linksPlayrs li a,
    .linksPlayrs li button {
        width: 34px;
        height: 34px;
    }

    .linksPlayrs .bras-player__more { display: flex; }

    /* The shortcuts open sideways, in the row itself. The cover steps out to
       give them the room, the same trade player 01 makes with the title */
    .bras-player__apps { display: none; gap: 2px; }
    .bras-player.is-apps .bras-player__apps { display: flex; }
    .bras-player.is-apps .imgPlayerCapa,
    .bras-player.is-apps #playerBeat .statusStream { display: none; }




    /* Phones drop the absolute placing: one row that shrinks with the screen,
       and a shorter bar so the page keeps more room */
    #playerBeat,
    #playerBeat .container,
    .containerAnimation,
    .containerPlayer { height: 78px; }

    .bras-player-spacer { height: 78px; }

    #playerBeat .container {
        max-width: none;
        padding: 0 12px;
    }

    .containerAnimation { display: none; }

    /* The phone has volume keys of its own, and the room is better spent on
       the shortcuts and the cast */
    #playerBeat .fallplayer-volume { display: none !important; }

    /* Cover, title, button and shortcuts, in this order. Only the title has
       a flexible track, so it grows with whatever the screen gives */
    .containerPlayer {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto auto;
        align-items: center;
        gap: 0;
        padding: 0;
    }

    /* With the shortcuts open there is no cover and no title left: the two
       tracks collapse and the button comes along to the left */
    .bras-player.is-apps .containerPlayer { grid-template-columns: 0 0 auto minmax(0, auto); }

    #playerBeat .imgPlayerCapa {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        width: 52px; height: 52px;
        min-width: 52px; min-height: 52px;
        margin: 0 -20px 0 0;
        border-width: 2px;
    }

    /* The card of the desktop, only as wide as the row can afford: the cover
       still steps over its left end */
    #playerBeat .statusStream {
        grid-column: 2;
        grid-row: 1;
        justify-self: stretch;
        min-width: 0;
        margin: 0 8px 0 0;
        padding: 7px 12px 7px 28px;
        font-size: 12.5px;
    }

    #playerBeat .bras-player__offline {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-self: center;
        margin: 0;
    }

    #playpause {
        grid-column: 3;
        grid-row: 1;
        justify-self: center;
        position: relative !important;
        left: auto !important;
        transform: none !important;
        margin: 0 6px 0 0;
        width: 64px; height: 64px;
        min-width: 64px; min-height: 64px;
    }

    #playerBeat .fallplayer-volume {
        right: calc(100% + 14px);
        left: auto;
    }

    #playpause .iconPlaying { width: 64px; height: 64px; }
    #playpause .iconPlaying svg { width: 64px; height: 64px; }

    #playpause .iconVolume { width: 32px; height: 32px; }
}

@media (max-width: 480px) {

    .linksPlayrs li a,
    .linksPlayrs li button {
        width: 32px;
        height: 32px;
    }

    .linksPlayrs { gap: 1px; }
}

@media (max-width: 360px) {
    .containerPlayer { gap: 6px; }

    #playerBeat .imgPlayerCapa {
        width: 48px; height: 48px;
        min-width: 48px; min-height: 48px;
    }

    #playpause { gap: 6px; }
    #playpause .iconPlaying { width: 56px; height: 56px; }
    #playpause .iconPlaying svg { width: 56px; height: 56px; }
    #playpause .iconVolume { width: 28px; height: 28px; }
}