.rally-player {
    --rally-player-accent: #ed1c24;
    --rally-player-bg: #171717;
    --rally-player-panel: #252525;
    --rally-player-muted: #b9b9b9;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 16px;
    width: 100%;
    margin: 1.25rem 0;
    padding: 14px;
    border: 1px solid #3d3d3d;
    border-radius: 14px;
    background: #202020;
    background:
        radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--rally-player-accent) 24%, transparent), transparent 35%),
        linear-gradient(135deg, #101010, var(--rally-player-panel));
    color: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    box-sizing: border-box;
}

.rally-player *,
.rally-player *::before,
.rally-player *::after {
    box-sizing: border-box;
}

.rally-player--no-thumbnail {
    grid-template-columns: minmax(0, 1fr);
}

.rally-player__thumbnail {
    width: 92px;
    height: 92px;
    overflow: hidden;
    align-self: center;
    border-radius: 10px;
    background: #0d0d0d;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
}

.rally-player__thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: cover;
}

.rally-player__main {
    min-width: 0;
}

.rally-player__topline {
    display: grid;
    grid-template-columns: 52px minmax(130px, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.rally-player .rally-player__button {
    -webkit-appearance: none !important;
    appearance: none !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
    font: inherit !important;
    line-height: 1 !important;
    text-decoration: none !important;
    text-transform: none !important;
    cursor: pointer;
}

.rally-player .rally-player__play {
    position: relative;
    display: grid;
    place-items: center;
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    background: var(--rally-player-accent) !important;
    color: #fff !important;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--rally-player-accent) 17%, transparent) !important;
}

.rally-player .rally-player__play:hover,
.rally-player .rally-player__play:focus-visible {
    filter: brightness(1.12);
}

.rally-player .rally-player__play:focus-visible,
.rally-player .rally-player__skip:focus-visible,
.rally-player .rally-player__speed:focus-visible,
.rally-player .rally-player__download:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 3px;
}

.rally-player__play-icon {
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid currentColor;
}

.rally-player.is-playing .rally-player__play-icon {
    width: 12px;
    height: 16px;
    margin-left: 0;
    border: 0;
    background: linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px, currentColor 8px 12px);
}

.rally-player__identity {
    min-width: 0;
}

.rally-player__eyebrow {
    display: block;
    margin-bottom: 2px;
    color: #d9b779;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .11em;
    line-height: 1.2;
    text-transform: uppercase;
}

.rally-player__title {
    --rally-player-title-shift: 0;
    --rally-player-title-duration: 8s;
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: clamp(17px, 2.4vw, 22px);
    font-weight: 800;
    line-height: 1.16;
    white-space: nowrap;
}

.rally-player__title-text {
    display: inline-block;
    min-width: 100%;
    white-space: nowrap;
    will-change: transform;
}

.rally-player__title.is-overflowing {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

.rally-player__title.is-overflowing .rally-player__title-text {
    animation: rally-player-title-scroll var(--rally-player-title-duration) ease-in-out 1s infinite alternate;
}

@keyframes rally-player-title-scroll {
    0%,
    12% {
        transform: translateX(0);
    }

    88%,
    100% {
        transform: translateX(var(--rally-player-title-shift));
    }
}

.rally-player__actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

.rally-player .rally-player__skip,
.rally-player .rally-player__speed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: 34px !important;
    padding: 0 10px !important;
    border: 1px solid #515151 !important;
    border-radius: 7px !important;
    background: rgba(255, 255, 255, .035) !important;
    color: #f2f2f2 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap;
}

.rally-player .rally-player__skip:hover,
.rally-player .rally-player__speed:hover {
    border-color: #858585 !important;
    background: rgba(255, 255, 255, .1) !important;
}

.rally-player .rally-player__download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 13px !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: var(--rally-player-accent) !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    white-space: nowrap;
}

.rally-player .rally-player__download:hover {
    filter: brightness(1.12);
}

.rally-player__timeline {
    margin-top: 15px;
}

.rally-player input[type="range"].rally-player__seek {
    --rally-player-progress: 0%;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 18px !important;
    min-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--rally-player-accent) !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    cursor: pointer !important;
}

.rally-player input[type="range"].rally-player__seek::-webkit-slider-runnable-track {
    width: 100% !important;
    height: 8px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(
        to right,
        var(--rally-player-accent) 0,
        var(--rally-player-accent) var(--rally-player-progress),
        #505050 var(--rally-player-progress),
        #505050 100%
    ) !important;
    box-shadow: none !important;
}

.rally-player input[type="range"].rally-player__seek::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 14px !important;
    height: 14px !important;
    margin-top: -3px !important;
    padding: 0 !important;
    border: 3px solid #fff !important;
    border-radius: 50% !important;
    background: var(--rally-player-accent) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .45) !important;
}

.rally-player input[type="range"].rally-player__seek::-moz-range-track {
    height: 8px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #505050 !important;
    box-shadow: none !important;
}

.rally-player input[type="range"].rally-player__seek::-moz-range-progress {
    height: 8px !important;
    border-radius: 999px !important;
    background: var(--rally-player-accent) !important;
}

.rally-player input[type="range"].rally-player__seek::-moz-range-thumb {
    width: 10px !important;
    height: 10px !important;
    padding: 0 !important;
    border: 3px solid #fff !important;
    border-radius: 50% !important;
    background: var(--rally-player-accent) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .45) !important;
}

.rally-player input[type="range"].rally-player__seek:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 3px !important;
}

.rally-player__times {
    display: grid;
    grid-template-columns: minmax(52px, 1fr) auto minmax(52px, 1fr);
    gap: 10px;
    align-items: center;
    margin-top: 7px;
    color: var(--rally-player-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.rally-player__remaining {
    text-align: right;
}

.rally-player__volume {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
}

.rally-player .rally-player__mute {
    display: grid !important;
    place-items: center !important;
    width: 28px !important;
    height: 28px !important;
    flex: 0 0 28px !important;
    border-radius: 6px !important;
    color: #fff !important;
    font-size: 15px !important;
}

.rally-player .rally-player__mute:hover,
.rally-player .rally-player__mute:focus-visible {
    background: rgba(255, 255, 255, .1) !important;
}

.rally-player input[type="range"].rally-player__volume-range {
    --rally-player-volume: 100%;
    -webkit-appearance: none !important;
    appearance: none !important;
    display: block !important;
    width: 82px !important;
    min-width: 82px !important;
    max-width: 82px !important;
    height: 18px !important;
    min-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--rally-player-accent) !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    cursor: pointer !important;
}

.rally-player input[type="range"].rally-player__volume-range::-webkit-slider-runnable-track {
    width: 100% !important;
    height: 5px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: linear-gradient(
        to right,
        var(--rally-player-accent) 0,
        var(--rally-player-accent) var(--rally-player-volume),
        #626262 var(--rally-player-volume),
        #626262 100%
    ) !important;
    box-shadow: none !important;
}

.rally-player input[type="range"].rally-player__volume-range::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    width: 13px !important;
    height: 13px !important;
    margin-top: -4px !important;
    padding: 0 !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
    background: var(--rally-player-accent) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .4) !important;
}

.rally-player input[type="range"].rally-player__volume-range::-moz-range-track {
    height: 5px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #626262 !important;
}

.rally-player input[type="range"].rally-player__volume-range::-moz-range-progress {
    height: 5px !important;
    border-radius: 999px !important;
    background: var(--rally-player-accent) !important;
}

.rally-player input[type="range"].rally-player__volume-range::-moz-range-thumb {
    width: 9px !important;
    height: 9px !important;
    padding: 0 !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
    background: var(--rally-player-accent) !important;
}

.rally-player input[type="range"].rally-player__volume-range:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 2px !important;
}

.rally-player__audio {
    width: 100%;
    margin-top: 10px;
}

.rally-player--ready .rally-player__audio {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

/* Replace FRN's custom hero deck without leaving its old controls behind. */
.frn-ep-player-deck.rally-player-host {
    display: block !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.frn-ep-player-deck.rally-player-host > :not(.rally-player) {
    display: none !important;
}

.frn-ep-player-deck.rally-player-host > .rally-player {
    width: 100% !important;
    margin: 0 !important;
}

@media (max-width: 680px) {
    .rally-player {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .rally-player__thumbnail {
        width: 72px;
        height: 72px;
        align-self: start;
    }

    .rally-player__topline {
        grid-template-columns: 46px minmax(0, 1fr);
        gap: 12px;
    }

    .rally-player .rally-player__play {
        width: 44px !important;
        height: 44px !important;
    }

    .rally-player__title {
        font-size: 17px;
        white-space: normal;
    }

    .rally-player__actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
        margin-top: 2px;
    }

    .rally-player__timeline {
        margin-top: 13px;
    }
}

@media (max-width: 460px) {
    .rally-player {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 10px;
        border-radius: 11px;
    }

    .rally-player__thumbnail {
        width: 58px;
        height: 58px;
        border-radius: 8px;
    }

    .rally-player .rally-player__skip,
    .rally-player .rally-player__speed {
        height: 32px !important;
        padding: 0 8px !important;
        font-size: 11px !important;
    }

    .rally-player .rally-player__download {
        height: 32px !important;
        padding: 0 10px !important;
        font-size: 11px !important;
    }

    .rally-player__times {
        grid-template-columns: 1fr 1fr;
    }

    .rally-player__volume {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rally-player *,
    .rally-player *::before,
    .rally-player *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }

    .rally-player__title {
        white-space: normal;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .rally-player__title-text {
        white-space: normal;
        animation: none !important;
        transform: none !important;
    }
}
