import { Game } from './game'; function init(): void { const canvas = document.getElementById('game-canvas') as HTMLCanvasElement | null; if (!canvas) { throw new Error('Canvas element not found'); } const game = new Game(canvas); game.start(); // Expose game for debugging (window as unknown as { game: Game }).game = game; } // Wait for DOM if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', init); } else { init(); }