/* Enhanced Leaderboard Styling */

/* Section Header */
.leaderboard .section-header {
    position: relative;
    margin-bottom: 40px;
    text-align: center;
    padding-bottom: 15px;
}

.leaderboard .section-title {
    font-size: 36px;
    letter-spacing: 2px;
    margin: 0;
    background: linear-gradient(to bottom, #fff, var(--minecraft-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    display: inline-block;
    padding: 0 20px;
    animation: titlePulse 3s ease-in-out infinite alternate;
}

.tier-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--minecraft-accent);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    display: inline-block;
    text-align: center;
    width: 100%;
}

@keyframes titlePulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(255, 204, 0, 0.3)); }
    100% { transform: scale(1.05); filter: drop-shadow(0 0 15px rgba(255, 204, 0, 0.7)); }
}

.leaderboard .section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--minecraft-accent), transparent);
    box-shadow: 0 0 10px var(--minecraft-accent);
}

.header-decoration {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.header-decoration.left {
    left: 0;
    background-image: url('https://static.wikia.nocookie.net/minecraft_gamepedia/images/c/c8/Diamond_JE3_BE3.png/revision/latest/scale-to-width-down/160?cb=20191229174851');
    background-size: contain;
}

.header-decoration.right {
    right: 0;
    background-image: url('https://static.wikia.nocookie.net/minecraft_gamepedia/images/c/c8/Diamond_JE3_BE3.png/revision/latest/scale-to-width-down/160?cb=20191229174851');
    background-size: contain;
    transform: translateY(-50%) scaleX(-1);
}

.header-decoration.enchanted {
    animation: enchantedGlow 2s ease-in-out infinite alternate;
}

@keyframes enchantedGlow {
    0% { filter: brightness(1) drop-shadow(0 0 5px rgba(255, 204, 0, 0.5)); }
    100% { filter: brightness(1.3) drop-shadow(0 0 15px rgba(255, 204, 0, 0.8)); }
}

/* Enhanced Leaderboard Container */
.leaderboard {
    position: relative;
    margin: 40px auto;
    padding: 20px;
    max-width: 900px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 20, 0.8));
    border: 3px solid var(--minecraft-accent);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(255, 204, 0, 0.1);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.leaderboard::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: url('../images/noise.png');
    opacity: 0.05;
    z-index: -1;
    border-radius: 20px;
    pointer-events: none;
}

/* Enhanced Tier Container */
.tier-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    position: relative;
    perspective: 1000px;
}

/* Podium Base */
.tier-container::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 5%;
    right: 5%;
    height: 30px;
    background: linear-gradient(to right, rgba(50, 50, 50, 0.7), rgba(70, 70, 70, 0.9), rgba(50, 50, 50, 0.7));
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    z-index: -1;
    transform: rotateX(45deg);
}

/* Enhanced Tier Box */
.tier-box {
    position: relative;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    transform: translateZ(0);
    overflow: hidden;
    width: 30%;
    margin-bottom: 15px;
    align-items: center;
}

.tier-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 6px 6px 0 0;
    pointer-events: none;
}

/* Gold Tier */
.tier-box.gold {
    border-color: #FFD700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(184, 134, 11, 0.3));
    z-index: 3;
    transform: translateY(-20px) scale(1.1) translateZ(0);
}

/* Silver Tier */
.tier-box.silver {
    border-color: #C0C0C0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.3), rgba(105, 105, 105, 0.3));
    z-index: 2;
}

/* Bronze Tier */
.tier-box.bronze {
    border-color: #CD7F32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.3), rgba(139, 69, 19, 0.3));
    z-index: 1;
}

/* Tier Medal */
.tier-medal {
    position: relative;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Participant List */
.participant-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--minecraft-accent) rgba(0, 0, 0, 0.3);
}

/* Participant Item */
.participant-item {
    padding: 8px 10px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid var(--minecraft-accent);
}

.participant-item:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateX(5px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5);
}

.participant-name {
    font-weight: bold;
    margin-right: 10px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.participant-score {
    margin-left: auto;
    color: var(--minecraft-accent);
    font-weight: bold;
}

.participant-list::-webkit-scrollbar {
    width: 8px;
}

.participant-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.participant-list::-webkit-scrollbar-thumb {
    background-color: var(--minecraft-accent);
    border-radius: 4px;
}

.tier-medal::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent);
    z-index: -1;
}

.tier-box.gold .tier-medal {
    color: #FFD700;
}

.tier-box.gold .tier-medal::before {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.tier-box.silver .tier-medal {
    color: #C0C0C0;
}

.tier-box.silver .tier-medal::before {
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.5);
}

.tier-box.bronze .tier-medal {
    color: #CD7F32;
}

.tier-box.bronze .tier-medal::before {
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5);
}

/* Tier Trophy */
.tier-trophy {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.7));
}

.tier-box.gold .tier-trophy {
    background-image: url('https://cdn-icons-png.flaticon.com/512/2583/2583344.png');
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.tier-box.silver .tier-trophy {
    background-image: url('https://cdn-icons-png.flaticon.com/512/2583/2583319.png');
    filter: drop-shadow(0 0 8px rgba(192, 192, 192, 0.5));
}

.tier-box.bronze .tier-trophy {
    background-image: url('https://cdn-icons-png.flaticon.com/512/2583/2583434.png');
    filter: drop-shadow(0 0 8px rgba(205, 127, 50, 0.5));
}

/* Tier Name */
.tier-name {
    font-size: 24px;
    margin: 15px 0;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

/* Tier Score */
.tier-score {
    font-size: 18px;
    color: var(--minecraft-accent);
    margin: 10px 0;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Tier Label */
.tier-label {
    position: absolute;
    bottom: -35px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 16px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 5px 10px;
    border-radius: 0 0 10px 10px;
    border-bottom: 2px solid var(--minecraft-accent);
}

/* Tier Hover Effects */
.tier-box:hover {
    transform: translateY(-10px) translateZ(10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
}

.tier-box.gold:hover {
    transform: translateY(-30px) scale(1.12) translateZ(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 215, 0, 0.4);
}

.tier-box.silver:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(192, 192, 192, 0.4);
}

.tier-box.bronze:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(205, 127, 50, 0.4);
}

/* Fire Effect */
.fire-effect {
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, #ff6600, #ffcc00);
    background-size: contain;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    pointer-events: none;
    filter: blur(1px);
}

.fire-effect.fire-active {
    opacity: 0.7;
    transform: translateY(0);
}

.fire-gold {
    filter: hue-rotate(45deg) brightness(1.2) blur(1px);
}

.fire-silver {
    filter: hue-rotate(180deg) brightness(1.1) blur(1px);
}

.fire-bronze {
    filter: hue-rotate(30deg) saturate(1.5) brightness(1.1) blur(1px);
}

/* Player Avatar */
.tier-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 10px;
    background: url('https://cdn-icons-png.flaticon.com/512/3135/3135715.png') center/cover;
    border: 3px solid;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.tier-box.gold .tier-avatar {
    border-color: #FFD700;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 215, 0, 0.6);
}

.tier-box.silver .tier-avatar {
    border-color: #C0C0C0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), 0 0 8px rgba(192, 192, 192, 0.5);
}

.tier-box.bronze .tier-avatar {
    border-color: #CD7F32;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5), 0 0 8px rgba(205, 127, 50, 0.5);
}

/* Responsive Design */
@media (max-width: 992px) {
    .tier-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .tier-box {
        min-height: 250px;
        padding: 20px 15px;
    }
    
    .tier-box.gold {
        transform: translateY(-15px) scale(1.05);
    }
    
    .tier-medal {
        font-size: 28px;
    }
    
    .tier-name {
        font-size: 20px;
    }
    
    .tier-score {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .tier-container {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .tier-box {
        width: 80%;
        margin: 0 auto;
        min-height: 200px;
    }
    
    .tier-box.gold {
        transform: translateY(0) scale(1.05);
        order: 1;
    }
    
    .tier-box.silver {
        order: 2;
    }
    
    .tier-box.bronze {
        order: 3;
    }
}

@media screen and (max-width: 1200px) {
    .tier-box {
        width: 30%;
        margin: 1.5%;
    }
    
    .leaderboard .section-title {
        font-size: 36px;
    }
}

@media screen and (max-width: 992px) {
    .tier-box {
        width: 45%;
        margin: 2.5%;
    }
    
    .leaderboard .section-title {
        font-size: 32px;
    }
    
    .tier-header {
        padding: 10px;
    }
    
    .tier-title {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 768px) {
    .tier-container {
        flex-direction: column;
        align-items: center;
    }
    
    .tier-box {
        width: 90%;
        margin: 10px 0;
    }
    
    .leaderboard .section-title {
        font-size: 28px;
        padding: 0 15px;
    }
    
    .header-decoration {
        width: 30px;
        height: 30px;
    }
}

@media screen and (max-width: 576px) {
    .leaderboard .section-title {
        font-size: 24px;
    }
    
    .tier-box {
        width: 95%;
    }
    
    .tier-title {
        font-size: 1.2rem;
    }
    
    .tier-participant {
        padding: 8px;
    }
    
    .participant-name {
        font-size: 0.9rem;
    }
    
    .participant-score {
        font-size: 0.8rem;
    }
}

/* Fireworks Container */
.fireworks-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    box-shadow: 0 0 10px 5px rgba(255, 204, 0, 0.8);
    opacity: 0;
}

#firework1 {
    animation: firework-animation 3s ease-in-out infinite 0.5s;
    top: 30%;
    left: 20%;
}

#firework2 {
    animation: firework-animation 4s ease-in-out infinite 1.5s;
    top: 40%;
    left: 80%;
}

#firework3 {
    animation: firework-animation 3.5s ease-in-out infinite 2.5s;
    top: 20%;
    left: 50%;
}

@keyframes firework-animation {
    0% { transform: scale(0); opacity: 0; }
    5% { transform: scale(1); opacity: 1; }
    10% { transform: scale(1.2); opacity: 0.8; }
    15% { transform: scale(1.5); opacity: 0.6; }
    20% { transform: scale(2); opacity: 0.4; }
    25% { transform: scale(2.5); opacity: 0.2; }
    30% { transform: scale(3); opacity: 0; }
    100% { transform: scale(3); opacity: 0; }
}

/* Particles Container */
#particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.firework-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    animation: particle 1s ease-out forwards;
}

@keyframes particle {
    0% { transform: translate(0, 0); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)); opacity: 0; }
}
