Don't worry about losing your work. Everything is being automatically saved on your Google drive as long as you're connected to internet. If you happen to close the tab you were working on accidently, find the same file from Google Classroom and continue working on it.