.gwd-sound-wave {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    right: 150px;
    display: inline-grid;
    place-items: center;
    width: var(--gwd-sound-size, 100px);
    max-width: 100%;
    aspect-ratio: 1;
    flex: 0 1 auto;
    vertical-align: middle;
    overflow: hidden;
    border-radius: 50%;
    isolation: isolate;
    cursor: pointer;
    background:
        radial-gradient(ellipse at 65% 110%, rgba(199, 154, 77, .17), transparent 58%),
        linear-gradient(145deg, #121617, #101212);
}

.gwd-sound-wave:focus-visible {
    outline: 2px solid #ffedaa;
    outline-offset: 4px;
}

.gwd-sound-wave::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1.8%;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .04) 43%, rgba(255, 255, 255, .04) 57%, rgba(255, 255, 255, .65));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* Dấu gạch chéo hiển thị riêng khi toàn bộ video đang tắt âm. */
.gwd-sound-wave::after {
    content: "";
    position: absolute;
    z-index: 3;
    width: 5.67%;
    height: 104%;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 max(1px, calc(var(--gwd-sound-size, 100px) * .012)) rgba(16, 18, 18, .72);
    opacity: 0;
    transform: rotate(-39deg) scaleY(.82);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}

.gwd-sound-wave.is-muted::after {
    opacity: 1;
    transform: rotate(-39deg) scaleY(1);
}

.gwd-sound-wave__bars {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 66%;
    height: 74%;
}

.gwd-sound-wave__bar {
    display: block;
    flex: 0 0 9%;
    height: 33%;
    border-radius: 999px;
    background: #fff;
    transform-origin: center;
    animation: gwd-sound-pulse 1.25s ease-in-out infinite;
}

.gwd-sound-wave__bar:nth-child(2),
.gwd-sound-wave__bar:nth-child(6) { height: 68%; }
.gwd-sound-wave__bar:nth-child(4) { height: 100%; }
.gwd-sound-wave__bar:nth-child(2) { animation-delay: -.7s; }
.gwd-sound-wave__bar:nth-child(3) { animation-delay: -.25s; }
.gwd-sound-wave__bar:nth-child(4) { animation-delay: -.9s; }
.gwd-sound-wave__bar:nth-child(5) { animation-delay: -.45s; }
.gwd-sound-wave__bar:nth-child(6) { animation-delay: -.15s; }
.gwd-sound-wave__bar:nth-child(7) { animation-delay: -.6s; }

@keyframes gwd-sound-pulse {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(.35); }
}

@media (max-width: 1900px) {
    .gwd-sound-wave {
        right: 2%;
    }
}

@media (min-width: 550px) and (max-width: 1000px) {
    .gwd-sound-wave {
        --gwd-sound-size: 50px !important;
        top: 120px;
    }
}

@media (max-width: 549px) {
    .gwd-sound-wave {
        --gwd-sound-size: 40px !important;
        top: 100px;
        right: 3%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gwd-sound-wave__bar { animation: none; }
}
