* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #f0f6ff;
  background: linear-gradient(to bottom, #0b1a33 0%, #1c3557 60%, #3a5a80 100%);
  cursor: crosshair;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

/* Container für die Flocken – liegt über allem, blockiert aber keine Klicks */
#snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 10;
}

.snowflake {
  position: absolute;
  top: -2em;
  color: #fff;
  user-select: none;
  line-height: 1;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  will-change: transform;
  /* Fallen: Dauer und Verzögerung setzt das JS pro Flocke */
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* Inneres Element für das seitliche Schaukeln */
.snowflake span {
  display: inline-block;
  animation-name: sway;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

@keyframes fall {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(calc(100vh + 4em)) rotate(360deg); }
}

@keyframes sway {
  from { transform: translateX(calc(var(--sway, 30px) * -1)); }
  to   { transform: translateX(var(--sway, 30px)); }
}

.content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 1rem;
}

.content h1 {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.content p {
  font-size: 1.15rem;
  opacity: 0.8;
}

/* ---- Schneemaschinen ---- */
/* Das SVG ist 120×200, der Drehpunkt liegt bei 60/160 (= 50% / 80%).
   bottom: -40px setzt den Drehpunkt genau auf den unteren Bildschirmrand. */
.snowmachine {
  position: fixed;
  bottom: -40px;
  width: 120px;
  height: 200px;
  z-index: 5;
  transform-origin: 50% 80%;
  /* --angle: Ausrichtung zur Maus, --kick: Rückstoß beim Feuern (setzt das JS) */
  transform: rotate(var(--angle, 0deg)) translateY(var(--kick, 0px));
  transition: transform 70ms ease-out;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.snowmachine--left  { left: 24px; }
.snowmachine--right { right: 24px; }

.snowmachine.recoil { --kick: 8px; }

@media (max-width: 600px) {
  .snowmachine {
    width: 84px;
    height: 140px;
    bottom: -28px;
  }
  .snowmachine--left  { left: 12px; }
  .snowmachine--right { right: 12px; }
}

/* Abgefeuerte Flocken */
#shots {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 11;
}

.shot {
  position: absolute;
  left: 0;
  top: 0;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  will-change: transform;
}

/* Liegender Schnee am unteren Rand */
#ground {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 12;
}

/* Wer reduzierte Bewegung eingestellt hat, bekommt keinen Schneefall */
@media (prefers-reduced-motion: reduce) {
  #snow { display: none; }
}
