import { mount } from 'svelte';
import './app.css';
import App from './App.svelte';
import { initInstallListeners } from './lib/pwa.svelte';

// Pin the document for the game SPA (see app.css `html.app-shell`) so iOS/WKWebView — notably
// the Telegram Mini App — cannot rubber-band the whole page on a vertical drag. The standalone
// landing page (landing.ts) is a normal scrolling document and deliberately omits this class.
document.documentElement.classList.add('app-shell');

// Capture the PWA install prompt as early as possible — before the install CTA mounts. Harmless
// where it never fires (Firefox, Safari, the Telegram/VK Mini App webviews).
initInstallListeners();

export default mount(App, { target: document.getElementById('app')! });
