/* Reusable fullscreen entry for every non-cover game page.
   It belongs to the common 16:9 stage and does not alter scene layouts. */
#stage-fullscreen {
  position:absolute;
  z-index:999; /* Above all ordinary scene overlays; native dialogs keep their own top layer. */
  right:max(10px,env(safe-area-inset-right));
  bottom:max(10px,env(safe-area-inset-bottom));
  width:38px;
  height:38px;
  min-width:38px;
  min-height:38px;
  box-sizing:border-box;
  display:grid;
  place-items:center;
  margin:0;
  padding:7px;
  border:1px solid rgba(148,113,69,.30);
  border-radius:9px;
  background:rgba(255,249,237,.72);
  color:#4b3829;
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  box-shadow:0 2px 8px rgba(39,35,28,.15);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
#stage-fullscreen[hidden],
#stage-fullscreen[aria-pressed="true"],
html:fullscreen #stage-fullscreen,
html:-webkit-full-screen #stage-fullscreen { display:none; }
#stage-fullscreen:hover { background:rgba(255,251,242,.90); }
#stage-fullscreen:focus-visible { outline:2px solid #8b683f; outline-offset:2px; }
#stage-fullscreen svg { width:100%; height:100%; pointer-events:none; }
#stage-fullscreen .fullscreen-collapse-mark { display:none; }
#stage-fullscreen[aria-pressed="true"] .fullscreen-expand-mark { display:none; }
#stage-fullscreen[aria-pressed="true"] .fullscreen-collapse-mark { display:block; }
/* Protect fullscreen access on short mobile stages without oversizing it. */
html[data-mobile-device="true"] #stage-fullscreen {
  width:34px;
  height:34px;
  min-width:34px;
  min-height:34px;
  padding:6px;
  right:7px;
  bottom:7px;
}
@media (prefers-reduced-motion:reduce) {
 #stage-fullscreen { transition:none; }
}
/* The current setup's Continue/Back row must not sit under the fullscreen control. */
body[data-game='palace'] #creation.opening-setup .scene-paths {
 padding-inline-end:clamp(48px,6cqw,72px);
}
