/* Shared answer controls, with the existing assessment and keyboard paths. */
.answer-controls{width:100%;grid-column:1/-1;flex-basis:100%;text-align:center;margin:4px 0}
.answer-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:540px;margin:0 auto}
dialog .answer-options button{min-height:48px;min-width:0;padding:8px 14px;font:700 24px system-ui;color:#3d2c17;background:linear-gradient(#fff1c9,#e3c58a);border:2px solid #ad8041;border-radius:10px;box-shadow:0 3px 0 #755128;touch-action:manipulation}
dialog .answer-controls .answer-mode{display:block;min-height:44px;padding:6px 12px;margin:6px auto 0;font:15px system-ui;text-decoration:underline;background:transparent;color:inherit;border:0;box-shadow:none}
.answer-options-active .answer-native{display:none!important}
.answer-gap{display:none}.answer-options-active .answer-gap{display:inline-flex;align-items:center;justify-content:center;min-width:50px;border:2px dashed #ab813f;border-radius:8px}
.number-pad{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;width:100%;max-width:560px;margin:6px auto 0;grid-column:1/-1;flex-basis:100%}
.number-pad-label{grid-column:1/-1;font:12px system-ui;min-height:14px}
dialog .number-pad button{min-height:44px;min-width:0;padding:3px;font:600 18px system-ui;border:1px solid #ab813f;border-radius:6px;background:#fff5d9;color:#382a16;box-shadow:0 2px 0 #8d6a37;touch-action:manipulation}
.number-pad button:last-child{grid-column:span 2;font-size:14px}
dialog .number-pad button:nth-last-child(-n+3){font-size:14px}
.pad-selected{outline:3px solid #936421!important;outline-offset:-3px}
.answer-options button:focus-visible,.number-pad button:focus-visible{outline:3px solid #277c85;outline-offset:2px}
.answer-controls[hidden],.answer-options[hidden],.number-pad[hidden]{display:none!important}
.touch-answers #puzzle{width:min(960px,calc(100vw - 20px));max-width:960px;max-height:calc(var(--view-height,100dvh) - 16px);overflow:auto;padding:18px 24px}
.touch-answers #puzzle .portrait,.touch-answers #puzzle #quest-intro,.touch-answers #puzzle #story{display:none}
.touch-answers #puzzle h2{font-size:24px;margin:4px 40px 6px}
.touch-answers #puzzle #equation{display:block!important;font-size:32px;padding:4px;margin:6px 0}
.touch-answers #worksheet-panel{padding:8px;margin:4px 0}
.touch-answers #worksheet-guide{font-size:12px;line-height:1.3}
.touch-answers .worksheet-scroll{max-height:35dvh;overflow:auto;overscroll-behavior:contain}
.touch-answers .worksheet-actions{gap:6px;margin:5px 0}
.touch-answers .worksheet-actions button{min-height:44px;padding:6px 9px;font-size:14px}
.touch-answers #puzzle .close{position:absolute!important;top:8px;right:16px;float:none;margin:0;z-index:2}
.touch-answers #puzzle #feedback{font-size:14px;min-height:18px;margin:5px 0}
.touch-answers #puzzle #new-question{min-height:44px;margin:3px auto;padding:6px 12px;font-size:15px}
.touch-answers #puzzle #crystal-progress{margin:4px auto}
.touch-answers #puzzle .answer-row input{font-size:20px;min-height:44px}
.touch-answers #puzzle:has(#worksheet-panel:not([hidden])) #answer-form>.number-pad{display:none!important}
.touch-answers #rune-riddles .rune-guide{display:none}
.touch-answers #rune-riddles{padding-left:18px;padding-right:18px}
.touch-answers #troll-dialog{max-height:calc(var(--view-height,100dvh) - 16px);overflow:auto}
.touch-answers #troll-dialog .sequence-row{flex-wrap:wrap;gap:8px}
.touch-answers #troll-dialog .sequence-row>*{min-width:40px}
.touch-answers #rune-riddles .answer-options button{font-size:24px;min-height:44px}
.touch-answers #wildlife-game.level-stats .wildlife-scene{width:100%;height:var(--view-height,100dvh);aspect-ratio:auto}
.touch-answers #wildlife-game.level-stats .wildlife-board{top:62px;bottom:62px;height:auto;left:3%;width:94%;padding:10px}
.touch-answers #wildlife-game.level-stats .wildlife-board h3{font-size:20px;min-height:26px;margin:0 0 8px}
.touch-answers #wildlife-game.level-stats #wildlife-rows{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(200px,1fr);grid-template-rows:auto auto minmax(0,1fr);height:calc(100% - 50px);gap:8px}
.touch-answers #wildlife-game .stats-caption{grid-column:1;font-size:13px}
.touch-answers #wildlife-game .stats-chart{grid-column:1;grid-row:3;height:100%;min-height:95px;padding-bottom:60px;margin:4px 8px 0 12px}
.touch-answers #wildlife-game .stats-answer{grid-column:2;grid-row:1/span 3;flex-wrap:wrap;overflow:auto;align-content:center;align-self:stretch;margin:0;min-height:0}
.touch-answers #wildlife-game .stats-label{height:28px;font-size:12px}
.touch-answers #wildlife-game .stats-controls button{min-height:36px;min-width:40px}
.touch-answers #wildlife-game .stats-scale{font-size:11px}
.touch-answers #wildlife-game .answer-options button{font-size:22px;min-height:44px}
.touch-answers #wildlife-game .answer-mode{min-height:32px;margin:0}
.touch-answers #wildlife-game footer{bottom:6px;gap:2px}
.touch-answers #wildlife-game #wildlife-feedback{min-height:0;font-size:13px}
@media(orientation:landscape){
 .touch-answers #puzzle:has(#worksheet-panel:not([hidden])){display:grid;grid-template-columns:minmax(200px,.85fr) minmax(300px,1.15fr);gap:0 18px;align-content:start}
 .touch-answers #puzzle:has(#worksheet-panel:not([hidden]))>*{grid-column:1;min-width:0}
 .touch-answers #puzzle:has(#worksheet-panel:not([hidden])) #worksheet{grid-column:2;grid-row:1/span 15;align-self:start;padding-right:12px}
 .touch-answers #puzzle:has(#worksheet-panel:not([hidden])) #math-support{display:none}
 .touch-answers .worksheet-scroll{max-height:calc(var(--view-height,100dvh) - 275px);min-height:80px}
}
@media(max-height:550px){
 .touch-answers #puzzle{padding:8px 18px}
 .touch-answers #puzzle h2{font-size:20px;margin:0 30px 3px}
 .touch-answers #puzzle #equation{font-size:27px;margin:2px 0}
 .touch-answers #puzzle #puzzle-step{font-size:10px}
 .touch-answers #puzzle #worksheet-toggle{min-height:38px;padding:5px 9px;font-size:14px}
 .touch-answers #puzzle #worksheet-guide{max-height:32px;overflow:auto;margin-bottom:4px!important}
 .touch-answers #puzzle #worksheet .number-pad-label{display:none}
 .touch-answers #puzzle .worksheet-actions{display:grid;grid-template-columns:1fr 1fr}
 .touch-answers #puzzle .worksheet-actions button{min-width:0;font-size:12px;padding:4px}
 .touch-answers #puzzle .worksheet-actions button:nth-child(2){display:none}
 .touch-answers #puzzle:has(#worksheet-panel:not([hidden])) #crystal-progress{display:none}
 .touch-answers #rune-riddles{padding:8px 14px;border-width:5px}
 .touch-answers #rune-riddles h2{font-size:21px;margin:2px 30px}
 .touch-answers #rune-riddles .rune-rule{font-size:13px;margin:2px 0}
 .touch-answers #rune-riddles .rune-progress{font-size:10px}
 .touch-answers #rune-riddles .rune-equation{min-height:31px;font-size:22px;padding:0}
 .touch-answers #rune-riddles .rune-icon{width:30px;height:30px;flex-basis:30px}
 .touch-answers #rune-riddles .rune-question,.touch-answers #rune-riddles .rune-form{margin:4px 0}
 .touch-answers #rune-riddles .answer-options{grid-template-columns:repeat(4,minmax(0,1fr))}
 .touch-answers #rune-riddles footer{margin:2px 0;gap:8px}
 .touch-answers #rune-riddles .rune-feedback{font-size:13px;margin:3px 0}
 .touch-answers #rune-riddles .answer-mode{margin-top:0}
 .touch-answers #fishing-reel{top:57%;padding:8px;width:95%}
 .touch-answers .fishing-reel-grid{grid-template-columns:26% 1fr 38px;gap:8px}
 .touch-answers #fishing-equation{font-size:25px;margin-bottom:4px;padding:4px}
 .touch-answers #fishing-answers .answer-options button{font-size:22px;min-height:44px;padding:4px}
 .touch-answers #fishing-answers .answer-mode{font-size:13px;min-height:32px;height:32px;margin:0}
 .touch-answers .fishing-reel-heading h2{font-size:21px}
 .touch-answers #troll-dialog{padding:10px 18px}
 .touch-answers #troll-dialog h2{font-size:23px;margin:3px 30px}
 .touch-answers #troll-dialog p{margin:4px 0;font-size:14px}
 .touch-answers #troll-dialog .answer-options{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(orientation:portrait){
 .touch-answers #puzzle{padding:12px}
 .touch-answers #rune-riddles{width:calc(100vw - 16px);max-height:calc(var(--view-height,100dvh) - 16px);padding:12px;border-width:5px}
 .touch-answers #fishing-stage:has(#fishing-reel:not([hidden])){height:100dvh;aspect-ratio:auto}
 .touch-answers #fishing-reel{top:56%;width:94%;padding:10px}
 .touch-answers .fishing-reel-grid{grid-template-columns:1fr 32px;gap:8px}
 .touch-answers .fishing-fish-view{display:none}
 .touch-answers .fishing-reel-heading h2{font-size:23px}
 .touch-answers .fishing-toolbar strong{display:none}
 .touch-answers #fishing-intro,.touch-answers #fishing-pause-cover{max-height:80dvh;overflow:auto}
 .touch-answers #wildlife-game.level-stats #wildlife-rows{display:flex;height:calc(100% - 60px);gap:8px}
 .touch-answers #wildlife-game .stats-chart{min-height:150px;width:90%;flex:1}
 .touch-answers #wildlife-game .stats-answer{overflow:visible;flex:none}
 .touch-answers #wildlife-game .wildlife-scene h2{display:none}
}
