         div.className = 'message ' + type;
            const timestamp = new Date().toLocaleTimeString();
            div.innerHTML = `<strong>${timestamp}</strong> - ${text}`;
            messages.appendChild(div);
            messages.scrollTop = messages.scrollHeight;
        }

        function updateStatus(connected) {
            if (connected) {
                status.textContent = 'üü¢ Connected to WebSocket server';
                status.className = 'status connected';
                input