textElement.textContent;
            textElement.innerHTML = '';

            text.split(' ').forEach(word => {
                const span = document.createElement('span');
                span.className = 'word';
                span.textContent = word;
                textElement.appendChild(span);

                // Add space after word (except last)
                if (word !== text.split(' ').pop()) {
                    textElement.appendChild(document.createTextNode(' '));
                }
        