
                    editor.refresh();
                }, 1000);

            } catch (error) {
                console.error('Error loading user save:', error);
                const editorContainer = document.getElementById('editor-container');
                editorContainer.innerHTML = `<div class="error">Error loading save: ${error.message}</div>`;
            }
        }

        function updateSelectedEvent() {
            selectedEventTime = parseInt(document.getElementById('eventSelect').value);
  