/* 실시간 순위 위젯 */
.ranking-widget {
    display:none;
    position: fixed;
    width: 260px;
    right:510px;
    top:10px;
    background: linear-gradient(145deg, rgba(0,20,40,0.95), rgba(0,40,80,0.95));
    border-radius: 12px;
    border: 2px solid #00d4ff;
    box-shadow:
            0 0 20px rgba(0,212,255,0.3),
            inset 0 1px 0 rgba(255,255,255,0.1);
    backdrop-filter: blur(15px);
    overflow: hidden;
    z-index:9;
}

/* 헤더 */
.ranking-header {
    background: linear-gradient(90deg, #00d4ff, #0099cc);
    padding: 8px 15px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.ranking-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.ranking-title {
    color: #000;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

/* 순위 트랙 */
.ranking-track {
    padding: 7px 10px;
    height: 80px;
    position: relative;
    background:
            linear-gradient(90deg,
            rgba(0,212,255,0.1) 0%,
            rgba(0,100,200,0.05) 50%,
            rgba(0,212,255,0.1) 100%);
}

.ranking-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #0099cc, #00d4ff);
    opacity: 0.6;
}

.ranking-track::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4ff, #0099cc, #00d4ff);
    opacity: 0.6;
}

/* 차량 컨테이너 - 중앙 정렬 적용 */
.car-container {
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; /* 차량 간 간격 */
}

/* 개별 차량 */
.racing-car {
    position: relative; /* absolute에서 relative로 변경 */
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    text-shadow: 0 0 8px rgba(0,212,255,0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
    flex-shrink: 0; /* 크기 축소 방지 */
}

.racing-car::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: -1;
}

/* 1등 차량 스타일 */
.racing-car.first {
    text-shadow: 0 0 10px rgba(255,215,0,1);
    order: 1; /* flexbox 순서 설정 */
}

/* 2등 차량 스타일 */
.racing-car.second {
    text-shadow: 0 0 8px rgba(192,192,192,0.8);
    order: 2; /* flexbox 순서 설정 */
}

/* 3등 차량 스타일 */
.racing-car.third {
    text-shadow: 0 0 8px rgba(205,127,50,0.8);
    order: 3; /* flexbox 순서 설정 */
}

/* 추월 중 효과 */
.racing-car.overtaking {
    z-index: 10;
    transform: scale(1.15);
    filter: brightness(1.3);

}

/* 새 진입 애니메이션 */
.racing-car.new-entry {
    animation: slideInFromRight 0.8s ease-out;
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(300px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateX(150px) scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* 퇴장 애니메이션 */
.racing-car.exit {
    animation: slideOutToRight 0.8s ease-in;
}

@keyframes slideOutToRight {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(300px) scale(0.8);
        opacity: 0;
    }
}

/* 순위 라벨 */
.position-labels {
    display: flex;
    justify-content: center; /* 중앙 정렬 */
    gap: 30px; /* 라벨 간 간격 */
    padding: 8px 15px;

    border-top: 1px solid rgba(0,212,255,0.3);
}

.position-label {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    opacity: 0.8;
    font-family: 'snsv','sans-serif';
}

.ranking-widget .position-label i {
    font-style:normal;
}

.position-label.highlight {
    animation: labelPulse 0.6s ease-out;
}

@keyframes labelPulse {
    0% { transform: scale(1); color: #00d4ff; }
    50% { transform: scale(1.1); color: #ffd700; }
    100% { transform: scale(1); color: #00d4ff; }
}

/* 추월 알림 */
.overtake-notification {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #ff6b35, #ff8e35);
    color: #fff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid #fff;
    box-shadow: 0 0 15px rgba(255,107,53,0.6);
    animation: notificationSlide 2s ease-out forwards;
    z-index: 100;
}

@keyframes notificationSlide {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(-5px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-15px) scale(0.9);
    }
}

/* 테스트 버튼 */
.test-button {
    position: absolute;
    bottom: -0px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.test-button:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,212,255,0.4);
}

.test-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.racing-car img { height:100%;}
 #body .ranking-widget .fa-crown:before {
     content:initial;
 }
/* 반응형 디자인 */
@media (max-width: 480px) {
    .car-container {
        gap: 0px; /* 좁은 화면에서 간격 줄이기 */
    }
    .position-labels {
        gap: 20px;
    }

    .ranking-widget {
        width:35%;
        right:5px;
        top:5px;
    }

    .ranking-header {
        padding:0;
    }
    .ranking-title {
        font-size:10px;
    }

    .ranking-track {
        padding:0;
        height:42px;
    }

    .position-labels {
        display:none;
    }
}