/* A single bright stage contains the floating scene and its controls. */
.fav-overlay .fav-modal-games {
  width: min(800px, 96vw, 76svh); max-height: 92svh; padding: 0;
  background: #009cde; border: 1px solid #c6f4f7;
  box-shadow: 0 22px 100px #010c2580;
}
.fav-modal-games::before, .fav-modal-games::after { display: none; }
.fav-modal-games .fav-modal-heading {
  position: absolute; top: 20px; left: 52px; right: 52px; z-index: 2;
  margin: 0; pointer-events: none; filter: drop-shadow(0 2px 1px #254e6155);
}
.fav-modal-games .fav-modal-close {
  z-index: 3; top: 5px; right: 6px; width: 54px; height: 54px;
  display: grid; place-items: center;
  padding: 0; border: 0; border-radius: 50%; box-shadow: none;
  font-size: 0; color: transparent;
  background: url('icons/bubble-paper-close.png?v=paper-texture-1') center / contain no-repeat;
  filter: drop-shadow(0 2px 3px #123a5055);
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, filter .18s ease;
}
.fav-modal-games .fav-modal-close::before,
.fav-modal-games .fav-modal-close::after {
  content: none;
}
.fav-modal-games .fav-modal-close:hover {
  transform: translateY(-2px) scale(1.08);
  filter: saturate(1.1) drop-shadow(0 4px 4px #123a5066);
}
.fav-modal-games .fav-modal-close:active { transform: scale(.92); }
.fav-modal-games .fav-modal-close:focus-visible {
  outline: 2px solid #153d50; outline-offset: 2px;
}
.fav-modal-games .gcon { position: relative; margin: 0; }
.fav-modal-games:has(.is-paper) .fav-modal-close {
  top: 2.5%; right: 2.5%; width: 10%; height: 10%; min-width: 38px; min-height: 38px;
  background: none; filter: none; transform: none;
}
.gcon.is-paper > .gcon-tv,
.gcon.is-paper > .gcon-dock,
.gcon.is-paper > .gcart-row { display: none; }
.gpaper-stage {
  position: relative; width: 100%; aspect-ratio: 1;
  overflow: hidden; isolation: isolate; container-type: inline-size; background: #64bad1;
  touch-action: pan-y;
}
.gpaper-stage button, .gpaper-stage img {
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.gpaper-reference, .gpaper-background {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.gpaper-background { display: none; }
/* is-room lands before is-layered: the backdrop does not wait for the things
   that stand in it, so the stage stops being an empty blue rectangle as soon
   as the room itself has arrived. */
.gpaper-stage.is-room .gpaper-background,
.gpaper-stage.is-layered .gpaper-background { display: block; }
.gpaper-stage.is-layered .gpaper-reference { visibility: hidden; }
.gpaper-air {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none;
}
.gpaper-eraser { position: absolute; z-index: 1; pointer-events: none; }
.gpaper-eraser[hidden] { display: none; }
.gpaper-tv, .gpaper-cart {
  position: absolute; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; cursor: pointer;
  transform-origin: center; -webkit-appearance: none; appearance: none;
}
.gpaper-tv { z-index: 3; transform-origin: 0 0; }
.gpaper-stage.is-reference .gpaper-tv img { opacity: 0; }
.gpaper-stage.is-layered .gpaper-tv img,
.gpaper-stage.is-layered .gpaper-cart-art { opacity: 1; }
.gpaper-tv:disabled { cursor: default; opacity: 1; }
.gpaper-cart { z-index: 2; }
.gpaper-cart { transform-origin: 0 0; }
.gpaper-tv img, .gpaper-cart img {
  display: block; width: 100%; height: 100%; pointer-events: none;
}
.gpaper-tv img[hidden] { display: none; }
.gpaper-tv:focus-visible, .gpaper-cart:focus-visible {
  outline: 2px dashed #fff5cb; outline-offset: 5px; border-radius: 12px;
}
.gpaper-cart-art {
  opacity: 0;
}
.gpaper-cart.is-docked .gpaper-cart-art,
.gpaper-cart.is-travelling .gpaper-cart-art { opacity: 1; }
.fav-modal-games .g3-canvas {
  display: block; width: auto !important; max-width: 100%; max-height: 76svh;
  margin: 0 auto; touch-action: pan-y;
}
.g3-link-wrap { position: absolute; right: 22px; bottom: 22px; z-index: 3; }
.g3-game-link {
  display: inline-block; padding: 9px 18px 12px; min-width: 82px;
  background: none;
  color: #243d3a; border: 0; box-shadow: none;
  font: 32px/1 'BlackCasperColor', Georgia, serif; font-palette: --ransom;
  text-decoration: none; text-align: center; transform: rotate(-5deg);
  user-select: none; transition: transform .18s;
}
.g3-game-link[hidden] { display: none; }
.g3-game-link:hover { transform: rotate(-2deg) translateY(-2px); }
.g3-game-link:focus-visible { outline: 2px solid #163e4c; outline-offset: 5px; }
.g3-announcement {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.gpaper-error {
  position: absolute; bottom: 12px; left: 12px; right: 12px; z-index: 4;
  padding: 8px; text-align: center; background: #143e50; color: #fff;
  font: 14px/1.4 ui-monospace, monospace;
}
@media(prefers-reduced-motion:reduce) {
  .g3-game-link, .fav-modal-games .fav-modal-close { transition: none; }
  .gpaper-cart-art { animation: none; transition: none; }
}
@media(max-width:600px) {
  .fav-modal-games .fav-modal-heading { font-size: 23px; top: 16px; padding: 0; }
  .fav-modal-games .fav-modal-close { top: 2px; right: 2px; }
}
@container (max-width:600px) {
  .gpaper-stage .g3-link-wrap {
    left: 50%; right: auto; bottom: 9.5%; transform: translateX(-50%);
  }
  .gpaper-stage .g3-game-link { font-size: 24px; }
}
