async function connectWallet(){
  if(!window.ethereum){ alert("Open in Trust Wallet"); return; }
  const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' });
  const wallet = accounts[0];
  localStorage.setItem('wallet', wallet);

  const res = await checkUser(wallet);
  if(res.status === "new") window.location.href="signup.html";
  else window.location.href="dashboard.html";
}
