1## Context23Gift is rendered on a canvas from `src/scenes/gift.js`. The current card derives preview and action positions from fixed offsets inside a centered card, so a desktop shared-pack preview can consume the same vertical region as the action buttons. Mobile cards also need independent vertical placement because the available width and height are smaller.45## Goals / Non-Goals67**Goals:**89- Define separate content, preview, metadata, actions, and hint regions within the card.10- Keep every action visible and inside the card at desktop and mobile sizes.11- Keep button hit targets at least 44 CSS pixels high and preserve keyboard selection order.12- Make collision mode use the same layout contract for Replace, Keep Both as a Copy, and Cancel.13- Verify the shared URL Gift path and reduced-motion rendering.1415**Non-Goals:**1617- Changing pack payloads, preview data, installation confirmation, or duplicate policy.18- Reworking the designer's visual language, typography, or board art beyond placement needed to prevent overlap.19- Adding a DOM layout fallback or a new UI dependency.2021## Decisions2223### Reserve the action region before sizing the preview2425Compute card geometry from viewport size, reserve the action stack and footer hint first, then fit title, metadata, and board preview into the remaining content rectangle. This keeps actions stable as level titles and preview boards vary. A purely fixed preview height was rejected because it can still collide on shorter desktop windows.2627### Use one responsive layout contract with stacked mobile actions2829Desktop may place the preview beside the action column when space allows; narrow cards SHALL stack preview above actions. Both modes use the same hit rectangles and minimum button height. Separate desktop and mobile implementations were rejected because they drift in keyboard and pointer behavior.3031### Keep preview clipping local to its content region3233Clip or scale only the board preview to its assigned rectangle. Text metadata and action labels remain independently measurable and are never allowed to draw into the action region. Allowing the whole card to overflow was rejected because it hides controls and creates ambiguous pointer targets.3435### Test geometry as observable layout data3637Expose or inspect the scene's rendered button rectangles and assert containment, non-overlap, and viewport margins in unit tests. Browser checks then verify the visible shared URL Gift card and actual pointer/keyboard activation. Screenshot-only coverage was rejected because it does not prove hit target geometry.3839## Risks / Trade-offs4041- [Risk] Long pack names or level titles reduce preview space. → Fit text to its content region and preserve the action region as the highest priority.42- [Risk] Very short viewports may not fit all content simultaneously. → Keep the card within safe margins, allow the content preview to scale or clip, and keep actions reachable in the scroll-free canvas scene.43- [Risk] Desktop and mobile hit rectangles diverge. → Share action construction and assert keyboard/pointer parity in both layouts.4445## Migration Plan46471. Update Gift geometry and drawing/hit testing together.482. Add unit regressions for desktop, mobile, collision, and reduced-motion layout.493. Run browser shared URL Gift checks at desktop and mobile widths.504. Roll back by reverting the scene geometry and tests; no persisted data migration is required.5152## Open Questions5354None for this focused fix. Final visual spacing remains subject to the existing designer reference review.