@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Metal+Mania&family=Cinzel:wght@400;600;700&family=Uncial+Antiqua&family=Kanit:wght@300;400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Kanit', sans-serif;
    background: 
        radial-gradient(ellipse at top, rgba(25, 25, 112, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at bottom, rgba(75, 0, 130, 0.5) 0%, transparent 50%),
        linear-gradient(135deg, #000000 0%, #1a1a2e 20%, #16213e 40%, #0f3460 60%, #533483 80%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}


body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(3px 3px at 20px 30px, #4169e1, transparent),
        radial-gradient(2px 2px at 40px 70px, #9370db, transparent),
        radial-gradient(1px 1px at 90px 40px, #6495ed, transparent),
        radial-gradient(2px 2px at 130px 80px, #8a2be2, transparent),
        radial-gradient(3px 3px at 160px 30px, #4682b4, transparent);
    background-repeat: repeat;
    background-size: 300px 150px;
    animation: mysticalStars 12s linear infinite;
    z-index: -1;
    opacity: 0.7;
}

@keyframes mysticalStars {
    0% { transform: translateY(0px) translateX(0px); opacity: 0.4; }
    25% { opacity: 0.8; }
    50% { transform: translateY(-50px) translateX(20px); opacity: 0.6; }
    75% { opacity: 0.9; }
    100% { transform: translateY(-100px) translateX(-10px); opacity: 0.4; }
}


body::after {
    content: '';
    position: fixed;
    bottom: -100px;
    left: -50%;
    width: 200%;
    height: 300px;
    background: 
        radial-gradient(ellipse, rgba(75, 0, 130, 0.4) 0%, rgba(25, 25, 112, 0.3) 40%, transparent 70%);
    animation: darkMist 15s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes darkMist {
    0% { 
        transform: translateX(-30px) scale(1) rotate(-2deg);
        opacity: 0.3;
        filter: blur(25px);
    }
    100% { 
        transform: translateX(30px) scale(1.3) rotate(2deg);
        opacity: 0.6;
        filter: blur(20px);
    }
}

.header {

    text-align: center;
    position: relative;
margin-top: 20px;
}


@keyframes borderMystic {
    0% { 
        border-color: #6495ed;
        box-shadow: 
            inset 0 0 30px rgba(100, 149, 237, 0.3),
            0 0 30px rgba(100, 149, 237, 0.3);
    }
    100% { 
        border-color: #9370db;
        box-shadow: 
            inset 0 0 50px rgba(147, 112, 219, 0.5),
            0 0 50px rgba(147, 112, 219, 0.5);
    }
}

.header-content {
    position: relative;
    z-index: 2;
}

.title {
    font-family: 'Metal Mania', serif;
    font-size: 4rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 
        0 0 20px #6495ed,
        0 0 40px #4169e1,
        0 0 60px #9370db,
        4px 4px 8px rgba(0, 0, 0, 0.9),
        0 0 80px #6495ed;
    margin-bottom: 1rem;
    letter-spacing: 6px;
    animation: titleMystic 5s ease-in-out infinite alternate;
    transform: perspective(300px) rotateX(15deg);
}

@keyframes titleMystic {
    0% { 
        text-shadow: 
            0 0 20px #6495ed,
            0 0 40px #4169e1,
            0 0 60px #9370db,
            4px 4px 8px rgba(0, 0, 0, 0.9);
        transform: perspective(300px) rotateX(15deg) scale(1);
        color: #ffffff;
    }
    100% { 
        text-shadow: 
            0 0 30px #6495ed,
            0 0 60px #4169e1,
            0 0 90px #9370db,
            4px 4px 8px rgba(0, 0, 0, 0.9),
            0 0 120px #8a2be2;
        transform: perspective(300px) rotateX(15deg) scale(1.05);
        color: #f0f8ff;
    }
}

.subtitle {
    font-family: 'Creepster', serif;
    font-size: 1.6rem;
    color: #e6e6fa;
    font-weight: 400;
    letter-spacing: 4px;
    text-shadow: 
        0 0 10px #9370db,
        0 4px 8px rgba(0, 0, 0, 0.8);
    animation: subtitleGlow 3s ease-in-out infinite alternate;
}

@keyframes subtitleGlow {
    0% { 
        color: #e6e6fa;
        text-shadow: 0 0 10px #9370db, 0 4px 8px rgba(0, 0, 0, 0.8);
    }
    100% { 
        color: #ffffff;
        text-shadow: 0 0 20px #8a2be2, 0 4px 8px rgba(0, 0, 0, 0.8);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}


.top-three {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 2rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.podium-card {
    position: relative;
    text-align: center;
    transition: all 0.5s ease;
}

.podium-card:hover {
    transform: translateY(-15px) scale(1.05);
}


.podium-card.first {
    order: 2;
    transform: scale(1.1);
}

.podium-card.first .card-inner {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffa500 100%);
    box-shadow: 
        0 20px 40px rgba(255, 215, 0, 0.4),
        0 0 60px rgba(255, 215, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.3);
    border: 4px solid #ffd700;
}

.podium-card.first .rank-number {
    color: #8b4513;
    text-shadow: 0 0 20px #ffd700;
    font-size: 3rem;
}

.podium-card.first::before {
    content: '👑';
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    animation: crownFloat 3s ease-in-out infinite alternate;
    z-index: 10;
}

@keyframes crownFloat {
    0% { transform: translateX(-50%) translateY(0px) rotate(-5deg); }
    100% { transform: translateX(-50%) translateY(-10px) rotate(5deg); }
}


.podium-card.second {
    order: 1;
}

.podium-card.second .card-inner {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #a0a0a0 100%);
    box-shadow: 
        0 15px 30px rgba(192, 192, 192, 0.4),
        0 0 40px rgba(192, 192, 192, 0.2);
    border: 3px solid #c0c0c0;
}

.podium-card.second .rank-number {
    color: #4a4a4a;
    text-shadow: 0 0 15px #c0c0c0;
}

/* Third Place */
.podium-card.third {
    order: 3;
}

.podium-card.third .card-inner {
    background: linear-gradient(135deg, #cd7f32 0%, #deb887 50%, #8b4513 100%);
    box-shadow: 
        0 15px 30px rgba(205, 127, 50, 0.4),
        0 0 40px rgba(205, 127, 50, 0.2);
    border: 3px solid #cd7f32;
}

.podium-card.third .rank-number {
    color: #2f1b14;
    text-shadow: 0 0 15px #cd7f32;
}

.card-inner {
    width: 200px;
    height: 280px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.guild-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(45deg, #6495ed, #9370db);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.rank-number {
    font-family: 'Metal Mania', serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.guild-name-card {
    font-family: 'Cinzel', serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    color: #2c2c2c;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    word-wrap: break-word;
    max-width: 180px;
}

.score-card {
    font-family: 'Metal Mania', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c2c2c;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* Regular Rankings */
.regular-rankings {
    background: 
        linear-gradient(135deg, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(25, 25, 112, 0.6) 30%,
        rgba(75, 0, 130, 0.5) 60%,
        rgba(0, 0, 0, 0.8) 100%);
    border-radius: 25px;
    padding: 2rem;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.8),
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        0 0 100px rgba(100, 149, 237, 0.3);
    border: 4px solid #6495ed;
    backdrop-filter: blur(20px);
    position: relative;
}

.regular-rankings::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: 
        linear-gradient(45deg, 
        #000000 0%, 
        #6495ed 25%, 
        #4169e1 50%, 
        #9370db 75%, 
        #000000 100%);
    border-radius: 30px;
    z-index: -1;
    animation: crystalGlow 6s ease-in-out infinite alternate;
}

@keyframes crystalGlow {
    0% { 
        background: linear-gradient(45deg, #000000, #6495ed, #4169e1, #9370db, #000000);
        filter: drop-shadow(0 0 20px rgba(100, 149, 237, 0.3));
    }
    100% { 
        background: linear-gradient(45deg, #1a1a2e, #8a2be2, #6495ed, #4682b4, #1a1a2e);
        filter: drop-shadow(0 0 40px rgba(100, 149, 237, 0.6));
    }
}

.regular-card {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    border-left: 5px solid #6495ed;
    transition: all 0.3s ease;
    position: relative;
}

.regular-card:hover {
    transform: translateX(10px) scale(1.02);
    background: rgba(25, 25, 112, 0.3);
    box-shadow: 0 10px 30px rgba(100, 149, 237, 0.3);
}

.regular-card:last-child {
    margin-bottom: 0;
}

.regular-rank {
    font-family: 'Metal Mania', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    width: 60px;
    text-align: center;
    text-shadow: 0 0 10px #6495ed;
}

.regular-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, #6495ed, #9370db);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 1.5rem;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(100, 149, 237, 0.3);
}

.regular-guild-name {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    flex: 1;
    text-shadow: 0 0 5px #6495ed;
}

.regular-score {
    font-family: 'Metal Mania', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
}

.refresh-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: radial-gradient(circle, #6495ed 0%, #000000 100%);
    color: #ffffff;
    border: 4px solid #6495ed;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 
        0 10px 30px rgba(100, 149, 237, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        0 0 40px rgba(100, 149, 237, 0.3);
    transition: all 0.5s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    transform: scale(1.2) rotate(360deg);
    box-shadow: 
        0 15px 40px rgba(100, 149, 237, 0.7),
        0 0 60px #6495ed,
        inset 0 0 20px rgba(75, 0, 130, 0.3);
    background: radial-gradient(circle, #8a2be2 0%, #4169e1 100%);
    border-color: #9370db;
}

.loading {
    text-align: center;
    padding: 5rem;
    font-family: 'Metal Mania', serif;
    font-size: 1.8rem;
    color: #ffffff;
    text-shadow: 
        0 0 10px #6495ed,
        0 3px 6px rgba(0, 0, 0, 0.8);
}

.loading::before {
    content: '🔮';
    display: block;
    font-size: 5rem;
    margin-bottom: 2rem;
    animation: orbSpin 4s ease-in-out infinite;
}

@keyframes orbSpin {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 20px #6495ed);
    }
    50% { 
        transform: scale(1.2) rotate(180deg);
        filter: drop-shadow(0 0 40px #6495ed) drop-shadow(0 0 60px #4169e1);
    }
}

.last-updated {
    text-align: center;
    margin-top: 3rem;
    color: #e6e6fa;
    font-size: 1.1rem;
    font-family: 'Cinzel', serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Spin animation for refresh button */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 3rem;
        letter-spacing: 3px;
    }
    
    .subtitle {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    
    .container {
        padding: 2rem 1rem;
    }
    
    .top-three {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .podium-card {
        margin-bottom: 1rem;
    }
    
    .podium-card.first {
        transform: scale(1.05);
        order: 1;
    }
    
    .podium-card.second {
        order: 2;
    }
    
    .podium-card.third {
        order: 3;
    }
    
    .card-inner {
        width: 180px;
        height: 250px;
    }
    
    .guild-avatar {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .rank-number {
        font-size: 2rem;
    }
    
    .guild-name-card {
        font-size: 1.1rem;
        max-width: 160px;
    }
    
    .score-card {
        font-size: 1.6rem;
    }
    
    .regular-card {
        padding: 1rem;
        flex-wrap: wrap;
    }
    
    .regular-rank {
        font-size: 1.6rem;
        width: 50px;
    }
    
    .regular-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
        margin: 0 1rem;
    }
    
    .regular-guild-name {
        font-size: 1.2rem;
    }
    
    .regular-score {
        font-size: 1.4rem;
    }
    
    .refresh-btn {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2.5rem;
        letter-spacing: 2px;
    }
    
    .subtitle {
        font-size: 1.2rem;
        letter-spacing: 1px;
    }
    
    .container {
        padding: 1.5rem 1rem;
    }
    
    .card-inner {
        width: 160px;
        height: 220px;
    }
    
    .guild-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .rank-number {
        font-size: 1.8rem;
    }
    
    .guild-name-card {
        font-size: 1rem;
        max-width: 140px;
    }
    
    .score-card {
        font-size: 1.4rem;
    }
    
    .regular-card {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .regular-rank {
        font-size: 1.4rem;
        width: 45px;
    }
    
    .regular-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin: 0 0.8rem;
    }
    
    .regular-guild-name {
        font-size: 1.1rem;
    }
    
    .regular-score {
        font-size: 1.3rem;
    }
    
    .refresh-btn {
        width: 55px;
        height: 55px;
        font-size: 1.4rem;
    }
}

/* Additional animations and effects */
.magic-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, #6495ed, transparent);
    border-radius: 50%;
    animation: mysticParticles 12s infinite linear;
}

@keyframes mysticParticles {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) rotate(45deg) scale(1);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) rotate(315deg) scale(1);
    }
    100% {
        transform: translateY(-10vh) rotate(360deg) scale(0);
        opacity: 0;
    }
}