// --- Mobile Viewport Height Fix ---
function setGameContainerHeight() {
const gameContainer = document.getElementById('game-container');
if (gameContainer) {
// Use window.innerHeight for the actual available height
gameContainer.style.height = `${window.innerHeight}px`;
console.log(`Set container height to: ${window.innerHeight}px`); // For debugging
}
// Also call resizeCanvas to ensure canvas adjusts if needed
resizeCanvas();
}
// Set height initially on load
window.addEventListener('load', setGameContainerHeight);
// Adjust height on resize or orientation change
window.addEventListener('resize', setGameContainerHeight);
window.addEventListener('orientationchange', setGameContainerHeight);
// --- End Mobile Viewport Height Fix ---
// <-- Make sure this is above the existing closing tag if you add it inside