:root {
    --ranking-purple: #8b5cf6;
    --ranking-purple-light: #ede9fe;
    --ranking-purple-dark: #7c3aed;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
}

/* ================================================
   BANNER HEADER - ESTILO TABLÓN
   ================================================ */

.ranking-banner-header {
    background: linear-gradient(90deg, #00C853 0%, #00BFA5 25%, #00ACC1 50%, #5E35B1 75%, #7C4DFF 100%);
    padding: 30px 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.25);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

/* Efecto de fondo animado */
.ranking-banner-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    z-index: 1;
}

.ranking-banner-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

.ranking-banner-info {
    color: white;
}

.ranking-banner-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ranking-banner-description {
    font-size: 16px;
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    line-height: 1.5;
}

.ranking-banner-actions {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.btn-mi-ranking-header {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-mi-ranking-header:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: white;
}

.btn-mi-ranking-header svg {
    width: 20px;
    height: 20px;
}

/* ================================================
   CONTENIDO PRINCIPAL
   ================================================ */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-dark);
}

.info-section {
    margin-bottom: 3rem;
}

.info-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.info-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--ranking-purple);
}

.info-text {
    color: var(--color-gray);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.formas-ganar {
    background: var(--ranking-purple-light);
    padding: 1.5rem;
    border-radius: 12px;
}

.formas-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--ranking-purple-dark);
}

.formas-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.forma-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: 8px;
}

.forma-icon {
    font-size: 1.5rem;
}

.forma-text {
    flex: 1;
    font-weight: 500;
    color: var(--color-dark);
}

.forma-puntos {
    font-weight: 700;
    color: var(--ranking-purple);
}

.podio-section {
    margin-bottom: 3rem;
}

.podio-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.podio-place {
    background: white;
    border-radius: 16px;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    transition: transform 0.3s ease;
}

.podio-place:hover {
    transform: translateY(-5px);
}

.primer-lugar {
    background: linear-gradient(135deg, var(--gold) 0%, #ffed4e 100%);
    order: 1;
}

.segundo-lugar {
    background: linear-gradient(135deg, var(--silver) 0%, #e5e5e5 100%);
    order: 2;
}

.tercer-lugar {
    background: linear-gradient(135deg, var(--bronze) 0%, #d4a574 100%);
    order: 3;
}

.podio-crown {
    font-size: 2rem;
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.podio-rank {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 35px;
    height: 35px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.podio-avatar {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.podio-medal {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.podio-nombre {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--color-dark);
}

.podio-nivel {
    font-size: 0.9rem;
    color: var(--color-gray);
    margin-bottom: 1rem;
}

.podio-salseos {
    background: rgba(255, 255, 255, 0.5);
    padding: 0.75rem;
    border-radius: 8px;
}

.podio-salseos.champion {
    background: rgba(255, 255, 255, 0.8);
}

.salseos-numero {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--ranking-purple);
}

.salseos-label {
    font-size: 0.85rem;
    color: var(--color-gray);
}

.ranking-section {
    margin-bottom: 3rem;
}

.ranking-lista {
    background: white;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item:hover {
    background: var(--ranking-purple-light);
}

.ranking-item.top-3 {
    background: linear-gradient(90deg, var(--ranking-purple-light) 0%, transparent 100%);
}

.ranking-posicion {
    min-width: 50px;
    text-align: center;
}

.posicion-numero {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--ranking-purple);
}

.ranking-avatar {
    font-size: 2.5rem;
}

.ranking-info {
    flex: 1;
}

.ranking-nombre {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-dark);
}

.ranking-nivel {
    font-size: 0.85rem;
    color: var(--color-gray);
}

.ranking-puntos {
    text-align: right;
}

.puntos-numero {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--ranking-purple);
}

.puntos-label {
    font-size: 0.75rem;
    color: var(--color-gray);
}

.niveles-section {
    margin-bottom: 3rem;
}

.niveles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.nivel-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 2px solid #f1f5f9;
    transition: all 0.3s ease;
}

.nivel-card:hover {
    transform: translateY(-3px);
    border-color: var(--ranking-purple);
}

.nivel-card.destacado {
    background: var(--ranking-purple-light);
    border-color: var(--ranking-purple);
}

.nivel-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.nivel-nombre {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.nivel-rango {
    font-size: 0.9rem;
    color: var(--color-gray);
}

.cta-ranking {
    background: linear-gradient(135deg, var(--ranking-purple) 0%, var(--ranking-purple-dark) 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cta-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    color: var(--ranking-purple);
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: var(--ranking-purple);
    text-decoration: none;
}

.canje-section {
    margin-bottom: 3rem;
}

.canje-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    border: 2px solid var(--ranking-purple-light);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.1);
}

.canje-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s ease-in-out infinite;
}

.canje-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--ranking-purple);
    margin-bottom: 1rem;
}

.canje-text {
    font-size: 1.05rem;
    color: var(--color-gray);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.canje-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.preview-item {
    background: white;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.preview-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.preview-icon {
    font-size: 2.5rem;
}

.preview-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-dark);
    text-align: center;
}

.canje-footer {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--color-gray);
    line-height: 1.6;
    max-width: 700px;
    margin: 0 auto;
}

.canje-footer strong {
    color: var(--ranking-purple);
    font-weight: 600;
}

.loading-container {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    border: 4px solid var(--ranking-purple-light);
    border-top: 4px solid var(--ranking-purple);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

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

.error-message {
    background: #fee;
    padding: 2rem;
    border-radius: 12px;
    color: #c00;
}

.btn-reintentar {
    background: var(--ranking-purple);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    cursor: pointer;
    font-weight: 600;
}

.btn-reintentar:hover {
    background: var(--ranking-purple-dark);
}

/* ================================================
   MEDIA QUERIES - MÓVIL (max 768px)
   ================================================ */

@media (max-width: 768px) {
    .ranking-banner-header {
        flex-direction: column;
        padding: 25px 30px;
        gap: 20px;
    }
    
    .ranking-banner-title {
        font-size: 28px;
    }
    
    .ranking-banner-description {
        font-size: 14px;
    }

    .canje-preview {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .preview-icon {
        font-size: 2rem;
    }
    
    .preview-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .ranking-banner-header {
        padding: 20px;
    }
    
    .ranking-banner-title {
        font-size: 24px;
    }
    
    .ranking-banner-description {
        font-size: 13px;
    }
    
    .btn-mi-ranking-header {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ================================================
   MEDIA QUERIES - TABLET (768px+)
   ================================================ */

@media (min-width: 768px) {
    .formas-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .podio-container {
        grid-template-columns: repeat(3, 1fr);
        align-items: flex-end;
    }

    .primer-lugar {
        order: 2;
        transform: scale(1.1);
    }

    .segundo-lugar {
        order: 1;
    }

    .tercer-lugar {
        order: 3;
    }

    .niveles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================================================
   MEDIA QUERIES - DESKTOP (1024px+)
   ================================================ */

@media (min-width: 1024px) {
    .formas-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .niveles-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}