/* Accent color para el diseño */
:root {
   --color-accent: #FF40CC;
}
.game-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(30, 30, 30, 0.65);
    backdrop-filter: blur(8px) brightness(0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


.game-modal-content {
    position: relative;
    width: 95vw;
    max-width: 1400px;
    max-height: 95vh;
    background: linear-gradient(135deg, #232526 0%, var(--color-accent) 100%);
    border-radius: 32px;
    box-shadow: 0 6px 32px 0 rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
    padding: 5px;
    transition: box-shadow 0.3s;
    animation: modalPopIn 0.35s cubic-bezier(.68,-0.55,.27,1.55);
}

@keyframes modalPopIn {
    0% { transform: scale(0.85) translateY(40px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.game-modal-close {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 2;
    font-size: 2.2rem;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.game-modal-close:hover {
    color: #fff;
    background: #ff3c3c;
    box-shadow: 0 4px 16px rgba(255,60,60,0.18);
}


.game-modal-content iframe {
    width: 100%;
    min-height: 500px;
    height: calc(95vh - 10px);
    max-height: min(calc(95vw * 0.5625), calc(95vh - 10px)); /* Mantiene ratio 16:9 o usa toda la altura disponible */
    border: none;
    border-radius: 20px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    background: #181818;
    display: block;
    flex: 1;
}

/* Media queries para responsive */
@media screen and (max-width: 768px) {
    .game-modal-overlay {
        padding: 0;
        margin: 0;
    }
    
    .game-modal-content {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        padding: 0;
        margin: 0;
    }
    
    .game-modal-content iframe {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        min-height: 100vh;
        border-radius: 0;
    }
    
    .game-modal-close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 2.5rem;
        z-index: 10000;
    }
}

/* Media query específico para teléfonos pequeños */
@media screen and (max-width: 480px) {
    .game-modal-overlay {
        width: 100vw;
        height: 100vh;
        padding: 0;
        margin: 0;
    }
    
    .game-modal-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        padding: 0;
        margin: 0;
        border-radius: 0;
    }
    
    .game-modal-content iframe {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        min-height: 100vh;
        border-radius: 0;
    }
    
    .game-modal-close {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
        font-size: 2rem;
        z-index: 10000;
    }
}

/* Media query para pantallas muy pequeñas (altura limitada) */
@media screen and (max-height: 667px) and (max-width: 768px) {
    .game-modal-overlay {
        height: 100vh;
    }
    
    .game-modal-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .game-modal-content iframe {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        min-height: 100vh;
    }
}

/* Media Query específico para Landscape */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .game-modal-overlay {
        width: 100vw;
        height: 100vh;
    }
    
    .game-modal-content {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        padding: 0;
    }
    
    .game-modal-content iframe {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        min-height: 100vh;
        border-radius: 0;
    }
    
    .game-modal-close {
        top: 8px;
        right: 8px;
        width: 35px;
        height: 35px;
        font-size: 2rem;
        z-index: 10000;
    }
}
