.modal-overlay {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto; /* scroll vertical si el contenido es alto */
    overflow-x: hidden; /* evitar scroll horizontal */
}

.modal-content {
    background: #222;
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 600px;
    max-height: 90%;
    overflow-y: auto;
    color: white;
    position: relative;
    box-sizing: border-box;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

/* Ajustes móviles */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;      /* ocupar casi todo el ancho */
        padding: 15px;
        max-height: 95%;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 100%;     /* ancho completo sin desbordar */
        padding: 10px;
        max-height: 95%;
        border-radius: 5px;
    }

    .close-btn {
        font-size: 20px;
        top: 5px;
        right: 10px;
    }

    /* Iframes dentro del modal */
    .modal-content iframe,
    .modal-content img,
    .modal-content video {
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    /* Grids o contenedores internos */
    .modal-content .games-grid,
    .modal-content .filters {
        width: 100%;
        overflow-x: hidden;
    }
}
