/* Estilos para el modo multijugador de Wordle Universe */

/* Contenedor principal para juegos multijugador */
.multiplayer-container {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    background-color: #1a2639;
}
/* Ajustes para la posición del contenedor del juego */
.multiplayer-container, .bestof3-container {
    padding-top: 10px !important;
    margin-top: -177px !important;
    justify-content: flex-start !important;
}

/* Encabezado del juego */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.game-header h2 {
    color: #ffdbb7;
    margin: 0;
    font-size: 1.3rem;
}

#game-timer {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    color: #ffffff;
    font-weight: bold;
    font-size: 1rem;
}

.game-category {
    background: rgba(255, 219, 183, 0.2);
    padding: 5px 10px;
    border-radius: 5px;
    color: #ffdbb7;
    font-size: 0.9rem;
}

/* Contenedor de tableros */
.boards-container {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 15px;
    margin-bottom: 10px;
}
/* Estilos para el contenedor de filas */
.row-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    width: 100%;
}

/* Tablero del jugador */
.player-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}
/* Asegurar que el teclado sea visible */
#keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
}


.player-board h3 {
    color: #ffdbb7;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

/* Panel de información */
.game-info-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.info-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-label {
    color: #ffffff;
    font-size: 1.1rem;
}

.info-value {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Tablero del oponente */
.opponent-board {
    flex: 0 0 auto;
    display: none;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.opponent-board h3 {
    color: #ffdbb7;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

#opponent-status {
    margin-top: 10px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    color: #ffffff;
    font-size: 0.9rem;
}

/* Estilos para las casillas del tablero */
.game-grid {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    gap: 4px;
    margin-top: 0 !important;
    margin-bottom: 15px;
    width: 100%;
    max-width: 250px;
}

.grid-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.grid-tile {
    aspect-ratio: 1/1;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.grid-tile.has-letter {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.05);
}

.grid-tile.correct {
    background-color: #6aaa64;
    border-color: #6aaa64;
    color: white;
}

.grid-tile.present {
    background-color: #c9b458;
    border-color: #c9b458;
    color: white;
}

.grid-tile.absent {
    background-color: #787c7e;
    border-color: #787c7e;
    color: white;
}

/* Área de entrada de palabra actual */
.current-word-area {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    width: 100%;
    max-width: 350px;
}

.current-word-tile {
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}

/* Estilos para el teclado */
.keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 500px;
    margin-top: 8px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.keyboard-key {
    height: 50px;
    min-width: 30px;
    border: none;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 0 8px;
    transition: all 0.2s ease;
}

.keyboard-key:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.keyboard-key.key-enter,
.keyboard-key.key-backspace {
    min-width: 60px;
    font-size: 0.9rem;
}

.keyboard-key.correct {
    background-color: #6aaa64;
}

.keyboard-key.present {
    background-color: #c9b458;
}

.keyboard-key.absent {
    background-color: #787c7e;
}

/* Controles del juego */
.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.game-button {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #4a76d4, #3b5998);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#surrender-button {
    background: linear-gradient(135deg, #d43c3c, #982b2b);
}

/* Pantalla de espera */
.waiting-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.waiting-content {
    background: linear-gradient(135deg, #363795, #005C97);
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 350px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    margin: 15px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.waiting-message {
    margin: 15px 0;
    font-size: 1rem;
}

/* Resultados del juego */
.game-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.results-content {
    background: linear-gradient(135deg, #2b3252, #1a1f30);
    border-radius: 20px;
    padding: 25px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.result-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.result-title.win {
    color: #6aaa64;
}

.result-title.lose {
    color: #d43c3c;
}

.result-title.draw {
    color: #c9b458;
}

.result-details {
    margin-bottom: 20px;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    gap: 15px;
}

.player-stats, .opponent-stats {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
}

.results-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

/* Estilos para el modo "Mejor de 3" */
.bestof3-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
}

.round-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    width: 100%;
}

.score-display {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 8px;
}

.player-score, .opponent-score {
    font-size: 1.1rem;
    font-weight: bold;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

#turn-indicator {
    margin-top: 12px;
    padding: 8px 15px;
    background: rgba(255, 219, 183, 0.2);
    border-radius: 10px;
    color: #ffdbb7;
    font-weight: bold;
}
/* Ajustes para los menús de multijugador */
#multiplayer-menu,
#realtime-options-menu,
#bestof3-options-menu,
#join-room-screen,
#create-room-screen {
    padding-top: 0 !important; /* Eliminar completamente el padding superior */
    justify-content: flex-start !important; /* Alinear contenido desde arriba */
    margin-top: 0 !important; /* Eliminar margen superior */
    position: relative;
    top: 0;
}

.section-header {
    margin-bottom: 10px !important; /* Reducir aún más el margen inferior del encabezado */
}

.multiplayer-options {
    margin-top: 0 !important; /* Eliminar el margen superior de las opciones */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 500px; /* Limitar el ancho para mejor apariencia */
}

.multiplayer-option {
    margin-bottom: 10px !important; /* Reducir el espacio entre botones */
    width: 90%; /* Hacer que los botones ocupen más espacio horizontal */
}

/* Ajuste específico para el título del modo */
.section-header h2 {
    margin-top: 5px !important;
    margin-bottom: 10px !important;
}

/* Ocultar la descripción de la aplicación solo en las pantallas de multijugador */
#multiplayer-menu .app-description,
#realtime-options-menu .app-description,
#bestof3-options-menu .app-description,
#join-room-screen .app-description,
#create-room-screen .app-description {
    display: none;
}


/* Estilos para el contenedor del juego multijugador */
.multiplayer-game-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    box-sizing: border-box;
}

.multiplayer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.multiplayer-content {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    margin-bottom: 1rem;
}

.player-section, .opponent-section {
    flex: 1;
    min-width: 0;
}

.opponent-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.attempts-info {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #ffdbb7;
}

.player-attempts, .opponent-attempts {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.keyboard-container {
    width: 100%;
    margin-top: auto;
}

/* Para pantallas más pequeñas */
@media (max-height: 700px) {
    #multiplayer-menu,
    #realtime-options-menu,
    #bestof3-options-menu,
    #join-room-screen,
    #create-room-screen {
        padding-top: 5px;
    }
    
    .section-header {
        margin-bottom: 8px;
    }
    
    .multiplayer-option {
        margin-bottom: 8px;
        padding: 8px 12px;
    }
    .multiplayer-container, .bestof3-container {
        padding-top: 0 !important;
    }
}
.opponent-section {
    flex: 0 0 30%;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-left: 1rem;
}
.attempts-counter{
    color: #ffdbb7;
}
.attempts-info {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.player-attempts, .opponent-attempts {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.player-attempts {
    background-color: rgba(0, 128, 255, 0.2);
}

.opponent-attempts {
    background-color: rgba(255, 64, 64, 0.2);
}

/* Responsive para pantallas medianas */
@media (max-width: 768px) {
    .multiplayer-content {
        flex-direction: column;
    }
    .opponent-section {
        margin-left: 0;
        margin-top: 1rem;
    }
    
    .player-section, .opponent-section {
        width: 100%;
    }
    
    .multiplayer-header h2 {
        font-size: 1.5rem;
    }
    
    .game-info {
        font-size: 0.9rem;
    }
    
    .keyboard-container {
        margin-top: 1rem;
    }
    
    .game-grid {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .grid-tile {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .boards-container {
        flex-direction: column;
    }
    
    .player-board, .opponent-board, .game-info-panel {
        width: 100%;
        max-width: 100%;
    }
    
    .keyboard-key {
        height: 45px;
        min-width: 28px;
        font-size: 1rem;
    }
    
    .keyboard-key.key-enter,
    .keyboard-key.key-backspace {
        min-width: 50px;
        font-size: 0.8rem;
    }
    
    .grid-tile {
        font-size: 1.4rem;
    }
    
    .game-controls {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .game-button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .stats-container {
        flex-direction: column;
    }
    
    .game-header h2 {
        font-size: 1.1rem;
    }
    
    #game-timer {
        font-size: 0.9rem;
        padding: 5px 10px;
    }
    
    .opponent-board {
        margin-top: 10px;
        padding: 10px;
    }
    
    .player-board {
        padding: 10px;
    }
    
    .info-row {
        padding: 10px 5px;
    }
    
    .info-label, .info-value {
        font-size: 1rem;
    }
}

/* Responsive para pantallas pequeñas (móviles) */
@media (max-width: 480px) {
    .multiplayer-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .exit-button {
        margin-top: 0.5rem;
        align-self: flex-end;
    }
    
    .grid-tile {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .keyboard-key {
        min-width: 25px;
        height: 40px;
        font-size: 0.9rem;
    }
    .multiplayer-container {
        padding: 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .game-header {
        flex-direction: column;
        gap: 5px;
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .game-header h2 {
        font-size: 1rem;
    }
    
    .game-category {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    #game-timer {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .keyboard-key {
        height: 40px;
        min-width: 24px;
        font-size: 0.9rem;
        padding: 0 4px;
    }
    
    .keyboard-row {
        gap: 3px;
    }
    
    .keyboard {
        gap: 4px;
        margin-top: 5px;
    }
    
    .grid-tile {
        font-size: 1.2rem;
        border-width: 1px;
    }
    
    .grid-row {
        gap: 3px;
    }
    
    .game-grid {
        gap: 3px;
        max-width: 250px;
    }
    
    .player-board h3, .opponent-board h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .game-controls {
        margin-top: 10px;
    }
    
    .game-button {
        padding: 6px 12px;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .info-row {
        padding: 8px 5px;
    }
    
    .info-label, .info-value {
        font-size: 0.9rem;
    }
    
    .current-word-area {
        padding: 8px;
    }
    
    .current-word-tile {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    /* Ajustes para resultados en móvil */
    .results-content {
        padding: 15px;
    }
    
    .result-title {
        font-size: 1.5rem;
    }
    
    .results-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .results-buttons .game-button {
        width: 100%;
    }
}

/* Ajustes específicos para dispositivos muy pequeños */
@media (max-width: 360px) {
    .keyboard-key {
        height: 35px;
        min-width: 20px;
        font-size: 0.8rem;
    }
    
    .keyboard-key.key-enter,
    .keyboard-key.key-backspace {
        min-width: 40px;
        font-size: 0.7rem;
    }
    
    .grid-tile {
        font-size: 1rem;
    }
    
    .game-grid {
        max-width: 220px;
    }
    
    .current-word-tile {
        width: 30px;
        height: 30px;
        font-size: 1.1rem;
    }
    
    .info-label, .info-value {
        font-size: 0.8rem;
    }
}
