From 9dd318313325e0d8925e6259db48709886e143c2 Mon Sep 17 00:00:00 2001
From: Pinapelz <yukais@pinapelz.com>
Date: Thu, 16 Apr 2026 22:38:28 -0700
Subject: fix: disable scrolling on typing game screen

---
 src/app/game/page.tsx | 48 ++++++++++++++++++++++++++++--------------------
 1 file changed, 28 insertions(+), 20 deletions(-)

(limited to 'src/app/game/page.tsx')

diff --git a/src/app/game/page.tsx b/src/app/game/page.tsx
index fa5f6b1..02ea319 100644
--- a/src/app/game/page.tsx
+++ b/src/app/game/page.tsx
@@ -17,6 +17,7 @@ import { toast, ToastContainer } from "react-toastify";
 import "react-toastify/dist/ReactToastify.css";
 import {
   GameRoot,
+  GameGlobalStyle,
   GameNavbar,
   GameContent,
   HUD,
@@ -90,6 +91,10 @@ function GameInner() {
   const searchParams = useSearchParams();
   const router = useRouter();
 
+  useEffect(() => {
+    window.scrollTo({ top: 0, left: 0, behavior: "auto" });
+  }, []);
+
   const audioRef = useRef<HTMLAudioElement>(null);
   const videoRef = useRef<HTMLVideoElement>(null);
   const gameStartTimeRef = useRef<number>(0);
@@ -860,25 +865,28 @@ function GameInner() {
 
 export default function GamePage() {
   return (
-    <Suspense
-      fallback={
-        <GameRoot>
-          <div
-            style={{
-              flex: 1,
-              display: "flex",
-              alignItems: "center",
-              justifyContent: "center",
-              fontSize: 18,
-              color: "rgba(255,255,255,0.5)",
-            }}
-          >
-            Loading...
-          </div>
-        </GameRoot>
-      }
-    >
-      <GameInner />
-    </Suspense>
+    <>
+      <GameGlobalStyle />
+      <Suspense
+        fallback={
+          <GameRoot>
+            <div
+              style={{
+                flex: 1,
+                display: "flex",
+                alignItems: "center",
+                justifyContent: "center",
+                fontSize: 18,
+                color: "rgba(255,255,255,0.5)",
+              }}
+            >
+              Loading...
+            </div>
+          </GameRoot>
+        }
+      >
+        <GameInner />
+      </Suspense>
+    </>
   );
 }
-- 
cgit v1.2.3

