:root {
    --mrp-height: 70px;
    --mrp-background: #fafaf8;
    --mrp-text: #232521;
    --mrp-accent: #4e7565;
    --mrp-border: #e6e8e2;
}

html.mrp-mounted {
    scroll-padding-bottom: calc(var(--mrp-height) + 16px);
}

html.mrp-mounted body {
    padding-bottom: var(--mrp-height);
}

.mrp-player,
.mrp-player * {
    box-sizing: border-box;
}

.mrp-player {
    position: fixed;
    inset: auto 0 0;
    z-index: 99990;
    width: 100%;
    height: var(--mrp-height);
    margin: 0;
    padding: 0;
    color: var(--mrp-text);
    background: var(--mrp-background);
    border-top: 1px solid var(--mrp-border);
    box-shadow: 0 -5px 24px rgb(0 0 0 / 3%);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mrp-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
    height: 100%;
    padding: 0 clamp(16px, 3vw, 48px);
}

.mrp-player button {
    appearance: none;
    margin: 0;
    border: 0;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    text-transform: none;
    letter-spacing: normal;
}

.mrp-player button:focus-visible,
.mrp-player input:focus-visible {
    outline: 2px solid var(--mrp-accent);
    outline-offset: 5px;
}

.mrp-toggle {
    display: grid;
    flex: 0 0 46px;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    color: white;
    background: var(--mrp-text);
    border-radius: 50%;
    transition: background 180ms ease, transform 180ms ease;
}

.mrp-toggle:hover {
    background: var(--mrp-accent);
    transform: scale(1.04);
}

.mrp-toggle svg {
    grid-area: 1 / 1;
    width: 23px;
    height: 23px;
    fill: currentColor;
}

.mrp-toggle .mrp-play-icon {
    margin-left: 0px;
}

.mrp-toggle .mrp-pause-icon {
    display: none;
}

.mrp-player.is-playing .mrp-play-icon {
    display: none;
}

.mrp-player.is-playing .mrp-pause-icon {
    display: block;
}

.mrp-player.is-loading .mrp-toggle {
    animation: mrp-loading 900ms ease-in-out infinite alternate;
}

.mrp-stations {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 18px;
    min-width: 0;
    height: 100%;
}

.mrp-station {
    display: flex;
    flex: 0 0 52px;
    align-items: center;
    gap: 16px;
    min-width: 0;
    height: 64px;
    padding: 0;
    color: var(--mrp-text);
    background: transparent;
    border-radius: 12px;
}

.mrp-station:disabled {
    cursor: not-allowed;
}

.mrp-logo {
    display: block;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 12px;
    filter: grayscale(0);
    opacity: 1;
    transition: filter 300ms ease, opacity 300ms ease;
}

.mrp-logo img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
}

.mrp-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-size: 24px;
    font-weight: 750;
}

.mrp-fallback-0 {
    background: linear-gradient(135deg, #ff8865, #e14469);
}

.mrp-fallback-1 {
    background: linear-gradient(135deg, #66b4ee, #665cce);
}

.mrp-fallback-2 {
    background: linear-gradient(135deg, #88c982, #2b8d78);
}

.mrp-station-details {
    display: none;
    align-items: center;
    gap: 18px;
    min-width: 0;
    overflow: hidden;
}

.mrp-station-name {
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mrp-player.has-selection .mrp-station {
    order: 2;
}

.mrp-player.has-selection .mrp-station:not(.is-active) .mrp-logo {
    filter: grayscale(1);
    opacity: 0.55;
}

.mrp-player.has-selection .mrp-station:not(.is-active):hover .mrp-logo {
    opacity: 0.9;
}

.mrp-player.has-selection .mrp-station.is-active {
    order: -1;
    flex: 1 1 auto;
}

.mrp-station.is-active .mrp-station-details {
    display: flex;
}

.mrp-equalizer {
    display: flex;
    flex: 0 0 28px;
    align-items: center;
    justify-content: space-between;
    width: 28px;
    height: 25px;
    color: var(--mrp-accent);
}

.mrp-equalizer span {
    width: 3px;
    height: 100%;
    background: currentColor;
    border-radius: 3px;
    transform: scaleY(0.2);
    animation: mrp-equalizer 850ms ease-in-out infinite alternate;
    animation-play-state: paused;
}

.mrp-equalizer span:nth-child(2) {
    animation-duration: 630ms;
    animation-delay: -270ms;
}

.mrp-equalizer span:nth-child(3) {
    animation-duration: 740ms;
    animation-delay: -430ms;
}

.mrp-equalizer span:nth-child(4) {
    animation-duration: 570ms;
    animation-delay: -180ms;
}

.mrp-equalizer span:nth-child(5) {
    animation-duration: 920ms;
    animation-delay: -610ms;
}

.mrp-player.is-playing:not(.is-loading) .mrp-equalizer span {
    animation-play-state: running;
}

.mrp-volume {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
}

.mrp-mute {
    display: grid;
    place-items: center;
    width: 26px;
    height: 30px;
    padding: 0;
    color: #74786f;
    background: transparent;
}

.mrp-mute svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.mrp-sound-waves {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.mrp-player.is-muted .mrp-sound-waves {
    visibility: hidden;
}

#mrp-volume {
    appearance: none;
    width: 112px;
    height: 4px;
    margin: 0;
    padding: 0;
    background: linear-gradient(
        to right,
        var(--mrp-accent) 0%,
        var(--mrp-accent) var(--mrp-volume-value, 70%),
        #dedfd8 var(--mrp-volume-value, 70%),
        #dedfd8 100%
    );
    border: 0;
    border-radius: 10px;
    cursor: pointer;
}

#mrp-volume::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--mrp-accent);
    border: 0;
    border-radius: 50%;
}

#mrp-volume::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--mrp-accent);
    border: 0;
    border-radius: 50%;
}

.mrp-status {
    position: absolute;
    right: 20px;
    bottom: calc(100% + 10px);
    max-width: min(400px, calc(100vw - 40px));
    padding: 10px 14px;
    color: var(--mrp-text);
    background: #fff;
    border: 1px solid var(--mrp-border);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgb(0 0 0 / 8%);
    font-size: 13px;
    line-height: 1.4;
}

.mrp-status:empty {
    display: none;
}

.mrp-player audio {
    display: none;
}

@keyframes mrp-equalizer {
    from {
        transform: scaleY(0.18);
    }

    to {
        transform: scaleY(1);
    }
}

@keyframes mrp-loading {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .mrp-inner {
        gap: 12px;
        padding: 0 12px;
    }

    .mrp-toggle {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .mrp-stations {
        gap: 10px;
    }

    .mrp-station {
        flex-basis: 40px;
        gap: 10px;
    }

    .mrp-logo {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .mrp-station-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .mrp-station-name {
        max-width: 100%;
        font-size: 12px;
    }

    .mrp-equalizer {
        flex-basis: auto;
        width: 23px;
        height: 16px;
    }

    .mrp-volume {
        gap: 6px;
    }

    #mrp-volume {
        width: 58px;
    }

    .mrp-mute {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mrp-player *,
    .mrp-player *::before,
    .mrp-player *::after {
        animation: none !important;
        transition: none !important;
    }
}