.christmas-finale {
  position: absolute;
  z-index: 6;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
  user-select: none;
}

.tree-stage .christmas-finale__sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.christmas-finale__greeting {
  position: absolute;
  inset: max(53px, 8%, calc(env(safe-area-inset-top) + 44px)) 0 auto;
  margin: 0;
  padding-inline: 12px;
  color: #fff0ce;
  font-family: inherit;
  font-size: clamp(1.85rem, 9.2vw, 3.45rem);
  font-weight: 640;
  line-height: 1.18;
  letter-spacing: -.055em;
  text-align: center;
  text-shadow: 0 1px 2px #58343d, 0 0 12px #eeb57387, 0 0 35px #ca79589e;
  opacity: 0;
}

.christmas-finale--quiet .christmas-finale__greeting {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .tree-stage .christmas-finale__sky { display: none; }
}

@media (max-width: 600px), (hover: none) and (pointer: coarse) {
  .christmas-finale__greeting {
    inset-block-start: max(38px, 5.4%, calc(env(safe-area-inset-top, 0px) + 9px));
    text-shadow: 0 1px 2px #402e39, 0 0 9px #eeb57356;
  }
}

.app[data-scene=tree]:has(.christmas-finale) .tree-tray,
.app[data-scene=tree]:has(.christmas-finale) :is(.preview-controls, .tree-finale-preview) {
  visibility: hidden;
}

.tree-finale-preview {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 22px);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid #ffe0a75c;
  border-radius: 99px;
  background: #261e28c2;
  color: #ffe9c4;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 570;
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
}
.tree-finale-preview .icon { height: 13px; width: 13px; }

@media (prefers-reduced-motion: no-preference) {
  .tree-stage:has(.christmas-finale__sky) #tree-fallback-gifts img {
    animation: fallback-jewel-glow 1.5s var(--jewel-delay, 0s) both;
  }
}
@keyframes fallback-jewel-glow {
  0%, 100% { filter: drop-shadow(0 2px 3px #091c22a6); }
  16% { filter: brightness(1.7) drop-shadow(0 0 9px #fff2ae) drop-shadow(0 0 17px #ffb259); }
}
