diff --git a/src/game/duel/DuelTable.tsx b/src/game/duel/DuelTable.tsx index eb4fd71..e9fb32e 100644 --- a/src/game/duel/DuelTable.tsx +++ b/src/game/duel/DuelTable.tsx @@ -42,6 +42,22 @@ export function DuelTable({ view, legal, onAct, busy, error, onExit, onRecap }: const [decl, setDecl] = useState(EMPTY_DECL); const [targeting, setTargeting] = useState<{ cardId: string; chosen: string[] }>(); const logRef = useRef(null); + // Hand overflow cue (QA #58): how many hand cards are past the right edge. + const handRef = useRef(null); + const [hiddenRight, setHiddenRight] = useState(0); + useEffect(() => { + const el = handRef.current; + if (!el) return; + const measure = () => { + const edge = el.getBoundingClientRect().right; + setHiddenRight([...el.children].filter(c => c.getBoundingClientRect().left > edge - 24).length); + }; + measure(); + el.addEventListener('scroll', measure, { passive: true }); + const ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(measure) : null; + ro?.observe(el); + return () => { el.removeEventListener('scroll', measure); ro?.disconnect(); }; + }, [view.hand.length]); const mine = isMyTurn(view); const oppSeat = (1 - view.seat) as Seat; @@ -173,12 +189,15 @@ export function DuelTable({ view, legal, onAct, busy, error, onExit, onRecap }:
-
+
+
{view.hand.length ? view.hand.map(c => { const playable = !!legal.plays[c.id] && !busy; return setSheet({ kind: 'card', card: c, where: 'hand' })} />; }) : No cards in hand.} +
+ {hiddenRight > 0 && }

{error ? {error} : note}

diff --git a/src/game/duel/duel.css b/src/game/duel/duel.css index 214b82b..3d717f8 100644 --- a/src/game/duel/duel.css +++ b/src/game/duel/duel.css @@ -31,7 +31,7 @@ .duel-row.theirs{align-items:flex-end} .duel-slot{position:relative;display:flex;flex-direction:column;align-items:stretch;flex:1 1 0;min-width:62px;max-width:110px} .duel-empty{flex:1;align-self:center;text-align:center;font-size:12px;color:var(--ctp-overlay1);padding:8px} -.duel-attach{position:absolute;top:-4px;right:-3px;z-index:3;font-size:10px;font-weight:800;padding:1px 5px;border-radius:8px;background:var(--ctp-mauve);color:var(--ctp-crust)} +.duel-attach{position:absolute;top:-5px;right:-3px;z-index:3;font-size:12px;font-weight:800;padding:1px 5px;border-radius:8px;background:var(--ctp-mauve);color:var(--ctp-crust)} .duel-pair{font-size:9px;line-height:1.2;color:var(--ctp-green);text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:2px} .duel-ticker{display:flex;align-items:center;gap:6px;width:100%;min-height:36px;padding:6px 10px;border-radius:8px;background:var(--ctp-crust);border:1px dashed var(--ctp-surface1);text-align:left;font-size:12px;line-height:1.35;color:var(--ctp-subtext1)} @@ -48,6 +48,9 @@ .duel-dock{position:sticky;bottom:0;z-index:5;margin:0 -8px;padding:6px 8px calc(8px + env(safe-area-inset-bottom));background:var(--ctp-mantle);border-top:1px solid var(--theme-border);border-radius:0 0 12px 12px;display:flex;flex-direction:column;gap:6px} .duel-hand{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:6px 0 2px;min-height:112px} .duel-hand::-webkit-scrollbar{display:none} +.duel-hand-wrap{position:relative} +.duel-hand.has-more{-webkit-mask-image:linear-gradient(to right,#000 78%,transparent);mask-image:linear-gradient(to right,#000 78%,transparent)} +.duel-hand-more{position:absolute;right:0;top:50%;transform:translateY(-50%);min-width:40px;min-height:40px;border-radius:20px;background:var(--ctp-surface1);color:var(--ctp-text);font-weight:800;font-size:13px;box-shadow:0 2px 8px rgb(0 0 0/.4)} .duel-note{margin:0;min-height:18px;font-size:12px;line-height:1.35;color:var(--ctp-subtext1);display:flex;align-items:center;gap:6px} .duel-actions{display:flex;gap:8px;justify-content:flex-end} .duel-actions .button{min-height:46px;font-size:13px;padding:10px 16px} @@ -128,6 +131,17 @@ .duel-gate-bar{height:10px;border-radius:5px;background:var(--ctp-surface0);overflow:hidden;margin:12px 0 6px} .duel-gate-bar i{display:block;height:100%;background:var(--theme-accent)} +/* Tall phones (≥ 720 px): give the spare height to the cards, with 3-line titles (QA #58). */ +@media (max-width:899px) and (min-height:720px){ + .dface-board{min-height:112px} + .dface-board .dface-art{height:42px} + .dface-board .dface-title{-webkit-line-clamp:3;min-height:3.6em} + .dface-hand{min-height:128px} + .dface-hand .dface-art{height:52px} + .dface-hand .dface-title{-webkit-line-clamp:3;min-height:3.6em} + .duel-hand{min-height:134px} +} + /* Desktop: bigger cards, log always visible beside the field. */ @media (min-width:900px){ .duel{padding:10px 14px 0;font-size:14px} diff --git a/src/game/duel/mock.ts b/src/game/duel/mock.ts index 596f910..008cf52 100644 --- a/src/game/duel/mock.ts +++ b/src/game/duel/mock.ts @@ -46,7 +46,8 @@ export function previewCard(c: SampleCard, suffix = ''): BoardCard { const b = 2 * cost + 1, s = Math.min(0.7, Math.max(0.3, c.tiers.attention / (c.tiers.attention + c.tiers.depth || 1))); power = Math.max(1, Math.round(b * s)) - (keywords.length > 1 ? 1 : 0); toughness = Math.max(1, b - Math.round(b * s)); } else if (type === 'Location') { - rulesText = `Territory. Garrison 0/${1 + Math.floor(c.tiers.depth / 3)}.`; + power = 0; toughness = 1 + Math.floor(c.tiers.depth / 3); + rulesText = `Territory. Garrison 0/${toughness}.`; } else if (type === 'Event') { rulesText = /storm|nor.easter/i.test(c.description ?? '') ? `Deal ${Math.max(1, k - 1)} damage to each Figure and each Location.` : /election/i.test(c.description ?? '') ? `Create ${k} 1/1 Society Figure tokens named Elected Member.`