.tg-bubble-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.tg-bubble {
    position: relative;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: visible;
    /* чтобы 2× выходил за круг */
    touch-action: none;
    cursor: pointer;
    transition: width .3s, height .3s;
    z-index: 10;
}

.tg-bubble.playing {
    width: 300px;
    height: 300px;
    z-index: 10;
}

.tg-bubble-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
}

.tg-bubble-inner video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
    z-index: 2;
}

.tg-bubble.paused .pause-overlay {
    opacity: 1;
}

.progress-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    transition: transform .2s;
    transform-origin: 50% 50%;
}

.tg-bubble.paused .progress-canvas {
    pointer-events: auto;
    transform: scale(0.85);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    display: none;
    pointer-events: none;
}

.tg-bubble.paused .play-overlay {
    display: block;
}

.play-overlay svg {
    width: 48px;
    height: 48px;
    fill: #fff;
    opacity: .8;
}

.mute-toggle {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.mute-toggle svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

/* 2× */
.speed-toggle {
    position: absolute;
    top: -10px;
    right: -10px;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 44px;
    height: 44px;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font: 700 14px/1 system-ui, -apple-system, "SF Pro Display", Roboto, Arial, sans-serif;

    user-select: none;
    -webkit-user-select: none;
    cursor: pointer;

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    border: 2px solid rgba(255, 255, 255, 0.35);

    opacity: 0;
    transform: translateY(-6px) scale(0.96);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.tg-bubble.is-playing .speed-toggle {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.speed-toggle.active {
    background: rgba(255, 255, 255, 0.92);
    color: #000;
    border-color: rgba(0, 0, 0, 0.08);
}

@media screen and (max-width: 640px) {
    .tg-bubble {
        width: 240px !important;
        height: 240px !important;
    }

    .tg-bubble.playing {
        width: 240px !important;
        height: 240px !important;
    }

    .play-overlay svg {
        width: 36px;
        height: 36px;
    }

    .speed-toggle {
        width: 40px;
        height: 40px;
        top: -9px;
        right: -9px;
        font-size: 13px;
    }
}