.maple-scene {
  --maple-scene-width: 180px;
  --maple-scene-overlap-x: 0%;
  --maple-scene-overlap-y: 0%;
  position: absolute;
  z-index: 1;
  width: var(--maple-scene-width);
  pointer-events: none;
  display: block;
}

.maple-scene.is-open {
  z-index: 6;
}

.maple-scene--top-right {
  top: var(--maple-scene-overlap-y);
  right: var(--maple-scene-overlap-x);
}

.maple-scene--bottom-right {
  right: var(--maple-scene-overlap-x);
  bottom: var(--maple-scene-overlap-y);
}

.maple-scene--bottom-center {
  left: 50%;
  bottom: var(--maple-scene-overlap-y);
  transform: translateX(-50%);
}

.maple-scene__art {
  display: flex;
}

.maple-scene__button {
  pointer-events: auto;
  border: 0;
  background: none;
  padding: 0;
  display: block;
  cursor: pointer;
}

.maple-scene__button:focus-visible {
  outline: 3px solid rgba(233, 183, 79, 0.36);
  outline-offset: 6px;
  border-radius: 999px;
}

.maple-scene__image {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(92, 57, 26, 0.1));
}

.maple-scene__bubble {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 252, 245, 0.94);
  border: 1px solid rgba(142, 106, 63, 0.14);
  box-shadow: 0 14px 24px rgba(121, 81, 38, 0.12);
  color: var(--rr-text, var(--ink));
  width: min(188px, 54vw);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  pointer-events: none;
}

.maple-scene.is-open .maple-scene__bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

[data-display-mode="dark"] .maple-scene__bubble {
  background: rgba(44, 30, 22, 0.94);
  border-color: rgba(255, 232, 203, 0.14);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
}

.maple-scene__eyebrow {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(121, 81, 38, 0.72);
}

.maple-scene__title {
  display: block;
  font-size: 0.92rem;
  line-height: 1.28;
}

.maple-scene__message {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  line-height: 1.38;
  color: var(--rr-dim, var(--muted));
}

.maple-scene--peek-side .maple-scene__image,
.maple-scene--float-corner .maple-scene__image {
  animation: mapleSceneFloat 6.4s ease-in-out infinite;
}

.maple-scene--event-pop .maple-scene__image,
.maple-scene--celebrate-inline .maple-scene__image {
  animation: mapleSceneBounce 6.8s ease-in-out infinite;
}

.maple-scene--quiet .maple-scene__image {
  opacity: 0.96;
}

.maple-home,
.maple-tour-card,
.maple-rewards__card,
.rr-pricing-hero__frame,
.rr-smart-snapshot,
.rr-kid-hero-goal-card,
.rr-kid-quiz-callout,
.dt-child-panel,
.rr-category,
.help-hero {
  position: relative;
  overflow: visible;
  isolation: isolate;
}

.maple-home__hero-peek {
  top: 8%;
  right: -2%;
}

.maple-home__rewards-scene {
  right: -7%;
  bottom: -8%;
}

.maple-product-tour__guide {
  top: -7%;
  right: -4%;
}

.maple-product-tour__reward-guide-scene {
  right: -8%;
  bottom: -10%;
}

.rr-pricing-hero__maple-scene {
  top: -7%;
  right: 1%;
}

.maple-about__support-scene {
  top: -7%;
  right: -6%;
}

.help-center__support-scene {
  top: -10%;
  right: -4%;
}

.rr-kid-hero-goal-card > *:not(.maple-scene),
.rr-kid-quiz-callout .rr-card__body,
.rr-category > *:not(.maple-scene),
.help-hero > *:not(.maple-scene),
.rr-pricing-hero__frame > *:not(.maple-scene),
.maple-rewards__card > *:not(.maple-scene) {
  position: relative;
  z-index: 2;
}

.rr-kid-hero-goal-card__maple-scene {
  top: auto;
  right: auto;
  left: -8px;
  bottom: 12px;
  width: clamp(58px, 5.6vw, 78px);
}

.rr-kid-hero-goal-card__maple-scene .maple-scene__image {
  transform: translateX(-16%) scaleX(-1);
}

.rr-kid-hero-goal-card__maple-scene .maple-scene__bubble {
  left: 6px;
  right: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom left;
}

.rr-kid-quiz-callout__maple-scene {
  right: -10px;
  bottom: -1px;
  width: clamp(88px, 8.4vw, 118px);
}

.rr-kid-quiz-callout__maple-scene .maple-scene__image {
  transform: translateX(16%);
}

.rr-kid-quiz-callout__maple-scene .maple-scene__bubble {
  right: 18px;
  bottom: calc(100% + 4px);
}

.rr-marketplace__header-maple-scene {
  top: -10%;
  right: 1%;
}

.rr-marketplace__empty-maple-scene {
  top: -12%;
  right: -6%;
}

.rr-category__maple-scene {
  top: -4%;
  right: 0;
  width: clamp(72px, 7.8vw, 96px);
}

.rr-pricing-hero__maple-scene,
.help-center__support-scene,
.maple-about__support-scene,
.maple-home__hero-peek,
.maple-home__rewards-scene,
.maple-product-tour__guide,
.maple-product-tour__reward-guide-scene,
.rr-marketplace__header-maple-scene,
.rr-marketplace__empty-maple-scene {
  width: min(var(--maple-scene-width), 108px);
}

@keyframes mapleSceneFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(0, -8px, 0);
  }
}

@keyframes mapleSceneBounce {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  50% {
    transform: translate3d(0, -6px, 0) rotate(-1.2deg);
  }
}

@media (max-width: 900px) {
  .maple-scene {
    width: min(104px, 26vw);
  }

  .maple-scene__bubble {
    width: min(164px, 56vw);
    padding: 9px 11px;
  }

  .rr-pricing-hero__maple-scene,
  .rr-marketplace__header-maple-scene {
    top: -3%;
    right: 0;
  }
}

@media (max-width: 640px) {
  .maple-scene__bubble {
    font-size: 0.88rem;
  }

  .maple-scene--peek-side,
  .maple-scene--float-corner {
    display: none;
  }

  .rr-kid-quiz-callout__maple-scene,
  .maple-home__rewards-scene,
  .rr-marketplace__empty-maple-scene,
  .maple-home__hero-peek {
    display: none;
  }

  .rr-kid-hero-goal-card__maple-scene {
    left: -2px;
    bottom: 10px;
    width: 60px;
  }

  .rr-kid-quiz-callout__maple-scene {
    width: 88px;
    right: -8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .maple-scene__image {
    animation: none !important;
    transition: none !important;
  }
}
