game stops when document loses focus [fixes #5]