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

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(13, 110, 253, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(102, 16, 242, 0.1) 0%, transparent 50%);
    animation: backgroundShift 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

main {
    position: relative;
    z-index: 1;
    padding: 40px 20px;
}

h1 {
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(102, 126, 234, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
    letter-spacing: 2px;
}

@keyframes titleGlow {
    0%, 100% {
        filter: brightness(1);
        transform: scale(1);
    }
    50% {
        filter: brightness(1.2);
        transform: scale(1.02);
    }
}

/* Standings list container */
#standings {
    padding: 20px;
    gap: 15px;
    display: flex;
    flex-direction: column;
}

/* List item styling */
li {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px 25px;
    margin-bottom: 12px;
    counter-increment: item;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: slideIn 0.5s ease-out backwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Staggered animation for list items */
li:nth-child(1) { animation-delay: 0.05s; }
li:nth-child(2) { animation-delay: 0.1s; }
li:nth-child(3) { animation-delay: 0.15s; }
li:nth-child(4) { animation-delay: 0.2s; }
li:nth-child(5) { animation-delay: 0.25s; }
li:nth-child(6) { animation-delay: 0.3s; }
li:nth-child(7) { animation-delay: 0.35s; }
li:nth-child(8) { animation-delay: 0.4s; }
li:nth-child(9) { animation-delay: 0.45s; }

p {
    color: black;
}

li::before {
    content: counter(item);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    margin-right: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

li:hover {
    transform: translateY(-5px) scale(1.02);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

li:hover::before {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* Top 3 special styling */
li:nth-child(1)::before {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    animation: goldShine 2s ease-in-out infinite;
}

@keyframes goldShine {
    0%, 100% { box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5); }
    50% { box-shadow: 0 4px 30px rgba(255, 215, 0, 0.8); }
}

li:nth-child(1) {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
    border-color: rgba(255, 215, 0, 0.3);
}

li:nth-child(2)::before {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #c0c0c0 100%);
    box-shadow: 0 4px 15px rgba(192, 192, 192, 0.5);
}

li:nth-child(3)::before {
    background: linear-gradient(135deg, #cd7f32 0%, #e8a87c 50%, #cd7f32 100%);
    box-shadow: 0 4px 15px rgba(205, 127, 50, 0.5);
}

/* User name styling */
.standings-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    flex-grow: 1;
    text-align: left;
}

.standings-first-place .standings-text {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Score badge styling */
.score {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0d6efd 0%, #667eea 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    margin: 0 15px;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.4);
    transition: all 0.3s ease;
    animation: scorePulse 0.3s ease;
}

@keyframes scorePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Add score button styling */
button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

button:hover {
    transform: scale(1.15) rotate(90deg);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

button:active {
    transform: scale(0.95);
}

/* Score update animation */
.score.updated {
    animation: scoreUpdate 0.5s ease;
}

@keyframes scoreUpdate {
    0% {
        transform: scale(1);
        background: linear-gradient(135deg, #0d6efd 0%, #667eea 100%);
    }
    50% {
        transform: scale(1.3);
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    }
    100% {
        transform: scale(1);
        background: linear-gradient(135deg, #0d6efd 0%, #667eea 100%);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        padding: 20px 10px;
    }

    h1 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem !important;
    }

    /* Make list items wider on mobile */
    #standings {
        padding: 10px;
        gap: 12px;
    }

    li {
        padding: 18px 15px;
        margin-bottom: 10px;
        min-height: 70px;
    }

    .standings-text {
        font-size: 1.15rem;
        padding-right: 10px;
    }

    .standings-first-place .standings-text {
        font-size: 1.35rem;
    }

    .score {
        font-size: 1.3rem;
        padding: 10px 18px;
        min-width: 75px;
    }

    button {
        width: 50px;
        height: 50px;
        font-size: 1.6rem;
        flex-shrink: 0;
    }

    li::before {
        width: 40px;
        height: 40px;
        font-size: 1.05rem;
        margin-right: 15px;
        flex-shrink: 0;
    }
}

/* Loading animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
}
