#event-ui {
    position: absolute;
    right: 50px;
    top: 45%;
    width: 200px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 12px;
    padding: 12px;
    font-family: 'Arial', sans-serif;
    font-size: 16px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    animation: floaty 6s ease-in-out infinite alternate;
    overflow: hidden;
    z-index: 100;
}

#event-ui::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,0,0,0.1), rgba(0,255,0,0.1), rgba(0,0,255,0.1));
    background-size: 300% 300%;
    animation: gradientBG 12s ease infinite;
    z-index: -1;
    border-radius: 8px;
}

#event-ui.show {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.line {
    margin-bottom: 10px;
    font-size: 18px;
    animation: fadeIn 1s ease-in-out;
}

#prize {
    font-size: 20px;
    color: #FFD700;
    text-shadow: 0 0 8px #FFD700;
    animation: pulse 2s infinite, rainbow 8s linear infinite;
}

/* Alive counter flip */
.alive-wrapper {
    display: inline-block;
    position: relative;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    perspective: 800px;
    vertical-align: middle;
}

.alive-current,
.alive-next {
    position: absolute;
    width: 100%;
    height: 100%;
    font-weight: bold;
    font-size: 24px;
    color: #00FF00;
    line-height: 36px;
    backface-visibility: hidden;
    text-align: center;
    transition: transform 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

.alive-current.flip-out {
    transform: rotateX(90deg);
    opacity: 0;
}

.alive-next {
    transform: rotateX(-90deg);
    opacity: 0;
}

.alive-next.flip-in {
    transform: rotateX(0deg);
    opacity: 1;
}

/* Animations */
@keyframes pulse {
    0% { text-shadow: 0 0 5px #FFD700; }
    50% { text-shadow: 0 0 15px #FFD700; }
    100% { text-shadow: 0 0 5px #FFD700; }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes floaty {
    0% { transform: scale(1) translateY(0) rotate(0.5deg); }
    50% { transform: scale(1.02) translateY(-5px) rotate(-0.5deg); }
    100% { transform: scale(1) translateY(0) rotate(0.5deg); }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes rainbow {
    0% { color: #FFD700; }
    14% { color: #FF7F50; }
    28% { color: #FF69B4; }
    42% { color: #9370DB; }
    57% { color: #00BFFF; }
    71% { color: #32CD32; }
    85% { color: #FFA500; }
    100% { color: #FFD700; }
}