can you add a login mechanism to store game data
No, as this would require significant investment in server infrastructure, and would also add legal issues related to recent changes in laws in some regions of the world. Therefore, the option with offline game saves is optimal. And for problematic devices, users can use data backup, for example, copying the save file to Google Drive once a month.