/* Portfolio integration: preserve the game's artwork and controls on small screens. */
@media (max-width: 760px) {
    body {
        grid-template-areas: "header header" "main main" "footer footer" "left right";
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: 144px auto auto auto;
        height: auto;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        background-attachment: fixed;
    }
    header { min-width: 0; padding-top: 48px; }
    #header_buttons { left: 10px; top: 10px; }
    #header_buttons button { width: auto; height: 34px; font-size: 7px; padding: 6px; gap: 6px; }
    #docs_link { right: 10px; top: 10px; font-size: 7px; padding: 10px; }
    #title img { height: auto; width: min(270px, 72vw); }
    main { min-width: 0; padding: 10px; }
    .lantern { display: none; }
    #game_board { width: min(100%, 520px); gap: 6px; padding: 12px; }
    .compartment { padding: 3px; gap: 2px; min-width: 0; }
    .compartment button { min-width: 0; min-height: 0; touch-action: manipulation; }
    footer { min-width: 0; flex-wrap: wrap; gap: 8px; margin: 12px 10px; padding: 12px 8px; }
    #hint { display: none; }
    #piece_tray { flex: 1 1 100%; max-width: 100%; min-width: 0; overflow-x: auto; gap: 6px; padding: 4px 4px 10px; }
    .piece_button { flex: 0 0 70px; min-width: 70px; min-height: 84px; font-size: 7px; }
    .mini_grid div { width: 14px; height: 14px; }
    #rotate_button, #hint_button { height: 48px; font-size: 9px; padding: 6px 20px; flex-direction: row; gap: 12px; }
    .sidebar { min-width: 0; overflow: visible; padding: 18px 10px 30px; }
    .portrait { width: 72px; }
    .sidebar input, .sidebar select, .player_stats { width: 94%; max-width: 212px; font-size: 7px; }
    .player_stats { gap: 10px 5px; }
    .select_label, .status { font-size: 7px; line-height: 1.8; }
    #how_to_button { font-size: 7px; padding: 10px 5px; }
    .decor { display: none; }
    .run_hud { font-size: 8px; }
    #settings_dialog { max-width: 94vw; font-size: 9px; padding: 20px 12px; }
}
