/* ===== Adventskalender „Neo und Frieda feiern Weihnachten um die Welt“ (Dezember, beide Tafeln) =====
   Das Dorfbild IST der Kalender: Türchen sind Ausschnitte desselben Bildes (nur Perforation + Stern).
   Titel, Sterne und Ländernamen liegen als Bilder vor -> keine Webfonts nötig. */
.adv { position: fixed; inset: 0; z-index: 9000; background: #0d1a2b; opacity: 0; pointer-events: none; }
.adv.an { opacity: 1; }
.adv-buehne { position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; overflow: hidden;
              background: #0d1a2b url(assets/advent/hintergrund.webp) 0 0 / 1920px 1080px no-repeat; }
.adv-vignette { position: absolute; inset: 0; pointer-events: none;
                background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,0) 55%, rgba(5,10,25,.55) 100%); }
.adv-zoom { position: absolute; inset: 0; transition: transform 1.4s cubic-bezier(.55,.05,.25,1); will-change: transform;
            background: url(assets/advent/hintergrund.webp) 0 0 / 1920px 1080px no-repeat; }

/* Lichterkette */
.adv-lichter { position: absolute; top: 0; left: 0; width: 1920px; height: 90px; z-index: 6; }
.adv-lichter .k { animation: adv-blink 1.6s ease-in-out infinite alternate; }
@keyframes adv-blink { from { opacity: .35; } to { opacity: 1; } }

/* Türchen */
.adv-raster { position: absolute; inset: 0; }
.adv-tuer { position: absolute; perspective: 1200px; }
.adv-innen { position: absolute; inset: 0; overflow: hidden; background: #3a0609 center/cover no-repeat;
             box-shadow: inset 0 0 10px 2px rgba(0,0,0,.45); }
.adv-tuer.offen .adv-innen { box-shadow: inset 0 0 8px 2px rgba(0,0,0,.35), 0 0 0 1px rgba(60,40,30,.5), 0 6px 16px rgba(0,0,0,.4); }
.adv-licht { position: absolute; inset: -12px; border-radius: 16px; opacity: 0; transition: opacity 1s; pointer-events: none;
             background: radial-gradient(circle at 50% 50%, rgba(255,247,210,.95) 0%, rgba(255,210,100,.7) 35%, rgba(255,190,60,0) 72%); }
.adv-flg { position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d;
           transition: transform 1.6s cubic-bezier(.3,.1,.2,1), box-shadow 1.6s;
           background-image: url(assets/advent/hintergrund.webp); background-size: 1920px 1080px;
           outline: 2px dashed rgba(255,253,240,.75); outline-offset: -1px; }
.adv-stern { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 152px; height: 152px; }
.adv-tuer.gross .adv-stern { width: 240px; height: 240px; }
.adv-tuer.offen .adv-flg { transform: rotateY(-78deg); box-shadow: -6px 0 14px rgba(0,0,0,.45); }
.adv-tuer.heute .adv-flg { animation: adv-puls 1s ease-in-out infinite alternate; }
@keyframes adv-puls { from { box-shadow: 0 0 0 0 rgba(255,214,120,0); outline-color: rgba(255,253,240,.75); }
                      to   { box-shadow: 0 0 50px 16px rgba(255,214,120,.95); outline-color: #fff6c8; } }

/* Funkeln */
.adv-funkeln i { position: absolute; width: 26px; height: 26px; z-index: 7; pointer-events: none;
                 background: radial-gradient(circle, #fff 0 2px, transparent 3px),
                             linear-gradient(transparent 46%, #fff8d0 46% 54%, transparent 54%),
                             linear-gradient(90deg, transparent 46%, #fff8d0 46% 54%, transparent 54%);
                 animation: adv-funk 2.6s ease-in-out infinite; opacity: 0; }
@keyframes adv-funk { 0%,100% { opacity: 0; transform: scale(.2) rotate(0); } 50% { opacity: 1; transform: scale(1) rotate(45deg); } }

/* Schnee in drei Ebenen + Verwehung */
.adv-schnee { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.adv-schnee i { position: absolute; top: -40px; border-radius: 50%; background: #fff; animation: adv-fall linear infinite; }
.adv-schnee i.s { color: #fff; background: none; border-radius: 0; line-height: 1; text-shadow: 0 0 6px rgba(255,255,255,.8); }
@keyframes adv-fall { 0% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(35px, 560px, 0); } 100% { transform: translate3d(-10px, 1140px, 0); } }
.adv-wehe { position: absolute; left: 0; bottom: -2px; width: 1920px; height: 120px; z-index: 9; pointer-events: none; }

/* Bild des Tages */
.adv-bild { position: absolute; inset: -4px; z-index: 20; opacity: 0; transform: scale(.3);
            transition: transform 1.1s cubic-bezier(.2,.7,.2,1), opacity .12s; background: #000 center/cover no-repeat; }
.adv-bild.an { opacity: 1; transform: none; }
.adv-rahmen { position: absolute; inset: 4px; pointer-events: none; box-shadow: inset 0 0 0 14px #9d1219, inset 0 0 0 20px #e8c060; }
.adv-text { position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 110px 100px 60px;
            background: linear-gradient(to top, rgba(60,6,10,.94) 0%, rgba(60,6,10,.78) 55%, rgba(60,6,10,0) 100%);
            color: #fff; opacity: 0; transform: translateY(30px); transition: opacity .8s .6s, transform .8s .6s;
            font-family: "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif; }
.adv-bild.an .adv-text { opacity: 1; transform: none; }
.adv-text .adv-land { display: block; height: 144px; margin-left: -14px; }
.adv-text p { margin: 4px 0 0; font-size: 40px; line-height: 1.3; max-width: 1650px; color: #fff4e0; }
.adv-buehne.bildzeit > :not(.adv-bild) { visibility: hidden; }
.adv-buehne.bildzeit { background: #000; }

/* Schneesturm-Übergang */
.adv-sturm { position: fixed; inset: 0; z-index: 9500; pointer-events: none; width: 100vw !important; height: 100vh !important; }
.adv-sturm[hidden] { display: none; }

/* Dezember: statt des Schullogos oben links Bild des Tages + Tag · Land + Motto (gleiche Höhe wie das Logo) */
.adv-logo { display: none; height: 52px; width: 100%; box-sizing: border-box; align-items: center; gap: 10px; overflow: hidden;
            background: linear-gradient(135deg, #b81d27, #7d0d13); border: 2px solid #e8c060; border-radius: 8px; padding: 3px 10px 3px 3px;
            font-family: "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif; }
.adv-logo img { height: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; flex: none; }
.adv-logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.adv-logo-text b { color: #ffe9a8; font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adv-logo-text span { color: #fff4e0; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
body.adv-dezember .top-logo .logo { display: none; }
body.adv-dezember .adv-logo { display: flex; }

/* während der Kalender läuft: Fußzeile + Maskottchen aus */
body.adv-laeuft .copyright, body.adv-laeuft .mascot { visibility: hidden; }

/* Weihnachtsschmuck auf der normalen Tafel (Dezember): gemalte Girlande mit Lichtern, Schneehaube, Verwehung, Flocken.
   Alle Maße in vw -> skaliert mit jedem Bildschirm. */
.adv-deko { display: none; }
body.adv-schmuck .adv-deko { display: block; }
body.adv-schmuck .page { padding-top: calc(16px + 3.3vw); }          /* Girlande hängt leicht über die Kachelränder, verdeckt keinen Inhalt */
.adv-kopie { position: relative; height: 100%; flex: none; }
.adv-kopie > img { display: block; width: 100%; height: 100%; object-fit: fill; }
.adv-kopie.gespiegelt { transform: scaleX(-1); }
.adv-girlande { position: fixed; left: 0; top: -1.3vw; width: 100vw; height: 6.6vw; z-index: 55; pointer-events: none; display: flex; }
/* Lichter: warmes Birnchen mit weichem Lichthof, sanftes Glimmen wie echte Lichterkette */
.adv-girlande span { position: absolute; width: calc(1.9vw * var(--g, 1)); height: calc(1.9vw * var(--g, 1)); transform: translate(-50%, -50%);
                     border-radius: 50%; pointer-events: none;
                     background: radial-gradient(circle, var(--f, #fff1c4) 0 7%, rgba(255,214,120,.95) 12%, rgba(255,190,80,.38) 30%,
                                 rgba(255,170,60,.12) 50%, rgba(255,160,50,0) 70%);
                     animation: adv-glimm ease-in-out infinite alternate; }
.adv-gespiegelt-fix {}
@keyframes adv-glimm { 0% { opacity: .55; } 45% { opacity: .9; } 100% { opacity: 1; } }
.adv-haube { position: fixed; z-index: 53; pointer-events: none; display: flex; }
.adv-fuss { position: fixed; left: 0; bottom: -.3vw; width: 100vw; height: 3.2vw; z-index: 56; pointer-events: none; display: flex; }
.adv-flocken { position: fixed; inset: 0; z-index: 54; pointer-events: none; overflow: hidden; }
.adv-flocken i { position: absolute; top: -3vw; animation: adv-fall2 linear infinite; }
.adv-flocken b { display: block; }
.adv-flocken img { display: block; height: auto; }
@keyframes adv-fall2 { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, 112vh, 0); } }
@keyframes adv-pendel { from { transform: translateX(calc(var(--weg) * -1)); } to { transform: translateX(var(--weg)); } }
@keyframes adv-dreh { to { transform: rotate(360deg); } }

/* Anhänger an der Girlande (jeden Tag mehr) – schwingen ganz leicht */
.adv-anhaenger { position: fixed; inset: 0; z-index: 56; pointer-events: none; }
.adv-anhaenger img { position: absolute; width: auto; transition: opacity .6s; }
.adv-anhaenger img.neu { opacity: 0; }
@keyframes adv-schwing { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
/* Animationen (Clips) */
.adv-anim { position: fixed; inset: 0; z-index: 57; pointer-events: none; overflow: hidden; }
.adv-schlitten { position: absolute; left: 0; width: auto; animation: adv-flug 16s linear forwards; will-change: transform; }
@keyframes adv-flug {
  0%   { transform: translate(var(--von), 1.5vw); }
  25%  { transform: translate(calc(var(--von) + (var(--bis) - var(--von)) * .25), -1vw); }
  50%  { transform: translate(calc(var(--von) + (var(--bis) - var(--von)) * .5), 1vw); }
  75%  { transform: translate(calc(var(--von) + (var(--bis) - var(--von)) * .75), -1.2vw); }
  100% { transform: translate(var(--bis), .5vw); } }
.adv-clip { position: absolute; animation: adv-ein .5s ease-out; transition: opacity .6s;
            -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); mask-image: linear-gradient(to bottom, #000 70%, transparent 100%); }
.adv-clip.weg { opacity: 0; }
@keyframes adv-ein { from { opacity: 0; } to { opacity: 1; } }

/* Vorschau per URL (?advent=…): Standby ausblenden */
body.adv-test .standby-screen { display: none !important; }
body.adv-test .page { visibility: visible !important; }

/* Solange der Kalender den Bildschirm füllt: Tafel + Schmuck darunter nicht weiter berechnen (TV-Leistung) */
body.adv-kalender .page, body.adv-kalender .adv-deko, body.adv-kalender .copyright, body.adv-kalender .mascot { visibility: hidden !important; }
body.adv-kalender .adv-deko * { animation-play-state: paused !important; }

/* Schneesturm (vorab gezeichnet, nur verschoben) */
.adv-sturm-box { display: none; position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 9500; pointer-events: none; overflow: hidden; }
.adv-sturm-box.laeuft { animation: adv-sturm-huelle linear forwards; }
@keyframes adv-sturm-huelle { 0% { opacity: .25; } 22% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: .25; } }
.adv-sturm-lage { position: absolute; left: 0; top: 0; will-change: transform; transform: translate3d(var(--von), 0, 0); }
.adv-sturm-box.laeuft .adv-sturm-lage { animation: adv-sturm-zug cubic-bezier(.45,0,.55,1) forwards; }
@keyframes adv-sturm-zug { from { transform: translate3d(var(--von), 0, 0); } to { transform: translate3d(var(--bis), 0, 0); } }

/* Schnee als durchlaufendes Band (ein Bild je Schicht, nur verschoben) */
.adv-band { position: absolute; left: 0; top: 0; width: 100%; height: 200%; will-change: transform; animation: adv-band-fall linear infinite; }
.adv-band img { display: block; width: 100%; height: 50%; }
@keyframes adv-band-fall { from { transform: translate3d(0, -50%, 0); } to { transform: translate3d(0, 0, 0); } }
.adv-schnee { overflow: hidden; }

/* Schiebe-Übergang: Schmuck-Ebene wird zum Vollbild-Rahmen, damit sie als Ganzes mitgeschoben werden kann */
body.adv-schub .adv-deko { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 53; pointer-events: none; }
body.adv-schub .page { will-change: transform; }
.adv { will-change: transform; }
.adv-sturm-box { opacity: 1; }
/* Kamerafahrt: nichts im großen Bild animieren (TV muss sonst das ganze Bild je Bildschritt neu berechnen) */
.adv-zoom.fahrt .k, .adv-zoom.fahrt .adv-flg { animation: none !important; }
.adv-zoom.fahrt .adv-flg { transition: none; }
/* Während Kalender/Übergang: Einblendung („Wichtige Info“) ausblenden – das rote Neu-Band bleibt (Vorrang) */
body.adv-laeuft .global-overlay { visibility: hidden !important; }
body.adv-schmuck .page { will-change: transform; }
