/* Youth Games only. The authored upper garden/interactive friends keep their
 * existing crop. A separate, viewport-sized plate carries the same garden
 * throughout the catalog, without scaling it to the document's height.
 * Layer contract: page background 0, library 1, navigation 2. */
#games-youth-background-r40 {
  display:none;
  position:fixed;
  inset:0;
  z-index:0;
  overflow:hidden;
  pointer-events:none;
  isolation:isolate;
  contain:strict;
  background:#c9dda6;
}
body[data-ar-document="games"][data-library-theme="youth"] #games-youth-background-r40 {display:block}
#games-youth-background-r40[hidden],
body.sanctuary-open #games-youth-background-r40 {display:none!important}
#games-youth-background-r40[data-time="night"] {background:#142c34}
#games-youth-background-r40>img {
  display:block;
  width:100%;
  height:100%;
  max-width:none;
  object-fit:cover;
  object-position:27% top;
  pointer-events:none;
  user-select:none;
  filter:blur(.65px);
}
/* Remove only the flat full-document fill. Opaque content surfaces, typography,
 * colors, existing day/night effects and every input stay with their owners. */
body[data-ar-document="games"][data-library-theme="youth"] #hub-world[data-youth-continuity="r40"] {background:transparent}
body[data-ar-document="games"][data-library-theme="youth"] #hub-world[data-youth-continuity="r40"]>.hub-shell {position:relative;z-index:1}
/* The header crop still matches the native owl perch and meadow geometry.
 * Its lower edge now fades into the fixed garden, never a solid-color cutoff. */
body[data-ar-document="games"][data-library-theme="youth"] #hub-world[data-youth-continuity="r40"] .hub-world-scenery::before {
  background-image:url('./hub-youth/original-sunlit-garden.webp');
  background-color:transparent;
  -webkit-mask-image:linear-gradient(180deg,#000 0%,#000 55%,transparent 92%);
  mask-image:linear-gradient(180deg,#000 0%,#000 55%,transparent 92%);
}
body[data-ar-document="games"][data-library-theme="youth"] #hub-world[data-youth-continuity="r40"][data-youth-time="night"] .hub-world-scenery::before {background-image:url('./hub-youth/night-garden-r12.webp')}
/* Separate, noninteractive strips own their space in the normal flow. No toy
 * can overlap a card, label or control, even at narrow widths or zoom. */
.games-youth-toys-r40 {display:none;pointer-events:none;user-select:none}
body[data-ar-document="games"][data-library-theme="youth"] .games-youth-toys-r40 {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:12px 30px 0;
  min-height:78px;
}
.games-youth-toys-r40[hidden] {display:none!important}
body[data-ar-document="games"][data-library-theme="youth"] .games-youth-toys-r40[data-kind="stories"] {justify-content:flex-end}
.games-youth-toys-r40>img {display:block;flex:none;object-fit:contain;pointer-events:none;user-select:none;filter:drop-shadow(0 2px 2px #294a3924)}
.games-youth-toys-r40>[data-toy="sheep"] {width:48px;height:48px}
.games-youth-toys-r40>[data-toy="scroll"] {width:64px;height:64px}
.games-youth-toys-r40>[data-toy="lamp"] {width:76px;height:57px}
@media(max-width:700px) {
  #games-youth-background-r40>img {object-position:42% top}
  body[data-ar-document="games"][data-library-theme="youth"] .games-youth-toys-r40 {padding:10px 16px 0;min-height:66px;gap:16px}
  .games-youth-toys-r40>[data-toy="sheep"] {width:42px;height:42px}
  .games-youth-toys-r40>[data-toy="scroll"] {width:54px;height:54px}
  .games-youth-toys-r40>[data-toy="lamp"] {width:64px;height:48px}
}
/* Motion is intentionally absent. Reduced motion retains the quiet scene;
 * optional art is hidden by the controller for data saver / FX-off / contrast. */
@media(forced-colors:active) {
  #games-youth-background-r40,.games-youth-toys-r40 {display:none!important}
  body[data-ar-document="games"][data-library-theme="youth"] #hub-world[data-youth-continuity="r40"] {background:Canvas}
}
@media print {#games-youth-background-r40,.games-youth-toys-r40 {display:none!important}}
