#niriv-celebration-player {
    position: fixed;
    z-index: 100020;
    top: 50%;
    right: 1rem;
    width: 3.25rem;
    height: 3.25rem;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid hsl(var(--primary) / .24);
    border-radius: 50%;
    background: hsl(var(--card) / .96);
    color: hsl(var(--foreground));
    box-shadow: 0 8px 28px hsl(var(--foreground) / .18), 0 2px 7px hsl(var(--foreground) / .1);
    cursor: pointer;
    transform: translateY(-50%);
    transition: right .25s ease, transform .2s ease, box-shadow .2s ease, background .2s ease, border-radius .2s ease;
    -webkit-tap-highlight-color: transparent;
}
#niriv-celebration-player:hover {
    box-shadow: 0 12px 34px hsl(var(--foreground) / .22), 0 3px 9px hsl(var(--foreground) / .12);
    transform: translateY(-50%) scale(1.05);
}
#niriv-celebration-player:focus-visible { outline: 3px solid hsl(var(--primary) / .55); outline-offset: 3px; }
#niriv-celebration-player .niriv-celebration-emoji { font-size: 1.4rem; line-height: 1; }
#niriv-celebration-player .niriv-celebration-state {
    position: absolute;
    right: -.1rem;
    bottom: -.1rem;
    width: 1.15rem;
    height: 1.15rem;
    display: grid;
    place-items: center;
    border: 2px solid hsl(var(--card));
    border-radius: 50%;
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    font: 700 .58rem/1 system-ui, sans-serif;
}
#niriv-celebration-player.is-playing { border-color: hsl(var(--primary) / .55); box-shadow: 0 0 0 5px hsl(var(--primary) / .1), 0 9px 30px hsl(var(--foreground) / .18); }
#niriv-celebration-player.is-playing .niriv-celebration-emoji { animation: niriv-player-bob 1.8s ease-in-out infinite; }
#niriv-celebration-player.is-peeking:not(.is-open) {
    right: -1.5rem;
    border-radius: 999px 0 0 999px;
    border-color: hsl(var(--primary) / .42);
    background: linear-gradient(135deg, hsl(var(--card) / .98), hsl(var(--primary) / .16));
    box-shadow: inset 3px 0 0 hsl(var(--primary) / .72), 0 5px 18px hsl(var(--foreground) / .18);
}
#niriv-celebration-player.is-open { right: .5rem; }
#niriv-celebration-player.is-peeking:not(.is-open):hover,
#niriv-celebration-player.is-peeking:not(.is-open):focus-visible { right: .5rem; }

#niriv-celebration-rain {
    position: fixed;
    z-index: 100010;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.niriv-celebration-particle {
    position: absolute;
    top: -3.5rem;
    left: var(--particle-x);
    display: block;
    font-size: var(--particle-size, 1.8rem);
    line-height: 1;
    opacity: 0;
    filter: drop-shadow(0 3px 5px rgb(0 0 0 / .12));
    animation: niriv-celebration-fall var(--particle-duration, 3.8s) cubic-bezier(.22,.65,.35,1) var(--particle-delay, 0s) forwards;
    will-change: transform, opacity;
}
.niriv-celebration-message {
    position: fixed;
    z-index: 100015;
    top: clamp(5.5rem, 18vh, 10rem);
    left: 50%;
    max-width: min(90vw, 36rem);
    padding: .8rem 1.25rem;
    border: 1px solid hsl(var(--primary) / .22);
    border-radius: 999px;
    background: hsl(var(--card) / .94);
    color: hsl(var(--foreground));
    box-shadow: 0 12px 36px hsl(var(--foreground) / .16);
    font-size: clamp(1rem, 3vw, 1.35rem);
    font-weight: 750;
    text-align: center;
    pointer-events: none;
    transform: translate(-50%, -8px);
    opacity: 0;
    animation: niriv-celebration-message 3.2s ease forwards;
}

@keyframes niriv-celebration-fall {
    0% { opacity: 0; transform: translate3d(0, -3vh, 0) rotate(0); }
    8% { opacity: 1; }
    78% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(var(--particle-drift), 112vh, 0) rotate(var(--particle-rotation)); }
}
@keyframes niriv-celebration-message {
    0%, 100% { opacity: 0; transform: translate(-50%, -8px) scale(.96); }
    12%, 82% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes niriv-player-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-3px) rotate(4deg); } }

@media (max-width: 640px) {
    #niriv-celebration-player { right: .55rem; width: 2.9rem; height: 2.9rem; }
    #niriv-celebration-player .niriv-celebration-emoji { font-size: 1.25rem; }
    #niriv-celebration-player .niriv-celebration-state { width: 1rem; height: 1rem; font-size: .52rem; }
    #niriv-celebration-player.is-peeking:not(.is-open) { right: -1.75rem; }
    #niriv-celebration-player.is-open { right: .5rem; }
    #niriv-celebration-player.is-peeking:not(.is-open):hover,
    #niriv-celebration-player.is-peeking:not(.is-open):focus-visible { right: .5rem; }
    .niriv-celebration-message { top: 22vh; }
    .niriv-celebration-particle { font-size: min(var(--particle-size, 1.8rem), 1.55rem); }
}
@media (prefers-reduced-motion: reduce) {
    #niriv-celebration-player,
    #niriv-celebration-player .niriv-celebration-emoji { transition: none; animation: none !important; }
    .niriv-celebration-particle,
    .niriv-celebration-message { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
