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

body {
    background: #87CEEB;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#game-container {
    position: relative;
    width: 1080px;
    height: 1920px;
    overflow: hidden;
    background: #87CEEB;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#leaderboard {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px 25px;
    min-width: 280px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#leaderboard h2 {
    text-align: left;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
}

#leaderboard-list {
    list-style: none;
    counter-reset: leaderboard;
}

#leaderboard-list li {
    display: flex;
    align-items: center;
    padding: 10px 0;
    counter-increment: leaderboard;
    font-size: 1.5rem;
}

#leaderboard-list li::before {
    content: counter(leaderboard) ".";
    font-weight: 600;
    margin-right: 15px;
    color: #333;
    min-width: 35px;
    font-size: 1.5rem;
}

.leaderboard-flag {
    width: 45px;
    height: 30px;
    margin-right: 15px;
    object-fit: cover;
    border-radius: 4px;
}

.leaderboard-name {
    flex: 1;
    font-size: 1.5rem;
    color: #333;
}

.leaderboard-wins {
    font-weight: 600;
    color: #333;
    font-size: 1.5rem;
    margin-left: 25px;
}

#winner-announcement {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px 60px;
    text-align: center;
    color: #333;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

#winner-flag {
    margin-bottom: 25px;
}

#winner-flag img {
    width: 400px;
    height: 300px;
    border-radius: 20px;
}

#winner-text {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none !important;
}

/* Champion Celebration Styles */
#champion-celebration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 50, 0.95) 100%);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: celebrationFadeIn 0.5s ease-out;
}

@keyframes celebrationFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#champion-content {
    text-align: center;
    z-index: 210;
    animation: championBounce 0.8s ease-out;
}

@keyframes championBounce {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

#champion-crown {
    font-size: 120px;
    animation: crownFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px gold);
}

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

#champion-title {
    font-size: 80px;
    font-weight: 900;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700, #FFEC8B);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: goldShimmer 2s ease-in-out infinite;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    margin: 20px 0;
    letter-spacing: 10px;
}

@keyframes goldShimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#champion-flag {
    margin: 30px auto;
}

#champion-flag img {
    width: 400px;
    height: 300px;
    border-radius: 20px;
    border: 8px solid gold;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.6), 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: flagPulse 1.5s ease-in-out infinite;
}

@keyframes flagPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 60px rgba(255, 215, 0, 0.6); }
    50% { transform: scale(1.05); box-shadow: 0 0 100px rgba(255, 215, 0, 0.9); }
}

#champion-name {
    font-size: 50px;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    margin: 20px 0;
}

#champion-wins {
    font-size: 36px;
    font-weight: 600;
    color: #FFD700;
    letter-spacing: 5px;
    margin: 15px 0;
}

#champion-stars {
    font-size: 50px;
    animation: starsGlow 1s ease-in-out infinite alternate;
}

@keyframes starsGlow {
    from { filter: drop-shadow(0 0 10px gold); transform: scale(1); }
    to { filter: drop-shadow(0 0 30px gold); transform: scale(1.1); }
}

/* Confetti Container */
#confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 205;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    top: -20px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(2000px) rotate(720deg); opacity: 0.8; }
}

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

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

@keyframes fireworkExplode {
    0% { transform: scale(0); opacity: 1; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

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

@keyframes particleFly {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { opacity: 0; }
}
