/* ====================================
   🏆 HALL OF FAME - LEADERBOARD STYLES
   ==================================== */

/* ====== ANIMATED BACKGROUND ====== */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-emoji {
    position: absolute;
    font-size: 2rem;
    opacity: 0.1;
    animation: float 20s infinite linear;
}

.floating-emoji:nth-child(1) { left: 10%; animation-delay: 0s; }
.floating-emoji:nth-child(2) { left: 30%; animation-delay: -4s; }
.floating-emoji:nth-child(3) { left: 50%; animation-delay: -8s; }
.floating-emoji:nth-child(4) { left: 70%; animation-delay: -12s; }
.floating-emoji:nth-child(5) { left: 90%; animation-delay: -16s; }

.sparkle {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0;
    animation: sparkle 3s infinite;
}

.sparkle-1 { top: 10%; left: 20%; animation-delay: 0s; }
.sparkle-2 { top: 30%; right: 20%; animation-delay: 1s; }
.sparkle-3 { bottom: 40%; left: 15%; animation-delay: 2s; }
.sparkle-4 { top: 60%; right: 30%; animation-delay: 0.5s; }
.sparkle-5 { bottom: 20%; right: 10%; animation-delay: 1.5s; }

@keyframes float {
    from { transform: translateY(100vh) rotate(0deg); }
    to { transform: translateY(-100px) rotate(360deg); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

/* ====== MAIN CONTAINER ====== */
.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ====== HERO HEADER ====== */
.hero-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.title-container {
    margin-bottom: 30px;
}

.neon-title {
    font-family: 'Bangers', cursive;
    margin: 0;
    text-align: center;
}

.title-line {
    display: block;
    font-size: 3.5rem;
    color: #ffae00;
    text-shadow: 3px 3px 0px #a04f00;
    line-height: 0.9;
}

.title-line.golden {
    color: #ffd700;
    text-shadow: 3px 3px 0px #a04f00;
    font-size: 4rem;
}

.subtitle {
    font-size: 1.2rem;
    color: #ccc;
    font-style: italic;
    margin-top: 10px;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.5s forwards;
}


@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====== BACK BUTTON ====== */
.back-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 1rem;
    font-family: 'Fredoka One', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

.back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.back-button:hover::before {
    left: 100%;
}

.button-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.back-button:hover .button-icon {
    transform: translateX(-3px);
}

/* ====== PERSONAL BANNER ====== */
.personal-banner {
    background: linear-gradient(135deg, rgba(255, 174, 0, 0.2) 0%, rgba(160, 79, 0, 0.2) 100%);
    border: 2px solid #ff8c00;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    animation: slideInDown 0.8s ease-out;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 174, 0, 0.7));
    animation: bounce 2s infinite;
}

.stat-info {
    text-align: left;
}

.stat-label {
    color: #ffae00;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-value {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.stat-separator {
    width: 2px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, #ff8c00, transparent);
    animation: pulse 2s infinite;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ====== PODIUM SECTION ====== */
.podium-section {
    margin: 40px 0;
    animation: fadeIn 1s ease-out 0.8s both;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 20px;
    margin-bottom: 40px;
    min-height: 200px;
}

.podium-place {
    text-align: center;
    position: relative;
    transition: transform 0.3s ease;
}

.podium-place:hover {
    transform: translateY(-10px);
}

.podium-place.winner {
    z-index: 2;
}

.podium-crown {
    font-size: 2rem;
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    animation: crownFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

.podium-medal {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
    animation: medalSpin 4s linear infinite;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.6));
}

.podium-medal.silver {
    animation-delay: 1s;
    filter: drop-shadow(0 0 15px rgba(192, 192, 192, 0.6));
}

.podium-medal.bronze {
    animation-delay: 2s;
    filter: drop-shadow(0 0 15px rgba(205, 127, 50, 0.6));
}

.podium-info {
    margin: 15px 0;
}

.podium-name {
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}

.podium-score {
    color: #ffae00;
    font-weight: bold;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 174, 0, 0.7);
}

.podium-base {
    width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px 10px 0 0;
    font-weight: bold;
    font-size: 1.5rem;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.gold-base {
    background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
    color: #8b4513;
    height: 80px;
    box-shadow: 0 -8px 20px rgba(255, 215, 0, 0.5);
}

.silver-base {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: #404040;
    height: 60px;
    box-shadow: 0 -5px 15px rgba(192, 192, 192, 0.3);
}

.bronze-base {
    background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%);
    color: #2f1b14;
    height: 40px;
    box-shadow: 0 -3px 10px rgba(205, 127, 50, 0.3);
}

.winner-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite alternate;
    z-index: -1;
}

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

@keyframes medalSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes glowPulse {
    from { opacity: 0.5; transform: scale(1); }
    to { opacity: 0.8; transform: scale(1.1); }
}

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

/* ====== SECTION TITLE ====== */
.section-title {
    font-size: 2rem;
    color: #ffae00;
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-shadow: 0 0 10px rgba(255, 174, 0, 0.5);
}

.title-icon {
    font-size: 2.5rem;
    animation: iconBounce 2s infinite;
}

.live-indicator {
    font-size: 0.8rem;
    background: linear-gradient(45deg, #ff0000, #ff4444);
    padding: 4px 8px;
    border-radius: 10px;
    animation: blink 1.5s infinite;
    color: white;
    font-weight: normal;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ====== LEADERBOARD TABLE ====== */
.leaderboard-table {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid #ff8c00;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.leaderboard-list {
    max-height: 500px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ff8c00 rgba(0, 0, 0, 0.3);
}

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

.leaderboard-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: #ff8c00;
    border-radius: 4px;
}

.loading-animation {
    text-align: center;
    padding: 40px 20px;
    color: #ffae00;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 174, 0, 0.3);
    border-top: 4px solid #ffae00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 1.1rem;
    font-weight: bold;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====== LEADERBOARD ENTRIES ====== */
.leaderboard-entry {
    display: grid;
    grid-template-columns: 80px 1fr 120px;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 140, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: slideInLeft 0.6s ease-out forwards;
}

.leaderboard-entry::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 174, 0, 0.1), transparent);
    transition: left 0.5s ease;
}

.leaderboard-entry:hover {
    background: rgba(255, 174, 0, 0.1);
    transform: translateX(10px);
}

.leaderboard-entry:hover::before {
    left: 100%;
}

.leaderboard-entry:nth-child(1) { animation-delay: 0.1s; }
.leaderboard-entry:nth-child(2) { animation-delay: 0.2s; }
.leaderboard-entry:nth-child(3) { animation-delay: 0.3s; }
.leaderboard-entry:nth-child(4) { animation-delay: 0.4s; }
.leaderboard-entry:nth-child(5) { animation-delay: 0.5s; }
.leaderboard-entry:nth-child(6) { animation-delay: 0.6s; }
.leaderboard-entry:nth-child(7) { animation-delay: 0.7s; }
.leaderboard-entry:nth-child(8) { animation-delay: 0.8s; }
.leaderboard-entry:nth-child(9) { animation-delay: 0.9s; }
.leaderboard-entry:nth-child(10) { animation-delay: 1.0s; }

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

/* Position styling */
.position {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    position: relative;
}

.position-number {
    color: #ff8c00;
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.5);
}

.medal {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
    animation: medalGlow 2s ease-in-out infinite alternate;
}

@keyframes medalGlow {
    from { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8)); }
    to { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1)); }
}

/* Player name styling */
.player-name {
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
    padding: 0 15px;
}

.leaderboard-entry.current-player .player-name {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
}

.leaderboard-entry.current-player .player-name::after {
    content: ' (Tú)';
    font-size: 0.9rem;
    color: #81C784;
    font-style: italic;
}

/* Score styling */
.score-value {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffae00;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 20px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 174, 0, 0.7);
    border: 2px solid rgba(255, 140, 0, 0.3);
    transition: all 0.3s ease;
}

.leaderboard-entry:hover .score-value {
    background: rgba(255, 174, 0, 0.2);
    border-color: #ffae00;
    transform: scale(1.05);
}

/* Special styling for top 3 */
.leaderboard-entry.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 140, 0, 0.1) 100%);
    border-left: 5px solid #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.leaderboard-entry.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2) 0%, rgba(160, 160, 160, 0.1) 100%);
    border-left: 5px solid #c0c0c0;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.2);
}

.leaderboard-entry.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2) 0%, rgba(160, 82, 45, 0.1) 100%);
    border-left: 5px solid #cd7f32;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.2);
}

/* ====== FUN STATS ====== */
.fun-stats {
    display: flex;
    justify-content: space-around;
    margin: 40px 0;
    gap: 20px;
}

.fun-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 174, 0, 0.1);
    padding: 15px 20px;
    border-radius: 50px;
    border: 2px solid rgba(255, 140, 0, 0.3);
    transition: all 0.3s ease;
}

.fun-stat:hover {
    background: rgba(255, 174, 0, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 140, 0, 0.3);
}

.fun-icon {
    font-size: 1.5rem;
    animation: funIconSpin 8s linear infinite;
}

.fun-text {
    color: #ccc;
    font-size: 0.9rem;
}

.fun-value {
    color: #ffae00;
    font-weight: bold;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(255, 174, 0, 0.5);
}

@keyframes funIconSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title-line {
        font-size: 2.5rem;
    }
    
    .title-line.golden {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .banner-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .stat-separator {
        width: 50px;
        height: 2px;
        background: linear-gradient(to right, transparent, #ff8c00, transparent);
    }
    
    .podium-container {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .podium-place {
        width: 100%;
        max-width: 300px;
    }
    
    .podium-base {
        width: 100%;
        height: 50px;
    }
    
    .leaderboard-entry {
        grid-template-columns: 60px 1fr 100px;
        padding: 12px 15px;
    }
    
    .position {
        font-size: 1.5rem;
    }
    
    .player-name {
        font-size: 1rem;
    }
    
    .score-value {
        font-size: 1.2rem;
        padding: 6px 12px;
    }
    
    .fun-stats {
        flex-direction: column;
        align-items: center;
    }
    
    .fun-stat {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .title-line {
        font-size: 2rem;
    }
    
    .title-line.golden {
        font-size: 2.5rem;
    }
    
    .leaderboard-entry {
        grid-template-columns: 50px 1fr 80px;
        padding: 10px 12px;
    }
    
    .position {
        font-size: 1.3rem;
    }
    
    .player-name {
        font-size: 0.9rem;
    }
    
    .score-value {
        font-size: 1rem;
        padding: 5px 10px;
    }
}

/* =====================================
   LITE MODE - LEADERBOARD OPTIMIZATIONS
   ===================================== */

/* Disable background animations */
.lite-mode .animated-bg {
    display: none !important;
}

.lite-mode .floating-emoji,
.lite-mode .sparkle {
    display: none !important;
}

/* Simplify animations */
.lite-mode * {
    animation: none !important;
    transition-duration: 0.1s !important;
}

/* Allow only essential transitions */
.lite-mode .back-button,
.lite-mode .leaderboard-entry {
    transition: all 0.1s ease !important;
}

/* Remove complex keyframes */
.lite-mode .neon-title,
.lite-mode .title-line {
    animation: none !important;
}

.lite-mode .subtitle {
    animation: none !important;
    opacity: 1 !important;
}

/* Simplify podium effects */
.lite-mode .podium-place {
    animation: none !important;
}

.lite-mode .podium-medal {
    animation: none !important;
}

.lite-mode .winner-glow {
    display: none !important;
}

/* Remove leaderboard entry animations */
.lite-mode .leaderboard-entry {
    animation: none !important;
}

/* Simplify gradients */
.lite-mode .personal-banner {
    background: #2c3e50 !important;
}

.lite-mode .podium-base {
    background: #34495e !important;
}

.lite-mode .gold-base {
    background: #f1c40f !important;
}

.lite-mode .silver-base {
    background: #95a5a6 !important;
}

.lite-mode .bronze-base {
    background: #cd7f32 !important;
}

/* Simplify leaderboard table */
.lite-mode .leaderboard-table {
    background: #2c3e50 !important;
    border: 2px solid #ffae00 !important;
}

.lite-mode .leaderboard-entry {
    background: #34495e !important;
    border: 1px solid #ffae00 !important;
}

.lite-mode .leaderboard-entry:hover {
    background: #3c5a78 !important;
    transform: none !important;
}

.lite-mode .leaderboard-entry.current-player {
    background: #2c3e50 !important;
    border-color: #f39c12 !important;
}

/* Remove rank-specific animations */
.lite-mode .rank-1,
.lite-mode .rank-2,
.lite-mode .rank-3 {
    animation: none !important;
}

/* Simplify fun stats */
.lite-mode .fun-stats {
    background: #2c3e50 !important;
}

.lite-mode .fun-stat {
    animation: none !important;
}

/* Remove loading animations */
.lite-mode .loading-spinner {
    animation: spin 1s linear infinite !important;
}

/* Simplify back button */
.lite-mode .back-button {
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    transition: all 0.1s ease !important;
}

.lite-mode .back-button:hover {
    background: linear-gradient(135deg, #5dade2, #3498db) !important;
    transform: translateY(-1px) !important;
}

/* Remove message animations */
.lite-mode .message {
    animation: none !important;
}

/* Optimize for mobile in lite mode */
@media (max-width: 768px) {
    .lite-mode .neon-title {
        font-size: 2.5rem !important;
    }
    
    .lite-mode .podium-container {
        gap: 10px !important;
    }
    
    .lite-mode .leaderboard-entry {
        padding: 8px 10px !important;
    }
    
    .lite-mode .personal-banner {
        padding: 15px !important;
    }
}