/* --- 1. VARIABLES Y RESET --- */
:root {
    --azul-fondo: #99C0E1;
    --rosa-retro: #EFA7B9;
    --azul-oscuro: #8cb1d0;
}

body {
    background-color: var(--azul-fondo);
    color: #ffffff;
    font-family: 'VT323', monospace;
    margin: 0; padding: 0;
    display: flex; flex-direction: column; align-items: center;
}

.wrapper-exterior {
    width: 100%;
    max-width: 1000px;
    display: flex; flex-direction: column; align-items: center; 
    margin-top: 30px;
}

/* --- 2. TIPOGRAFÍAS Y RENDERIZADO (Pixel Art Clean) --- */
h1, h2, .subtitulo-retro, #nombre {
    font-family: 'Press Start 2P', cursive;
    text-shadow: 2px 2px 0px white;
    color: var(--rosa-retro);
    text-align: center;
    -webkit-font-smoothing: none;
    image-rendering: pixelated;
    line-height: 1.2;
}

.subtitulo-torneo {
    font-family: 'Press Start 2P', cursive;
    text-shadow: 2px 2px 0px white;
    color: #627b90;
    text-align: center;
    -webkit-font-smoothing: none;
    image-rendering: pixelated;
    line-height: 1.2;
    font-size: clamp(0.9rem, 2.5vw, 1.2rem); 
}

h1 {
    font-size: clamp(1.2rem, 5vw, 4rem);
    letter-spacing: 2px;
    margin: 0;
}

h2 { 
    font-size: clamp(1rem, 2.5vw, 1.4rem); 
    margin: 20px 0 40px 0;
    width: 100%;
}

.subtitulo-retro { 
    font-size: clamp(0.8rem, 3vw, 1rem);
    margin: 40px 0 20px 0; 
}

#nombre {
    margin: 10px 0 20px 0;
    padding-top: 5px;
}

p {
    font-size: 1.2rem; 
    line-height: 1.2;  
    text-align: justify;
    hyphens: auto;    
    margin-bottom: 20px;
}

.descripcion-evento p {
    width: 90%;        
    margin: 0 auto 20px auto;
}

/* --- 3. COMPONENTES GLOBALES (Nav, Portada, Footer) --- */
.contenedor-portada {
    position: relative;
    width: 100%;
    max-width: 1000px;
}

.texto-portada {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    width: 100%;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.portada {
    width: 100%;    
    display: block;
    padding: 10px;
    box-sizing: border-box;
    margin-bottom: 0;
}

.nav {
    width: 90%; 
    max-width: 1000px;
    display: flex;
    justify-content: center; 
    align-items: center;     
    gap: 20px;               
    margin: 20px auto;      
    padding: 15px 0;
    border-top: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    flex-wrap: wrap;         
}

.nav-link {
    font-family: 'Press Start 2P', cursive;
    font-size: clamp(0.6rem, 2vw, 0.8rem); 
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
    text-align: center;
    padding: 5px 10px;       
}

.nav-link:hover, .nav-link.active {
    color: #EFA7B9; 
    text-shadow: 2px 2px 0px rgb(255, 255, 255);
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 30px;
    justify-content: center;
}

.nav-item {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #8cb1d0;
    border: 2px solid #ffffff;
    border-radius: 8px;
    list-style: none;
    padding: 10px 0;
    min-width: 180px;
    z-index: 100;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.dropdown-menu li a {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: #ffffff;
    text-decoration: none;
    display: block;
    padding: 8px 20px;
    transition: background 0.3s;
}

.dropdown-menu li a:hover {
    background-color: #EFA7B9;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.footer { padding: 40px 0; text-align: center; }

/* --- 4. ESTILOS ESPECÍFICOS: SELECTOR / POKÉDEX --- */
.main-container {
    display: flex; flex-direction: column; align-items: center;
    width: 90%; max-width: 800px; text-align: center;
    background: #8cb1d0; padding: 20px; border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

#selector {
    width: 70%; padding: 12px; background-color: #333; color: white;
    border: 2px solid #EFA7B9; border-radius: 8px;
    font-family: 'VT323'; font-size: 1.1rem; margin-bottom: 30px;
}

.contenedor-escena { position: relative; width: 400px; aspect-ratio: 1 / 1; margin: 0 auto 20px auto; }
.foto-persona {
    position: absolute; top: 30%; left: 15%;
    width: 30%; height: 30%; object-fit: cover; z-index: 1;
    transition: opacity 0.4s;
}
.foto-persona.cambiando { opacity: 0; }
.imagen-marco { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }

.pantalla-datos {
    position: absolute; top: 32.5%; left: 62.5%; width: 20%; height: 15%;
    z-index: 3; display: flex; align-items: center; justify-content: center; padding: 5px;
}
#texto-datos { font-family: 'VT323'; font-size: 0.8rem; color: #46F051; text-shadow: 0 0 5px #00ff00; margin: 0; line-height: 1;  text-align: center; text-align-last: center; letter-spacing: -1px; }

#info { display: none; background: #7695ae; padding: 20px; border-radius: 15px; width: 95%; box-shadow: 0 1px 1px rgba(0,0,0,0.5); margin-top: 20px; }
#descripcion { font-size: 1.3rem; line-height: 1.2; margin: 15px 0; }

.pokedex-wrapper {
    display: none; 
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
}

.btn-pokedex {
    background: #EFA7B9;
    border: 3px solid white;
    border-radius: 50%;
    color: white;
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2rem;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 0 white;
    z-index: 10;
    flex-shrink: 0;
}

#prevBtn { margin-right: -25px; }
#nextBtn { margin-left: -25px; }

.btn-pokedex:hover { transform: translateY(-2px); box-shadow: 0 6px 0 white; }
.btn-pokedex:active { transform: translateY(2px); box-shadow: 0 0px 0 white; }

/* --- ESTADÍSTICAS TORNEOS --- */

#stats-combate {
    margin: 10px auto 20px auto;
    width: 90%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border: 2px solid var(--rosa-retro);
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-item span {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    color: var(--rosa-retro);
    margin-bottom: 5px;
}

.stat-item strong {
    font-family: 'VT323', monospace;
    font-size: 1.5rem;
    color: #46F051; /* Verde neón */
}

.contenedor-puntos-retro {
    text-align: center !important;
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.medinacoins-display {
    display: flex;
    align-items: center;
    gap: 8px; /* Espacio entre el icono y el texto */
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.icon-coin-small {
    width: 24px;  /* Tamaño pequeño para que no rompa el diseño */
    height: 24px;
    image-rendering: pixelated; /* Mantiene el estilo retro si es pixel art */
    object-fit: contain;
}

/* --- LOGROS --- */
.logros-grid {
    display: flex; flex-wrap: wrap;
    gap: 15px; width: 100%; margin-bottom: 30px; justify-content: center;
}

.logro {
    background: #EFA7B9; border: 3px solid white; border-radius: 15px; padding: 10px; width: 140px;
    display: flex; flex-direction: column; align-items: center; text-align: center; transition: transform 0.2s;
}
.logro:hover { transform: scale(1.05); }
.logro img { width: 50px; height: 50px; object-fit: contain; margin-bottom: 8px; }
.logro-texto strong { font-family: 'Press Start 2P'; font-size: 0.5rem; color: white; display: block; margin-bottom: 5px; }
.logro-texto p { font-size: 0.9rem; color: white; margin: 0; line-height: 1.1; }

/* --- 5. ESTILOS ESPECÍFICOS: GALERIA FOTOS Y PARTICIPANTES --- */
.carrusel-minimalista { display: flex; align-items: center; margin: 20px 0 40px; }
        
.carrusel-escena { width: 100%; overflow: hidden; }

.carrusel-track { display: flex; transition: transform 0.5s ease; gap: 15px; }

.carrusel-track img {
    width: calc(33.33% - 10px); height: 180px;
    object-fit: cover; border: 3px solid white; border-radius: 8px; flex-shrink: 0;
}

.flecha-retro {
    background: none; border: none; color: white;
    font-size: 2.5rem; cursor: pointer; padding: 0 15px;
}

.flecha-retro:hover { color: #EFA7B9; transform: scale(1.2); }

.boton-album-contenedor { display: flex; justify-content: center; margin: 30px 0 60px; }

.boton-retro {
    font-family: 'Press Start 2P', cursive; font-size: 0.8rem;
    color: white; background: #EFA7B9; text-decoration: none;
    padding: 15px 25px; border: 3px solid white; border-radius: 8px;
    display: inline-block; box-shadow: 0 4px 0px white;
}

.boton-retro:hover { transform: translateY(-3px); box-shadow: 0 7px 0px white; }

.grid-participantes {
    display: grid !important;
    gap: 20px; 
    margin-top: 20px;
    width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}


#lista-participantes a {
    text-decoration: none;
    color: #ffffff;
    display: block;
    width: 100%;
}

.card-participante span {
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    color: #ffffff;
    text-align: center;
}

.card-participante {
    display: flex; flex-direction: column; align-items: center;
    background: #7695ae; padding: 10px; border: 2px solid white; border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.card-participante img {
    width: 80px; height: 80px; object-fit: cover;
    border-radius: 50%; border: 2px solid white; margin-bottom: 10px;
}

.card-participante:hover {
    transform: translateY(-5px);
    background: #EFA7B9;
}

.galeria-evento {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;
    margin-top: 30px;
}

.item-galeria {
    text-decoration: none;
    color: inherit;
    display: block;
}

figure {
    margin: 0;
    padding: 10px;
    background: #EFA7B9;
    border: 2px solid #ffffff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

figure:hover {
    border-color: #EFA7B9;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(239, 83, 80, 0.3);
}

.img-evento {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

figcaption {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem; 
    color: #ffffff;
    margin-top: 15px;
    text-align: center;
    line-height: 1.4;
}

/* --- 6. ESTILOS ESPECÍFICOS: TORNEO --- */
.mesas-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    width: 100%;
}

.mesa-card {
    box-sizing: border-box; 
    flex: 0 0 calc(33.33% - 20px); 
    
    background: #7695ae;
    border: 3px solid white;
    border-radius: 12px;
    overflow: hidden;
}

.mesa-header {
    background-color: #627b90;
    padding: 10px;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.8rem;
    border-bottom: 2px solid white;
    text-align: center;
}

.mesa-card:last-child:nth-child(odd) {
    grid-column: 1 / span 2; 
    margin-left: auto;
    margin-right: auto;
    width: calc(50% - 20px); 
}

.jugador-torneo-item {
    display: flex;
    align-items: center;
    gap: 50px;
    padding: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.foto-mini-torneo {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.nombre-jugador {
    font-family: 'VT323', monospace;
    font-size: 1.6rem;
}

.info-jugador {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}


.pasa-ronda {
    background: rgba(70, 240, 81, 0.3);
    border-left: 5px solid #46F051;
}

.posicion {
    background: white;
    color: var(--rosa-retro);
    padding: 0 5px;
    font-size: 0.7rem;
    font-family: 'Press Start 2P';
    margin-bottom: 4px;
    border-radius: 3px;
}

.torneo-individual-wrapper {
    margin-bottom: 60px;
    width: 100%;
}

.filtros-torneo {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-filtro {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 10px 15px;
    background-color: #333;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.2s;
    image-rendering: pixelated;
}

.btn-filtro:hover {
    background-color: var(--rosa-retro);
    transform: translateY(-2px);
}

.btn-filtro.active {
    background-color: var(--rosa-retro);
    box-shadow: 0 4px 0px white;
    transform: translateY(-2px);
}

/* Estilo para el ganador del torneo */
.ganador-absoluto {
    background: rgba(70, 240, 81, 0.4) !important; /* Verde más intenso */
    border-left: 8px solid #46F051 !important;
    position: relative;
    overflow: hidden;
}

.ganador-absoluto::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 0 15px rgba(70, 240, 81, 0.5);
    pointer-events: none;
}

.label-ganador {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    color: #46F051;
    margin-top: 5px;
    display: block;
    text-shadow: 1px 1px 0px black;
}

.ganador-absoluto .foto-mini-torneo {
    border-color: #fff;
}

/* Título con fecha y estado */
.torneo-header-centrado {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    margin-bottom: 30px;
    gap: 15px;
}

.torneo-meta-datos {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px; 
    width: 100%;
}

.badge-fecha {
    font-family: 'VT323', monospace;
    font-size: 0.8rem;
    color: #fff;
    background: #627b90;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(153, 192, 225, 0.3);
}

.badge-estado {
    padding: 5px 15px;
    font-size: 0.8rem;
    border-radius: 4px;
    font-weight: bold;
}

.estado-inscripcion {
    background-color: #46F051; /* Verde neón */
    color: #000;
}

.estado-curso {
    background-color: #f1c40f; /* Amarillo */
    color: #000;
}

.estado-finalizado {
    background-color: #e74c3c; /* Rojo */
}

.estado-generico {
    background-color: #95a5a6; /* Gris */
}

.seccion-inscritos {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lista-mini-inscritos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.foto-inscrito-mini {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
    background: #333;
}

.aviso-inscripcion {
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    color: #627b90;
    margin-top: 15px;
    text-align: center;
}

/* HALL OF FAME */
#hallOfFame {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: 'VT323', monospace;
    font-size: 1.6rem;
    color: #ffffff;
}

#hallOfFame thead th {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    background-color: #627b90; /* Azul más oscuro para cabeceras */
    color: #ffffff;
    padding: 15px 10px;
    cursor: pointer;
    border-bottom: 3px solid white;
    transition: all 0.2s;
    text-transform: uppercase;
}

#hallOfFame thead th:first-child { border-radius: 8px 0 0 0; }
#hallOfFame thead th:last-child { border-radius: 0 8px 0 0; }

#hallOfFame thead th:hover {
    background-color: var(--rosa-retro);
    color: white;
}

#hallOfFame td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    background-color: rgba(255, 255, 255, 0.05);
}

#hallOfFame tr:last-child td:first-child { border-radius: 0 0 0 8px; }
#hallOfFame tr:last-child td:last-child { border-radius: 0 0 8px 0; }

/* Estilo para las filas al pasar el ratón */
#hallOfFame tbody tr:hover td {
    background-color: rgba(239, 167, 185, 0.2); /* Rosa muy suave */
}

/* El líder de la tabla */
#hallOfFame tbody tr:first-child td {
    color: #ffff00;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}



.col-nombre {
    text-align: left !important;
    padding-left: 20px !important;
    font-family: 'VT323', monospace;
    color: #ffffff;
}

.sort-icon {
    display: inline-block;
    width: 15px;
    margin-left: 5px;
    font-size: 0.7rem;
    color: var(--rosa-retro);
    text-shadow: 1px 1px 0px white;
}

/* --- TIPOS DE MESA (GANADORES / CONSOLACIÓN-PERDEDORES) --- */
/* El badge de texto es neutro, igual para cualquier tipo de mesa */
.subcabecera-tipo-mesa {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.65rem;
    text-align: center;
    padding: 8px 14px;
    margin: 15px auto 15px auto;
    border-radius: 6px;
    width: fit-content;
    max-width: 90%;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* La única diferenciación visual es el color del ganador de la mesa de consolación/perdedores */
.ganador-consolacion {
    background: rgba(255, 107, 107, 0.35) !important;
    border-left: 8px solid #FF6B6B !important;
}

.label-ganador-consolacion {
    color: #FF6B6B !important;
}

/* --- 6. RESPONSIVE --- */
@media (max-width: 600px) {
    .nav-list { flex-direction: column; gap: 10px; }
    .dropdown-menu { position: static; transform: none; width: 100%; margin-top: 10px; }
    .dropdown:active .dropdown-menu { display: block; }
            
    .carrusel-track img { width: 100%; }
    .flecha-retro { font-size: 1.8rem; padding: 0 5px; }
            
    .boton-retro { font-size: 0.65rem; padding: 12px 20px; }
            
    h1 { font-size: 1.5rem; }

    .galeria-evento { grid-template-columns: 1fr;}
    .contenedor-escena { transform: scale(0.8); margin: -40px 0; }
    .logros-grid { grid-template-columns: 1fr 1fr; }
    .logro { width: 120px; }
    #selector { width: 90%; }
    #texto-datos { font-size: 0.65rem; }
    .pokedex-wrapper { max-width: 100%; }
    #prevBtn { margin-right: -10px; }
    #nextBtn { margin-left: -10px; }
    .mesas-grid { grid-template-columns: 1fr; }
    .subcabecera-tipo-mesa { font-size: 0.55rem; padding: 6px 10px; }
    .mesa-card:last-child:nth-child(odd) { grid-column: auto; width: 100%; margin: 0; }
    .mesa-card {
        flex: 0 0 100%;
        width: 100%;
    }
    #hallOfFame { font-size: 1.2rem; }
    #hallOfFame thead th { font-size: 0.45rem; padding: 10px 5px; }
}