.getElementById('log');

    // Client instance
    let client = null;

    // Log function
    function log(message, type = 'info') {
      const now = new Date().toLocaleTimeString();
      const entry = document.createElement('div');
      entry.className = type;
      entry.textContent = `[${now}] ${message}`;
      logElement.appendChild(entry);
      logElement.scrollTop = logElement.scrollHeight;
    }

    // Connect button click handler
    connectButton.addEventListener('click', async () => {
    