diff --git a/frontend/src/app.css b/frontend/src/app.css index 0970236..889f800 100644 --- a/frontend/src/app.css +++ b/frontend/src/app.css @@ -65,3 +65,12 @@ button { font-family: inherit; cursor: pointer; } @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } } .rise { animation: rise 0.5s ease both; } @media (prefers-reduced-motion: reduce) { .rise { animation: none; } html { scroll-behavior: auto; } } + +/* Daily Word on mobile becomes a focused, full-viewport screen: lock body scroll + and hide the site footer so the on-screen keyboard is truly pinned (not riding + the page's scroll). The .playing-word class is toggled by /play and always + removed on navigation via effect cleanup. Mobile only — desktop is unaffected. */ +@media (max-width: 720px) { + html.playing-word, html.playing-word body { overflow: hidden; } + html.playing-word footer.site { display: none; } +} diff --git a/frontend/src/lib/components/WordGame.svelte b/frontend/src/lib/components/WordGame.svelte index f6d8916..133f1fd 100644 --- a/frontend/src/lib/components/WordGame.svelte +++ b/frontend/src/lib/components/WordGame.svelte @@ -154,7 +154,7 @@

Loading today’s puzzle…

{:else}
-
+
{#each Array(maxGuesses) as _, r (r)} {@const g = guesses[r]} {@const cs = cols[r] || null} @@ -190,7 +190,7 @@
{#each ROWS as row, ri (ri)}
- {#if ri === 2}{/if} + {#if ri === 2}{/if} {#each row as k (k)} {/each} @@ -206,7 +206,7 @@ .wordgame { max-width: 480px; margin: 0 auto; opacity: 0; transform: translateY(6px); } .wordgame.ready { opacity: 1; transform: none; transition: opacity 0.3s ease, transform 0.3s ease; } .board { display: grid; gap: 6px; margin: 0 auto 18px; width: min(100%, 340px); } - .row { display: grid; grid-template-columns: repeat(var(--len), 1fr); gap: 6px; } + .row { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px; } .tile { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px solid var(--line); border-radius: 8px; font-family: var(--label); @@ -221,33 +221,38 @@ text-align: center; background: var(--ink); color: #fff; border-radius: 8px; padding: 7px 14px; width: fit-content; margin: 0 auto 12px; font-size: 0.86rem; } - .keyboard { display: flex; flex-direction: column; gap: 7px; margin-top: 8px; } + /* Flat, warm, on-brand keys — off-white with a hairline border, soft radius, + no heavy raised shadow. Centered, never a full-bleed slab. */ + .keyboard { display: flex; flex-direction: column; gap: 6px; margin: 10px auto 0; max-width: 430px; } .krow { display: flex; gap: 5px; justify-content: center; } .key { - flex: 1; min-width: 0; max-width: 44px; height: 54px; border: none; border-radius: 8px; - background: #e9e2d4; color: var(--ink); font-family: var(--label); font-weight: 600; - font-size: 1rem; cursor: pointer; text-transform: uppercase; - box-shadow: 0 1.5px 0 rgba(70, 58, 36, 0.16); transition: background 0.12s ease, transform 0.05s ease; + flex: 1; min-width: 0; max-width: 42px; height: 48px; border: 1px solid var(--line); border-radius: 11px; + background: var(--surface); color: var(--ink); font-family: var(--label); font-weight: 600; + font-size: 0.92rem; cursor: pointer; text-transform: uppercase; transition: background 0.12s ease, transform 0.05s ease; } - .key:active { transform: translateY(1px); box-shadow: none; } - .key.wide { max-width: 66px; font-size: 0.68rem; letter-spacing: 0.03em; } - .key.enter { background: var(--accent-soft); color: var(--accent-deep); } - .key.correct { background: #4a9d6e; color: #fff; box-shadow: 0 1.5px 0 rgba(40, 90, 60, 0.32); } - .key.present { background: #d8b24a; color: #fff; box-shadow: 0 1.5px 0 rgba(150, 110, 20, 0.32); } - .key.absent { background: #9aa6b2; color: #fff; box-shadow: 0 1.5px 0 rgba(80, 90, 100, 0.32); } - .key:hover { filter: brightness(0.97); } + .key:active { transform: translateY(1px); background: var(--bg); } + .key.wide { max-width: 56px; font-size: 1.1rem; } + .key.enter { background: var(--accent-soft); border-color: transparent; color: var(--accent-deep); } + .key.correct { background: #4a9d6e; border-color: #4a9d6e; color: #fff; } + .key.present { background: #d8b24a; border-color: #d8b24a; color: #fff; } + .key.absent { background: #9aa6b2; border-color: #9aa6b2; color: #fff; } + .key:hover { filter: brightness(0.98); } .muted { color: var(--muted); text-align: center; } - /* Mobile: fill the height — board scrolls in the middle, keyboard pinned at the - bottom and always reachable (full-bleed, on-brand, safe-area aware). */ + /* Mobile: a focused app screen — board sizes to fit BOTH width and the height + left above the keyboard, so the active row + keyboard are always visible. */ @media (max-width: 720px) { .wordgame { display: flex; flex-direction: column; height: 100%; max-width: 100%; } .play-area { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: 4px 0; } - .board { margin-bottom: 12px; } - .keyboard { flex-shrink: 0; margin: 6px -16px 0; gap: 6px; background: var(--bg); - border-top: 1px solid var(--line); padding: 9px 6px calc(9px + env(safe-area-inset-bottom)); } - .key { height: 50px; } + .board { + --tile: min(58px, calc((100vw - 44px) / var(--cols)), calc((100dvh - 300px) / var(--rows))); + gap: 4px; width: fit-content; margin: 0 auto 10px; + } + .row { grid-template-columns: repeat(var(--cols), var(--tile)); gap: 4px; } + .tile { width: var(--tile); height: var(--tile); aspect-ratio: auto; font-size: calc(var(--tile) * 0.46); } + .keyboard { flex-shrink: 0; margin: 8px auto calc(env(safe-area-inset-bottom) + 4px); gap: 5px; } + .key { height: 46px; } } .result { text-align: center; } .rmark { font-family: var(--serif); font-style: italic; color: var(--accent-deep); font-size: 1.2rem; margin: 0 0 10px; } diff --git a/frontend/src/routes/play/+page.svelte b/frontend/src/routes/play/+page.svelte index c2588ca..ad6348f 100644 --- a/frontend/src/routes/play/+page.svelte +++ b/frontend/src/routes/play/+page.svelte @@ -73,6 +73,16 @@ function openGame(g) { game = g; view = 'select'; refreshStatus(); } function pick(v) { if (game === 'word') variant = v; else wsSize = v; view = 'play'; } + + // Daily Word on mobile = a focused viewport: lock scroll + hide footer. Cleanup + // ALWAYS removes the class (re-run or unmount), so leaving /play can't strand it. + $effect(() => { + if (typeof document === 'undefined') return; + if (view === 'play' && game === 'word') { + document.documentElement.classList.add('playing-word'); + return () => document.documentElement.classList.remove('playing-word'); + } + }); function back() { view = view === 'play' ? 'select' : 'hub'; refreshStatus();