.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.results-popup {
    background: linear-gradient(145deg, #2a2a3e 0%, #1e1e2f 100%);
    border-radius: 20px;
    padding: 40px;
    width: 450px;
    max-width: 90vw;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow:
            0 25px 50px rgba(0, 0, 0, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    animation: popupEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupEnter {
    0% {
        transform: scale(0.7) translateY(50px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popup-header {
    text-align: center;
    margin-bottom: 35px;
}

.round-pop-title {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
    margin-bottom: 8px;
    animation: titleGlow 2s ease-in-out infinite alternate;
}

.round-pop-title span {
    -webkit-text-fill-color: initial;
}

@keyframes titleGlow {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.2); }
}

.subtitle {
    color: #a0a0b0;
    font-size: 14px;
    font-weight: 400;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.round-result-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.round-result-item.first {
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.05);
}

.rank-number {
    font-size: 24px;
    font-weight: 900;
    color: #666;
    width: 30px;
    text-align: center;
}

.round-result-item.first .rank-number {
    color: #ffd700;
}

.ball-container {
    position: relative;
    flex-shrink: 0;
}

.result-ball{
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.4),
            inset 0 -2px 6px rgba(0, 0, 0, 0.3),
            inset 0 2px 6px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    /* 초기 상태: 화면 왼쪽 밖에 위치 */
    transform: translateX(-500px);
    opacity: 0;
}

.result-ball::before {
    content: '';
    position: absolute;
    top: 15%;
    left: 20%;
    width: 25%;
    height: 25%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.6) 0%, transparent 70%);
    border-radius: 50%;
}

.crown {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    animation: crownFloat 2s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}

.progress-container {
    flex: 1;
    height: 35px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 17px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 17px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    /* 초기 상태: 너비 0 */
    width: 0%;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 프로그레스 바 색상 */
.round-result-item.first .progress-bar {
    background: linear-gradient(90deg, #e72121, #870909);
    box-shadow: 0 0 20px rgb(255 0 0 / 40%);
}

.round-result-item.second .progress-bar {
    background: linear-gradient(90deg, #007bff85, #0064cf85);
}

.round-result-item.third .progress-bar {
    background: linear-gradient(90deg, #cd7f32ad, #d98027ad);
}

/* 볼 날아오는 애니메이션 */
.result-ball.fly-in {
    animation: flyIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes flyIn {
    0% {
        transform: translateX(-500px);
        opacity: 0;
    }
    70% {
        transform: translateX(10px);
        opacity: 1;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes popupExit {
    0% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(0.8) translateY(30px);
        opacity: 0;
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.sparkle {
    position: absolute;
    color: #ffd700;
    font-size: 12px;
    animation: sparkle 2s linear infinite;
    pointer-events: none;
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

.sparkle:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 20%; right: 20%; animation-delay: 0.5s; }
.sparkle:nth-child(3) { bottom: 15%; left: 25%; animation-delay: 1s; }
.sparkle:nth-child(4) { bottom: 25%; right: 15%; animation-delay: 1.5s; }

.round-result-item .result-ball img { width:100%;}
.round-result-overlay { width:calc(100% - 500px);height:100%;position:fixed;left:0;top:0;z-index:9999999;display:none;}
@media (max-width: 1500px) {
    .round-result-overlay { width:500px;left:calc((100% - 500px) / 2);}
    .round-result-item { gap : 5px;}
    .result-ball { width:50px;height:50px;}
}