:root {
    --bg-color: #1e2125; /* Gris oscuro suave */
    --card-bg-color: #2b3035; /* Gris un poco más claro para las tarjetas */
    --text-color: #FFFFFF; /* Blanco roto para el texto */
    --primary-color: #61afef; /* Azul claro para acentos y botones */
    --primary-dark: #3b8ac4;
    --secondary-color: #98c379; /* Verde para la barra de versatilidad */
    --border-color: #444;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --font-family: 'Montserrat', sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* ===== Estilos para el Encabezado ===== */
.header {
    background-color: #1a1a1a;
    color: #f5f5f5;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border-bottom: 2px solid #ffcc00;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffcc00;
}
.logo-container h1 {
    font-size: 1.8rem;
    margin: 0;
    color: #ffcc00;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.nav a {
    color: #f5f5f5;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.2s ease;
    padding: 8px 12px;
    border-radius: 6px;
}

/* 🟢 HOVER en los enlaces de navegación */
.nav a:hover {
       color: #ffcc00;
    transform: translateY(-2px);
    background: rgba(255, 204, 0, 0.1);
}

.container {
    padding: 20px 50px;
}

.main-content {
    display: flex;
    gap: 30px;
}

.section-left, .section-right {
    background-color: var(--card-bg-color);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.section-left {
    flex: 0 0 30%;
}

.section-right {
    flex: 1;
}

/* --- ESTILOS DE BOTONES DE FILTRO GENERAL --- */
.filter-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 10px;
}

.filter-buttons button {
    background-color: var(--primary-color);
    color: black;
    border: none;
    padding: 10px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* 🟢 HOVER en los botones de filtro */
.filter-buttons button:hover {
    background-color: black;
    color: white;
    transform: translateY(-2px);
}

.filter-buttons button.active {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Estilos para los botones de rol en la sección 1 (galería) */
#role-buttons-gallery button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    width: 80px;
    height: 80px;
}

#role-buttons-gallery button img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    margin-bottom: 5px;
}

#role-buttons-gallery button span {
    font-size: 1.2em;
    text-align: center;
}

/* Estilos para los botones de rol en la sección 2 (tabla) */
#role-buttons-table {
    display: flex;
    gap: 10px;
    margin-bottom: 1px;
    width: 100%;
    justify-content: space-between;
}

#role-buttons-table button {
    display: flex;
    align-items: center;
    padding: 5px 5px;
    flex: 1;
    justify-content: center;
}

#role-buttons-table button img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    margin-right: 8px;
}

#role-buttons-table button span {
    font-size: 1.5em;
}

/* Galería */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
}

.hero-card {
    text-align: center;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 🟢 HOVER en las tarjetas de héroes */
.hero-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px var(--shadow-color);
}

.hero-card img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
}

.hero-card h4 {
    font-size: 0.6em;
    margin: 5px 0 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    color: var(--text-color);
}

/* Tabla */
.table-container {
    overflow-x: auto;
}

.heroes-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.9em;
}

.heroes-table th, .heroes-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: center;
    vertical-align: middle;
}

.heroes-table th {
    background-color: var(--primary-color);
    color: black;
    font-weight: 600;
}

.heroes-table tr:nth-child(even) {
    background-color: var(--bg-color);
}

/* 🟢 HOVER en las filas de la tabla */
.heroes-table tbody tr:hover {
    background-color: rgba(97, 175, 239, 0.2);
    cursor: pointer;
}

/* Imágenes de la tabla - Héroe, Rol, Línea */
.heroes-table td img {
    height: 40px;
    width: 40px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 8px;
}

/* Estilo específico para la imagen del héroe en la tabla (ahora cuadrada) */
.heroes-table td:first-child img {
    border-radius: 8px;
}

/* Estilos específicos para las imágenes de counters con borde dorado */
.heroes-table td:last-child .flex-row img {
    height: 35px;
    width: 35px;
    border-radius: 50%;
    transition: transform 0.2s ease;
    border: 2px solid gold;
}

/* 🟢 HOVER en las imágenes de los counters */
.heroes-table td:last-child .flex-row img:hover {
    transform: scale(1.1);
}

/* Ajuste para que los counters no se salten de línea */
.flex-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flex-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

.versatility-bar {
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    height: 20px;
    width: 100px;
    position: relative;
}

.versatility-bar-fill {
    height: 100%;
    background-color: var(--secondary-color);
    text-align: right;
    padding-right: 5px;
    box-sizing: border-box;
    font-size: 15px;
    color: black;
    line-height: 20px;
    transition: width 0.5s ease-in-out;
}
/* Estilos para los botones de filtro en estado normal */
.filter-buttons button {
    background-color: var(--primary-color);
    color: black;
    border: 2px solid transparent;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, border-color 0.3s ease;
}

/* 🟢 Efecto al pasar el mouse (hover) */
.filter-buttons button:hover {
    background-color: var(--primary-dark);
    color: var(--text-color);
    transform: translateY(-2px);
    border-color: var(--primary-dark);
}

/* ✅ Efecto al hacer clic y dejarlo "activo" (¡Ahora en verde!) */
.filter-buttons button.active {
    background-color: var(--secondary-color); /* Fondo verde */
    color: black; /* Texto en negro para un buen contraste */
    border: 2px solid gold; /* Borde dorado al estar seleccionado */
}
/* Para centrar el contenedor del título y el párrafo */
.main-title-container {
    width: 70%; /* Define un ancho para que el `margin: auto` funcione */
    margin: 0 auto; /* Centra el bloque horizontalmente */
    text-align: center; /* Centra el texto dentro del bloque */
    padding: 2px;
}

/* ===== MEDIA QUERIES RESPONSIVE ===== */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 20px 30px;
    }
    
    .main-content {
        gap: 20px;
    }
    
    .section-left {
        flex: 0 0 35%;
    }
}

/* Tablets pequeñas y móviles grandes (600px - 768px) */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .logo-container {
        justify-content: center;
    }
    
    .logo {
        width: 70px;
        height: 70px;
    }
    
    .logo-container h1 {
        font-size: 1.5rem;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .nav a {
        margin-left: 0;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .container {
        padding: 15px 20px;
    }
    
    .main-title-container {
        width: 90%;
    }
    
    .main-title-container h1 {
        font-size: 1.4rem;
    }
    
    .main-title-container p {
        font-size: 0.9rem;
    }
    
    .main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .section-left, .section-right {
        width: 100%;
        flex: none;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }
    
    .hero-card img {
        width: 40px;
        height: 40px;
    }
    
    .hero-card h4 {
        font-size: 0.6rem;
    }
    
    #role-buttons-gallery button {
        width: 70px;
        height: 70px;
    }
    
    #role-buttons-gallery button img {
        width: 35px;
        height: 35px;
    }
    
    #role-buttons-gallery button span {
        font-size: 0.7rem;
    }
}

/* Móviles (480px - 600px) */
@media (max-width: 600px) {
    .header {
        padding: 12px 15px;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .logo-container h1 {
        font-size: 1.3rem;
    }
    
    .nav a {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .container {
        padding: 10px 15px;
    }
    
    .main-title-container {
        width: 95%;
    }
    
    .main-title-container h1 {
        font-size: 1.2rem;
    }
    
    .main-title-container p {
        font-size: 0.8rem;
    }
    
    .section-left, .section-right {
        padding: 15px;
    }
    
    .version-filters h3,
    .role-filters h3 {
        font-size: 0.9rem;
    }
    
    .filter-buttons {
        gap: 6px;
    }
    
    .filter-buttons button {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 6px;
    }
    
    .hero-card {
        padding: 5px;
    }
    
    .hero-card img {
        width: 35px;
        height: 35px;
    }
    
    .hero-card h4 {
        font-size: 0.55rem;
    }
    
    #role-buttons-gallery button {
        width: 60px;
        height: 60px;
    }
    
    #role-buttons-gallery button img {
        width: 30px;
        height: 30px;
    }
    
    #role-buttons-gallery button span {
        font-size: 0.65rem;
    }
    
    #role-buttons-table button {
        padding: 6px 8px;
    }
    
    #role-buttons-table button img {
        width: 30px;
        height: 30px;
        margin-right: 5px;
    }
    
    #role-buttons-table button span {
        font-size: 0.75rem;
    }
    
    .heroes-table {
        font-size: 0.8rem;
    }
    
    .heroes-table th, 
    .heroes-table td {
        padding: 8px 6px;
    }
    
    .heroes-table td img {
        height: 30px;
        width: 30px;
    }
}

/* Móviles pequeños (menos de 480px) */
@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .logo {
        width: 50px;
        height: 50px;
    }
    
    .logo-container h1 {
        font-size: 1.1rem;
    }
    
    .nav {
        gap: 5px;
    }
    
    .nav a {
        font-size: 0.75rem;
        padding: 5px 8px;
    }
    
    .container {
        padding: 8px 10px;
    }
    
    .main-title-container h1 {
        font-size: 1.1rem;
    }
    
    .main-title-container p {
        font-size: 0.75rem;
    }
    
    .section-left, .section-right {
        padding: 12px;
    }
    
    .filter-buttons {
        gap: 4px;
    }
    
    .filter-buttons button {
        padding: 6px 8px;
        font-size: 0.75rem;
        min-width: 50px;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 5px;
    }
    
    .hero-card img {
        width: 30px;
        height: 30px;
    }
    
    .hero-card h4 {
        font-size: 0.5rem;
    }
    
    #role-buttons-gallery button {
        width: 55px;
        height: 55px;
    }
    
    #role-buttons-gallery button img {
        width: 25px;
        height: 25px;
    }
    
    #role-buttons-gallery button span {
        font-size: 0.6rem;
    }
    
    .table-container {
        overflow-x: auto;
        margin: 0 -8px;
        padding: 0 8px;
    }
    
    .heroes-table {
        min-width: 700px;
        font-size: 0.75rem;
    }
    
    .heroes-table th {
        font-size: 0.7rem;
        padding: 6px 4px;
    }
    
    .heroes-table td {
        padding: 6px 4px;
    }
}

/* Ajuste para la tabla en todos los móviles */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 5px;
    }
    
    .heroes-table {
        min-width: 800px;
    }
}
/* Estilos para el selector de rooms - RESPONSIVE */
.room-selector {
    position: relative;
    display: inline-block;
    width: auto; /* Cambiado de 100% a auto */
    max-width: 250px;
    min-width: 180px; /* Ancho mínimo para mantener legibilidad */
}

.room-selector select {
    background-color: #1a1a2e;
    color: white;
    padding: 8px 16px; /* Reducido padding para hacerlo más compacto */
    border: 1px solid #333;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px; /* Tamaño normal para desktop */
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 35px;
    width: 100%;
    min-height: 40px; /* Reducido ligeramente */
}

.room-selector::after {
    content: "▼";
    font-size: 10px; /* Reducido para mejor proporción */
    color: white;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.room-selector select:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.2);
}

.room-selector select option {
    background-color: #1a1a2e;
    color: white;
    padding: 10px;
    font-size: 14px;
}

.room-selector select option[value=""] {
    color: #888;
}

/* Media Queries para Responsive */
@media (max-width: 768px) {
    .room-selector {
        max-width: 200px; /* Máximo más pequeño en tablets */
        margin: 0; /* Sin margen vertical */
        min-width: 160px; /* Mínimo más pequeño */
    }
    
    .room-selector select {
        font-size: 14px; /* Mantener tamaño consistente */
        padding: 10px 14px;
        min-height: 42px;
    }
    
    .room-selector::after {
        right: 10px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .room-selector {
        max-width: 180px; /* Aún más pequeño en móviles */
        min-width: 140px;
    }
    
    .room-selector select {
        font-size: 13px; /* Un poco más pequeño en móviles muy pequeños */
        padding: 8px 12px;
        min-height: 40px;
    }
    
    .nav {
        flex-wrap: wrap; /* Permitir que los elementos se envuelvan */
        gap: 8px;
        justify-content: center; /* Centrar los elementos */
    }
    
    .room-selector {
        order: 1; /* Opcional: controlar el orden si es necesario */
    }
}

/* Estilos para mejorar la experiencia táctil */
@media (hover: none) and (pointer: coarse) {
    .room-selector select {
        font-size: 14px;
        padding: 10px 15px;
        min-height: 44px; /* Buen tamaño para dedos */
    }
    
    .room-selector::after {
        right: 15px;
        font-size: 12px;
    }
}

/* Asegurar que el nav mantenga los elementos en línea */
.nav {
    display: flex;
    align-items: center;
    gap: 20px; /* Espacio entre elementos */
    flex-wrap: wrap; /* Permitir wrap solo cuando sea necesario */
}

/* Para pantallas muy pequeñas donde el wrap es inevitable */
@media (max-width: 360px) {
    .nav {
        gap: 5px;
    }
    
    .room-selector {
        max-width: 150px;
        min-width: 130px;
    }
    
    .room-selector select {
        font-size: 12px;
        padding: 6px 10px;
    }
}