/*
 * Copyright (c) 2026 Martin Bundschuh, SeeBubble Media FlexCo. All rights reserved.
 * Written by Martin Bundschuh.
 *
 * Weihnachtsschmuck (Saison „weihnachten“). Diese Datei lädt layout.tsx nur, wenn der
 * Admin die Saison umgestellt hat; bei „normal“ gibt es weder sie noch die Bausteine
 * aus components/Winterschmuck.tsx. Aller Schmuck ist Zier: Klicks gehen hindurch.
 */

.schnee, .schneehaufen, .muetze, .zweig, .flocken, .adventkranz { pointer-events: none; -webkit-user-select: none; user-select: none; }

/* ---------- Himmel der Winterfotos (schmal läuft das Foto oben in diese Farbe aus) ---------- */
html:root[data-saison="weihnachten"] [data-foto="oesterreich"] { --f-himmel: #5685c8; }
html:root[data-saison="weihnachten"] [data-foto="burgenland"] { --f-himmel: #3964a9; }
html:root[data-saison="weihnachten"] [data-foto="kaernten"] { --f-himmel: #3066b3; }
html:root[data-saison="weihnachten"] [data-foto="niederoesterreich"] { --f-himmel: #81a1d3; }
html:root[data-saison="weihnachten"] [data-foto="oberoesterreich"] { --f-himmel: #3a6db7; }
html:root[data-saison="weihnachten"] [data-foto="salzburg"] { --f-himmel: #235795; }
html:root[data-saison="weihnachten"] [data-foto="steiermark"] { --f-himmel: #306dc3; }
html:root[data-saison="weihnachten"] [data-foto="tirol"] { --f-himmel: #2764b1; }
html:root[data-saison="weihnachten"] [data-foto="vorarlberg"] { --f-himmel: #3064b4; }
html:root[data-saison="weihnachten"] [data-foto="wien"] { --f-himmel: #2c5897; }

/* ---------- Schneekappen auf den Oberkanten ---------- */
.schnee {
  position: absolute; z-index: 2; left: 3px; right: 3px; top: -19px; height: 32px; border-radius: 14px 14px 6px 6px;
  background: url("schnee.svg") 0 0 / 300px 100% round no-repeat;
  filter: drop-shadow(0 2px 1.5px rgba(30, 45, 80, 0.38));
}
.schnee--zapfen { background-image: url("schnee-zapfen.svg"); }
html[data-modus="dunkel"] .schnee, html[data-modus="dunkel"] .schneehaufen { filter: brightness(0.84) drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.5)); }

/* Kopfzeile: flache Kappe, die Knöpfe bleiben frei */
.kopf__leiste { position: relative; }
.schnee--kopf { left: 12px; right: 12px; top: -10px; height: 17px; background-size: 230px 100%; border-radius: 9px 9px 4px 4px; }

/* Ortstafel und Brett haben einen Rand: Die Kappe sitzt außen darauf. */
.ortstafel__blech > .schnee { top: -27px; left: 2px; right: 2px; }
.brett__rahmen > .schnee { top: calc(-1 * var(--rb, 14px) - 19px); left: calc(-1 * var(--rb, 14px) + 3px); right: calc(-1 * var(--rb, 14px) + 3px); }

/* Fuß der Seite: eine Schneewechte über der ganzen Breite, sie deckt die gezackte Kante zu */
.schnee--fuss { left: 0; right: 0; top: -28px; height: 80px; border-radius: 0; background-size: 520px 100%; }

/* Schneehaufen dort und da: unten in den Ecken des Bretts, am Fuß der Seite */
.schneehaufen {
  position: absolute; z-index: 1; bottom: 0; width: clamp(90px, 16%, 190px); height: clamp(16px, 2.4vw, 26px);
  background: radial-gradient(120% 100% at 50% 0%, #fff 35%, #d6e3f2 100%);
  filter: drop-shadow(0 1px 1.5px rgba(30, 45, 80, 0.35));
}
.schneehaufen--links { left: 0; border-radius: 30% 70% 0 0 / 100% 100% 0 0; }
.schneehaufen--rechts { right: 0; width: clamp(70px, 12%, 150px); border-radius: 75% 25% 0 0 / 100% 100% 0 0; }
.fuss > .schneehaufen { bottom: auto; top: -10px; height: 40px; z-index: 3; }
.fuss > .schneehaufen--links { left: 7%; width: clamp(140px, 22%, 300px); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }
.fuss > .schneehaufen--rechts { right: 11%; width: clamp(110px, 15%, 220px); height: 30px; top: 0; border-radius: 50% 50% 0 0 / 100% 100% 0 0; }

/* ---------- Zipfelmütze an der Ecke der Tafeln ---------- */
/* Gezeichnet für die linke Ecke: Der Zipfel fällt nach außen, der Bommel baumelt neben der Tafel. */
.muetze {
  position: absolute; z-index: 3; top: -46px; width: 82px; height: auto; overflow: visible;
  filter: drop-shadow(2px 4px 3px rgba(20, 10, 0, 0.45));
}
.muetze--links { left: -42px; rotate: -16deg; }
.muetze--rechts { right: -42px; rotate: 16deg; scale: -1 1; }
.muetze__stoff { fill: #c5161d; }
.muetze__falte { fill: #8f0d14; opacity: 0.5; }
.muetze__pelz { fill: #fff; }
.muetze__pelzschatten { fill: #cfdcea; }
.held__titel > .muetze { width: clamp(76px, 9vw, 112px); top: clamp(-62px, -5vw, -42px); left: clamp(-58px, -4.6vw, -38px); }
.ortstafel__blech > .muetze { top: -54px; right: -50px; }
/* Platz über dem Titelschild, damit die Mütze nicht in die Brotkrumen oder unter die Kopfzeile ragt */
.held--brett .held__inhalt > .schild:not(.schild--unterTafel) { margin-top: 30px; }
.schild--werk { margin-top: 26px; }
@media (max-width: 560px) {
  .muetze { width: 66px; top: -38px; }
  .muetze--links, .held__titel > .muetze { left: -18px; }
  .muetze--rechts, .ortstafel__blech > .muetze { right: -18px; top: -44px; }
}

/* ---------- Tannenzweig mit roter Schleife am Rahmen des Bretts ---------- */
.zweig {
  position: absolute; z-index: 3; left: 50%; translate: -50% 0; width: clamp(120px, 15vw, 176px); height: auto; overflow: visible;
  top: calc(-0.5 * var(--rb, 14px) - clamp(28px, 3.5vw, 41px));
  filter: drop-shadow(1px 3px 2px rgba(20, 10, 0, 0.45));
}
.zweig__gruen path { fill: none; stroke: #2f7040; stroke-width: 2.6; stroke-linecap: round; }
.zweig__gruen--dunkel path { stroke: #1d4a2a; }
.zweig__ast { fill: none; stroke: #5b3a1f; stroke-width: 3; stroke-linecap: round; }
.zweig__beere circle { fill: #c5161d; stroke: #8f0d14; stroke-width: 1; }
.zweig__band { fill: #c5161d; stroke: #8f0d14; stroke-width: 1; stroke-linejoin: round; }
.zweig__band--hinten { fill: #a81219; }
.zweig__knoten { fill: #a81219; stroke: #8f0d14; stroke-width: 1; }

/* ---------- Leiser Schneefall oben im Kopfbild ---------- */
.flocken {
  position: absolute; z-index: 1; inset: 0 0 auto 0; height: min(72%, 480px); overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent);
}
.flocken i {
  position: absolute; top: -14px; left: var(--f-links); width: var(--f-gross); height: var(--f-gross); border-radius: 50%;
  background: radial-gradient(circle, #fff 40%, rgba(255, 255, 255, 0) 72%); opacity: 0.9;
  animation: schneien var(--f-dauer) linear var(--f-start) infinite; will-change: transform;
}
@keyframes schneien {
  from { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(16px, 250px, 0); }
  to { transform: translate3d(-8px, 500px, 0); }
}
.held.ist-weg .flocken i { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .flocken { display: none; }
}

/* ---------- Adventkranz auf der Startseite (unter der Zahlen-Karte) ---------- */
/* Bild und Farben: components/Adventkranz.tsx. Die Ortssuche (z-index 5) bleibt samt Trefferliste davor. */
.adventkranz {
  display: flex; flex-direction: column; align-items: center; width: clamp(250px, 70vw, 380px); max-width: 100%; margin-top: 2px;
  animation: aufsteigen 0.8s var(--sanft) 1.5s both;
}
.adventkranz__bild { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 5px 5px rgba(10, 5, 0, 0.5)); }
.adventkranz__taferl {
  position: relative; margin: -8px 0 0; padding: 7px 24px 9px; border-radius: 9px; background: var(--r-brett); color: var(--r-creme);
  font-family: var(--schrift-schild); font-weight: 600; font-size: clamp(1.4rem, 5vw, 1.75rem); line-height: 1.1; white-space: nowrap;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 0 2px rgba(30, 15, 5, 0.65), inset 0 0 0 4px rgba(255, 225, 170, 0.16), 0 14px 22px -10px rgba(0, 0, 0, 0.8);
}
/* Flammen flackern sanft, der Schein atmet mit */
.adventkranz__flamme { transform-box: fill-box; transform-origin: 50% 100%; animation: flackern 2.1s ease-in-out infinite; }
.adventkranz__schein { animation: glimmen 3.1s ease-in-out infinite; }
@keyframes flackern {
  0%, 100% { transform: scale(1, 1) skewX(0deg); }
  22% { transform: scale(0.94, 1.06) skewX(-3deg); }
  47% { transform: scale(1.04, 0.95) skewX(2.5deg); }
  71% { transform: scale(0.97, 1.04) skewX(-1.5deg); }
}
@keyframes glimmen {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}
.held.ist-weg .adventkranz__flamme, .held.ist-weg .adventkranz__schein { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .adventkranz, .adventkranz__flamme, .adventkranz__schein { animation: none; }
}
