/* Only phone and touch-tablet structure; original illustrated surfaces and engines remain intact. */
@media(max-width:700px),(max-width:1024px) and (pointer:coarse){
 body[data-mobile-game152] :is(dialog,.win-panel){max-width:calc(100vw - 20px)!important;max-height:calc(100dvh - 20px)!important;overflow-y:auto;overscroll-behavior:contain}
 body[data-mobile-game152] input:not([type=range]):not([type=checkbox]):not([type=radio]),body[data-mobile-game152] select{font-size:16px}
 body[data-mobile-game152=twenty-squares] dialog[open]{display:block!important;overflow-y:auto!important;padding:10px 8px 16px!important;max-height:calc(100dvh - 16px)!important;border-width:22px 16px!important}
 body[data-mobile-game152=twenty-squares] dialog .dialog-body{overflow:visible!important;max-height:none!important;height:auto!important;padding:0!important}
 body[data-mobile-game152=twenty-squares] dialog .dialog-heading{margin-bottom:10px}
 body[data-mobile-game152=twenty-squares] :is(.dialog-done,.primary-button){min-height:44px}
 body[data-mobile-game152=twenty-squares] .board-surface{width:min(100%,190px)!important;aspect-ratio:1/3!important;margin:12px auto!important}
 body[data-mobile-game152=twenty-squares] .board-grid{width:174px!important;max-width:100%!important}
 body[data-mobile-game152=twenty-squares] .player-panel{min-height:120px!important;padding:20px 28px 54px!important;gap:8px!important}
 body[data-mobile-game152=twenty-squares] .player-identity h2{font-size:20px!important}
 body[data-mobile-game152=twenty-squares] .player-identity p{font-size:12px!important}
 body[data-mobile-game152=twenty-squares] .player-identity .player-stone{width:24px!important;height:24px!important}
 body[data-mobile-game152=twenty-squares] .reserve-stones .player-stone{width:13px!important;height:13px!important}
 body[data-mobile-game152=twenty-squares] .enter-button{position:absolute!important;left:28px!important;bottom:8px!important;width:calc(100% - 56px)!important;min-height:44px!important;padding:10px 20px!important}
 body[data-mobile-game152=twenty-squares] .turn-panel{padding:10px!important;min-height:0!important}
 body[data-mobile-game152=scripture-quest]{--rail:12px;padding-inline:var(--rail)!important}
 body[data-mobile-game152=scripture-quest] .set-masthead{min-height:100px!important;padding:12px!important}
 body[data-mobile-game152=scripture-quest] .set-masthead .quest-brand-title{font-size:clamp(24px,7vw,32px)!important;white-space:normal!important}
 body[data-mobile-game152=scripture-quest] .set-masthead .quest-brand-seal{width:44px!important;height:44px!important}
 body[data-mobile-game152=scripture-quest] .question-sheet{padding:18px 14px!important}
 body[data-mobile-game152=scripture-quest] .test-controls{gap:6px!important;flex-wrap:wrap!important;margin-bottom:14px!important}
 body[data-mobile-game152=scripture-quest] .test-controls .bg{flex:1!important;min-height:44px!important;padding:8px!important;font-size:13px!important}
 body[data-mobile-game152=knucklebones][data-kb-view=game]>.wrap{padding-block:8px!important;gap:12px!important;width:calc(100% - 20px)}
 body[data-mobile-game152=knucklebones] .match-bar{display:grid!important;grid-template-columns:1fr 1fr!important;align-items:center;gap:6px;margin-bottom:10px;padding:0}
 body[data-mobile-game152=knucklebones] .match-option{min-width:0!important;display:flex!important;flex-wrap:wrap!important}
 body[data-mobile-game152=knucklebones] .match-option select{width:100%!important;font-size:14px!important}
 body[data-mobile-game152=knucklebones] .match-option #volume{width:70px!important;min-height:44px!important}
 body[data-mobile-game152=knucklebones] .match-bar>button{min-height:44px;padding:7px 10px;font-size:12px}
 body[data-mobile-game152=knucklebones] .match-option{font-size:12px;gap:6px}
 body[data-mobile-game152=knucklebones] .match-option select{padding:6px;min-height:44px}
 body[data-mobile-game152=knucklebones] .arena{grid-template-columns:1fr 1fr!important;grid-template-areas:'you mira' 'stage stage'!important;gap:10px}
 body[data-mobile-game152=knucklebones] .fighter{display:grid;grid-template-columns:54px minmax(0,1fr);align-items:start;min-width:0;border-radius:12px}
 body[data-mobile-game152=knucklebones] .fighter .portrait{width:54px;height:80px!important}
 body[data-mobile-game152=knucklebones] .fighter .body{padding:8px!important;gap:3px!important}
 body[data-mobile-game152=knucklebones] .fighter .name{font-size:16px}
 body[data-mobile-game152=knucklebones] .fighter .role{font-size:10px;line-height:1.3}
 body[data-mobile-game152=knucklebones] .fighter .score-num{font-size:24px;line-height:1}
 body[data-mobile-game152=knucklebones] .fighter .score-of{font-size:10px}
 body[data-mobile-game152=knucklebones] .fighter .status-chip{font-size:10px;min-height:0;padding:2px}
 body[data-mobile-game152=knucklebones] .fighter .turn-flag{font-size:8px;padding:4px;left:2px;right:2px}
 body[data-mobile-game152=knucklebones] .stage{padding:10px;gap:8px}
 body[data-mobile-game152=knucklebones] .stage .speech{min-height:0;padding:8px;font-size:13px;line-height:1.4}
 body[data-mobile-game152=knucklebones] .stage .mat{min-height:0!important;height:clamp(140px,23dvh,200px)!important;padding:16px 10px}
 body[data-mobile-game152=knucklebones] .stage .bone{max-width:90px;min-height:44px}
 body[data-mobile-game152=knucklebones] .result-banner{padding:8px;line-height:1.4}
 body[data-mobile-game152=knucklebones] .result-banner .big{font-size:17px}
 body[data-mobile-game152=knucklebones] .result-banner .detail{font-size:12px}
 body[data-mobile-game152=knucklebones] .controls{display:flex;flex-wrap:wrap;gap:8px}
 body[data-mobile-game152=knucklebones] .controls>button{min-height:44px;flex:1;padding:10px}
 body[data-mobile-game152=knucklebones] .hero h1{overflow-wrap:anywhere;font-size:clamp(28px,7.7vw,48px)!important}
}
@media(max-width:359px){
 body[data-mobile-game152=knucklebones] .fighter{grid-template-columns:42px minmax(0,1fr)}
 body[data-mobile-game152=knucklebones] .fighter .portrait{width:42px}
}
@media(max-width:700px),(max-width:1024px) and (pointer:coarse){
 body[data-mobile-game152=gifts-of-grace] #dialogContent p{font-size:calc(16px * var(--scale,1))!important;line-height:1.55!important}
 body[data-mobile-game152=gifts-of-grace] #dialogContent p.small{font-size:14px!important}
 body[data-mobile-game152=gifts-of-grace] #dialogTitle{font-size:28px!important}
 body[data-mobile-game152=gifts-of-grace] .setting-row{flex-wrap:wrap!important;gap:10px!important}
 body[data-mobile-game152=gifts-of-grace] .setting-row select{width:100%!important;max-width:100%!important;min-height:44px!important}
 body[data-mobile-game152=gifts-of-grace] #dialog .button-row{flex-wrap:wrap!important}
 body[data-mobile-game152=gifts-of-grace] #dialog .button-row>button{width:100%!important;min-height:44px!important}
}

@media(max-width:700px),(max-width:1024px) and (pointer:coarse){
 body[data-mobile-game152=scripture-quest] .utility-dock{width:44px!important;right:12px!important;gap:4px!important}
 body[data-mobile-game152=scripture-quest] .utility-dock>button{width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
}
@media(min-width:761px) and (max-width:1024px) and (pointer:coarse){
 body[data-mobile-game152=twenty-squares] .board-surface{width:100%!important;aspect-ratio:3/1!important}
 body[data-mobile-game152=twenty-squares] .board-grid{width:81.5%!important}
}
