.tbpv2,
.tbpv2 *,
.tbpv2 *::before,
.tbpv2 *::after,
.tbpv2-modal,
.tbpv2-modal *,
.tbpv2-modal *::before,
.tbpv2-modal *::after {
    box-sizing: border-box;
}

.tbpv2 {
    position: fixed;
    z-index: 999999;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    height: calc(108px + env(safe-area-inset-bottom, 0px));
    padding: 12px 22px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #111;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.55);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
}

body.tbpv2-active {
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)) !important;
}

body.tbpv2-modal-open {
    overflow: hidden;
}

.tbpv2__cover {
    display: block;
    flex: 0 0 78px;
    width: 78px;
    height: 78px;
    border-radius: 10px;
    background: #222;
    object-fit: cover;
}

.tbpv2__meta {
    flex: 1 1 auto;
    min-width: 0;
}

.tbpv2__now-playing,
.tbpv2-modal__now-playing {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    color: #d32f2f;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.8px;
    line-height: 1.2;
    text-transform: uppercase;
}

.tbpv2__live-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: #d32f2f;
    box-shadow: 0 0 8px rgba(211, 47, 47, 0.9), 0 0 15px rgba(211, 47, 47, 0.6);
    animation: tbpv2-pulse 1.5s infinite;
}

.tbpv2__title,
.tbpv2__artist {
    display: block;
    overflow: hidden;
    color: #fff;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tbpv2__title {
    font-size: 21px;
    font-weight: 700;
}

.tbpv2__artist {
    margin-top: 2px;
    color: #bdbdbd;
    font-size: 15px;
}

.tbpv2__links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.tbpv2__links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.tbpv2__links svg {
    display: block;
    width: 17px;
    height: 17px;
}

.tbpv2__expand,
.tbpv2__play,
.tbpv2-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    color: #fff;
    cursor: pointer;
}

.tbpv2__expand {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: transparent;
}

.tbpv2__expand svg {
    width: 20px;
    height: 20px;
}

.tbpv2__play {
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 50%;
    background: #d32f2f;
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.4), 0 0 20px rgba(211, 47, 47, 0.2);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.tbpv2__play svg {
    width: 27px;
    height: 27px;
}

.tbpv2__pause-icon {
    display: none;
}

.tbpv2__play.is-active .tbpv2__play-icon {
    display: none;
}

.tbpv2__play.is-active .tbpv2__pause-icon {
    display: block;
}

.tbpv2__play.is-connecting {
    animation: tbpv2-button-pulse 1.2s ease-in-out infinite;
}

.tbpv2__links a:hover,
.tbpv2__links a:focus-visible,
.tbpv2-modal__links a:hover,
.tbpv2-modal__links a:focus-visible {
    border-color: #d32f2f;
    background: #d32f2f;
}

.tbpv2__links a:hover,
.tbpv2__play:hover,
.tbpv2__expand:hover {
    transform: scale(1.06);
}

.tbpv2__play:hover {
    background: #e53935;
}

.tbpv2 button:focus-visible,
.tbpv2 a:focus-visible,
.tbpv2-modal button:focus-visible,
.tbpv2-modal a:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.tbpv2__sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tbpv2-modal[hidden] {
    display: none !important;
}

.tbpv2-modal {
    position: fixed;
    z-index: 1000000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.86);
    font-family: Arial, Helvetica, sans-serif;
}

.tbpv2-modal__content {
    position: relative;
    width: min(90vw, 450px);
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    overflow: auto;
    padding: 30px;
    border-radius: 20px;
    background: #111;
    color: #fff;
    text-align: center;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}

.tbpv2-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
}

.tbpv2-modal__close svg {
    width: 24px;
    height: 24px;
}

.tbpv2-modal__cover {
    display: block;
    width: min(280px, 100%);
    aspect-ratio: 1;
    margin: 0 auto 22px;
    border-radius: 12px;
    background: #222;
    object-fit: cover;
}

.tbpv2-modal__now-playing {
    justify-content: center;
}

.tbpv2-modal__title {
    margin: 10px 0 5px;
    color: #fff;
    font-size: 30px;
    line-height: 1.2;
}

.tbpv2-modal__artist {
    margin: 0;
    color: #bdbdbd;
    font-size: 18px;
    line-height: 1.4;
}

.tbpv2-modal__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.tbpv2-modal__links a {
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

@keyframes tbpv2-pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

@keyframes tbpv2-button-pulse {
    0%,
    100% {
        box-shadow: 0 0 10px rgba(211, 47, 47, 0.4), 0 0 20px rgba(211, 47, 47, 0.2);
    }

    50% {
        box-shadow: 0 0 13px rgba(211, 47, 47, 0.75), 0 0 28px rgba(211, 47, 47, 0.4);
    }
}

@media (max-width: 768px) {
    .tbpv2 {
        gap: 9px;
        height: calc(86px + env(safe-area-inset-bottom, 0px));
        padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px));
    }

    body.tbpv2-active {
        padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .tbpv2__cover {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
        border-radius: 8px;
    }

    .tbpv2__now-playing {
        margin-bottom: 3px;
        font-size: 10px;
        letter-spacing: 1.1px;
    }

    .tbpv2__live-dot {
        flex-basis: 7px;
        width: 7px;
        height: 7px;
        margin-right: 6px;
    }

    .tbpv2__title {
        font-size: 15px;
    }

    .tbpv2__artist {
        font-size: 12px;
    }

    .tbpv2__links {
        display: none;
    }

    .tbpv2__expand {
        width: 38px;
        height: 38px;
    }

    .tbpv2__expand svg {
        width: 17px;
        height: 17px;
    }

    .tbpv2__play {
        width: 50px;
        height: 50px;
    }

    .tbpv2__play svg {
        width: 23px;
        height: 23px;
    }

    .tbpv2-modal {
        padding: 16px;
    }

    .tbpv2-modal__content {
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
        padding: 24px 20px;
    }

    .tbpv2-modal__cover {
        width: min(220px, 72vw);
        margin-bottom: 18px;
    }

    .tbpv2-modal__title {
        font-size: 25px;
    }
}

@media (max-width: 420px) {
    .tbpv2 {
        gap: 7px;
        height: calc(80px + env(safe-area-inset-bottom, 0px));
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
    }

    body.tbpv2-active {
        padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .tbpv2__cover {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
    }

    .tbpv2__expand {
        width: 36px;
        height: 36px;
    }

    .tbpv2__play {
        width: 48px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tbpv2 *,
    .tbpv2-modal * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

