/* Weihnachten (seit 05.12.2026): wirkt nur, wenn weihnacht.js die Klasse
 * `pk-weihnacht` an <html> haengt (Schalter in den Admin-Einstellungen und
 * Saison 1.12.-6.1.). Farben: Weihnachtsrot, Tannengruen, Gold, Schneeweiss.
 * Nichts hier verschiebt die Seite nachtraeglich, ausser dem einen Balken
 * ueber dem Laufband (wie beim Karneval). Animationen nur ueber opacity/transform. */

/* ---------- Schnee auf den Karten ----------
 * Eine Schneekante innen am oberen Rand jeder Karte, folgt den runden Ecken
 * (border-radius vererbt) und hat kleine Tropfen. Innen, weil viele Karten in
 * Kaesten mit overflow:auto stecken - darueber wuerde der Schnee abgeschnitten.
 * Hoechstens 10 px hoch, damit nichts vom Inhalt verdeckt wird. */
.pk-weihnacht .card { position: relative; }
.pk-weihnacht .card::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 12px;
    border-radius: inherit;
    border-bottom-left-radius: 0; border-bottom-right-radius: 0;
    pointer-events: none;
    z-index: 3;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='12'%3E%3Cdefs%3E%3ClinearGradient id='s' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.5' stop-color='%23f2f7fd'/%3E%3Cstop offset='1' stop-color='%23bcd3ee'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 0 L280 0 L280.0 5.63 L278.0 5.30 L276.0 4.99 L274.0 4.71 L272.0 4.48 L270.0 4.30 L268.0 4.19 L266.0 4.15 L264.0 4.16 L262.0 4.22 L260.0 4.31 L258.0 4.41 L256.0 4.60 L254.0 5.31 L252.0 6.62 L250.0 6.65 L248.0 5.39 L246.0 4.72 L244.0 4.56 L242.0 4.47 L240.0 4.37 L238.0 4.29 L236.0 4.24 L234.0 4.24 L232.0 4.29 L230.0 4.41 L228.0 4.58 L226.0 4.82 L224.0 5.10 L222.0 5.41 L220.0 5.73 L218.0 6.04 L216.0 6.32 L214.0 6.55 L212.0 6.72 L210.0 6.81 L208.0 6.89 L206.0 7.33 L204.0 8.18 L202.0 8.00 L200.0 6.81 L198.0 6.09 L196.0 5.79 L194.0 5.57 L192.0 5.39 L190.0 5.24 L188.0 5.15 L186.0 5.10 L184.0 5.09 L182.0 5.11 L180.0 5.15 L178.0 5.18 L176.0 5.21 L174.0 5.20 L172.0 5.16 L170.0 5.07 L168.0 4.94 L166.0 4.77 L164.0 4.56 L162.0 4.34 L160.0 4.12 L158.0 3.92 L156.0 3.75 L154.0 3.64 L152.0 3.60 L150.0 3.63 L148.0 3.74 L146.0 3.92 L144.0 4.16 L142.0 4.45 L140.0 4.77 L138.0 5.10 L136.0 5.41 L134.0 5.69 L132.0 5.92 L130.0 6.10 L128.0 6.21 L126.0 6.34 L124.0 7.04 L122.0 8.41 L120.0 8.31 L118.0 6.79 L116.0 5.97 L114.0 5.79 L112.0 5.73 L110.0 5.70 L108.0 5.71 L106.0 5.76 L104.0 5.84 L102.0 5.93 L100.0 6.03 L98.0 6.11 L96.0 6.16 L94.0 6.16 L92.0 6.11 L90.0 5.99 L88.0 5.82 L86.0 5.58 L84.0 5.30 L82.0 4.99 L80.0 4.67 L78.0 4.36 L76.0 4.08 L74.0 3.85 L72.0 3.68 L70.0 3.59 L68.0 3.57 L66.0 3.62 L64.0 3.75 L62.0 3.93 L60.0 4.14 L58.0 4.38 L56.0 4.61 L54.0 4.83 L52.0 5.01 L50.0 5.16 L48.0 5.25 L46.0 5.30 L44.0 5.31 L42.0 5.29 L40.0 5.25 L38.0 5.50 L36.0 6.35 L34.0 7.80 L32.0 6.39 L30.0 5.62 L28.0 5.46 L26.0 5.63 L24.0 5.84 L22.0 6.06 L20.0 6.28 L18.0 6.48 L16.0 6.65 L14.0 6.76 L12.0 6.80 L10.0 6.77 L8.0 6.66 L6.0 6.48 L4.0 6.24 L2.0 5.95 L0.0 5.63Z' fill='url(%23s)'/%3E%3Ccircle cx='69' cy='2.6' r='0.5' fill='%23fff'/%3E%3Ccircle cx='168' cy='2.8' r='0.4' fill='%23fff'/%3E%3Ccircle cx='8' cy='3.2' r='0.5' fill='%23fff'/%3E%3Ccircle cx='68' cy='3.5' r='0.6' fill='%23fff'/%3E%3Ccircle cx='232' cy='2.5' r='0.7' fill='%23fff'/%3E%3Ccircle cx='45' cy='2.8' r='0.7' fill='%23fff'/%3E%3Ccircle cx='146' cy='3.0' r='0.7' fill='%23fff'/%3E%3Ccircle cx='21' cy='3.0' r='0.6' fill='%23fff'/%3E%3Ccircle cx='86' cy='1.6' r='0.7' fill='%23fff'/%3E%3Ccircle cx='133' cy='2.9' r='0.8' fill='%23fff'/%3E%3C/svg%3E") 0 0 / 280px 12px repeat-x;
    filter: drop-shadow(0 1px 1px rgba(10, 30, 70, .35));
}
.pk-weihnacht .card:nth-child(2n)::before { background-position-x: -95px; }
.pk-weihnacht .card:nth-child(3n)::before { background-position-x: -180px; }

/* ---------- Lichterkette unter dem Menue (06.12.: Tannengirlande mit warmweissen Lichtern) ----------
 * Nadeln als statisches SVG, Lichter als kleine HTML-Punkte mit Schein; animiert wird nur opacity. */
.pk-lichter { position: relative; height: 38px; margin: -16px auto -18px; pointer-events: none; z-index: 5; }
.pk-lichter svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.pk-lichter .pk-wlicht { position: absolute; display: block; width: 5px !important; height: 5px !important; min-width: 0 !important; padding: 0 !important; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #fffbea; box-shadow: 0 0 2px 1px #fff0c0, 0 0 5px 2px rgba(255, 190, 70, .9); z-index: 1; }
.pk-lichter .pk-wlicht::after {
    content: ""; position: absolute; left: -4.5px; top: -4.5px; width: 14px; height: 14px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 214, 120, .8) 0, rgba(255, 180, 60, .3) 40%, transparent 70%);
    will-change: opacity; animation: pk-funkeln var(--t) ease-in-out var(--v) infinite;
}
@keyframes pk-funkeln { 0%, 100% { opacity: .9; } 50% { opacity: .35; } }
/* /lichterkette: alles flackert schnell */
.pk-weihnacht-party .pk-lichter .pk-wlicht::after { animation-duration: .45s; }
.pk-weihnacht-party .card { box-shadow: 0 0 0 2px rgba(255, 210, 63, .55), 0 0 22px rgba(255, 59, 59, .45); transition: box-shadow .3s; }

/* ---------- Heutiges Tuerchen im Spiele-Kasten (rechts unter "… online") ---------- */
#cardbody_userlist.pk-wtuer-da { position: relative; }
.pk-wtuer {
    position: absolute; inset: 8px; z-index: 4; border-radius: 10px; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px; text-align: center; color: #fff;
    background: linear-gradient(rgba(30, 8, 12, .55), rgba(30, 8, 12, .8)), url("/img/weihnacht/advent.jpg?v=1") center / cover;
    border: 1px solid rgba(217, 180, 74, .7);
}
.pk-wtuer-titel { font-weight: 700; font-size: 15px; color: #ffe08a; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.pk-wtuer-knopf { position: relative; width: 104px; height: 104px; perspective: 500px; border: 0; padding: 0; background: none; cursor: pointer; }
.pk-wtuer-knopf .pk-tuer-innen { font-size: 14px; }
.pk-wtuer-knopf .pk-tuer-klappe { font-size: 40px; animation: pk-tuer-glanz 1.6s ease-in-out infinite; box-shadow: 0 0 0 3px #ffe08a, 0 0 22px rgba(255, 224, 138, .8); }
.pk-wtuer-knopf.pk-offen .pk-tuer-klappe { transform: rotateY(-108deg); animation: none; }
.pk-wtuer-text { font-size: 13px; line-height: 1.4; max-width: 300px; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.pk-wtuer-text b { color: #ffe08a; }
.pk-wtuer-nein { background: rgba(0, 0, 0, .35); color: #fff; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.pk-wtuer-nein:hover { background: rgba(0, 0, 0, .55); }
.pk-wtuer.pk-weg { opacity: 0; transition: opacity .8s; }

/* ---------- Meldung im Laufband ---------- */
#tickweihnacht .pk-zeit { display: inline-block; padding: 0 6px; border-radius: 4px; background: rgba(0, 0, 0, .25); color: #ffe08a; font-variant-numeric: tabular-nums; font-weight: 700; }
#tickweihnacht .pk-wlink { color: #ffe08a; font-weight: 700; text-decoration: underline; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
#tickweihnacht .pk-wlink:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#tickweihnacht .pk-wbaro { display: inline-flex; align-items: center; gap: 8px; }
#tickweihnacht .pk-wbaro i { display: inline-block; width: 160px; max-width: 35vw; height: 10px; border-radius: 5px; background: rgba(0, 0, 0, .3); overflow: hidden; }
#tickweihnacht .pk-wbaro i b { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff3b3b); }

/* ---------- Schneefall (Canvas) ---------- */
#pk-schnee { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 900; }

/* ---------- Adventskalender ---------- */
.pk-advent-hg { position: fixed; inset: 0; z-index: 10050; background: rgba(8, 12, 24, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pk-advent {
    position: relative; width: min(980px, 100%); max-height: calc(100vh - 32px); overflow: auto;
    border-radius: 16px; border: 2px solid #d9b44a; box-shadow: 0 18px 60px rgba(0, 0, 0, .6);
    background: #2a0d10 url("/img/weihnacht/advent.jpg?v=1") center/cover;
    color: #fff; font-family: inherit;
}
.pk-advent-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: linear-gradient(rgba(20, 6, 8, .85), rgba(20, 6, 8, .35)); }
.pk-advent-kopf h2 { margin: 0; font-size: 22px; color: #ffe08a; text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.pk-advent-kopf p { margin: 2px 0 0; font-size: 13px; color: #f3e6d0; }
.pk-advent-zu { background: rgba(0, 0, 0, .35); color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 50%; width: 34px; height: 34px; font-size: 18px; cursor: pointer; flex: 0 0 auto; }
.pk-advent-gitter { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; padding: 90px 18px 18px; }
@media (max-width: 700px) { .pk-advent-gitter { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 40px 10px 10px; } .pk-advent-kopf h2 { font-size: 18px; } }
.pk-tuer { position: relative; aspect-ratio: 1 / 1; perspective: 600px; border: 0; padding: 0; background: none; cursor: pointer; font: inherit; }
.pk-tuer:disabled { cursor: default; }
.pk-tuer-innen {
    position: absolute; inset: 0; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: rgba(255, 248, 235, .92); color: #6b1418; font-weight: 700; font-size: 13px; text-align: center; padding: 4px;
    box-shadow: inset 0 0 0 2px #d9b44a;
}
.pk-tuer-innen span { font-size: 26px; line-height: 1; }
.pk-tuer-klappe {
    position: absolute; inset: 0; border-radius: 10px; transform-origin: left center; transition: transform .9s cubic-bezier(.3, 1.4, .5, 1);
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, rgba(160, 18, 30, .93), rgba(110, 10, 20, .93)); border: 2px solid #d9b44a;
    font-size: clamp(20px, 4vw, 34px); font-weight: 800; color: #ffe08a; text-shadow: 0 2px 3px rgba(0, 0, 0, .55);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .45); backface-visibility: hidden;
}
.pk-tuer:nth-child(3n+2) .pk-tuer-klappe { background: linear-gradient(145deg, rgba(27, 94, 32, .93), rgba(15, 61, 23, .93)); }
.pk-tuer:nth-child(4n+3) .pk-tuer-klappe { background: linear-gradient(145deg, rgba(23, 50, 110, .93), rgba(12, 30, 70, .93)); }
.pk-tuer.pk-offen .pk-tuer-klappe { transform: rotateY(-108deg); opacity: .85; }
.pk-tuer.pk-heute .pk-tuer-klappe { box-shadow: 0 0 0 3px #ffe08a, 0 0 22px rgba(255, 224, 138, .85); animation: pk-tuer-glanz 1.6s ease-in-out infinite; }
.pk-tuer.pk-zu .pk-tuer-klappe { filter: saturate(.55) brightness(.75); }
.pk-tuer.pk-zu .pk-tuer-klappe::after { content: "🔒"; position: absolute; right: 6px; bottom: 4px; font-size: 13px; }
.pk-tuer[data-tag="24"] .pk-tuer-klappe { background: linear-gradient(145deg, #d4a017, #9c6b00); color: #fff; }
@keyframes pk-tuer-glanz { 50% { box-shadow: 0 0 0 3px #fff3c4, 0 0 30px rgba(255, 224, 138, 1); } }
.pk-advent-text { margin: 0 18px 18px; padding: 12px 14px; border-radius: 10px; background: rgba(20, 6, 8, .78); border: 1px solid rgba(217, 180, 74, .7); font-size: 15px; line-height: 1.45; min-height: 1.45em; }
.pk-advent-text b { color: #ffe08a; }
.pk-advent-fuss { display: flex; justify-content: flex-end; padding: 0 18px 16px; margin-top: -8px; }
.pk-advent-fuss button { background: rgba(0, 0, 0, .35); color: #fff; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }

/* ---------- Fliegende Sachen ---------- */
.pk-wflug { position: fixed; z-index: 1000; pointer-events: none; will-change: transform; font-size: 30px; line-height: 1; }
.pk-wfang { pointer-events: auto; cursor: pointer; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); }
.pk-wplatsch { position: fixed; z-index: 1000; pointer-events: none; font-size: 26px; animation: pk-platsch .9s ease-out forwards; }
@keyframes pk-platsch { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.pk-wschlitten { position: fixed; top: 90px; left: 0; z-index: 1000; pointer-events: none; font-size: 40px; white-space: nowrap; will-change: transform; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.pk-wgruss { position: fixed; left: 50%; top: 38%; z-index: 1001; pointer-events: none; transform: translate(-50%, -50%); text-align: center; font-size: clamp(30px, 6vw, 64px); font-weight: 800; color: #fff; text-shadow: 0 0 18px #ff3b3b, 0 4px 10px rgba(0, 0, 0, .6); animation: pk-wgruss 5s ease-in-out forwards; }
@keyframes pk-wgruss { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 15%, 80% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1.05); } }
.pk-gluehwein { display: inline-block; margin-left: 4px; font-size: .95em; }
#pk-feuerwerk { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1001; }

@media (prefers-reduced-motion: reduce) {
    .pk-wlicht::after, .pk-tuer.pk-heute .pk-tuer-klappe, .pk-wtuer-knopf .pk-tuer-klappe { animation: none; }
}

/* Handy: Karte unter "Mehr" (sieht aus wie die PK-City-Karte, aber mit dem Kalenderbild) */
.mob-mehr .mob-stadtkarte.pk-wmobil {
    background-image: linear-gradient(90deg, rgba(40, 6, 10, .9), rgba(40, 6, 10, .45) 70%, rgba(40, 6, 10, .2)), url("/img/weihnacht/advent.jpg?v=1");
    background-size: cover; background-position: center;
}

/* ---------- Weihnachtlicher Hintergrund (eigener Schalter, nur am Computer) ----------
 * Fest hinter der Seite; leicht abgedunkelt, damit die Kaesten lesbar bleiben.
 * Der Sternenhimmel (z-index -1) liegt nachts darueber. */
.pk-whg {
    position: fixed; inset: 0; z-index: -2; pointer-events: none;
    /* 16:9 mit Himmel bis oben (06.12.: nach oben erweitert), fuellt den ganzen Bildschirm;
       unten angelegt, damit Baum, Schneemann und Haus bei breiten Bildschirmen bleiben. */
    background: #060d1c url("/img/weihnacht/hintergrund.jpg?v=3") center bottom / cover no-repeat;
}
.pk-whg::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(8, 16, 40, .15), rgba(8, 16, 40, .45) 28%, rgba(8, 16, 40, .45) 72%, rgba(8, 16, 40, .15));
}

/* Mit dem dunklen Winterbild waren die Kaesten (sonst nur 20 % Schwarz auf hellem Blau)
   nicht mehr zu erkennen: eigener blauer Grund, heller Rand und Schatten. */
.pk-weihnacht-hg .card {
    background-color: rgba(30, 58, 118, .82);
    border-color: rgba(170, 205, 255, .3);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
}
.pk-weihnacht-hg .card .card { box-shadow: none; }

/* Tagsueber (7-18 Uhr, weihnacht.js setzt pk-weihnacht-tag): dieselbe Szene als sonniger Wintertag */
.pk-weihnacht-tag .pk-whg { background: #3f78c2 url("/img/weihnacht/hintergrund-tag.jpg?v=2") center bottom / cover no-repeat; }
.pk-weihnacht-tag .pk-whg::after { background: linear-gradient(90deg, rgba(10, 30, 70, 0), rgba(10, 30, 70, .22) 28%, rgba(10, 30, 70, .22) 72%, rgba(10, 30, 70, 0)); }
.pk-whg { transition: opacity .6s; }
