{
                input.value = input.value.substring(0, 10);
            }
        }
        
        document.addEventListener("DOMContentLoaded", () => {
            const savedAvatar = localStorage.getItem("selectedAvatar");
            if (savedAvatar) {
                const selectedImg = document.querySelector(`.avatars img[src*='${savedAvatar}']`);
                if (selectedImg) {
                    selectedImg.classList.add('selected');
                    selectedAvatar = savedAvatar;
         