#leaderboard {
    padding: 20px;
    background-color: #222;
    border-radius: 10px;
    max-width: 400px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
}

#leaderboard .title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 15px;
    color: #ffd700;
}

#leaderboard .list {
    width: 100%;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #333;
}

.leaderboard-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.leaderboard-item .rank {
    margin-right: 15px;
    color: #777;
    width: 20px;
    font-weight: bold;
}

.leaderboard-item .name {
    flex-grow: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-item .score {
    font-weight: bold;
    color: #4CAF50;
    margin-left: 10px;
    text-wrap: nowrap;
}

#leaderboard .controls {
    text-align: center;
    width: 100%;
    max-height: 0;
    padding-top: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

#leaderboard:hover .controls {
    padding-top: 20px;
    max-height: 100px;
    opacity: 1;
    overflow: visible;
}

#leaderboard-statistic {
    align-items: normal;
    gap: 20px;
}

#statistic {
    padding: 20px;
    background-color: #222;
    border-radius: 10px;
    max-width: 400px;
    width: 100%;
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    flex-direction: column;
    position: relative;
}

#statistic .title {
    text-align: center;
    font-size: 24px;
    margin-bottom: 15px;
    color: #8800ff;
}

#statistic .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    line-height: 1.7;
}

.reset-btn {
    background-color: #333;
    font-size: 14px;
    padding: 10px 15px;
}

.reset-btn:hover {
    background-color: #555;
    box-shadow: none;
}

#winner {
    padding: 20px;
    background: radial-gradient(circle at top, rgba(255, 215, 0, 0.15), rgba(34, 34, 34, 0.95) 60%), #222;
    border-radius: 20px;
    font-size: 20px;
    text-align: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    overflow: visible;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.winner-decorations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.emoji-decor {
    position: absolute;
    font-size: 3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    user-select: none;
}

.decor-crown {
    top: -55px;
    left: 50%;
    font-size: 4rem;
    animation: float-crown 3s ease-in-out infinite;
}

.decor-trophy {
    bottom: -30px;
    right: 35px;
    animation: sway 5s ease-in-out infinite alternate;
    font-size: 2.1em;
}

.decor-star-1 {
    top: 0px;
    left: -27px;
    font-size: 2.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.decor-star-2 {
    bottom: -3px;
    left: -30px;
    font-size: 2rem;
    animation: float-simple 4s ease-in-out infinite reverse;
}

.decor-party {
    top: -35px;
    right: -35px;
    animation: winner-party 2.5s ease-in-out infinite;
    font-size: 2.4em;
}

@keyframes float-crown {

    0%,
    100% {
        transform: translate(-50%, 0) rotate(-5deg);
    }

    50% {
        transform: translate(-50%, -15px) rotate(5deg);
    }
}

@keyframes float-simple {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes sway {

    0%,
    100% {
        transform: rotate(-15deg);
    }

    50% {
        transform: rotate(15deg);
    }
}

@keyframes winner-party {

    0%,
    100% {
        transform: rotate(-15deg) translateY(0);
    }

    50% {
        transform: rotate(15deg) translateY(10px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1) rotate(-10deg);
    }

    50% {
        transform: scale(1.2) rotate(0deg);
    }
}

#winner .title {
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.25);
}

#winner .content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#winner .winner-avatar-wrapper {
    overflow: hidden;
    border-radius: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#winner-avatar {
    max-width: 80px;
    border-radius: 300px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.35);
}

#winner-avatar.blurred {
    filter: blur(10px);
}

#winner-avatar img {
    vertical-align: middle;
}

#winner .winner-name {
    font-size: 50px;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.25);
}