/* MANTENER VARIABLES Y RESET ANTERIORES */
:root { --bg-dark: #0f0f0f; --bg-card: #1a1a1a; --text-main: #f5f5f5; --accent: #ff4d00; }
body { background: var(--bg-dark); color: var(--text-main); font-family: 'Montserrat', sans-serif; min-height: 100vh; display: flex; flex-direction: column; margin: 0;}
.container { max-width: 900px; margin: 0 auto; padding: 20px; width: 100%; }

/* HERO SECTION RESTAURADA */
.hero {
    height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1558981403-c5f9899a28bc?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    padding: 20px;
    margin-bottom: 30px;
}
.hero h1 { font-size: 3.5rem; font-family: 'Orbitron'; margin-bottom: 10px; }
.hero p { font-size: 1.2rem; max-width: 600px; margin-bottom: 30px; }

/* ... MANTENER ESTILOS DE FORMS, BUTTONS, BADGES, FEED, PROFILE ... */
nav { background: var(--bg-card); padding: 1rem; border-bottom: 2px solid var(--accent); position: sticky; top:0; z-index:100; }
.nav-container { display:flex; justify-content:space-between; align-items:center; max-width:1200px; margin:0 auto; }
.brand { font-family: 'Orbitron'; font-weight:900; color:white; text-decoration:none; font-size:1.5rem; }
.nav-links a { color:#ccc; margin-left:20px; font-size:1.2rem; transition:0.3s; }
.nav-links a:hover { color:var(--accent); }

.form-box, .card { background: var(--bg-card); padding: 20px; border-radius: 10px; margin-bottom: 20px; border: 1px solid #333; }
input, select, textarea { width: 100%; padding: 10px; margin: 8px 0; background: #222; border: 1px solid #444; color: white; border-radius: 5px; }
button, .btn { background: var(--accent); color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-family: 'Orbitron'; width: 100%; margin-top:10px; font-weight: bold; }
.btn-small { width: auto; font-size: 0.8rem; padding: 5px 15px; }

/* FIX RANKING TABLE */
table { width: 100%; border-collapse: collapse; margin-top: 10px; table-layout: fixed; /* Fuerza ancho igual */ }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #333; overflow: hidden; text-overflow: ellipsis; }
th:first-child, td:first-child { width: 50px; text-align: center; } /* Columna # */
th:last-child, td:last-child { width: 100px; text-align: right; } /* Columna Nivel */

/* CLASES DE COLORES */
.badge-item { background: #2a2a2a; padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 8px; margin: 2px; color: white; border: 1px solid transparent; }
.badge-cyan { border-color: #a8dadc; color: #a8dadc; }
.badge-gold { border-color: #ffd700; color: #ffd700; }
.badge-red { border-color: #e63946; color: #e63946; }
.badge-silver { border-color: #c0c0c0; color: #c0c0c0; }
.badge-maroon { border-color: #9b2226; color: #9b2226; }
.badge-purple { border-color: #6775f8; color: #6775f8; }
.badge-green { border-color: #2a9d8f; color: #2a9d8f; }

.avatar-selector { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; max-height: 300px; overflow-y: auto; padding: 10px; background: #111; border-radius: 8px; }
.avatar-option img { width: 100%; border-radius: 50%; border: 2px solid transparent; }
.avatar-option input:checked + img { border-color: var(--accent); transform: scale(1.1); }

.ranking-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.tab-btn { background: #222; color: #aaa; text-decoration: none; padding: 10px 20px; border-radius: 20px; border: 1px solid #333; }
.tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; margin: 20px 0; }
.stat-box { background: #222; padding: 10px; border-radius: 8px; }
.profile-avatar-large { width: 120px; height: 120px; border-radius: 50%; border: 4px solid var(--accent); }
.avatar-feed { width: 45px; height: 45px; border-radius: 50%; border: 2px solid var(--accent); object-fit: cover; }
.post-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
footer { text-align: center; padding: 20px; font-size: 0.8rem; color: #666; margin-top: auto; }

* Boton VIP Especial */
.vip-section {
    margin-top: 20px;
    border: 1px solid #ffd700;
    padding: 20px;
    border-radius: 8px;
    background: linear-gradient(45deg, #1a1a1a, #2a2200);
}

.btn-vip {
    background: linear-gradient(45deg, #ffd700, #ffaa00);
    color: black;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Orbitron';
    width: 100%;
}

.btn-vip:hover {
    transform: scale(1.02);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

/* Colores historial Campeonato */
.res-champ-1 { color: #ffd700; font-weight: bold; text-shadow: 0 0 5px #ffd700; }
.res-champ-2 { color: #c0c0c0; font-weight: bold; }
.res-champ-3 { color: #cd7f32; font-weight: bold; } /* Bronce */

/* Estilos VIP / Premium */
.card-premium {
    border-top: 5px solid #ffd700 !important;
}
.card-standard {
    border-top: 5px solid var(--accent);
}

.avatar-premium {
    border-color: #ffd700 !important;
}
.avatar-standard {
    border-color: var(--accent);
}

.row-premium {
    background: rgba(255, 215, 0, 0.05);
}

.text-premium {
    color: #ffd700 !important;
}
.text-white {
    color: white !important;
}

/* Ajuste para avatar en ranking */
.ranking-avatar {
    width: 35px; 
    height: 35px; 
    border-radius: 50%; 
    border: 2px solid transparent; /* Por defecto transparente */
}

/* Comentarios y Reacciones */
.post-actions {
    border-top: 1px solid #333;
    padding-top: 10px;
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.reaction-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    transition: 0.2s;
}
.reaction-btn:hover, .reaction-active {
    color: var(--accent);
    transform: scale(1.2);
}

.comments-section {
    background: #151515;
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.comment-item {
    border-bottom: 1px solid #222;
    padding: 5px 0;
}

.comment-input {
    width: 100%;
    background: #222;
    border: none;
    padding: 8px;
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Bitácora / Maintenance */
.maint-card {
    border-left: 4px solid var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.maint-action {
    background: #333;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #ccc;
}

/* Marketplace Placeholder */
.coming-soon {
    text-align: center;
    padding: 50px;
    border: 2px dashed #444;
    border-radius: 20px;
}

/* Sub-navegación del Ranking */
.ranking-subnav {
    margin-top: 10px; 
    font-size: 0.8rem; 
    text-align: center;
}

.ranking-sublink {
    color: white; 
    margin: 0 10px; 
    text-decoration: none;
    transition: 0.3s;
}

.ranking-sublink:hover {
    color: var(--accent);
}

/* Estado activo del link */
.ranking-sublink.active {
    text-decoration: underline; 
    color: var(--accent);
    font-weight: bold;
}

/* Reacciones estilo Facebook */
.reaction-counts {
    display: flex;
    gap: 5px;
    margin-left: auto; /* Empuja a la derecha */
}

.reaction-badge {
    background: #252525;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ccc;
}

/* Botón Editar Avatar (Lápiz) */
.avatar-container {
    position: relative;
    display: inline-block;
}

.edit-avatar-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--accent);
    color: white;
    border: 2px solid #1a1a1a;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s;
    list-style: none; /* Quita el triángulo de details/summary */
}

.edit-avatar-btn:hover {
    transform: scale(1.1);
    background: white;
    color: var(--accent);
}

/* Ocultar triángulo default del details en Chrome/Safari */
details > summary {
    list-style: none;
}
details > summary::-webkit-details-marker {
    display: none;
}

/* Animación del menú de avatares */
.avatar-menu {
    margin-top: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}