I love this architecture. The "Functional Core, Imperative Shell" pattern prevents the frontend from becoming a tangled mess of duplicated game logic. By having the Canvas purely act as a reactive display loopreading from storage.read() and triggering animations solely based on the events array from call_routine()we guarantee perfect synchronization between the engine and the UI. I have updated your prototype to include a new GameRenderer class that manages the Canvas. We are starting by hooking into init_match: once the backend resolves the initial spawn event and saves it to IndexedDB/LocalStorage, the Canvas fetches the canonical JSON, grabs the budgets and stats, and animates the food trucks into position.