/* Rank Up Modal Styles */
.rank-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(138,43,226,0.3) 0%, rgba(0,0,0,0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647 !important;
    animation: rankUpFadeIn 0.5s ease-out;
}

.rank-up-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 3px solid #8a2be2;
    border-radius: 25px;
    padding: 50px 40px;
    text-align: center;
    max-width: 550px;
    width: 90%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 50px rgba(138,43,226,0.6),
        0 0 100px rgba(138,43,226,0.4),
        inset 0 0 30px rgba(138,43,226,0.1);
    animation: rankUpPulse 0.6s ease-out;
}

.rank-up-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.rank-up-particles::before,
.rank-up-particles::after {
    content: '⭐';
    position: absolute;
    font-size: 25px;
    animation: floatParticles 3s infinite;
    color: #ffd700;
}

.rank-up-particles::before {
    top: 15%;
    left: 15%;
    animation-delay: 0s;
}

.rank-up-particles::after {
    top: 75%;
    right: 15%;
    animation-delay: 1.5s;
}

.rank-up-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: rankUpBounce 0.8s ease-out;
    filter: drop-shadow(0 0 20px rgba(138,43,226,0.8));
}

.rank-up-title {
    font-family: 'Cinzel', serif;
    font-size: 38px;
    font-weight: 700;
    color: #8a2be2;
    text-shadow: 
        0 0 20px rgba(138,43,226,0.8),
        0 0 40px rgba(138,43,226,0.4);
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.rank-up-subtitle {
    font-size: 20px;
    color: #ffffff;
    margin-bottom: 30px;
    opacity: 0.95;
}

.rank-up-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.old-rank, .new-rank {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.rank-up-rank-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(138,43,226,0.5);
    transition: all 0.3s;
}

.new-rank .rank-up-rank-image {
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255,215,0,0.6);
    animation: rankGlow 2s ease-in-out infinite;
}

.rank-arrow {
    font-size: 40px;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255,215,0,0.6);
}

.rank-name {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.new-rank .rank-name {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.4);
}

.rank-up-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.rank-stat {
    text-align: center;
}

.rank-stat .stat-number {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.4);
}

.rank-stat .stat-label {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.rank-up-message {
    font-size: 16px;
    color: rgba(255,255,255,0.9);
    margin: 20px 0;
}

.rank-up-continue-btn {
    background: linear-gradient(135deg, #8a2be2 0%, #9932cc 100%);
    border: 2px solid #ffd700;
    color: white;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 20px;
}

.rank-up-continue-btn:hover {
    background: linear-gradient(135deg, #9932cc 0%, #8a2be2 100%);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(138,43,226,0.6);
}

/* Animations */
@keyframes rankUpFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes rankUpPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes rankUpBounce {
    0% {
        transform: translateY(-50px);
        opacity: 0;
    }
    60% {
        transform: translateY(10px);
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes rankGlow {
    0%, 100% { 
        box-shadow: 0 0 30px rgba(255,215,0,0.6);
        filter: drop-shadow(0 0 10px rgba(255,215,0,0.4));
    }
    50% { 
        box-shadow: 0 0 50px rgba(255,215,0,0.8);
        filter: drop-shadow(0 0 15px rgba(255,215,0,0.6));
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .rank-up-overlay {
        align-items: flex-start;
        padding: 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .rank-up-modal {
        padding: 25px 15px;
        max-width: 400px;
        margin: auto;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .rank-up-title {
        font-size: 28px;
        letter-spacing: 2px;
        margin-bottom: 8px;
    }
    
    .rank-up-subtitle {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .rank-up-display {
        gap: 15px;
        margin: 20px 0;
    }
    
    .rank-up-rank-image {
        width: 60px;
        height: 60px;
    }
    
    .rank-arrow {
        font-size: 30px;
    }
    
    .rank-up-stats {
        gap: 20px;
        margin: 20px 0;
    }
    
    .rank-stat .stat-number {
        font-size: 22px;
    }
    
    .rank-up-message {
        font-size: 14px;
        margin: 15px 0;
    }
    
    .rank-up-continue-btn {
        padding: 12px 25px;
        font-size: 16px;
        margin-top: 15px;
        margin-bottom: 10px;
    }
}

/* Extra small screens */
@media (max-width: 480px) and (max-height: 700px) {
    .rank-up-overlay {
        padding: 10px;
    }
    
    .rank-up-modal {
        padding: 20px 12px;
        max-height: calc(100vh - 20px);
    }
    
    .rank-up-icon {
        font-size: 60px;
        margin-bottom: 15px;
    }
    
    .rank-up-title {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .rank-up-subtitle {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .rank-up-display {
        margin: 15px 0;
    }
    
    .rank-up-rank-image {
        width: 50px;
        height: 50px;
    }
    
    .rank-arrow {
        font-size: 24px;
    }
    
    .rank-up-stats {
        gap: 15px;
        margin: 15px 0;
    }
    
    .rank-stat .stat-number {
        font-size: 20px;
    }
    
    .rank-stat .stat-label {
        font-size: 12px;
    }
    
    .rank-up-message {
        font-size: 13px;
        margin: 10px 0;
    }
    
    .rank-up-continue-btn {
        padding: 10px 20px;
        font-size: 14px;
        margin-top: 10px;
    }
}