lichess.org
Donate

I lost the game automatically, because the window closed

Basically, Lichess makes you lose games because I accidentally closed the browser window and when I open it again the second. 10 seconds later it was already open, I see that I lost the game. And I think there should be a time, at least 30 seconds, before you lose the, because it can be an accident.
Some time after a user has left the board, the opponent has the opportunity to claim a win or a draw. It shows a countdown timer before that. I don't know the exact amount of time, and it might depend on the game and time control, but it was never only 10 seconds, 8 think it was always at least 30 seconds, and probably longer for rapid. There would be plenty time to open lichess again, and go to your game, which is prominently shown on the main page.
I understand, although I'm sure I hadn't left the game until that moment.