age.jpg';
        link.href = optimizedSrc;
        link.click();
      }
    });

    // Copy button handler
    copyBtn.addEventListener('click', async () => {
      if (imgDataUri.value) {
        try {
          await navigator.clipboard.writeText(imgDataUri.value);
          copyBtn.textContent = '‚úì Copied!';
          copyBtn.classList.add('success');
          setTimeout(() => {
            copyBtn.textContent = 'Copy to Clipboard';
            copyBtn.classList.remove('success');
          }, 