/* Narrowly scoped gameplay layout. Does not affect account, report, or admin screens. */
#r46DinoPage .r48GameWelcome{background-image:linear-gradient(180deg,rgba(255,255,255,.09),rgba(13,75,35,.45)),url('./ui194/sa_chick_mascot.svg')!important;background-repeat:no-repeat!important;background-position:center!important;background-size:cover,auto 92%!important;background-color:#caedbb!important;width:min(85%,360px)!important;min-height:170px!important}
#r46DinoPage .r48WelcomeShade{padding:12px!important}
#r46DinoPage .r48WelcomeShade h3{font-size:clamp(17px,4vw,22px)!important;margin:3px 0!important}
#r46DinoPage .r48WelcomeShade p{font-size:12px!important;line-height:1.3!important}
#r46DinoPage .r46DinoCanvasWrap{flex:1 1 0!important;min-height:0!important;overflow:hidden!important;touch-action:manipulation!important}
#r46DinoPage .r46DinoShell{display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;height:100%!important}
#r46DinoPage #r46DinoCanvas{touch-action:manipulation!important;max-height:100%!important}
#r46DinoPage .r46DinoControls,#r46DinoPage .r58DinoDifficulty{flex:0 0 auto!important}
#r46DinoPage .r46GameBody{min-height:0!important}
@media(max-width:720px){
 #r46DinoPage .r46DinoCanvasWrap{min-height:0!important}
 #r46DinoPage .r46DinoShell{padding:5px!important;gap:4px!important}
 #r46DinoPage .r46GameHead{min-height:36px!important;padding:3px 5px!important}
 #r46DinoPage .r46GameHead h2{font-size:16px!important}
 #r46DinoPage .r58DinoDifficulty button{min-height:36px!important}
 #r46DinoPage #r46Jump,#r46DinoPage #r46DinoStart{min-height:44px!important;padding:7px!important}
 #r46DinoPage .r48GameWelcome{min-height:135px!important;width:min(87%,300px)!important}
}
@media(max-width:930px){
 /* Adventure gameplay: remove 400–460px minimum heights that cut landscape phone screens. */
 #game.saCleanAdventure #v17FrameWrap{min-height:0!important;height:clamp(130px,calc(100dvh - 175px),600px)!important;max-height:calc(100dvh - 145px)!important}
 #game.saCleanAdventure #v17MarioFrame{min-height:0!important;max-height:100%!important;height:100%!important}
 #game.saCleanAdventure #v19EmbeddedGameHost{min-height:0!important;height:clamp(130px,calc(100dvh - 175px),600px)!important;max-height:calc(100dvh - 145px)!important}
 #game.saCleanAdventure .gamewrap{max-width:100%!important;min-width:0!important}
 #abacus.saAbacusClean .abstage{height:clamp(140px,calc(100dvh - 205px),600px)!important;min-height:0!important;max-height:calc(100dvh - 160px)!important;overflow:auto!important}
 #abacus.saAbacusClean #abinner{display:flex!important;visibility:visible!important;opacity:1!important;max-height:100%!important}
}
@media(max-height:520px) and (orientation:landscape){
 #game.saCleanAdventure{padding:3px 6px!important}
 #game.saCleanAdventure>.head{min-height:28px!important;margin:0!important}
 #game.saCleanAdventure>.head h2{font-size:15px!important}
 #game.saCleanAdventure #v17FrameWrap{height:calc(100dvh - 88px)!important;max-height:calc(100dvh - 88px)!important}
 #game.saCleanAdventure #v19EmbeddedGameHost{height:calc(100dvh - 88px)!important;max-height:calc(100dvh - 88px)!important}
 #game.saCleanAdventure .card.gamewrap{padding:3px!important}
 #abacus.saAbacusClean{padding:2px 8px 48px!important}
 #abacus.saAbacusClean>.head{margin:0 0 2px!important}
 #abacus.saAbacusClean>.head h2{font-size:15px!important}
 #abacus.saAbacusClean .abstage{height:calc(100dvh - 110px)!important;max-height:calc(100dvh - 110px)!important;min-height:0!important}
 #abacus.saAbacusClean .saSettingsToggle{min-height:30px!important;padding:2px!important}
 #r46DinoPage .r48GameWelcome{min-height:92px!important;width:min(73%,245px)!important}
 #r46DinoPage .r48WelcomeShade p{display:none!important}
 #r46DinoPage .r48WelcomeShade h3{font-size:15px!important}
}
/* Avoid swallowing pointer events in game canvas controls. */
#game .gamecanvasbox .gameTouchOverlay button,#r46DinoPage button{touch-action:manipulation!important}
.saHistoryStatus{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid #d9e6e0;border-radius:12px;padding:8px 12px;background:#eef7f2;font-size:13px;font-weight:750;color:#245b4b;margin-bottom:8px}
.saHistoryStatus[data-state="error"]{color:#963a34;background:#fff0eb;border-color:#f2c1b5}
.saHistoryStatus button{border:1px solid #bd6b60;border-radius:10px;background:#fff;padding:6px 10px;font-weight:800;color:inherit;cursor:pointer}

/* Keep each activity's primary play surface and action area above the bottom dock. */
@media(max-width:720px), (max-height:520px) and (orientation:landscape){
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel{display:flex!important;flex-direction:column!important;gap:5px!important;padding:7px!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel>.note{font-size:12px!important;line-height:1.25!important;padding:5px 7px!important;margin:0!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel>.bigcenter,
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel>.flashstage{font-size:clamp(28px,8vw,45px)!important;padding:5px!important;margin:0!important;min-height:50px!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel .mazeCanvas{width:100%!important;max-height:34dvh!important;height:auto!important;object-fit:contain!important;touch-action:none!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel .canvasPaint{max-height:36dvh!important;object-fit:contain!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel .ab-mini{max-height:34dvh!important;min-height:0!important;overflow:auto!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel .mazeShell,
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel .pathBoard{max-height:36dvh!important;min-height:0!important;overflow:hidden!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel .choices,
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel .mazeControls,
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel .palette{flex:0 0 auto!important;gap:4px!important;margin-top:2px!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel textarea{max-height:30dvh!important;min-height:60px!important;resize:vertical!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel .field{margin-block:3px!important}
 #fun.saQaActivityOpen:not(.sa78ReadActive) #activityArea>.activitypanel>.feedback{flex:0 0 auto!important;min-height:20px!important}
}

/* Chick screen: proportional actor and quiet introduction, no impact on other games. */
#r46DinoPage .r48GameWelcome{width:min(74%,270px)!important;min-height:112px!important;background-size:cover,auto 82%!important;border-radius:18px!important}
#r46DinoPage .r48WelcomeShade{padding:9px 11px!important}
#r46DinoPage .r48WelcomeShade p{font-size:11px!important;line-height:1.2!important}
#r46DinoPage .r48WelcomeShade h3{font-size:clamp(14px,3.6vw,18px)!important;margin:1px 0!important}
#r46DinoPage .r46DinoControls{gap:5px!important}
@media (max-width:720px){
 #r46DinoPage .r48GameWelcome{width:min(68%,225px)!important;min-height:92px!important}
 #r46DinoPage .r46DinoStat .r46Pill{padding:4px 7px!important;font-size:11px!important}
 #r46DinoPage #r46Jump,#r46DinoPage #r46DinoStart{min-height:44px!important;font-size:15px!important;padding:8px!important}
}
@media(max-height:520px) and (orientation:landscape){
 #r46DinoPage .r48GameWelcome{width:min(56%,165px)!important;min-height:70px!important}
 #r46DinoPage .r48WelcomeShade p{display:none!important}
 #r46DinoPage .r48WelcomeShade h3{font-size:13px!important}
}

/* The first-use chick instructions remain available but no longer obscure most of the playfield. */
#r46DinoPage .r52TutorialCard{width:min(90%,295px)!important;max-height:min(72dvh,285px)!important;overflow:auto!important;padding:12px 14px!important;border-radius:17px!important}
#r46DinoPage .r52TutorialCard .r48ResultIcon{font-size:27px!important}
#r46DinoPage .r52TutorialCard h3{font-size:18px!important;margin:2px!important}
#r46DinoPage .r52TutorialCard p{font-size:12px!important;line-height:1.4!important}
#r46DinoPage .r52TutorialCard .r52TutorialClose{min-height:40px!important;padding:8px 20px!important;font-size:14px!important;margin-top:6px!important}
@media(max-height:520px) and (orientation:landscape){#r46DinoPage .r52TutorialCard{max-height:calc(100dvh - 70px)!important;padding:7px 12px!important}#r46DinoPage .r52TutorialCard p{line-height:1.25!important}}

/* Desktop-only responsive surface: preserve the original game/lab layout and
   touch coordinates, but do not constrain these two pages to the 430px app shell.
   The app's other pages remain unchanged. */
@media screen and (min-width:900px) {
 body.r57-app-mode:has(#game:not(.hidden)) #app,
 body.r57-app-mode:has(#abacus:not(.hidden)) #app {
  width:min(100%,1120px)!important;
  max-width:1120px!important;
  margin-inline:auto!important;
 }
 body.r57-app-mode:has(#game:not(.hidden)) #game,
 body.r57-app-mode:has(#abacus:not(.hidden)) #abacus {
  width:100%!important;
  max-width:100%!important;
 }
}
