:root {
    --sponsored-ad-bg: rgba(2, 8, 14, .88);
    --sponsored-ad-panel: #071723;
    --sponsored-ad-line: rgba(111, 220, 255, .24);
    --sponsored-ad-text: #f5fbff;
    --sponsored-ad-muted: #8ba6b7;
    --sponsored-ad-cyan: #58e2ff;
    --sponsored-ad-orange: #ffad52;
}

.sponsored-ad {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.sponsored-ad.is-visible {
    display: flex;
}

.sponsored-ad__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 25%, rgba(42, 140, 181, .26), transparent 42%),
        var(--sponsored-ad-bg);
    backdrop-filter: blur(18px);
}

.sponsored-ad__dialog {
    position: relative;
    width: min(1040px, 96vw);
    max-height: 94vh;
    overflow: auto;
    padding: 18px;
    border: 1px solid var(--sponsored-ad-line);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(11, 34, 49, .97), rgba(3, 15, 24, .98));
    color: var(--sponsored-ad-text);
    box-shadow: 0 35px 100px rgba(0, 0, 0, .58);
}

.sponsored-ad__close {
    position: absolute;
    top: 10px;
    right: 14px;
    z-index: 4;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
    background: rgba(0,0,0,.48);
    color: #fff;
    font-size: 25px;
    cursor: pointer;
}

.sponsored-ad__label {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 173, 82, .13);
    color: #ffc17d;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
}

.sponsored-ad__heading,
.sponsored-ad__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.sponsored-ad__heading {
    margin: 14px 0 15px;
}

.sponsored-ad__heading span {
    display: block;
    color: var(--sponsored-ad-muted);
    font-size: 10px;
    letter-spacing: .16em;
}

.sponsored-ad__heading h2 {
    margin: 3px 0 0;
    font-size: clamp(24px, 4vw, 42px);
    letter-spacing: -.04em;
}

.sponsored-ad__sound,
.sponsored-ad__skip {
    border: 1px solid var(--sponsored-ad-line);
    border-radius: 10px;
    background: rgba(255,255,255,.05);
    color: #fff;
    padding: 11px 14px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    cursor: pointer;
}

.sponsored-ad__video-shell {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 14px;
    background: #000;
}

.sponsored-ad__video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.sponsored-ad__play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 74px;
    height: 74px;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 50%;
    background: rgba(2, 12, 20, .72);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.sponsored-ad__play.is-hidden {
    display: none;
}

.sponsored-ad__progress {
    height: 4px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
}

.sponsored-ad__progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--sponsored-ad-cyan), var(--sponsored-ad-orange));
}

.sponsored-ad__footer {
    padding-top: 15px;
}

.sponsored-ad__footer strong,
.sponsored-ad__footer span {
    display: block;
}

.sponsored-ad__footer strong {
    font-size: 16px;
}

.sponsored-ad__footer span {
    margin-top: 3px;
    color: var(--sponsored-ad-muted);
    font-size: 11px;
}

body.sponsored-ad-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .sponsored-ad {
        padding: 10px;
    }

    .sponsored-ad__dialog {
        width: 100%;
        padding: 14px;
    }

    .sponsored-ad__heading,
    .sponsored-ad__footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .sponsored-ad__sound,
    .sponsored-ad__skip {
        width: 100%;
    }
}
