' + 'Чтобы сохранить открытку, зажмите изображение и выберите «Сохранить в Фото».
' + '' ); iosWin.document.close(); shown = true; } catch (_) { shown = false; } } // popup заблокирован → модальное окно с картинкой и инструкцией if (!shown) { if (iosWin) { try { iosWin.close(); } catch (_) {} } showIOSPreview(dataUrl); } track('season_love_png_success_ios_preview'); btn.textContent = 'Открытка готова'; } else { // desktop-flow без изменений: const a = document.createElement('a'); a.download = 'vinograd-stranica-leta.png'; a.href = dataUrl; a.click(); track('season_love_png_success_desktop'); btn.textContent = 'Сохранено'; } } catch (err) { console.error(err); if (isIOS && iosWin) { try { iosWin.close(); } catch (_) {} } track('season_love_png_error'); btn.textContent = 'Не удалось сохранить'; } setTimeout(() => (btn.textContent = defaultSaveLabel()), 1800); } // ============================================================ // СТАРТ // ============================================================ function init() { track('season_love_open'); buildGrid(); initActions(); // старт по кнопке или по тапу в любом месте стартового экрана $('screen-start').addEventListener('click', () => startGame()); } document.addEventListener('DOMContentLoaded', init); })();