#christmas-container {
  --sky: 100vh;
  --flake-scale: 1;
  position: fixed;
  inset: 0;
  z-index: 999999;
  overflow: hidden;
  contain: strict;
  isolation: isolate;
  pointer-events: none !important;
  user-select: none;
}

@supports (height: 100dvh) {
  #christmas-container { --sky: 100dvh; }
}

#christmas-container * { box-sizing: border-box; pointer-events: none !important; }

#christmas-container::before {
  content: "";
  position: absolute;
  inset: 0 -8% auto;
  height: clamp(78px, 20vh, 180px);
  background:
    radial-gradient(ellipse at 19% 0%, #fbd48533, transparent 48%),
    radial-gradient(ellipse at 76% -6%, #b2e4dc2e, transparent 50%);
  transform-origin: 50% 0;
  animation: csAurora 18s ease-in-out infinite alternate;
}

#christmas-container .snow-air {
  position: absolute;
  inset: 0;
  animation: csWind 19s ease-in-out infinite;
}

#christmas-container :is(.snow, .christmas-item, .christmas-sparkle, .frost-sparkle) {
  position: absolute;
  top: 0;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  width: calc(var(--size) * var(--flake-scale));
  height: calc(var(--size) * var(--flake-scale));
  opacity: 0;
  animation: csFall var(--time) linear var(--delay) infinite;
}

#christmas-container .flake-face {
  position: relative;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff6da;
  font: normal var(--size)/1 Georgia, serif;
  text-shadow: 0 1px 1px #617584;
  animation: csSway var(--swing) ease-in-out var(--delay) infinite alternate;
}

#christmas-container canvas { display: block; width: 100%; height: 100%; }
#christmas-container .snow canvas { animation: csSpin var(--spin) linear var(--delay) infinite; }

#christmas-container .layer-back .flake-face {
  border-radius: 50%;
  background: radial-gradient(circle, #fff 12%, #eef5f8 32%, #a2b6bcaa 54%, transparent 75%);
}

#christmas-container .hero .flake-face::after,
#christmas-container .frost-sparkle,
#christmas-container .christmas-sparkle .flake-face {
  background: radial-gradient(circle, #fff 6%, #fff4ca 26%, #e2b75d 65%, #b68b42);
  clip-path: polygon(50% 0, 59% 40%, 100% 50%, 59% 59%, 50% 100%, 41% 60%, 0 50%, 41% 40%);
}

#christmas-container .hero .flake-face::after {
  content: "";
  position: absolute;
  top: 18%;
  left: 63%;
  width: 26%;
  height: 26%;
  animation: csGlint 5.8s ease-in-out var(--delay) infinite;
}

#christmas-container .frost-sparkle {
  top: var(--y);
  animation: csGlint var(--time) ease-in-out var(--delay) infinite;
}

#christmas-container .christmas-item { animation-name: csOrnamentFall; }
#christmas-container .christmas-item canvas {
  transform-origin: 50% 9%;
  animation: csPendulum var(--swing) ease-in-out var(--delay) infinite alternate;
}

@keyframes csFall {
  0% { opacity: 0; transform: translate3d(0, calc(0px - var(--size)), 0); }
  6%, 94% { opacity: var(--alpha); }
  100% { opacity: 0; transform: translate3d(var(--drift), calc(var(--sky) + var(--size)), 0); }
}

@keyframes csOrnamentFall {
  0%, 55% { opacity: 0; transform: translate3d(0, calc(0px - var(--size)), 0); }
  60%, 94% { opacity: var(--alpha); }
  100% { opacity: 0; transform: translate3d(var(--drift), calc(var(--sky) + var(--size)), 0); }
}

@keyframes csWind {
  0%, 100% { transform: translateX(0); }
  28% { transform: translateX(var(--gust)); }
  68% { transform: translateX(calc(0px - var(--gust))); }
}

@keyframes csSway {
  from { transform: translateX(calc(0px - var(--sway))); }
  to { transform: translateX(var(--sway)); }
}

@keyframes csSpin {
  from { transform: rotate(var(--angle)) scaleX(.76); }
  50% { transform: rotate(calc(var(--angle) + var(--turn) * .5)) scaleX(1); }
  to { transform: rotate(calc(var(--angle) + var(--turn))) scaleX(.76); }
}

@keyframes csGlint {
  0%, 36%, 85%, 100% { opacity: 0; transform: scale(.45); }
  61% { opacity: .88; transform: scale(1); }
}

@keyframes csPendulum {
  from { transform: rotate(-13deg); }
  to { transform: rotate(14deg); }
}

@keyframes csAurora {
  from { opacity: .55; transform: translateX(-2%) scaleY(.85); }
  to { opacity: .95; transform: translateX(2%) scaleY(1.05); }
}

#christmas-container[data-paused]::before,
#christmas-container[data-paused] *,
#christmas-container[data-paused] *::after { animation-play-state: paused !important; }

@media (max-width: 600px) {
  #christmas-container { --flake-scale: .85; }
}

@media print, (prefers-reduced-motion: reduce) {
  #christmas-container { display: none !important; }
}