/* Website phones only: one overlay inside the painted game surface. */
@media(pointer:coarse){
 html body :is(.weight-game,.quiz-shell,.new-game-shell,.plate-genesis) .phone-layout-toolbar{
  position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;padding:0!important;margin:0!important;transform:none!important;display:block!important;overflow:visible!important;pointer-events:none!important;background:none!important;border:0!important;box-shadow:none!important;z-index:110!important;
 }
 html body .phone-layout-toolbar :is(.arcade-toolbar-primary,.arcade-toolbar-access){display:contents!important}
 html body .phone-layout-toolbar button[data-toolbar-action]{position:absolute!important;pointer-events:auto!important;box-sizing:border-box!important}
 html body .phone-layout-toolbar button[hidden]{display:none!important}
 html body .phone-layout-toolbar button :is(img,svg){width:28px!important;height:28px!important;max-width:100%!important;max-height:100%!important}
}

/* Instruction screens cover the arena on desktops and phones, including rotated games. */
html body .weight-game.game-instructions-pending .game-retro-instructions{
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
 max-width:none!important;max-height:none!important;margin:0!important;border:0!important;
 border-radius:0!important;box-shadow:none!important;box-sizing:border-box!important;
 padding:64px max(20px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))!important;
 display:flex!important;flex-direction:column!important;justify-content:center!important;
 gap:6px!important;overflow:hidden!important;background:#122239!important;z-index:7!important;
 color:#fff1b9!important;font-size:clamp(13px,2.3vh,18px)!important;line-height:1.35!important;
}
html body .weight-game.game-instructions-pending .game-retro-instructions p{margin:4px 0!important;font-size:inherit!important;line-height:inherit!important}
html body .weight-game.game-instructions-pending .game-retro-instructions>strong{min-height:0!important;padding:0!important}
html body .weight-game.game-instructions-pending .game-instructions-title{font-size:clamp(18px,3.5vh,28px)!important;margin:0!important;padding:0!important;border:0!important}
html body .weight-game.game-instructions-pending .game-instructions-start{flex-shrink:0!important;min-height:40px!important;margin:6px auto 0!important;max-width:600px!important;width:100%!important}
html body .weight-game.game-instructions-pending .game-arena{overflow:hidden!important}

/* Full instruction surface: beat landscape/food inset rules in every phone flow. */
html body .weight-game.game-instructions-pending:is(.action-landscape,.food-game,.runner-game,#weight-game) .game-retro-instructions{
 position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
 max-width:none!important;max-height:none!important;margin:0!important;border:0!important;
 border-radius:0!important;box-sizing:border-box!important;box-shadow:none!important;
 padding:60px 18px 12px!important;background:#122239!important;overflow:hidden!important;
 display:flex!important;flex-direction:column!important;justify-content:center!important;
 align-items:stretch!important;gap:8px!important;font-size:clamp(13px,2.5cqh,18px)!important;line-height:1.35!important;
}
html body .weight-game.game-instructions-pending:is(.action-landscape,.food-game,.runner-game,#weight-game) .game-retro-instructions p{font-size:inherit!important;line-height:inherit!important;margin:0!important}
html body .weight-game.game-instructions-pending:is(.action-landscape,.food-game,.runner-game,#weight-game) .game-retro-instructions>strong{padding:0!important;min-height:0!important;text-align:center!important}
html body .weight-game.game-instructions-pending:is(.action-landscape,.food-game,.runner-game,#weight-game) .game-instructions-title{display:none!important}
html body .weight-game.game-instructions-pending:is(.action-landscape,.food-game,.runner-game,#weight-game) .game-instructions-start{min-height:40px!important;width:min(100%,600px)!important;margin:6px auto 0!important;flex-shrink:0!important}
@media(pointer:coarse){
 html body .weight-game.game-instructions-pending .game-desktop-help{display:none!important}
 html body .weight-game.game-instructions-pending .game-mobile-help{display:block!important}
}

/* Reserve one clear row above every food loss-menu block on website phones. */
@media(pointer:coarse){
 html body .weight-game.food-game.game-is-over .game-over-panel{
  inset:0!important;transform:none!important;width:100%!important;height:100%!important;
  max-height:none!important;box-sizing:border-box!important;
  padding-top:var(--phone-result-inset,74px)!important;
 }
}

/* Center the phone food result group in the space below its toolbar. */
@media(pointer:coarse){
 html body #food-game.weight-game.food-game.game-is-over .game-over-panel{
  justify-content:safe center!important;align-items:center!important;
  padding-bottom:20px!important;padding-inline:16px!important;
  overflow-y:auto!important;
 }
 html body #food-game.weight-game.food-game.game-is-over .game-over-panel > *{
  flex-shrink:0;box-sizing:border-box;width:min(100%,460px);max-width:100%;
 }
 html body #food-game.weight-game.food-game.game-is-over .game-over-heading-block{
  text-align:center!important;
 }
}
