in);
                    grid.appendChild(card);
                });
                
            } catch (error) {
                console.error('Failed to load DApps:', error);
                document.getElementById('dappGrid').innerHTML = '<p>Failed to load DApps. Please check your connection.</p>';
            }
        }

        function navigateToDapp(domain) {
            document.getElementById('urlBar').value = domain;
            navigate();
        }

        // Wallet functions
        async f