#tiktokWinnerCelebration {
    position: fixed;
    z-index: 100000;
    top: 0;
    left: 50%;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: min(100%, 530px);
    height: 100vh;
    height: 100dvh;
    min-width: 0;
    min-height: 0;
    padding: clamp(16px, 4vw, 30px);
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    text-align: center;
    pointer-events: none;
    transform: translateX(-50%);
    border-right: 1px solid rgba(255, 215, 109, 0.2);
    border-left: 1px solid rgba(255, 215, 109, 0.2);
    box-shadow: 0 0 64px rgba(0, 0, 0, 0.48);
    background:
        radial-gradient(circle at 50% 42%, rgba(255, 205, 92, 0.3), transparent 42%),
        radial-gradient(circle at 16% 18%, rgba(98, 169, 255, 0.2), transparent 36%),
        radial-gradient(circle at 88% 84%, rgba(255, 91, 151, 0.16), transparent 34%),
        linear-gradient(180deg, rgb(10, 12, 19), rgb(8, 9, 14));
    opacity: 0;
}

#tiktokWinnerCelebration[hidden] {
    display: none !important;
}

#tiktokWinnerCelebration.is-active {
    animation: tiktokWinnerCelebrationEnter 0.55s cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}

#tiktokWinnerCelebration::before {
    content: "";
    position: absolute;
    z-index: -1;
    width: 125vmax;
    height: 125vmax;
    opacity: 0.28;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255, 222, 128, 0.3) 0deg 7deg,
        transparent 7deg 18deg
    );
    -webkit-mask-image: radial-gradient(circle, #000 0 9%, transparent 58%);
    mask-image: radial-gradient(circle, #000 0 9%, transparent 58%);
    animation: tiktokWinnerRays 22s linear infinite;
}

#tiktokWinnerConfetti {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
}

.tiktokWinnerCelebrationContent {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    animation: tiktokWinnerContentPop 0.72s 0.08s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tiktokWinnerAvatarHalo {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(180px, 70%, 380px);
    aspect-ratio: 1;
    margin-bottom: clamp(12px, 2.4vmin, 28px);
    border: clamp(5px, 1vw, 9px) solid #ffd76d;
    border-radius: 50%;
    background: linear-gradient(145deg, #68afff, #9b6cff 52%, #ff6d9e);
    box-shadow:
        0 0 0 clamp(7px, 1.4vw, 13px) rgba(255, 215, 109, 0.16),
        0 0 clamp(38px, 8vw, 80px) rgba(255, 196, 77, 0.58),
        0 clamp(18px, 4vw, 40px) clamp(28px, 6vw, 60px) rgba(0, 0, 0, 0.42);
    animation: tiktokWinnerAvatarPulse 1.65s ease-in-out infinite alternate;
}

.tiktokWinnerAvatarHalo::after {
    content: "★";
    position: absolute;
    top: -0.34em;
    right: -0.12em;
    display: grid;
    place-items: center;
    width: 1.35em;
    height: 1.35em;
    border-radius: 50%;
    background: #ffd76d;
    color: #30220a;
    font-size: clamp(34px, 7vw, 64px);
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
    transform: rotate(10deg);
}

#tiktokWinnerAvatar,
#tiktokWinnerAvatarFallback {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

#tiktokWinnerAvatar {
    display: block;
    object-fit: cover;
    background: #202533;
}

#tiktokWinnerAvatar[hidden],
#tiktokWinnerAvatarFallback[hidden] {
    display: none !important;
}

#tiktokWinnerAvatarFallback {
    display: grid;
    place-items: center;
    color: #fff;
    font-size: clamp(74px, 22vw, 180px);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 5px 24px rgba(0, 0, 0, 0.34);
}

.tiktokWinnerCelebrationLabel {
    margin: 0 0 0.12em;
    color: #ffe291;
    font-size: clamp(14px, 3vw, 24px);
    font-weight: 850;
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-shadow: 0 3px 22px rgba(255, 197, 77, 0.44);
}

#tiktokWinnerCelebrationName {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: clamp(30px, 10vw, 64px);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -0.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow:
        0 4px 0 rgba(91, 57, 10, 0.32),
        0 8px 34px rgba(0, 0, 0, 0.5);
}

.tiktokWinnerCelebrationWord {
    margin: 0.38em 0 0;
    color: rgba(239, 245, 255, 0.84);
    font-size: clamp(16px, 3.2vw, 28px);
    font-weight: 680;
    line-height: 1.2;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.46);
}

#tiktokWinnerCelebrationWord {
    color: #ffd76d;
    font-weight: 850;
}

.tiktokWinnerCountdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.38em;
    min-height: 2.35em;
    margin: clamp(14px, 3vmin, 26px) 0 0;
    padding: 0.48em 0.82em;
    border: 1px solid rgba(255, 226, 145, 0.42);
    border-radius: 999px;
    background: rgba(9, 12, 20, 0.64);
    color: rgba(245, 248, 255, 0.9);
    font-size: clamp(14px, 2.8vw, 21px);
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(8px);
}

.tiktokWinnerCountdown[hidden] {
    display: none !important;
}

#tiktokWinnerCountdownValue {
    display: inline-grid;
    place-items: center;
    width: 1.8em;
    height: 1.8em;
    border-radius: 50%;
    background: #ffd76d;
    color: #2f2208;
    font-size: 1.12em;
    font-weight: 900;
    box-shadow: 0 0 24px rgba(255, 205, 92, 0.42);
}

#tiktokWinnerCountdownValue[hidden],
#tiktokWinnerCountdownUnit[hidden] {
    display: none !important;
}

.tiktokWinnerCountdown.is-loading {
    color: #ffe291;
}

@keyframes tiktokWinnerCelebrationEnter {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes tiktokWinnerContentPop {
    from {
        opacity: 0;
        transform: translateY(8vh) scale(0.62) rotate(-2deg);
    }
    68% {
        opacity: 1;
        transform: translateY(-1.4vh) scale(1.045) rotate(0.4deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0);
    }
}

@keyframes tiktokWinnerAvatarPulse {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-1.1vmin) scale(1.025); }
}

@keyframes tiktokWinnerRays {
    to { transform: rotate(360deg); }
}

@media (min-width: 1440px) {
    #tiktokWinnerCelebration {
        width: 35.8vw;
    }
}

@media (prefers-reduced-motion: reduce) {
    #tiktokWinnerCelebration.is-active {
        animation: none !important;
        opacity: 1;
        transform: translateX(-50%);
    }

    .tiktokWinnerCelebrationContent,
    .tiktokWinnerAvatarHalo,
    #tiktokWinnerCelebration::before {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Подіум: показується після екрана переможця й підсумовує, хто веде на цьому
   стрімі. Живе в тій самій вертикальній смузі, що й святкування, тому в кадрі
   OBS обидва екрани стоять на одному місці й однаково обрізаються.
   ========================================================================== */
#tiktokPodium {
    position: fixed;
    z-index: 100000;
    top: 0;
    left: 50%;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: min(100%, 530px);
    height: 100vh;
    height: 100dvh;
    padding: clamp(16px, 4vw, 30px);
    overflow: hidden;
    isolation: isolate;
    color: #fff;
    text-align: center;
    pointer-events: none;
    transform: translateX(-50%);
    border-right: 1px solid rgba(255, 215, 109, 0.2);
    border-left: 1px solid rgba(255, 215, 109, 0.2);
    box-shadow: 0 0 64px rgba(0, 0, 0, 0.48);
    background:
        radial-gradient(circle at 50% 38%, rgba(255, 205, 92, 0.26), transparent 44%),
        radial-gradient(circle at 14% 20%, rgba(98, 169, 255, 0.18), transparent 36%),
        linear-gradient(180deg, rgb(10, 12, 19), rgb(8, 9, 14));
    opacity: 0;
}

#tiktokPodium[hidden] { display: none !important; }

#tiktokPodium.is-active {
    animation: tiktokWinnerCelebrationEnter 0.5s cubic-bezier(0.2, 0.85, 0.25, 1) forwards;
}

#tiktokPodiumConfetti {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tiktokPodiumContent {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(18px, 4vw, 30px);
    width: 100%;
}

.tiktokPodiumTitle {
    margin: 0;
    font-size: clamp(1.5rem, 6vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Перше місце посередині й вище за решту: подіум читається з одного погляду,
   без потреби дивитися на цифри. */
.tiktokPodiumRow {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(8px, 3vw, 18px);
    width: 100%;
}

.tiktokPodiumSlot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
}

.tiktokPodiumSlot[hidden] { display: none !important; }

.tiktokPodiumAvatarWrap {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(64px, 19vw, 88px);
    height: clamp(64px, 19vw, 88px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.16);
    overflow: visible;
}

.is-first .tiktokPodiumAvatarWrap {
    width: clamp(86px, 25vw, 118px);
    height: clamp(86px, 25vw, 118px);
    box-shadow: 0 0 0 3px rgba(255, 205, 92, 0.85), 0 0 34px rgba(255, 205, 92, 0.35);
}

.tiktokPodiumAvatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.tiktokPodiumAvatarFallback {
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.85);
}

.tiktokPodiumBadge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
}

.is-first .tiktokPodiumBadge { background: #ffcd5c; color: #23180a; }
.is-second .tiktokPodiumBadge { background: #cbd5e1; color: #1b2027; }
.is-third .tiktokPodiumBadge { background: #d08a52; color: #221206; }

.tiktokPodiumName {
    margin: 0;
    max-width: 100%;
    font-size: clamp(0.86rem, 3.6vw, 1.06rem);
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tiktokPodiumLogin {
    margin: 0;
    max-width: 100%;
    font-size: clamp(0.68rem, 2.8vw, 0.8rem);
    color: rgba(255, 255, 255, 0.55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Сходинка: висота підказує місце навіть без цифри. */
.tiktokPodiumStep {
    display: grid;
    place-items: center;
    width: 100%;
    margin-top: 4px;
    border-radius: 12px 12px 0 0;
    background: rgba(255, 255, 255, 0.07);
    font-size: clamp(1.2rem, 5vw, 1.7rem);
    font-weight: 800;
}

.is-first .tiktokPodiumStep {
    height: clamp(74px, 18vw, 96px);
    background: linear-gradient(180deg, rgba(255, 205, 92, 0.24), rgba(255, 205, 92, 0.07));
}

.is-second .tiktokPodiumStep { height: clamp(52px, 13vw, 68px); }
.is-third .tiktokPodiumStep { height: clamp(40px, 10vw, 54px); }

.tiktokPodiumCountdown {
    margin: 0;
    font-size: clamp(0.82rem, 3.2vw, 0.95rem);
    color: rgba(255, 255, 255, 0.6);
}

.tiktokPodiumCountdown[hidden] { display: none !important; }
.tiktokPodiumCountdown strong { color: #ffcd5c; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    #tiktokPodium.is-active { animation: none; opacity: 1; }
}
