/* V24 – sichtbar wirksames Schwingen am Aufhängefaden.
   Wird als letzte CSS-Datei geladen, damit alte Hover-Verbote nicht gewinnen. */
.theme-extra .tree-stage .tree-door {
  --sway-amplitude: 5deg;
  --sway-time: 1.12s;
  transform-origin: 50% -48% !important;
  /* Die vorhandene Tiefenskalierung und Zentrierung bleiben erhalten. */
}
.theme-extra .tree-stage .tree-door.bauble-size-small {
  --sway-amplitude: 8deg;
  --sway-time: .78s;
}
.theme-extra .tree-stage .tree-door.bauble-size-medium {
  --sway-amplitude: 5.5deg;
  --sway-time: 1.12s;
}
.theme-extra .tree-stage .tree-door.bauble-size-large {
  --sway-amplitude: 3.5deg;
  --sway-time: 1.55s;
}
@keyframes advV24HangingSwing {
  0%   { transform: translate(-50%,-50%) scale(var(--depth-scale,1)) rotate(0deg); }
  18%  { transform: translate(-50%,-50%) scale(var(--depth-scale,1)) rotate(var(--sway-amplitude)); }
  40%  { transform: translate(-50%,-50%) scale(var(--depth-scale,1)) rotate(calc(var(--sway-amplitude) * -.66)); }
  61%  { transform: translate(-50%,-50%) scale(var(--depth-scale,1)) rotate(calc(var(--sway-amplitude) * .38)); }
  79%  { transform: translate(-50%,-50%) scale(var(--depth-scale,1)) rotate(calc(var(--sway-amplitude) * -.16)); }
  100% { transform: translate(-50%,-50%) scale(var(--depth-scale,1)) rotate(0deg); }
}
/* Auch gesperrte Kugeln reagieren. Animation nur auf der einzelnen Aufhängung. */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .theme-extra .tree-stage.tree-ready .tree-door:is(:hover, :focus-within) {
    animation-name: advV24HangingSwing !important;
    animation-duration: var(--sway-time) !important;
    animation-timing-function: ease-in-out !important;
    animation-iteration-count: 1 !important;
    animation-fill-mode: none !important;
    z-index: 9 !important;
  }
}
/* Auch Tastaturbedienung erhält die Bewegung, wenn Animationen erlaubt sind. */
@media (hover: none) and (prefers-reduced-motion: no-preference) {
  .theme-extra .tree-stage.tree-ready .tree-door:focus-within {
    animation: advV24HangingSwing var(--sway-time) ease-in-out 1 !important;
  }
}
/* Nur berührte Kugel leuchtet, sowohl gesperrt als auch freigeschaltet. */
.theme-extra .tree-stage .tree-door:is(:hover, :focus-within) .bauble-button,
.theme-extra .tree-stage .tree-door:hover .bauble-locked {
  filter: brightness(1.28) saturate(1.18) !important;
  box-shadow: inset 4px 6px 15px #fff7c4b5,
              inset -12px -15px 20px #0007,
              0 9px 17px #0009,
              0 0 19px 8px #ffdc7abf,
              0 0 37px 13px #ffda765b !important;
}
@media (prefers-reduced-motion: reduce) {
  .theme-extra .tree-stage .tree-door,
  .theme-extra .tree-stage .tree-door:is(:hover, :focus-within) {
    animation: none !important;
  }
}
