/* Santae Weather v1.2.4. Keep controls outside the clipped effect layers. */
.santae-weather-root .santae-weather-effect,
.santae-weather-root .santae-weather-cloud-clip {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none !important;
}
.santae-weather-root .santae-weather-effect {
    background-position: center top;
    background-repeat: repeat-x;
    background-size: auto 100%;
    opacity: .82;
    user-select: none;
}
.wideWeatherScene.santae-weather-root .santae-weather-effect { z-index: 6; }
/* Original seasonal crystal glow, aligned exactly to the foreground art. */
.santae-weather-root .santae-weather-crystal-glow {
    --santae-crystal-low: .12;
    --santae-crystal-high: 1;
    --santae-crystal-steady: .7;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none !important;
    background-position: center top;
    background-repeat: repeat-x;
    background-size: auto 100%;
    mix-blend-mode: screen;
    filter: brightness(1.6);
    opacity: var(--santae-crystal-steady);
    animation: none !important;
}
.wideWeatherScene.santae-weather-root .santae-weather-crystal-glow { z-index: 7; }
.santae-weather-root .santae-weather-crystal-glow::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: inherit;
    background-position: inherit;
    background-repeat: inherit;
    background-size: inherit;
    filter: blur(5px);
    opacity: .4;
    animation: none !important;
}
.santae-weather-root .santae-weather-crystal-glow[hidden] { display: none; }
.santae-weather-root[data-weather-time="day"] .santae-weather-crystal-glow {
    --santae-crystal-low: .1;
    --santae-crystal-high: .92;
    --santae-crystal-steady: .55;
}
.santae-weather-root[data-weather-color-sensitive="true"] .santae-weather-crystal-glow {
    --santae-crystal-low: .3;
    --santae-crystal-high: .8;
    filter: grayscale(70%) brightness(1.15);
}
.santae-weather-root.santae-weather-moving .santae-weather-crystal-glow {
    animation: santae-weather-crystal-pulse 2.8s ease-in-out -.4s infinite !important;
}
.santae-weather-root.santae-weather-moving .santae-weather-crystal-glow::before {
    animation: santae-weather-crystal-halo 2.8s ease-in-out -.4s infinite !important;
}
.santae-weather-root[data-weather-crystals="on"][data-weather-crystal-replaces-sprinkles="true"] .headerSparkles,
.santae-weather-root[data-weather-crystals="on"][data-weather-crystal-replaces-sprinkles="true"] .wideWeatherSprinkles {
    display: none !important;
}
.santae-weather-root .santae-weather-particles,
.santae-weather-root .santae-weather-lightning {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
}
.santae-weather-root .santae-weather-lightning {
    background-position: center top;
    background-repeat: repeat-x;
    background-size: auto 100%;
}
.santae-weather-root .santae-weather-particles[hidden],
.santae-weather-root .santae-weather-lightning[hidden] { display: none; }
.santae-weather-root[data-weather="snowing"] .santae-weather-effect { opacity: .9; }
.santae-weather-root[data-weather="storming"] .santae-weather-effect { opacity: .95; }
.santae-weather-root[data-weather="sunny"] .santae-weather-effect {
    background-position: right top;
    background-repeat: no-repeat;
    /* Size the original rays to the banner height, not the full viewport width. */
    background-size: auto 140%;
    opacity: .26;
    filter: blur(2px);
    -webkit-mask-image: linear-gradient(to bottom, #000 15%, rgba(0, 0, 0, .65) 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 15%, rgba(0, 0, 0, .65) 60%, transparent 100%);
    animation: none !important;
}
/* A quiet, steady glow bridges the original APNG's pause between glints.
   It exists only while the day-time Sunny effect is actually active. */
.santae-weather-root[data-weather="sunny"][data-weather-time="day"][data-weather-effect="on"] .santae-weather-effect::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 560px 240px at right top, rgba(255, 239, 185, .55), rgba(255, 239, 185, .16) 45%, transparent 75%);
}
.santae-weather-root .santae-weather-cloud-clip > .headerMid,
.santae-weather-root .santae-weather-cloud-clip > .wideWeatherClouds {
    left: 0;
    width: 100%;
    transform: none;
    animation: santae-weather-cloud-drift var(--santae-cloud-duration, 384s) linear infinite !important;
    animation-play-state: paused !important;
}
.santae-weather-root .wideWeatherRain,
.santae-weather-root .headerOverlay,
.santae-weather-root .wideWeatherOverlay,
.santae-weather-root .headerSparkles,
.santae-weather-root .wideWeatherSprinkles { animation: none !important; }
.santae-weather-root.santae-weather-moving .santae-weather-cloud-clip > .headerMid,
.santae-weather-root.santae-weather-moving .santae-weather-cloud-clip > .wideWeatherClouds {
    animation-play-state: running !important;
}
.santae-weather-root.santae-weather-moving .headerOverlay,
.santae-weather-root.santae-weather-moving .wideWeatherOverlay {
    animation: santae-weather-light-twinkle 3.8s ease-in-out infinite !important;
}
.santae-weather-root.santae-weather-moving .headerSparkles,
.santae-weather-root.santae-weather-moving .wideWeatherSprinkles {
    animation: santae-weather-star-glow 2.4s ease-in-out infinite !important;
}
/* These legacy images already contain precipitation. Avoid drawing it twice. */
.santae-weather-root[data-weather-effect="on"] .headerRain,
.santae-weather-root[data-weather-effect="on"] .wideWeatherRain,
.santae-weather-root[data-weather-effect="on"][data-weather="raining"] .santae-weather-cloud-clip,
.santae-weather-root[data-weather-effect="on"][data-weather="snowing"] .santae-weather-cloud-clip {
    display: none !important;
}
.santae-weather-root[data-weather-color-sensitive="true"] .santae-weather-effect {
    filter: grayscale(70%);
}
.santae-weather-root[data-weather="sunny"][data-weather-color-sensitive="true"] .santae-weather-effect {
    filter: grayscale(70%) blur(2px);
}
@keyframes santae-weather-cloud-drift {
    from { background-position-x: var(--santae-cloud-start, 0px); }
    to { background-position-x: calc(var(--santae-cloud-start, 0px) + var(--santae-cloud-distance, -3840px)); }
}
@keyframes santae-weather-light-twinkle {
    0%, 100% { opacity: .28; }
    30% { opacity: 1; }
    55% { opacity: .48; }
    75% { opacity: .86; }
}
@keyframes santae-weather-star-glow {
    0%, 100% { opacity: .15; }
    50% { opacity: 1; }
}
@keyframes santae-weather-crystal-pulse {
    0%, 100% { opacity: var(--santae-crystal-low); }
    50% { opacity: var(--santae-crystal-high); }
}
@keyframes santae-weather-crystal-halo {
    0%, 100% { opacity: .08; }
    50% { opacity: .95; }
}
@media (prefers-reduced-motion: reduce) {
    .santae-weather-root .santae-weather-crystal-glow,
    .santae-weather-root.santae-weather-moving .santae-weather-crystal-glow {
        animation: none !important;
        opacity: var(--santae-crystal-steady);
    }
    .santae-weather-root .santae-weather-crystal-glow::before,
    .santae-weather-root.santae-weather-moving .santae-weather-crystal-glow::before {
        animation: none !important;
        opacity: .4;
    }
    .santae-weather-root .santae-weather-particles,
    .santae-weather-root .santae-weather-lightning { display: none !important; }
    .santae-weather-root .santae-weather-effect { background-image: none !important; animation: none !important; }
    .santae-weather-root[data-weather="sunny"] .santae-weather-effect::before { content: none; }
    .santae-weather-root .santae-weather-cloud-clip > .headerMid,
    .santae-weather-root .santae-weather-cloud-clip > .wideWeatherClouds,
    .santae-weather-root.santae-weather-moving .headerOverlay,
    .santae-weather-root.santae-weather-moving .wideWeatherOverlay,
    .santae-weather-root.santae-weather-moving .headerSparkles,
    .santae-weather-root.santae-weather-moving .wideWeatherSprinkles { animation: none !important; }
}
