      const statusEl = document.getElementById('status');
            statusEl.className = `status ${status}`;
            statusEl.textContent = message;
        }

        function updateStats() {
            document.getElementById('messagesSent').textContent = messagesSent;
            document.getElementById('messagesReceived').textContent = messagesReceived;
        }

        function updateConnectionTime() {
            if (connectionStartTime) {
                const elapsed = Math.floor((Date.now(