/* Critical illustrated content and primary actions share one portrait viewport. */
.quest-app .game-board:has(> .ballet-sample){
 display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;
 align-items:stretch;justify-content:stretch;gap:8px;
}
.quest-app .game-board>.ballet-sample{
 display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;
 width:100%;height:100%;margin:0;padding:5px;overflow:hidden;box-sizing:border-box;
}
.quest-app .game-board>.ballet-sample img.portrait{
 display:block;min-width:0;min-height:0;width:100%;height:100%;max-width:100%;max-height:100%;
 object-fit:contain;object-position:center;border-radius:13px;
}
.quest-app .game-board:has(>.racers-route){
 display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);
 align-items:stretch;overflow:hidden;padding:2px 0;
}
.quest-app .game-board>.racers-route{
 display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) 44px;
 gap:5px;width:100%;height:100%;min-height:0;min-width:0;container-type:size;
}
.quest-app .racers-route>.mini-caption,.quest-app .racers-route>.road-endpoints{margin:0}
.quest-app .racers-route>.road-grid{
 height:100%;width:auto;aspect-ratio:1;max-width:100%;max-height:100cqw;min-width:0;min-height:0;
 justify-self:center;align-self:center;
}
.quest-app .racers-route>.road-go{justify-self:center;min-height:44px;margin:0}
/* The cipher keeps a full-size input and action; ornament yields space first. */
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-fixed-scene{
 align-items:stretch;overflow:hidden;
}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-cipher{
 width:100%;height:100%;max-height:100%;min-height:0;box-sizing:border-box;
 grid-template-columns:minmax(76px,30%) minmax(0,1fr);
 grid-template-rows:auto minmax(24px,1fr) 44px auto auto;
 gap:5px 8px;padding:8px;align-content:stretch;
}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-cipher-head{font-size:12px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-cipher-head span{font-size:10px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-disk{
 width:min(100%,100px);height:auto;max-height:100%;min-height:0;align-self:center;
}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-key{font-size:13px;align-self:center}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-toolbar{
 grid-template-columns:44px minmax(65px,1fr) 44px;gap:3px;
}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-toolbar .det-btn{
 width:44px;min-width:44px;max-width:44px;min-height:44px;font-size:18px;
}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-toolbar strong{font-size:12px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-cipher-word{padding:4px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-code{font-size:22px;line-height:1.1}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-cipher-pairs{gap:3px;flex-wrap:nowrap}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-cipher-pairs span{min-width:0;flex:1;padding:3px;font-size:17px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-answer-form{align-self:end}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-answer-form label{font-size:12px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-answer-form input,
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-answer-form>.det-btn{min-height:44px}
/* WebKit needs explicit line heights so a 4×4 route keeps 44px touch targets. */
.quest-app .racers-route>.mini-caption{font-size:14px;line-height:1.25}
.quest-app .racers-route>.road-endpoints{font-size:10px;line-height:1.2}
.quest-app .game-board>.racers-route{gap:3px}
/* Modern keeper dial gets space while preserving the input and touch targets. */
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-cipher{grid-template-columns:minmax(0,52%) minmax(0,1fr);grid-template-rows:auto minmax(36px,1fr) 44px auto auto;gap:6px;padding:9px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-disk{width:min(100%,210px);max-height:none}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-toolbar{grid-template-columns:44px minmax(0,1fr) 44px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-toolbar strong{font-size:10px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-fixed-scene{overflow:auto}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-cipher{grid-template-columns:minmax(0,60%) minmax(0,1fr);grid-template-rows:auto minmax(32px,1fr) auto auto auto}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-toolbar{grid-template-columns:1fr 1fr;grid-template-rows:auto 44px;gap:3px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-toolbar [data-shift]{grid-column:1/-1;grid-row:1;font-size:11px}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-toolbar [data-det=minus]{grid-column:1;grid-row:2;justify-self:center}
.quest-app .det-fixed-board[data-detective-stage=cipher] .det-toolbar [data-det=plus]{grid-column:2;grid-row:2;justify-self:center}
