# Responsive Modal Pattern ## Overview This pattern provides an optimal UX for modal-like content by adapting to screen size: - **Desktop (>1024px)**: Displays content in modal overlays - **Mobile (≤1024px)**: Navigates to dedicated full pages This addresses common mobile modal UX issues: cramped space, nested scrolling, keyboard conflicts, and lack of native back button support. --- ## When to Use This Pattern Use this pattern when: - Content requires significant interaction (forms, chat, complex data) - Mobile users need better scroll/keyboard handling - The interaction benefits from full-screen on mobile - Desktop users benefit from keeping context visible **Don't use** for: - Simple confirmations/alerts (use standard modals) - Very brief interactions (dropdowns, tooltips) - Content that must overlay the game state --- ## Implementation Steps ### 1. Create Shared Content Partial Extract the actual content into a reusable partial template that both the modal and page can use. **File**: `templates/game/partials/[feature]_content.html` ```html {# Shared content partial #}