Refactored game logic, HTML, CSS