.th-audio-player {
    position: fixed;
    z-index: 10000;
    bottom: 28px;
    left: 28px;
    width: 40px;
    height: 32px;
}

.th-audio-player__audio {
    display: none;
}

.th-audio-player__modal {
    position: fixed;
    z-index: 1;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 100vw;
    min-height: 100vh;
    padding: 20px;
    background: #00000099;
}

.th-audio-player__modal[hidden] {
    display: none;
}

.th-audio-player__modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    width: 450px;
    max-width: 100%;
    padding: 30px 70px;
    text-align: center;
    background: #f2eee6;
}

/*
 * Only the centring needs overriding — the component centres itself with
 * left/transform, which the flex column here does instead.
 *
 * The display must stay as the component set it: with `display: table` the
 * height below is treated as a minimum, so the span's `vertical-align: super`
 * stretched the box and the tabs (height: 100%) grew past the label.
 */
.th-audio-player .th-audio-player__modal-tag {
    left: auto;
    margin: 0 auto 60px;
    transform: none;
}

.th-audio-player .one-line-tag.one-line-tag--grey {
    --tag-bg-color: #e0e0e0;
}

.th-audio-player__modal-title {
    margin: 0 0 40px;
    color: #0d0d0d;
    font-family: var(--font-primary);
    font-size: 44px;
    font-weight: 400;
    line-height: 0.95;
    text-transform: uppercase;
}

.th-audio-player__enter-with-sound {
    display: inline-flex;
    gap: 7px;
    margin: 0 0 10px;
}

.th-audio-player__enter-icon {
    display: block;
    flex: 0 0 11px;
    width: 11px;
    height: 11px;
    color: #81f249;
}

.th-audio-player__modal-content .th-audio-player__enter-with-sound.button-black:not(.creative-button):hover {
    background-color: #81f249;
    color: #0d0d0d;
}

.th-audio-player__enter-with-sound:hover .th-audio-player__enter-icon {
    color: #0d0d0d;
}

.th-audio-player .th-audio-player__enter-without-sound {
    --link-underline-color: #0d0d0d;
    padding: 0 0 4px;
    cursor: pointer;
    border: 0;
    background: transparent;
    font-family: var(--font-secondary);
    font-size: 12px;
    font-weight: 400;
    line-height: 140%;
    color: #0d0d0d;
}

/*
 * The component paints the text and the underline from one variable, so the
 * line gets its own colour here: the same hex at 10%. Both pseudo-elements
 * need it — they are the two halves of the hover wipe.
 */
.th-audio-player .th-audio-player__enter-without-sound::before,
.th-audio-player .th-audio-player__enter-without-sound::after {
    background: #0d0d0d1a;
}

.th-audio-player__enter-without-sound:focus-visible,
.th-audio-player__enter-with-sound:focus-visible {
    outline: 2px solid #0d0d0d;
    outline-offset: 3px;
}

.th-audio-player__button {
    position: relative;
    display: block;
    width: 40px;
    height: 32px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    border: 0;
    background: transparent;
}

.th-audio-player__background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.th-audio-player__bars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.th-audio-player__bar {
    width: 1px;
    height: 10px;
    border-radius: 1px;
    background: #f2eee6;
    transform: scaleY(1);
    transform-origin: center;
}

.th-audio-player__bar:nth-child(1),
.th-audio-player__bar:nth-child(5) {
    height: 4.3px;
}

.th-audio-player__bar:nth-child(2),
.th-audio-player__bar:nth-child(4) {
    height: 7.14px;
}

.th-audio-player.is-playing .th-audio-player__bar {
    animation: th-audio-player-wave 0.55s ease-in-out infinite alternate;
}

.th-audio-player.is-playing .th-audio-player__bar:nth-child(1) {
    animation-delay: -0.14s;
}

.th-audio-player.is-playing .th-audio-player__bar:nth-child(2) {
    animation-delay: -0.31s;
}

.th-audio-player.is-playing .th-audio-player__bar:nth-child(3) {
    animation-delay: -0.06s;
}

.th-audio-player.is-playing .th-audio-player__bar:nth-child(4) {
    animation-delay: -0.42s;
}

.th-audio-player.is-playing .th-audio-player__bar:nth-child(5) {
    animation-delay: -0.22s;
}

.th-audio-player__button:focus-visible {
    outline: 2px solid #f2eee6;
    outline-offset: 3px;
}

@media (min-width: 768px) {
    .th-audio-player,
    .th-audio-player__button {
        width: 60px;
        height: 48px;
    }

    .th-audio-player__bars {
        transform: scale(1.5);
    }
}

@media (max-width: 767px) {
    .th-audio-player__modal-content {
        padding: 20px 40px;
    }

    .th-audio-player__modal-tag {
        margin-bottom: 30px;
    }

    .th-audio-player__modal-title {
        margin-bottom: 24px;
        font-size: 28px;
    }
}

@keyframes th-audio-player-wave {
    from {
        transform: scaleY(0.45);
    }

    to {
        transform: scaleY(1.45);
    }
}

@media (prefers-reduced-motion: reduce) {
    .th-audio-player.is-playing .th-audio-player__bar {
        animation: none;
    }
}

body.th-audio-player-modal-open {
    overflow: hidden;
}
