@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ffd700;
    /* Dorado anime */
    --secondary: #1a1a2e;
    --accent: #00a8cc;
    --text-light: #ffffff;
    --text-dark: #111111;
    --panel-bg: rgba(26, 26, 46, 0.85);
    --panel-border: rgba(255, 255, 255, 0.2);
    --btn-hover: rgba(255, 255, 255, 0.15);
}

body {
    font-family: "Inter", sans-serif;
    background-color: #f0f0f0;
    overflow-x: hidden;
}

.container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url(../IMG/FondoOriginal.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

/* Logo */
.logo {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

.logo img {
    height: auto;
    width: 35rem;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

/* Panel principal */
.panelCompleto {
    display: flex;
    gap: 3rem;
    z-index: 10;
    margin-top: 40px;
}

/* Panel izquierdo */
.left-panel {
    text-align: center;
    max-width: 280px;
    font-family: "Montserrat", sans-serif;
}

.avatar-container {
    position: relative;
    margin-bottom: 20px;
}

.avatar {
    width: 13rem;
    height: 13rem;
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    object-fit: cover;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.avatar-grid img {
    max-width: 8rem;
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    object-fit: cover;
}

.edit-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: var(--primary);
    color: var(--secondary);
    border: none;
    border-radius: 50%;
    width: 30px;
    /* Tamaño reducido */
    height: 30px;
    /* Tamaño reducido */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    /* Tamaño de fuente reducido */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.name-input,
.room-code-input {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 30px;
    color: var(--text-light);
    font-family: "Montserrat", sans-serif;
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: border 0.3s ease;
}

.name-input,
.room-code-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.name-input:focus,
.room-code-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.room-code-input {
    margin-bottom: 10px;
}

.left-panel label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 16px;
    color: #e8e8e8;
}

/* Panel derecho */
.right-panel {
    padding: 24px;
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    font-family: "Montserrat", sans-serif;
}

.right-panel h3,
.lbl-room-code {
    color: #e8e8e8;
}

.panel-header {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.btn-create,
.btn-join {
    flex: 1;
    padding: 12px 16px;
    border-radius: 30px;
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-create:hover,
.btn-join:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
}

.btn-create:active,
.btn-join:active {
    transform: translateY(0);
}

.instructions {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 16px 0;
    line-height: 1.5;
}

.game-modes {
    margin: 16px 0;
}

.mode-btn {
    width: 100%;
    padding: 14px;
    margin: 8px 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 40px;
    background: transparent;
    color: var(--text-light);
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 215, 0, 0.05);
}

.mode-btn.active {
    background: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
    font-weight: 800;
}

.dificultad-selector label {
    color: white;
    font-weight: 800;
}


/* Botones animados */
.button-crear {
    /* Variables */
    --button_radius: 0.75em;
    --button_color: #e8e8e8;
    --button_outline_color: #000000;
    margin-top: 5px;
    width: 100%;
    font-size: 17px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    border-radius: var(--button_radius);
    background: var(--button_outline_color);
    font-family: "Montserrat", sans-serif;
}

.button_top {
    display: block;
    box-sizing: border-box;
    border: 2px solid var(--button_outline_color);
    border-radius: var(--button_radius);
    padding: 0.75em 1.5em;
    background: var(--primary);
    color: var(--button_outline_color);
    transform: translateY(-0.2em);
    transition: transform 0.1s ease;
}

.button-crear:hover .button_top {
    /* Pull the button upwards when hovered */
    transform: translateY(-0.33em);
}

.button-crear:active .button_top {
    /* Push the button downwards when pressed */
    transform: translateY(0);
}

.contenedor-jugar {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}



.button_top_jugar {
    display: block;
    box-sizing: border-box;
    border: 2px solid var(--button_outline_color);
    border-radius: var(--button_radius);
    padding: 0.75em 1.5em;
    background: #2196F3;
    color: var(--button_outline_color);
    transform: translateY(-0.2em);
    transition: transform 0.1s ease;
    font-family: "Montserrat", sans-serif;
    font-size: 15px;
}

.button-crear:hover .button_top_jugar {
    /* Pull the button upwards when hovered */
    transform: translateY(-0.33em);
}

.button-crear:active .button_top_jugar {
    /* Push the button downwards when pressed */
    transform: translateY(0);
}

/* Toast elegante */
#toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Open Sans', sans-serif;
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-width: 90%;
    text-align: center;
}

#toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Selector de idioma en la esquina inferior derecha */
.lang-selector {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(26, 26, 46, 0.8);
    padding: 10px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-selector select {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    cursor: pointer;
    min-width: 120px;
}

.lang-selector select option {
    background: #333;
}

.btn-help-css {
    width: auto;
    padding: 0;
    background: transparent;
    border: none;
}

/* Botones top right */
.top-right {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 20;
    /* Asegura que esté encima de todo */
    background: rgba(26, 26, 46, 0.7);
    /* Fondo semitransparente */
    padding: 8px;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-btn,
.settings-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(10px);
}

.social-btn:hover,
.settings-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-2px);
    color: var(--primary);
    border-color: var(--primary);
}

/* Estilos generales del modal */
.modal {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    padding: 20px;
}

/* Cuando el modal esté visible, usar flexbox para centrar */
.modal[style*="display: block"],
.modal.show {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #121212;
    border: 2px solid #ffffff;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
    position: relative;
    /* Eliminar margin: 0 auto; ya que flex se encarga del centrado */
}

.modal-content-avatares {
    background-color: #121212;
    border: 2px solid #ffffff;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 650px;
    box-sizing: border-box;
    color: white;
    font-family: Arial, sans-serif;
    text-align: center;
    position: relative;
    /* Eliminar margin: 0 auto; ya que flex se encarga del centrado */
}

.modal-content h2 {
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 12px;
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
}

.modal-content p {
    font-size: 14px;
    margin: 8px 0 16px;
    font-family: "Montserrat", sans-serif;
    font-weight: 500;
}

.modal-content ol {
    text-align: left;
    padding-left: 20px;
    margin: 16px 0;
    font-size: 16px;
    line-height: 1.6;
}

.modal-content ol li {
    margin-bottom: 8px;
    font-family: "Montserrat", sans-serif;
    font-weight: 500;
}

.modal-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary);
    /* Color gris claro como en la imagen */
    color: black;
    border: none;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-btn:hover {
    background-color: #5a6268;
    color: #e8e8e8;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
}

.close:hover {
    color: #ccc;
}

/* SALA.php */

.salaMain {
    height: 100vh;
    background-image: url(../IMG/FondoOriginal.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    font-family: "Montserrat", sans-serif;
    padding: 20px;
}

.info {
    font-size: 1.5rem;
    margin: 2rem 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button-crear-sala {
    /* Variables */
    --button_radius: 0.75em;
    --button_color: #e8e8e8;
    --button_outline_color: #000000;
    margin-top: 5px;
    /* width: 50%; */
    font-size: 17px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    border-radius: var(--button_radius);
    background: var(--button_outline_color);
    font-family: "Montserrat", sans-serif;
}






.sala-espera-contenedor {
    display: flex;
    justify-content: space-between;
}


.sala-espera-text {
    display: flex;
    flex-direction: column;
}


.button_top_jugar-sala {
    display: block;
    box-sizing: border-box;
    border: 2px solid var(--button_outline_color);
    border-radius: var(--button_radius);
    padding: 0.75em 1.5em;
    transform: translateY(-0.2em);
    transition: transform 0.1s ease;
}



.btn-sala1 {
    background: var(--primary);
    color: var(--button_outline_color);
}

.btn-sala2 {
    background-color: #007bff;
    color: var(--button_outline_color);
}

.btn-sala3 {
    background-color: red;
    color: var(--button_outline_color);
    display: block;
    box-sizing: border-box;
    border: 2px solid var(--button_outline_color);
    border-radius: var(--button_radius);
    padding: 0.75em 1.5em;
    transform: translateY(-0.2em);
    transition: transform 0.1s ease;
}

.button-crear-sala:hover .button_top_jugar-sala {
    /* Pull the button upwards when hovered */
    transform: translateY(-0.33em);
}

.button-crear-sala:active .button_top_jugar-sala {
    /* Push the button downwards when pressed */
    transform: translateY(0);
}


.button-crear-sala:hover .btn-sala3 {
    /* Pull the button upwards when hovered */
    transform: translateY(-0.33em);
}

.button-crear-sala:active .btn-sala3 {
    /* Push the button downwards when pressed */
    transform: translateY(0);
}


.impostor {
    color: red;
    font-weight: bold;
}

/* Estilos de la interfaz de la imagen */

.sala-principal {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Cambiar de center a flex-start */
    max-width: 1200px;
    gap: 20px;
    margin: 0 auto;
    text-align: left;
    width: 100%;
    /* Asegurar que ocupe el ancho completo */
}

.sala-espera {
    flex: 2;
    padding: 20px;
    color: white;
    padding: 24px;
    border-radius: 20px;

    width: 100%;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);

}

.controles {
    flex: 1;
    padding: 20px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    min-width: 200px;
}

.controles h4 {
    color: white;
    font-weight: 800;
}

.controles li {
    color: #fffc;
    font-size: .875rem;
    line-height: 1.25rem;
    padding: 8px;
}

.controles ul {
    padding: 10px;
}

.player-card {
    display: inline-block;
    padding: 10px;
    margin: 10px;
    border: 2px solid gold;
    border-radius: 10px;
    background: #444;
    text-align: center;
}

.player-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}
.mensaje-config {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
    display: none;
}
.mensaje-config.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.mensaje-config.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}


/* .game-settings-container {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background: #444;
}

.custom-select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
    color: #333;
}

.dropdown-menu {
    position: relative;
    background: #282828;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.dropdown-menu>select {
    width: 100%;
} */




/* Estilo general del contenedor de ajustes */
.game-settings-container {
    margin-top: 20px;
    padding: 16px;
    background: #1e1e2e;
    /* Fondo oscuro tipo "Sala de Espera" */
    border: 1px solid #333;
    border-radius: 8px;
    color: #ffffff;
    font-family: "Montserrat", sans-serif;
}

.game-settings-container h4 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

/* Estilo del select principal (modo de juego) */
.custom-select {
    width: 100%;
    padding: 8px 12px;
    margin-top: 8px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2d2d3f;
    color: #ffffff;
    font-size: -1.95rem;
    cursor: pointer;
    font-family: "Montserrat", sans-serif;
    transition: border-color 0.2s ease;
}

.custom-select:hover {
    border-color: #666;
}

.custom-select:focus {
    outline: none;
    border-color: #888;
    box-shadow: 0 0 0 2px rgba(136, 136, 136, 0.2);
}

/* Estilo del dropdown (menú desplegable) */
.custom-select option {
    background: #2d2d3f;
    color: #ffffff;
    padding: 8px 12px;
}

/* Estilo para el selector específico de anime (si se muestra) */
#sala-anime-specific-selector {
    margin-top: 12px;
}

#sala-anime-specific-selector label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #cccccc;
}

#select-anime-id-host {
    width: 100%;
    padding: 8px 12px;
    margin-top: 4px;
    border-radius: 6px;
    border: 1px solid #444;
    background: #2d2d3f;
    color: #ffffff;
    font-size: 0.95rem;
}

/* Botón Guardar Configuración */
#btn-guardar-config-anime,
#btn-guardar-config-personajes {
    margin-top: 16px;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #28a745, #218838);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: "Montserrat";
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 0.95rem;
}

#btn-guardar-config-anime:hover,
#btn-guardar-config-personajes :hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Para hacerlo más parecido a la foto: texto más pequeño y limpio */
.game-settings-container p {
    margin: 10px 0;
    font-size: 0.95rem;
    color: #cccccc;
}




#lista-jugadores {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #1a252f;
    border-radius: 8px;
    border: 1px solid #34495e;
    margin-top: 20px;
    min-height: 100px; 
    display: block; 
    border: 2px solid #ff0000 !important; 
}


/* Responsive */

@media (max-width: 1024px) {
    .sala-principal {
        flex-direction: column;
        align-items: center;
        max-width: 600px;
    }

    .sala-espera,
    .controles {
        width: 100%;
        max-width: 100%;
    }

    .controles {
        min-width: unset;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .salaMain {
        padding: 15px;
        height: auto;
        min-height: 100vh;
    }

    .sala-principal {
        gap: 15px;
    }

    .sala-espera,
    .controles {
        padding: 15px;
    }

    .sala-espera-contenedor {
        flex-direction: column;
        gap: 15px;
    }

    .sala-espera-text h1 {
        font-size: 1.5rem;
    }

    .sala-espera-text h2 {
        font-size: 1.2rem;
    }

    .player-card {
        margin: 5px;
        padding: 8px;
    }

    .player-card img {
        width: 60px;
        height: 60px;
    }

    .button-crear-sala {
        font-size: 15px;
        min-width: 180px;
        max-width: 250px;
    }

    .button_top_jugar-sala,
    .btn-sala3 {
        padding: 0.6em 1.2em;
        font-size: 14px;
    }


    .controles h4 {
        font-size: 1rem;
    }

    .controles li {
        font-size: 0.8rem;
        padding: 6px;
    }

    .game-settings-container {
        padding: 12px;
    }

    .custom-select {
        font-size: 0.85rem;
        padding: 6px 10px;
    }

    #btn-guardar-config-anime,
    #btn-guardar-config-personajes {
        padding: 8px;
        font-size: 0.85rem;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .salaMain {
        padding: 10px;
    }

    .sala-principal {
        gap: 10px;
    }

    .sala-espera,
    .controles {
        padding: 12px;
        border-radius: 15px;
    }

    .sala-espera-text h1 {
        font-size: 1.3rem;
    }

    .sala-espera-text h2 {
        font-size: 1rem;
    }

    .sala-espera-jugadores p {
        font-size: 0.9rem;
    }

    .player-card {
        margin: 5px 0;
        padding: 6px;
        width: 100%;
    }

    .player-card img {
        width: 50px;
        height: 50px;
    }

    .player-card p {
        font-size: 0.9rem;
    }


    .button-crear-sala {
        font-size: 14px;
        min-width: 160px;
        max-width: 220px;
    }

    .button_top_jugar-sala,
    .btn-sala3 {
        padding: 0.5em 1em;
        font-size: 13px;
    }


    .controles h4 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .controles li {
        font-size: 0.75rem;
        padding: 4px;
        line-height: 1.4;
    }

    .controles ul {
        padding: 8px;
    }

    .game-settings-container {
        padding: 10px;
        margin-top: 15px;
    }

    .game-settings-container h4 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }

    .custom-select {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    #btn-guardar-config-anime,
    #btn-guardar-config-personajes {
        padding: 8px;
        font-size: 0.8rem;
        margin-top: 12px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    .sala-espera-text h1 {
        font-size: 1.1rem;
    }

    .sala-espera-text h2 {
        font-size: 0.9rem;
    }

    .button-crear-sala {
        min-width: 140px;
        max-width: 200px;
        font-size: 13px;
    }

    .button_top_jugar-sala,
    .btn-sala3 {
        font-size: 12px;
        padding: 0.4em 0.8em;
    }

    .controles li {
        font-size: 0.7rem;
    }
}

/* Ajuste para pantallas muy altas */
@media (min-height: 900px) {
    .sala-principal {
        align-items: center;
    }

    .button-crear-sala {
        max-width: 300px;
    }
}



@media (max-width: 900px) {

    .container {
        height: 130dvh;
    }

    .panelCompleto {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        margin-top: 100px;
    }

    /* .right-panel {
        max-width: 100%;
    } */
}

@media (max-width: 500px) {
        .logo img {
        width: 25rem;
        height: auto;
    }

    .panel-header {
        flex-direction: column;
        gap: 10px;
    }

    .btn-create,
    .btn-join {
        width: 100%;
    }

    /* Estilos para el modal de selección de avatar */
    #avatar-modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        justify-content: center;
        align-items: center;
        padding: 15px;
        overflow-y: auto;
    }

    .modal-content-avatares {
        background-color: #1a1a2e;
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        padding: 20px;
        width: 100%;
        /* max-width: 95%; */
        max-height: 85vh;
        overflow-y: auto;
        margin: auto;
    }

    .modal-content-avatares h2 {
        margin-top: 0;
        font-size: 1.3rem;
        color: #ffffff;
        margin-bottom: 15px;
    }

    .modal-content-avatares .close {
        color: #ffffff;
        float: right;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
        line-height: 1;
    }

    .modal-content-avatares .close:hover,
    .modal-content-avatares .close:focus {
        color: var(--primary);
        text-decoration: none;
        cursor: pointer;
    }

    .avatar-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-top: 15px;
        /* padding: 5px; */
    }

    .avatar-option {
        width: 100%;
        aspect-ratio: 1;
        max-width: 90px;
        object-fit: cover;
        border-radius: 50%;
        border: 3px solid transparent;
        cursor: pointer;
        transition: all 0.2s ease;
        background: #2d2d3f;
    }

    .avatar-option:hover,
    .avatar-option:active {
        border-color: var(--primary);
        transform: scale(1.05);
    }

    .avatar-option.selected {
        border-color: var(--primary);
    }

    /* Panel izquierdo */
    .left-panel {
        text-align: center;
        max-width: 280px;
        font-family: "Montserrat", sans-serif;
    }

    /* --- ESTILO CORREGIDO PARA EL CONTENEDOR DEL AVATAR --- */
    .avatar-container {
        position: relative;
        /* Contenedor padre relativo */
        display: inline-block;
        /* Ajusta el tamaño al contenido */
        margin-bottom: 20px;
        /* Espacio entre el contenedor y el nombre */
    }

    .avatar-container .avatar {
        border-radius: 50%;
        border: 3px solid var(--primary);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        object-fit: cover;
        /* No necesita posición absoluta */
        display: block;
        /* Asegura que sea un bloque y no inline */
        margin-top: 10rem;
    }

    .avatar-container .edit-btn {
        position: absolute;
        /* Posición absoluta relativa al contenedor padre */
        bottom: 0;
        /* Coloca el botón en la esquina inferior derecha del contenedor */
        right: 0;
        background: var(--primary);
        color: var(--secondary);
        border: 2px solid var(--secondary);
        /* Borde para destacar sobre la imagen */
        border-radius: 50%;
        width: 35px;
        /* Tamaño reducido */
        height: 35px;
        /* Tamaño reducido */
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 10px;
        /* Tamaño de fuente reducido */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        /* Sombra para mejor visibilidad */
        z-index: 10;
        /* Asegura que esté encima de la imagen del avatar */
        transition: background-color 0.2s, transform 0.1s ease;
        /* Transición suave */
    }

    .avatar-container .edit-btn:hover {
        background-color: #e6c200;
        /* Hover ligeramente más oscuro */
        transform: scale(1.1);
        /* Pequeño efecto de agrandamiento al pasar el mouse */
    }

    /* --- FIN DEL ESTILO CORREGIDO --- */

    .name-input,
    .room-code-input {
        /* ... (resto del CSS sigue igual) ... */
    }
}

@media(width < 400px) {
    .container {
        height: 160dvh;
    }

    .logo img {
        width: 20rem;
    }

}

/* @media (height < 700px) {
    .container {
        height: auto;
    }
} */

/* ------------------------------ */
/* Altura menor a 700px Y ancho menor a 900px */

/* Altura menor a 700px Y ancho mayor a 900px */
@media (min-height: 1px) and (max-height: 700px) and (min-width: 901px) {
    .container {
        height: 100vh;
        padding: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .logo {
        position: absolute;
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
    }

    .logo img {
        width: 25rem;
        height: auto;
    }

    .panelCompleto {
        flex-direction: row;
        gap: 2rem;
        margin-top: 0;
        align-items: center;
        max-width: 1100px;
    }

    .left-panel {
        max-width: 220px;
    }

    .avatar-container {
        margin-bottom: 15px;
    }

    .avatar {
        width: 10rem;
        height: 10rem;
    }

    .edit-btn {
        width: 28px;
        height: 28px;
        font-size: 9px;
    }

    .name-input,
    .room-code-input {
        padding: 10px;
        margin-top: 10px;
        font-size: 14px;
    }

    .left-panel label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .right-panel {
        padding: 18px;
        max-width: 380px;
    }

    .panel-header {
        gap: 10px;
        margin-bottom: 18px;
    }

    .btn-create,
    .btn-join {
        padding: 10px 14px;
        font-size: 14px;
    }

    .instructions {
        font-size: 13px;
        margin: 12px 0;
    }

    .right-panel h3 {
        font-size: 15px;
        margin-bottom: 8px;
    }

    .game-modes {
        margin: 12px 0;
    }

    .mode-btn {
        padding: 11px;
        margin: 6px 0;
        font-size: 14px;
    }

    .dificultad-selector {
        margin: 12px 0 !important;
    }

    .dificultad-selector label {
        font-size: 13px;
    }

    #select-dificultad {
        padding: 7px;
        font-size: 13px;
    }

    .button-crear {
        font-size: 15px;
        margin-top: 8px;
    }

    .button_top,
    .button_top_jugar {
        padding: 0.6em 1.2em;
        font-size: 14px;
    }

    .contenedor-jugar {
        margin-top: 8px;
    }

    .top-right {
        top: 15px;
        right: 15px;
        padding: 6px;
        gap: 10px;
    }

    .social-btn,
    .settings-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .lang-selector {
        bottom: 15px;
        right: 15px;
        padding: 8px;
    }

    .lang-selector select {
        padding: 5px 9px;
        font-size: 13px;
    }

    /* Modal adjustments */
    .modal-content {
        padding: 20px;
        max-width: 450px;
    }

    .modal-content-avatares {
        padding: 20px;
        max-width: 600px;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    .modal-content p {
        font-size: 13px;
    }

    .modal-content ol {
        font-size: 15px;
    }

    .avatar-grid {
        gap: 10px;
    }

    .avatar-grid img {
        width: 7rem;
        height: 7rem;
    }
}