/* Este archivo incluye estilos para el modal del juego y controles táctiles responsivos que solo se muestran en móviles. */

#start-btn {
    background-color: #4CAF50;
    border: 2px solid #2E7D32;
    border-radius: 20px;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
}

#start-btn:active {
    background-color: #2E7D32;
    transform: scale(0.95);
}

.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1100;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.game-modal-content {
    background-color: #222;
    border-radius: 15px;
    width: 95%;
    max-width: 500px;
    height: 650px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.6);
    border: 3px solid yellow;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.game-modal-content.active {
    transform: scale(1);
}

.game-modal-header {
    background-color: #000;
    color: yellow;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid yellow;
    position: relative;
    z-index: 1;
}

.game-modal-header h3 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.7);
    letter-spacing: 1px;
}

.game-modal-close {
    background: none;
    border: none;
    color: yellow;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.game-modal-close:hover {
    transform: scale(1.2);
    background-color: rgba(255, 255, 0, 0.2);
}

.game-modal-body {
    padding: 0;
    text-align: center;
    background-color: #111;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#pacman {
    width: 100%;
    height: 100%;
    min-height: 500px;
    background-color: #000;
    flex-grow: 1;
}

/* Estilos para controles táctiles ocultos por defecto */
/* Estilos para controles táctiles ocultos por defecto */
.touch-controls {
    display: none;
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1101;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 20px;
    width: 90%;
    max-width: 320px;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 0, 0.4);
}

/* Mostrar solo en móviles Y cuando el modal esté activo */
@media (max-width: 768px) {
    .game-modal.active ~ .touch-controls,
    .game-modal.active + .touch-controls {
        display: flex;
    }

    .controls-container {
        display: flex;
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .d-pad {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 6px;
        width: 120px;
    }

    .d-pad button {
        width: 100%;
        aspect-ratio: 1;
        font-size: 16px;
    }

    .action-btns {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .control-btn {
        width: 55px;
        height: 55px;
        font-size: 18px;
    }

    #pause-btn {
        width: 100px;
        font-size: 16px;
    }
}

.control-btn {
    background-color: rgba(255, 255, 0, 0.25);
    border: 2px solid yellow;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.control-btn:active, .control-btn.active {
    background-color: rgba(255, 255, 0, 0.7);
    transform: scale(0.92);
}

#pause-btn {
    border-radius: 20px;
    background-color: rgba(0, 100, 255, 0.3);
    border-color: #0064ff;
    font-size: 18px;
    margin-top: 10px;
}

#up-btn { grid-column: 2; grid-row: 1; }
#left-btn { grid-column: 1; grid-row: 2; }
#down-btn { grid-column: 2; grid-row: 3; }
#right-btn { grid-column: 3; grid-row: 2; }

@media (hover: hover) {
    .control-btn:hover {
        background-color: rgba(255, 255, 0, 0.4);
    }

    #pause-btn:hover {
        background-color: rgba(0, 100, 255, 0.4);
    }
}

/* Animación modal */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease-out forwards;
}
/* Estilos para el modal de ajedrez */
.chess-iframe-container {
    width: 100%;
    height: 70vh; /* 70% del viewport height */
    min-height: 500px; /* Altura mínima */
    overflow: hidden;
}

.chess-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Asegurar que el modal sea lo suficientemente grande */
