// referral.js — extracted from referral.html
// Data injected via window.__DATA__

document.getElementById('copyCode').addEventListener('click', () => {
    navigator.clipboard.writeText('window.__DATA__.code').then(() => {
        const btn = document.getElementById('copyCode');
        btn.textContent = 'Copied!';
        setTimeout(() => btn.textContent = 'Copy', 2000);
    });
});

document.getElementById('copyLink').addEventListener('click', () => {
    navigator.clipboard.writeText('window.__DATA__.shareUrl').then(() => {
        const btn = document.getElementById('copyLink');
        btn.textContent = 'Copied!';
        setTimeout(() => btn.textContent = 'Copy Link', 2000);
    });
});