extElement.textContent;
            textElement.innerHTML = '';

            text.split('').forEach(char => {
                const span = document.createElement('span');
                span.className = 'char';
                span.textContent = char === ' ' ? '\u00A0' : char; // Non-breaking space
                textElement.appendChild(span);
            });
        }

        // Split text into word spans (basic implementation)
        function splitTextIntoWords(textElement) {
            const text = 