/* FormyDog v23 · distribución PC balanceada + popups robustos */
@media (min-width:901px){
  html body .app{
    padding:10px 18px 12px!important;
    gap:12px!important;
  }
  html body .app>.topbar{
    width:min(1380px,100%)!important;
    min-height:64px!important;
    padding:8px 12px!important;
    gap:10px!important;
  }
  html body .app>.topbar .brand{min-width:205px!important}
  html body .app>.topbar .fd-header-tools{margin-left:4px!important}
  html body .app>.topbar .resources{gap:7px!important}
  html body .app>.topbar .resource{min-width:92px!important}

  html body .app>.game-layout{
    width:min(1260px,100%)!important;
    grid-template-columns:220px minmax(520px,720px) 220px!important;
    grid-template-rows:minmax(0,1fr) auto!important;
    column-gap:18px!important;
    row-gap:8px!important;
    align-items:center!important;
  }
  html body .app>.game-layout>.side{
    width:220px!important;
    align-self:center!important;
  }
  html body .app>.game-layout>.goals{
    grid-column:1!important;
    grid-row:1!important;
    padding:13px!important;
  }
  html body .app>.game-layout>.boosters{
    grid-column:3!important;
    grid-row:1!important;
    padding:12px!important;
    gap:8px!important;
  }
  html body .app>.game-layout>.boosters .booster{
    min-height:62px!important;
    grid-template-columns:44px 1fr auto!important;
    padding:7px 8px!important;
  }
  html body .app>.game-layout>.boosters .booster img{
    width:41px!important;
    height:41px!important;
  }
  html body .app>.game-layout>.boosters .mini-btn{
    min-height:38px!important;
  }

  html body .app>.game-layout>.center{
    grid-column:2!important;
    grid-row:1!important;
    width:100%!important;
    max-width:720px!important;
    min-width:0!important;
    min-height:0!important;
    margin:0 auto!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    grid-template-rows:auto auto auto!important;
    gap:8px!important;
    align-items:stretch!important;
    justify-items:stretch!important;
  }
  html body .app>.game-layout>.center .board-shell{
    grid-column:1/-1!important;
    grid-row:1!important;
    width:min(66dvh,100%,650px)!important;
    max-width:650px!important;
    max-height:calc(100dvh - 210px)!important;
    margin:0 auto!important;
  }
  html body .app>.game-layout>.center .status{
    grid-column:1/-1!important;
    grid-row:2!important;
    width:min(100%,650px)!important;
    margin:0 auto!important;
    min-height:32px!important;
  }
  html body .app>.game-layout>.center .fd-game-share{
    grid-column:1!important;
    grid-row:3!important;
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
    margin:0!important;
    padding:5px!important;
    align-self:stretch!important;
  }
  html body .app>.game-layout>.center .fd-pet-tools{
    grid-column:2!important;
    grid-row:3!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:5px!important;
    align-self:stretch!important;
  }
  html body .app>.game-layout>.center .fd-pet-tools button{
    min-height:46px!important;
    height:100%!important;
    padding:5px 7px!important;
    font-size:8px!important;
    line-height:1.15!important;
  }
  html body .app>.game-layout>.fd-board-ad{
    grid-column:2!important;
    grid-row:2!important;
    width:auto!important;
    min-width:180px!important;
    max-width:360px!important;
    min-height:24px!important;
    margin:0 auto!important;
    padding:4px 12px!important;
    border-radius:999px!important;
    opacity:.92!important;
  }

  /* Laterales visualmente equilibrados con el centro. */
  html body .app>.game-layout>.goals .goal-box{padding:10px!important}
  html body .app>.game-layout>.goals .moves-box{padding:9px!important}
  html body .app>.game-layout>.goals .progress-row{margin-top:10px!important}
  html body .app>.game-layout>.goals .how{margin-top:10px!important}
}

@media (min-width:901px) and (max-height:820px){
  html body .app>.game-layout>.center .board-shell{
    width:min(60dvh,100%,590px)!important;
    max-width:590px!important;
  }
  html body .app>.game-layout>.center .status{width:min(100%,590px)!important}
}

@media (min-width:901px) and (max-width:1160px){
  html body .app>.game-layout{
    grid-template-columns:185px minmax(470px,1fr) 185px!important;
    column-gap:10px!important;
  }
  html body .app>.game-layout>.side{width:185px!important}
  html body .app>.game-layout>.center .board-shell{width:min(62dvh,100%,610px)!important}
  html body .app>.game-layout>.boosters .booster{grid-template-columns:38px 1fr auto!important;padding:6px!important}
  html body .app>.game-layout>.boosters .booster img{width:36px!important;height:36px!important}
}

/* Un modal visible siempre gana al canvas y al header. */
html body .fd-modal:not([hidden]),
html body #fdProfile:not([hidden]),
html body #fdCareCenter:not([hidden]),
html body #fdStore:not([hidden]){
  z-index:26000!important;
  pointer-events:auto!important;
}
html body .fd-modal:not([hidden]) .fd-card,
html body #fdCareCenter:not([hidden]) .fd-care-card{
  pointer-events:auto!important;
}
