/* ==========================================================================
   Weihnachtsdeko für Startseite und /gutscheine (site.json → weihnachten).
   Ein lauter Moment: Der Weihnachtsmann fährt im Hot Rod mit Rentieren über den Hero.
   Dazu ruhiger Schnee im Hero, Geschenkschleifen an den Gutscheinen, Schneekante am goldenen Abschluss.
   Bei reduzierter Bewegung: kein Flug, kein fallender Schnee, der Weihnachtsmann steht still im Hero.
   ========================================================================== */

.xm-santa {
  --xm-gold: #e0aa3e;
  --xm-rot: #b85636;
  --xm-weiss: #fbfaf7;
  --xm-dunkel: #0e0e0f;
  display: block;
  overflow: visible;
}
.xm-gold { fill: var(--xm-gold); }
.xm-gold-strich { stroke: var(--xm-gold); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.xm-dunkel { fill: var(--xm-dunkel); }
.xm-dunkel-strich { stroke: var(--xm-dunkel); stroke-width: 2; }
.xm-rot { fill: var(--xm-rot); }
.xm-weiss { fill: var(--xm-weiss); }
.xm-haut { fill: #f1cfae; }
.xm-sack { fill: #cb6417; }
.xm-sack-band { stroke: var(--xm-gold); stroke-width: 3; stroke-linecap: round; }
.xm-arm { stroke: var(--xm-rot); stroke-width: 7; stroke-linecap: round; }
.xm-rad { fill: var(--xm-dunkel); stroke: var(--xm-gold); stroke-width: 5; }
.xm-zuegel { stroke: var(--xm-gold); stroke-width: 1.6; opacity: 0.8; }
.xm-nase { fill: #ff5a3c; }
.xm-nase-schein { fill: #ff5a3c; opacity: 0.35; }
.xm-stern { fill: var(--xm-gold); }

/* --------------------------------------------------------------------------
   Schnee im Hero (Canvas aus weihnachten.js). Liegt über Bild und Verlauf, unter dem Text.
   -------------------------------------------------------------------------- */
.xm-schnee {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.st-hero__inhalt,
.gs-hero__inhalt,
.st-hero__pause {
  z-index: 3;
}

/* --------------------------------------------------------------------------
   Der Flug: einmal kurz nach dem Laden quer über den oberen Teil des Heros, dann alle 40 Sekunden wieder.
   Außen: Weg von links nach rechts. Innen: sanftes Auf und Ab. Rentiere galoppieren leicht versetzt.
   -------------------------------------------------------------------------- */
.xm-flug {
  position: absolute;
  z-index: 2;
  top: clamp(14px, 7%, 70px);
  left: 0;
  width: clamp(230px, 30vw, 440px);
  pointer-events: none;
  transform: translateX(-110%);
  animation: xm-quer 40s linear 1.2s infinite;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}
.xm-flug .xm-santa {
  animation: xm-wiegen 2.4s ease-in-out infinite;
}
@keyframes xm-quer {
  0% { transform: translateX(-110%) translateY(18px) rotate(-3deg); }
  32% { transform: translateX(calc(100vw + 10%)) translateY(-26px) rotate(-6deg); }
  100% { transform: translateX(calc(100vw + 10%)) translateY(-26px) rotate(-6deg); }
}
@keyframes xm-wiegen {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.xm-rentier {
  transform-box: fill-box;
  animation: xm-galopp 0.9s ease-in-out infinite;
}
.xm-rentier--2 { animation-delay: -0.3s; }
.xm-rentier--3 { animation-delay: -0.6s; }
@keyframes xm-galopp {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(-3deg); }
}
.xm-nase-schein {
  transform-box: fill-box;
  transform-origin: center;
  animation: xm-leuchten 1.6s ease-in-out infinite;
}
@keyframes xm-leuchten {
  0%, 100% { transform: scale(0.8); opacity: 0.25; }
  50% { transform: scale(1.35); opacity: 0.55; }
}
.xm-stern {
  transform-box: fill-box;
  transform-origin: center;
  animation: xm-funkeln 1.2s ease-in-out infinite;
}
.xm-stern--2 { animation-delay: -0.3s; }
.xm-stern--3 { animation-delay: -0.6s; }
.xm-stern--4 { animation-delay: -0.9s; }
@keyframes xm-funkeln {
  0%, 100% { transform: scale(0.4); opacity: 0.3; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* Gutscheinseite am Handy: Foto oben, Text darunter. Der Flug bleibt über dem Foto. */
@media (max-width: 960px) {
  .gs-hero .xm-flug {
    top: 3%;
  }
}

/* --------------------------------------------------------------------------
   Geschenkschleife an den Gutschein-Tickets und an der Gutschein-Kachel der Startseite
   -------------------------------------------------------------------------- */
/* Band liegt unter dem Schriftzug (ticket__haupt hat z-index 1), kreuzt unten im leeren Teil des Tickets */
.xm-band {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 62%;
  width: 14px;
  background: var(--xm-band, #0e0e0f);
  pointer-events: none;
}
.xm-band::before {
  content: "";
  position: absolute;
  left: -2000px;
  right: -2000px;
  top: 82%;
  height: 14px;
  background: inherit;
}
.ticket--schwarz .xm-band { --xm-band: #e0aa3e; }
.xm-schleife {
  position: absolute;
  z-index: 2;
  width: 92px;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}
/* Schleife auf der Kreuzung der Bänder */
.ticket .xm-schleife {
  left: calc(62% + 7px);
  top: calc(82% + 7px);
  width: 74px;
  transform: translate(-50%, -46%);
}
.xm-schleife__band {
  fill: var(--xm-band, #0e0e0f);
  stroke: var(--xm-kante, #e0aa3e);
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.xm-schleife__falte {
  fill: none;
  stroke: var(--xm-kante, #e0aa3e);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.7;
}
/* Schleife in der Farbe des Bands: schwarzes Ticket → goldenes Band, goldenes Ticket → schwarzes Band */
.ticket--schwarz .xm-schleife { --xm-band: #e0aa3e; --xm-kante: #0e0e0f; }
.st-kachel .xm-schleife { z-index: 3; top: 14px; right: 16px; width: 104px; transform: rotate(10deg); --xm-band: #b85636; --xm-kante: #f0c070; }

/* --------------------------------------------------------------------------
   Goldener Abschluss: Schneekante oben, der Weihnachtsmann parkt rechts unten (schwarz auf Gold)
   -------------------------------------------------------------------------- */
.xm-schluss {
  position: relative;
  overflow: hidden;
}
.xm-schluss::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  top: -1px;
  height: 26px;
  background:
    radial-gradient(circle at 10px 0, #fbfaf7 13px, transparent 14px) 0 0 / 46px 26px repeat-x,
    radial-gradient(circle at 30px 0, #fbfaf7 9px, transparent 10px) 0 0 / 46px 26px repeat-x,
    linear-gradient(#fbfaf7, #fbfaf7) 0 0 / 100% 7px no-repeat;
}
.xm-schluss .gs-in {
  position: relative;
  z-index: 2;
  padding-top: 76px;
}
/* Szene unten im goldenen Abschluss: Tannenbaum links, Weihnachtsmann rechts */
.xm-szene {
  position: absolute;
  z-index: 1;
  left: max(16px, calc(50% - 640px));
  right: max(16px, calc(50% - 640px));
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  pointer-events: none;
}
.xm-baum--szene {
  width: 120px;
  margin-bottom: 4px;
}
.xm-parken {
  width: 300px;
  margin-bottom: 10px;
}
.xm-parken .xm-santa {
  --xm-gold: #0e0e0f;
  --xm-dunkel: #e0aa3e;
  --xm-rot: #8f3a1f;
}
.xm-parken .xm-zuegel { stroke: #0e0e0f; }
.xm-parken .xm-sack { fill: #8f3a1f; }
.xm-parken .xm-sack-band { stroke: #0e0e0f; }
.xm-parken .xm-stern { fill: #0e0e0f; }
.xm-parken .xm-rentier,
.xm-parken .xm-stern,
.xm-parken .xm-nase-schein { animation: none; }
@media (max-width: 1240px) {
  .xm-szene {
    position: static;
    justify-content: center;
    gap: 18px;
    margin: 18px auto 0;
    padding: 0 16px;
  }
  .xm-baum--szene { width: 84px; }
  .xm-parken { width: min(240px, 60%); }
}

/* --------------------------------------------------------------------------
   Tannenbaum
   -------------------------------------------------------------------------- */
.xm-baum { display: block; overflow: visible; }
.xm-baum__stamm { fill: #5a3016; }
.xm-baum__gruen { fill: #1d5a3a; }
.xm-baum__gruen:nth-of-type(2) { fill: #226843; }
.xm-baum__gruen:nth-of-type(3) { fill: #28774c; }
.xm-baum__schnee { fill: #fbfaf7; }
.xm-baum__girlande { fill: none; stroke: #e0aa3e; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1 5; }
.xm-baum__kugel--rot { fill: #d2342a; }
.xm-baum__kugel--gold { fill: #e0aa3e; }
.xm-baum__kugel--kupfer { fill: #b85636; }
.xm-baum__lichter circle { fill: #fff3c4; animation: xm-licht 1.8s ease-in-out infinite; }
.xm-baum__lichter circle:nth-child(3n + 1) { animation-delay: -0.6s; }
.xm-baum__lichter circle:nth-child(3n + 2) { animation-delay: -1.2s; }
@keyframes xm-licht {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.xm-baum__stern { fill: #e0aa3e; stroke: #fff3c4; stroke-width: 1; }
.xm-baum__schein { fill: #ffd97a; opacity: 0.35; transform-box: fill-box; transform-origin: center; animation: xm-leuchten 2.4s ease-in-out infinite; }
/* Im Hero: rechts unten, steht auf der Schneewehe */
.xm-baum--hero {
  position: absolute;
  z-index: 2;
  right: 5%;
  bottom: 4px;
  width: clamp(110px, 10vw, 170px);
  pointer-events: none;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
}
/* Startseite: links neben Pause-Knopf und Chat-Knopf (beide rechts unten) */
.st-hero .xm-baum--hero {
  right: max(110px, 10%);
  bottom: calc(clamp(22px, 3.2vw, 60px) - 8px);
}
@media (max-width: 960px) {
  .gs-hero .xm-baum--hero { display: none; }
}
@media (max-width: 700px) {
  .st-hero .xm-baum--hero { display: none; }
}

/* --------------------------------------------------------------------------
   Eiszapfen oben am Hero (wie an einer Dachkante)
   -------------------------------------------------------------------------- */
.xm-zapfen {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: 34px;
  pointer-events: none;
  background:
    linear-gradient(#fbfaf7, #fbfaf7) 0 0 / 100% 5px no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 34'%3E%3Cdefs%3E%3ClinearGradient id='e' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='1' stop-color='%23bfe3f7' stop-opacity='.55'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23e)' d='M0 4h160v3c-3 0-4 1-5 3l-2 9-2-9c-1-2-3-3-6-3-3 0-4 2-5 5l-3 22-3-22c-1-3-2-5-5-5s-5 1-6 3l-2 8-2-8c-1-2-2-3-5-3s-5 2-6 5l-3 14-3-14c-1-3-3-5-6-5s-4 1-5 3l-2 6-2-6c-1-2-3-3-6-3s-5 2-6 5l-3 18-3-18c-1-3-3-5-6-5s-4 1-5 3l-2 7-2-7c-1-2-3-3-6-3s-4 2-5 4l-2 10-2-10c-1-2-3-4-6-4H0z'/%3E%3C/svg%3E") 0 0 / 160px 34px repeat-x;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

/* --------------------------------------------------------------------------
   Bunte Lichterketten (weihnachten.js zeichnet das SVG passend zur Breite)
   -------------------------------------------------------------------------- */
.xm-lichter {
  position: absolute;
  z-index: 4;
  top: 2px;
  left: 0;
  right: 0;
  height: 44px;
  overflow: hidden;
  pointer-events: none;
}
.xm-lichter svg { display: block; }
.xm-lichter--schluss { top: 14px; }
.xm-kabel { fill: none; stroke: #1c2a22; stroke-width: 2; }
.xm-birne__fassung { fill: #3a3f3c; }
.xm-birne__glanz { fill: #fff; opacity: 0.7; }
.xm-birne__schein { opacity: 0.45; filter: blur(3px); }
.xm-birne--rot { --xm-licht: #ff4b3e; }
.xm-birne--gruen { --xm-licht: #3fd17a; }
.xm-birne--gold { --xm-licht: #ffc93c; }
.xm-birne--blau { --xm-licht: #4aa8ff; }
.xm-birne--weiss { --xm-licht: #fff6dc; }
.xm-birne--pink { --xm-licht: #ff7ad9; }
.xm-birne__glas,
.xm-birne__schein { fill: var(--xm-licht); }
.xm-birne {
  animation: xm-blinken 1.8s ease-in-out infinite;
}
@keyframes xm-blinken {
  0%, 100% { opacity: 1; }
  45% { opacity: 1; }
  60% { opacity: 0.35; }
  80% { opacity: 0.35; }
}

/* --------------------------------------------------------------------------
   Schneekappen auf Fotos und Knöpfen (weihnachten.js fügt .xm-kappe ein)
   -------------------------------------------------------------------------- */
.xm-hat-kappe {
  position: relative;
}
.xm-kappe {
  position: absolute;
  z-index: 4;
  top: -1px;
  left: 0;
  right: 0;
  height: 16px;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 16'%3E%3Cpath fill='%23fbfaf7' d='M0 0h120v6c-8 0-9 7-17 7s-8-5-15-5-8 7-17 7-9-6-16-6-8 5-15 5S31 7 24 7 15 12 8 12 2 7 0 7z'/%3E%3C/svg%3E") 0 0 / 120px 16px repeat-x;
  filter: drop-shadow(0 2px 2px rgba(20, 60, 90, 0.25));
}
/* Auf Knöpfen: kleine Kappe, die oben etwas übersteht */
.gs-btn > .xm-kappe {
  top: -7px;
  left: -2px;
  right: -2px;
  height: 12px;
  background-size: 60px 12px;
  border-radius: 6px 6px 0 0;
}

/* --------------------------------------------------------------------------
   Vereiste Hauptüberschrift im Hero: eisiger Verlauf, kühler Schimmer
   -------------------------------------------------------------------------- */
.st-hero .st-hero__eins,
.gs-hero h1 {
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 38%, #cfeaf8 62%, #9fd0ec 78%, #eef8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(160, 215, 245, 0.45)) drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35));
}
.gs-hero h1 .gs-eye {
  -webkit-text-fill-color: #e0aa3e;
}

/* --------------------------------------------------------------------------
   Nach dem Enddatum (Klasse xm-aus im <head>): alles Weihnachtliche ausblenden, bis neu veröffentlicht ist
   -------------------------------------------------------------------------- */
.xm-aus .xm-schnee, .xm-aus .xm-flug, .xm-aus .xm-szene, .xm-aus .xm-band, .xm-aus .xm-schleife,
.xm-aus .xm-baum, .xm-aus .xm-zapfen, .xm-aus .xm-lichter, .xm-aus .xm-kappe, .xm-aus .xm-schluss::before { display: none; }
.xm-aus .xm-schluss .gs-in { padding-top: 58px; }
.xm-aus .st-hero .st-hero__eins,
.xm-aus .gs-hero h1 {
  background: none;
  -webkit-text-fill-color: currentColor;
  filter: none;
}

/* --------------------------------------------------------------------------
   Reduzierte Bewegung: der Weihnachtsmann steht still oben rechts im Hero, nichts bewegt sich
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .xm-flug {
    left: auto;
    right: 4%;
    transform: none;
    animation: none;
  }
  .xm-flug .xm-santa,
  .xm-birne,
  .xm-baum__lichter circle,
  .xm-baum__schein,
  .xm-rentier,
  .xm-nase-schein,
  .xm-stern {
    animation: none;
  }
}
