));
            const url = `${window.location.origin}${window.location.pathname}?code=${encoded}`;
            
            navigator.clipboard.writeText(url).then(() => {
                alert('Share link copied to clipboard!');
            }).catch(() => {
                prompt('Copy this link to share your code:', url);
            });
        }

        // Load code from URL parameter
        function loadFromUrl() {
            const params = new URLSearchParams(window.location.search);
            c