From 78dea770d76562251c8e11fb7b548951afbb74a1 Mon Sep 17 00:00:00 2001 From: "soroush.asadi" Date: Thu, 11 Jun 2026 01:21:21 +0330 Subject: [PATCH] Landscape: add short-height variant; fix Home column overflow on landscape phones Root cause: a landscape phone is wide (>=640px) but short, so width-based sm: roominess inflated the title/buttons while the screen height was small -> the right column overflowed (vs-Computer card cut off). Add a height-based `short:` variant (@media max-height:520px) and compact Home's branding + action cards under it so the column fits short landscape viewports. Co-Authored-By: Claude Opus 4.8 --- src/app/globals.css | 6 ++++++ src/components/HomeScreen.tsx | 28 ++++++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index 5baafe2..6c7d460 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1,5 +1,11 @@ @import "tailwindcss"; +/* Height-based variants for short landscape phones (wide but short, where the + width-based sm: roominess would otherwise overflow vertically). Use `short:` + to compact and `tall:` for genuinely tall screens. */ +@custom-variant short (@media (max-height: 520px)); +@custom-variant tall (@media (min-height: 700px)); + /* FlatRender Hokm — "Persian Luxury" theme. Deep navy/teal table, gold filigree accents, geometric motifs. diff --git a/src/components/HomeScreen.tsx b/src/components/HomeScreen.tsx index 25b1626..8bf268b 100644 --- a/src/components/HomeScreen.tsx +++ b/src/components/HomeScreen.tsx @@ -94,17 +94,17 @@ export function HomeScreen() { > {/* logo + title on one row (no overflow); subtitle beneath the title */}
-
- +
+
-

+

{t("app.title")}

{t("app.subtitle")}

-
+
@@ -119,13 +119,13 @@ export function HomeScreen() { transition={{ delay: 0.05 }} whileTap={{ scale: 0.985 }} onClick={playOnline} - className="press-3d btn-gold relative w-full rounded-3xl px-5 py-4 sm:py-5 flex items-center gap-4 text-start" + className="press-3d btn-gold relative w-full rounded-3xl px-5 py-4 sm:py-5 short:py-2.5 flex items-center gap-4 short:gap-3 text-start" > - - + + - + {t("menu.online")} {t("menu.onlineDesc")} @@ -135,7 +135,7 @@ export function HomeScreen() {
{/* vs computer */} -
+
} title={t("menu.vsComputer")} @@ -143,11 +143,11 @@ export function HomeScreen() { onClick={playVsComputer} /> {/* Normal / Speed mode picker */} -
+