/*
 * Fullscreen presentation for the archived game.
 *
 * The curation centres its embeds with vw/vh maths at native size; stage.js
 * owns player position and scale, so the only job here is to provide a stable
 * letterbox surface and to keep the page itself from scrolling.
 */

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
}

body {
  /* Matches the curation's own stage colour so the letterbox never flashes. */
  background-color: #000;
}

embed,
ruffle-embed,
ruffle-player,
ruffle-object {
  position: absolute !important;
  transform-origin: 0 0;
  outline-width: 0;
  /* Nearest-neighbour would alias the vector art; Ruffle renders at the
     element's real pixel size, so normal smoothing is correct here. */
  image-rendering: auto;
}

/*
 * Flashpoint's 58px save/ad/lazy-load toolbar is useful for maintenance, but
 * it is not part of Poptropica's player UI. Keep the movie alive so its
 * ExternalInterface callbacks continue to work while removing it from the
 * visible playfield. F2 toggles this class through stage.js.
 */
.popCurationToolbarHidden {
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

#errorText {
  position: absolute;
  left: 0;
  width: 100vw;
  color: #fff;
  font-size: 1.6em;
  font-family: 'Billy Serif', sans-serif;
  text-align: center;
  pointer-events: none;
}

/* Shown by stage.js for a moment after the scale mode changes. */
#popScaleToast {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  font: 14px/1.2 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
  z-index: 10;
}

#popScaleToast.visible {
  opacity: 1;
}

/*
 * Shown by stage.js when the host reports that a scene loaded without drawing
 * anything. It has to sit above the player, which is absolutely positioned by
 * the layout pass, and it has to accept clicks - unlike #errorText, this one
 * is the only way out of a blank scene.
 */
#popSceneNotice {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  max-width: min(32em, 86vw);
  box-sizing: border-box;
  padding: 24px 28px;
  border-radius: 12px;
  background: rgba(8, 20, 34, 0.92);
  color: #fff;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

#popSceneNotice h1 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 600;
}

#popSceneNotice p {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.82);
}

#popSceneNotice .buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

#popSceneNotice button {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: #2f9bfd;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#popSceneNotice button.secondary {
  background: rgba(255, 255, 255, 0.16);
}

#popSceneNotice button:hover {
  filter: brightness(1.1);
}
