/* Tía Vicenta · Navidad Premium v5302.
   Capas independientes de luz: el dibujo y el recorrido de cámara no se modifican.
   Solo se animan opacidad y pequeños cambios de escala, sin RAF ni filtros por LED. */

/* Árbol (bienvenida y despedida). El apagado afecta tanto al núcleo como al halo. */
#tv-xmas-intro-v516 .tv-in-tree-svg .tv-photo-lamp,
#tv-v524-finale .tv-in-tree-svg .tv-photo-lamp {
  opacity: .82;
  animation-duration: var(--period, 4.1s) !important;
  animation-delay: var(--phase, 0s) !important;
  animation-iteration-count: infinite !important;
  animation-timing-function: linear !important;
}
#tv-xmas-intro-v516 .tv-photo-lamp-1,
#tv-v524-finale .tv-photo-lamp-1 { animation-name: tv5302-tree-twinkle-a !important; }
#tv-xmas-intro-v516 .tv-photo-lamp-2,
#tv-v524-finale .tv-photo-lamp-2 { animation-name: tv5302-tree-twinkle-b !important; }
#tv-xmas-intro-v516 .tv-photo-lamp-3,
#tv-v524-finale .tv-photo-lamp-3 { animation-name: tv5302-tree-twinkle-c !important; }
#tv-xmas-intro-v516 .tv-photo-lamp-4,
#tv-v524-finale .tv-photo-lamp-4 { animation-name: tv5302-tree-twinkle-d !important; }

@keyframes tv5302-tree-twinkle-a {
  0%, 8% { opacity:.025 } 14%, 25% {opacity:1}
  29% {opacity:.22} 34%, 43% {opacity:.94}
  50%, 64% {opacity:.04} 70%, 84% {opacity:.88}
  92%, 100% {opacity:.025}
}
@keyframes tv5302-tree-twinkle-b {
  0%, 18% {opacity:.06} 23%, 31% {opacity:.98}
  36%, 40% {opacity:.03} 45%, 61% {opacity:.85}
  68% {opacity:.29} 76%, 91% {opacity:1} 100% {opacity:.06}
}
@keyframes tv5302-tree-twinkle-c {
  0% {opacity:.85} 9%, 19% {opacity:.06}
  25%, 37% {opacity:1} 44%, 53% {opacity:.14}
  59%, 74% {opacity:.93} 82%, 88% {opacity:.02} 100% {opacity:.85}
}
@keyframes tv5302-tree-twinkle-d {
  0%, 12% {opacity:.98} 19% {opacity:.18} 22%, 27% {opacity:.04}
  33%, 48% {opacity:1} 54% {opacity:.38}
  61%, 73% {opacity:.06} 79%, 94% {opacity:.9} 100% {opacity:.98}
}

/* Estrella sobre la estrella real del dibujo: respiración cálida, no flash blanco. */
#tv-xmas-intro-v516 .tv-photo-star,
#tv-v524-finale .tv-photo-star {
  opacity: 1;
  animation: none !important;
}
#tv-xmas-intro-v516 .tv-photo-star-halo,
#tv-v524-finale .tv-photo-star-halo {
  transform-origin: 509px 205px;
  animation: tv5302-star-aura 5.65s cubic-bezier(.4,0,.25,1) -1.4s infinite !important;
}
#tv-xmas-intro-v516 .tv-photo-star-inner,
#tv-v524-finale .tv-photo-star-inner {
  transform-origin: 509px 205px;
  animation: tv5302-star-inner 3.9s ease-in-out -.7s infinite !important;
}
#tv-xmas-intro-v516 .tv-photo-star-spark,
#tv-v524-finale .tv-photo-star-spark {
  transform-origin: 509px 205px;
  animation: tv5302-star-spark 7.4s ease-in-out -.9s infinite !important;
}
#tv-xmas-intro-v516 .tv-photo-star-heart,
#tv-v524-finale .tv-photo-star-heart {opacity:.9}
@keyframes tv5302-star-aura {
  0%, 100% {opacity:.35; transform:scale(.97)}
  30% {opacity:.66; transform:scale(1.03)}
  54% {opacity:.94; transform:scale(1.075)}
  76% {opacity:.58; transform:scale(1.025)}
}
@keyframes tv5302-star-inner {
  0%,100% {opacity:.43;transform:scale(.98)}
  46% {opacity:.92;transform:scale(1.04)}
}
@keyframes tv5302-star-spark {
  0%,14%,34%,58%,100% {opacity:.15;transform:scale(.72)}
  20%,25% {opacity:.88;transform:scale(1.08)}
  64%,68% {opacity:.7;transform:scale(.93)}
}

/* Guirnaldas originales: LED opaco cuando descansa, con dos halos cuando está encendido.
   Misma iluminación en desktop (video) y celular (WebP), sin intervenir el movimiento original. */
html body header.topbar .tv-v5293-garland .tv-v5293-light.tv5302-top-light,
html body header.topbar .tv5299-mobile-banner .tv5299-bulb.tv5302-mobile-light {
  display: block !important;
  position:absolute !important;
  z-index:3 !important;
  width:clamp(5px,.92vw,12px) !important;
  height:clamp(5px,.92vw,12px) !important;
  aspect-ratio:1 !important;
  border:0 !important;
  border-radius:50% !important;
  transform:translate(-50%,-50%);
  background:radial-gradient(circle at 42% 36%, #fffff9 0 9%, #fff4df 22%, var(--tv5302-color,#ffdfa4) 44%, transparent 76%) !important;
  box-shadow:
    0 0 3px 1px color-mix(in srgb,var(--tv5302-color) 92%,white),
    0 0 10px 3px color-mix(in srgb,var(--tv5302-color) 64%,transparent),
    0 0 24px 5px color-mix(in srgb,var(--tv5302-color) 28%,transparent) !important;
  mix-blend-mode:screen !important;
  animation-duration:var(--tv5302-time,4s) !important;
  animation-delay:var(--tv5302-delay,0s) !important;
  animation-iteration-count:infinite !important;
  animation-timing-function:linear !important;
  animation-fill-mode:both !important;
}
html body header.topbar .tv5299-mobile-banner .tv5299-bulb.tv5302-mobile-light {
  width:clamp(5px,1.55vw,9px) !important;
  height:clamp(5px,1.55vw,9px) !important;
}
html body header.topbar .tv5302-top-light.tv5302-pattern-1,
html body header.topbar .tv5302-mobile-light.tv5302-pattern-1 {
  animation-name:tv5302-upper-twinkle-a !important;
}
html body header.topbar .tv5302-top-light.tv5302-pattern-2,
html body header.topbar .tv5302-mobile-light.tv5302-pattern-2 {
  animation-name:tv5302-upper-twinkle-b !important;
}
html body header.topbar .tv5302-top-light.tv5302-pattern-3,
html body header.topbar .tv5302-mobile-light.tv5302-pattern-3 {
  animation-name:tv5302-upper-twinkle-c !important;
}
@keyframes tv5302-upper-twinkle-a {
  0%, 16%, 100% {opacity:.035;transform:translate(-50%,-50%) scale(.6)}
  22%, 34% {opacity:1;transform:translate(-50%,-50%) scale(1.14)}
  41% {opacity:.17;transform:translate(-50%,-50%) scale(.77)}
  48%, 66% {opacity:.84;transform:translate(-50%,-50%) scale(1)}
  75%, 83% {opacity:.055;transform:translate(-50%,-50%) scale(.66)}
}
@keyframes tv5302-upper-twinkle-b {
  0%, 9% {opacity:.94;transform:translate(-50%,-50%) scale(1)}
  17%, 38% {opacity:.03;transform:translate(-50%,-50%) scale(.62)}
  46%, 63% {opacity:1;transform:translate(-50%,-50%) scale(1.1)}
  68% {opacity:.24;transform:translate(-50%,-50%) scale(.8)}
  77%, 87% {opacity:.91;transform:translate(-50%,-50%) scale(1)}
  100% {opacity:.94;transform:translate(-50%,-50%) scale(1)}
}
@keyframes tv5302-upper-twinkle-c {
  0%, 12% {opacity:.06;transform:translate(-50%,-50%) scale(.64)}
  20%, 29% {opacity:.96;transform:translate(-50%,-50%) scale(1.06)}
  33%, 38% {opacity:.08;transform:translate(-50%,-50%) scale(.7)}
  44%, 59% {opacity:.92;transform:translate(-50%,-50%) scale(1.14)}
  65%, 82% {opacity:.07;transform:translate(-50%,-50%) scale(.66)}
  90% {opacity:1;transform:translate(-50%,-50%) scale(1.04)}
  100% {opacity:.06;transform:translate(-50%,-50%) scale(.64)}
}

/* Halo adicional difuso de la estrella central de la guirnalda. */
html body header.topbar .tv5302-top-star {
  position:absolute !important;
  z-index:4 !important;
  display:block !important;
  pointer-events:none !important;
  left:50%;top:20%;
  width:clamp(44px,7.5vw,110px);
  height:clamp(44px,7.5vw,110px);
  border-radius:50%;
  transform:translate(-50%,-50%);
  background:radial-gradient(circle,rgba(255,255,244,.72) 0%,rgba(255,234,173,.32) 20%,rgba(245,188,95,.12) 53%,transparent 74%);
  mix-blend-mode:screen;
  animation:tv5302-top-star-aura 5.4s ease-in-out -1.4s infinite;
}
html body header.topbar .tv5302-top-star::after {
  content:'';
  position:absolute;
  inset:36%;
  background:#fff8df;
  clip-path:polygon(50% 0, 57% 43%, 100% 50%, 57% 57%, 50% 100%, 43% 57%, 0 50%, 43% 43%);
  filter:drop-shadow(0 0 3px #fff2c3);
  animation:tv5302-top-star-glint 8.4s ease-in-out -2.5s infinite;
}
html body header.topbar .tv5299-mobile-banner .tv5302-top-star {
  top:26%;
  width:clamp(39px,11vw,86px);
  height:clamp(39px,11vw,86px);
}
@keyframes tv5302-top-star-aura {
  0%, 100% {opacity:.48;transform:translate(-50%,-50%) scale(.94)}
  45% {opacity:.91;transform:translate(-50%,-50%) scale(1.12)}
  75% {opacity:.66;transform:translate(-50%,-50%) scale(1.01)}
}
@keyframes tv5302-top-star-glint {
  0%, 16%, 32%, 70%, 100% {opacity:.16;transform:scale(.72)}
  20%, 23% {opacity:.86;transform:scale(1.23)}
  75%, 78% {opacity:.52;transform:scale(.94)}
}

/* Evitar repintados fuera de pantalla y dar una experiencia estable en batería. */
html.tv5302-page-hidden #tv-xmas-intro-v516 .tv-photo-lamp,
html.tv5302-page-hidden #tv-xmas-intro-v516 .tv-photo-star *,
html.tv5302-page-hidden #tv-v524-finale .tv-photo-lamp,
html.tv5302-page-hidden #tv-v524-finale .tv-photo-star *,
html.tv5302-page-hidden body header.topbar .tv5302-top-light,
html.tv5302-page-hidden body header.topbar .tv5302-mobile-light,
html.tv5302-page-hidden body header.topbar .tv5302-top-star,
html body header.topbar .tv-v5293-garland:not(.tv5302-visible) .tv5302-top-light,
html body header.topbar .tv-v5293-garland:not(.tv5302-visible) .tv5302-top-star,
html body header.topbar .tv5299-mobile-banner:not(.tv5302-visible) .tv5302-mobile-light,
html body header.topbar .tv5299-mobile-banner:not(.tv5302-visible) .tv5302-top-star {
  animation-play-state:paused !important;
}
@media (prefers-reduced-motion:reduce) {
  #tv-xmas-intro-v516 .tv-in-tree-svg .tv-photo-lamp,
  #tv-v524-finale .tv-in-tree-svg .tv-photo-lamp,
  #tv-xmas-intro-v516 .tv-photo-star *,
  #tv-v524-finale .tv-photo-star *,
  html body header.topbar .tv-v5293-garland .tv-v5293-light.tv5302-top-light,
  html body header.topbar .tv5299-mobile-banner .tv5299-bulb.tv5302-mobile-light,
  html body header.topbar .tv5302-top-star,
  html body header.topbar .tv5302-top-star::after {
    animation:none !important;
    transition:none !important;
    opacity:.68 !important;
  }
}
