/* --- BASE --- */
body {
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Cambio: Pegado arriba para que en cel no flote al medio */
    height: 100vh;
    margin: 0;
    padding-top: 20px; /* Un poco de aire arriba */
    font-family: sans-serif;
    color: white;
    overflow: hidden;
}

/* --- BASE UNIFICADA PARA AMBAS TARJETAS --- */
#card, #card-ajena {
    width: 320px;
    height: 580px;
    border-radius: 20px;
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, 
        rgba(255,255,255,0.1) 0%, 
        rgba(150,150,255,0.2) 25%, 
        rgba(255,150,255,0.2) 50%, 
        rgba(150,150,255,0.2) 75%, 
        rgba(255,255,255,0.1) 100%);
    backdrop-filter: blur(15px);
    box-sizing: border-box;
}

/* MARCOS DINÁMICOS (Compartidos por ambas) */
.nivel-novato { border: 4px solid #4a4a4a; box-shadow: 0 0 15px #333; }
.nivel-medio { border: 4px solid #cd7f32; box-shadow: 0 0 20px #8b4513; }
.nivel-superior { border: 4px solid #c0c0c0; box-shadow: 0 0 25px #4682b4; }
.nivel-experto { border: 4px solid #ffd700; box-shadow: 0 0 30px #ff8c00; }
.nivel-leyenda { 
    border: 4px solid #00ffff; 
    box-shadow: 0 0 40px #00ffff, inset 0 0 20px rgba(0, 255, 255, 0.2); 
}

/* PERFIL */
.perfil-container { width: 90px; height: 90px; margin-top: 5px; flex-shrink: 0; }
#marco-perfil { width: 100%; height: 100%; border-radius: 50%; border: 2px solid #fff; overflow: hidden; align: center; }
#foto-perfil { width: 100%; height: 100%; object-fit: cover; align: center; }
#apodo { font-size: 1.4rem; margin: 12px 0 5px 0; text-transform: uppercase; text-align: center; width: 100%; letter-spacing: 1px; }

/* --- BARRAS DE STATS --- */
.stats-container { width: 100%; margin: 10px 0;} /* flex-grow para que use el espacio disponible */
.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px; /* Ajustado para que no se amontone */
    font-size: 0.85rem;
}

.progress-bar {
    flex-grow: 1;
    height: 8px;
    background: rgba(255,255,255,0.1);
    margin: 0 10px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar div {
    height: 100%;
    background: linear-gradient(90deg, #00f2fe 0%, #4facfe 100%);
    width: 0%;
    transition: width 1s ease-in-out;
}

.divisor {
    width: 90%;
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    margin: 4px 0;
    min-height: 1px;
    display: block !important;
}

/* --- PODIO REAL ACTUALIZADO --- */
.podio-container {
    display: flex;
    align-items: flex-end; /* Los alinea por la base */
    justify-content: center;
    gap: 12px;
    height: 75px; /* Le di más altura para los resplandores */
    margin: 8px 0;
    width: 100%;
}

.podio-container img {
    object-fit: contain;
    /* EL RESPLANDOR QUE PEDISTE (Dorado sutil) */
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    transition: transform 0.3s ease;
    margin: 0 10px
}

.mini { width: 45px; height: 45px; object-fit: contain;}    /* Derecha (Equipo 3) */
.mediana { width: 52px; height: 52px; object-fit: contain;} /* Izquierda (Equipo 2) */
.grande { width: 80px; height: 80px; object-fit: contain;}  /* Centro (Equipo 1) */

/* El orden visual del podio: Mediana - Grande - Mini */
#equipo-2 { order: 1; }
#equipo-1 { order: 2; }
#equipo-3 { order: 3; }

.logo-autenticidad {
    width: 30px;
    height: auto;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
    margin: 0;
}

#btn-ranking {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.7rem;
    cursor: pointer;
}

#btn-ranking:hover {
    background: rgba(0, 255, 255, 0.2);
}
    
.footer { 
    width: 100%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-top: auto; 
    padding-bottom: 5px;
}
#nivel-texto { font-size: 0.8rem; font-weight: bold; color: #ffd700; }

/* ESTILOS DEL RANKING */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.9);
}
.modal-content {
    /* Fondo con una red sutil de cian/azul */
    background: 
        radial-gradient(circle at 10% 20%, rgba(0, 255, 255, 0.05) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 255, 255, 0.05) 0%, transparent 20%),
        linear-gradient(180deg, #101010 0%, #000 100%);
    margin: 10% auto; padding: 20px; width: 85%; border-radius: 20px;
    border: 1px solid #00ffff; max-height: 70vh; overflow-y: auto;
    position: relative; /* Para el fondo */
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.close-modal { font-size: 28px; cursor: pointer; color: #ff0055; }

.ranking-item {
    display: flex; align-items: center; padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1); gap: 12px;
}
/* ESTE ES TU RESALTE */
.ranking-item.es-yo {
    background: rgba(0, 255, 255, 0.15);
    border: 1px solid #00ffff;
    border-radius: 10px;
}
.img-ranking { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #fff; object-fit: cover;}

.info-rank { flex-grow: 1; font-size: 0.95rem; }

/* NUEVAS BARRITAS DE EFECTIVIDAD EN RANKING */
.progress-bar-rank {
    width: 60px; height: 6px; background: rgba(255,255,255,0.1);
    border-radius: 3px; overflow: hidden; margin: 3px 0;
}
.progress-bar-rank div {
    height: 100%; background: linear-gradient(90deg, #00ffff 0%, #4facfe 100%); width: 0%;
    transition: width 0.5s ease-in-out;
}

.stats-rank { text-align: right; width: 65px;}
.val-efec { font-weight: bold; font-size: 1.1rem; color: #00ffff; }
.txt-efec { font-size: 0.7rem; color: #aaa; text-transform: uppercase; }

/* --- ESTILO PARA LA TARJETA AJENA (EL CLON) --- */
#card-ajena {
    width: 320px;
    height: 580px;
    border-radius: 20px;
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Este es el fondo tornasol que ya usas en la original */
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(150,150,255,0.2) 25%, rgba(255,150,255,0.2) 50%, rgba(150,255,255,0.2) 75%, rgba(255,255,255,0.1) 100%);
    backdrop-filter: blur(15px);
    box-sizing: border-box;
    margin: auto; /* Para que se centre en la pantalla */
}
