document.getElementById("reg-btn")?.addEventListener("click", () => { const lobbyInput = document.getElementById("username"); const lobbyName = lobbyInput ? lobbyInput.value.trim() : ""; if (lobbyName) { Storage.saveLobbyName(lobbyName); window.location.href = "lobby.html"; } else { lobbyInput?.focus(); } }); const reveals = document.querySelectorAll(".reveal"); const io = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { entry.target.classList.add("visible"); io.unobserve(entry.target); } }); }, { threshold: 0.12 }, ); reveals.forEach((el) => { io.observe(el); });