/* MoonTik — base stage (t261). Layout size is fixed; the stage contain-scales down. */
html.mt-stage-on,
html.mt-stage-on body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent !important;
}
html.mt-stage-on:not(.mt-stage-ready) body {
  visibility: hidden;
}
html.mt-stage-ready body {
  visibility: visible;
}
#mtStage,
.mt-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--mt-base-w, 1920px);
  height: var(--mt-base-h, 1080px);
  transform: translate(-50%, -50%) scale(var(--mt-stage-s, 1));
  transform-origin: center center;
  overflow: hidden;
  background: transparent;
  box-sizing: border-box;
}
/* Parent preview slot: iframe is laid out at the base size and CSS-scaled. */
.mt-stage-slot {
  position: relative;
  overflow: hidden;
}
iframe.mt-stage-iframe,
.mt-stage-slot iframe.mt-stage-iframe {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  transform-origin: 0 0;
}
/* t261c — size hint is on the Copier le lien tooltip, not visible next to the button. */
.mp-obs-size,
.ov-obs-size,
.gal-obs-size {
  display: none !important;
}

/* Gallery / battle card previews: follow the widget aspect, fill the card width. */
.ovlib-prev.mt-stage-slot,
.mtbe-prev.mt-stage-slot,
.ovlib-prev.mt-stage-fill-width,
.mtbe-prev.mt-stage-fill-width {
  aspect-ratio: var(--mt-base-w, 16) / var(--mt-base-h, 9);
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}
.ovlib-grid > .ovlib-card {
  align-self: start;
}

/* t261d — goal / counter skins: the template sized text with viewport units (vw), which broke once the
   page lives in a fixed stage. Same ratios, now relative to the stage width. Look unchanged. */
html.mt-stage-on #stage[class*="fam-"] { padding: calc(var(--mt-base-w, 1920px) * 0.03); }
html.mt-stage-on #stage.fam-goal_gift { font-size: calc(var(--k, 1) * 0.94 * var(--mt-base-w, 1920px) / 33); }
html.mt-stage-on #stage.fam-goal_bar { font-size: calc(var(--k, 1) * 0.94 * var(--mt-base-w, 1920px) / 37); }
html.mt-stage-on #stage.fam-counter_likes,
html.mt-stage-on #stage.fam-counter_followers { font-size: calc(var(--k, 1) * 0.94 * var(--mt-base-w, 1920px) / 18); }

/* t374 — preview fill: iframe matches the frame; overlay (fill=1) uses the viewport. OBS applyScale unchanged. */
html.is-fill #mtStage,
html.is-fill .mt-stage {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  overflow: hidden;
}
.mt-stage-fill-box > iframe,
.mt-stage-fill-box > .ov-ifr-prev > iframe,
iframe.mt-stage-fill,
.p2-prev.bt-stage-prev > .ov-ifr-prev > iframe,
.p2-prev.bt-ov-prev > .ov-ifr-prev > iframe,
.mtbe-frame > iframe.mt-stage-fill {
  position: absolute !important;
  inset: 0 !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  transform: none !important;
  transform-origin: 0 0 !important;
}
