/* Weihnachtsmodus - nur aktiv, wenn weihnachten.js <html class="xmas"> setzt.
   Alles liegt in einer festen Ebene ueber der Seite mit pointer-events:none: es faengt keinen Klick ab und
   aendert kein Farbschema. Ohne die Klasse "xmas" macht diese Datei nichts. */

#xmas-ebene { position: fixed; inset: 0; z-index: 9000; pointer-events: none; overflow: hidden; display: none; }
html.xmas #xmas-ebene { display: block; }

/* fallende Flocken */
#xmas-ebene .flocke {
    position: absolute; top: -32px; width: var(--s); height: var(--s);
    background: var(--flocke) center / contain no-repeat;
    animation: xmas-fall var(--d) linear var(--dl) infinite;
}
@keyframes xmas-fall {
    0%   { transform: translate(0, 0) rotate(0); }
    50%  { transform: translate(var(--dx), 55vh) rotate(180deg); }
    100% { transform: translate(calc(var(--dx) * -0.4), calc(100vh + 40px)) rotate(360deg); }
}

/* Lichterkette am oberen Rand */
#xmas-kette { position: absolute; left: 0; right: 0; top: 0; height: 22px; display: flex; justify-content: space-around; align-items: flex-start; }
#xmas-kette::before { content: ""; position: absolute; left: 0; right: 0; top: 3px; border-top: 2px solid rgba(60, 60, 60, .55); border-radius: 50%; height: 6px; }
#xmas-kette i {
    position: relative; margin-top: 5px; width: 9px; height: 13px; display: block;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--c);
    box-shadow: 0 0 6px var(--c);
    animation: xmas-blink 1.7s ease-in-out var(--dl) infinite;
}
@keyframes xmas-blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* Schneehaufen unten */
#xmas-haufen {
    position: absolute; left: -2%; right: -2%; bottom: 0; height: 10px;
    background: #f4f8ff; border-top: 1px solid #cfe0f5; border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transition: height 1.2s ease;
}

/* Tannenbaum unten rechts */
#xmas-baum { position: absolute; right: 18px; bottom: 6px; width: 58px; height: 74px; }
#xmas-baum svg { width: 100%; height: 100%; display: block; overflow: visible; }
#xmas-baum .kugel { animation: xmas-blink 1.1s ease-in-out infinite; }
@media (max-width: 700px) { #xmas-baum { display: none; } }

/* Zufallseffekte */
.xmas-fx { position: absolute; }
.xmas-schlitten { left: -220px; width: 200px; height: 56px; animation: xmas-flug var(--d) linear forwards; }
@keyframes xmas-flug {
    0%   { transform: translate(0, 24px); }
    50%  { transform: translate(calc(50vw + 60px), -14px); }
    100% { transform: translate(calc(100vw + 260px), 20px); }
}
.xmas-schnuppe {
    width: 90px; height: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 70%, #ffe9a0);
    box-shadow: 0 0 6px #ffe9a0; transform-origin: right center; animation: xmas-schnuppe 1.3s ease-in forwards;
}
@keyframes xmas-schnuppe {
    0%   { opacity: 0; transform: translate(0, 0) rotate(24deg); }
    15%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-46vw, 24vh) rotate(24deg); }
}
.xmas-stange {
    bottom: 0; width: 14px; height: 60px; border-radius: 7px 7px 0 0;
    background: repeating-linear-gradient(135deg, #fff 0 7px, #e24b4a 7px 14px); border: 1px solid #c9d4e6;
    animation: xmas-stange 6s ease-in-out forwards;
}
.xmas-stange::before {
    content: ""; position: absolute; left: -1px; top: -13px; width: 26px; height: 24px;
    border: 7px solid #e24b4a; border-bottom: 0; border-radius: 14px 14px 0 0; clip-path: inset(0 0 40% 0);
}
@keyframes xmas-stange { 0% { transform: translateY(90px); } 12%, 85% { transform: translateY(0); } 100% { transform: translateY(90px); } }
.xmas-funkeln { width: 26px; height: 26px; animation: xmas-blink .45s ease-in-out 5 forwards; }

/* Kerzen (Advent) und Schalter im Kopf */
.xmas-kerzen { display: inline-flex; align-items: flex-end; gap: 5px; height: 30px; margin: 0 14px; vertical-align: middle; }
.xmas-kerzen b { display: block; width: 7px; height: 20px; background: #b8302f; border-radius: 1px; position: relative; }
.xmas-kerzen b.an::after {
    content: ""; position: absolute; left: 0; top: -9px; width: 7px; height: 9px;
    border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; background: #ffb62e; box-shadow: 0 0 6px #ffb62e;
    animation: xmas-flackern .9s ease-in-out infinite alternate;
}
@keyframes xmas-flackern { from { transform: scaleY(1) rotate(-3deg); } to { transform: scaleY(1.2) rotate(3deg); } }
.xmas-zeit { font-size: 12px; opacity: .8; white-space: nowrap; margin-right: 10px; }
#xmas-schalter.aus { opacity: .6; }

@media (prefers-reduced-motion: reduce) {
    #xmas-ebene .flocke, #xmas-kette i, #xmas-baum .kugel, .xmas-kerzen b.an::after { animation: none; }
    .xmas-fx { display: none; }
}
