.cosm-new-year-snow {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
  user-select: none;
}

.cosm-new-year-snow > span {
  position: absolute;
  top: -30px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  background: url("new-year-flake.svg") center / contain no-repeat;
  opacity: 0;
  animation:
    cosm-new-year-fall calc(var(--time) * 1.65) linear calc(var(--delay) * 1.65) infinite,
    cosm-new-year-drift calc(var(--time) * .48) ease-in-out var(--delay) infinite alternate;
}

.cosm-new-year-snow > :nth-child(1) { --x: 4%; --size: 24px; --time: 17s; --delay: -3s; --drift: 22px; }
.cosm-new-year-snow > :nth-child(2) { --x: 11%; --size: 16px; --time: 21s; --delay: -10s; --drift: -16px; }
.cosm-new-year-snow > :nth-child(3) { --x: 18%; --size: 16px; --time: 18s; --delay: -14s; --drift: 30px; }
.cosm-new-year-snow > :nth-child(4) { --x: 25%; --size: 24px; --time: 23s; --delay: -9s; --drift: -28px; }
.cosm-new-year-snow > :nth-child(5) { --x: 34%; --size: 16px; --time: 19s; --delay: -4s; --drift: 19px; }
.cosm-new-year-snow > :nth-child(6) { --x: 42%; --size: 24px; --time: 21s; --delay: -19s; --drift: -34px; }
.cosm-new-year-snow > :nth-child(7) { --x: 51%; --size: 16px; --time: 16s; --delay: -11s; --drift: 26px; }
.cosm-new-year-snow > :nth-child(8) { --x: 59%; --size: 24px; --time: 20s; --delay: -7s; --drift: -22px; }
.cosm-new-year-snow > :nth-child(9) { --x: 66%; --size: 16px; --time: 24s; --delay: -17s; --drift: 29px; }
.cosm-new-year-snow > :nth-child(10) { --x: 73%; --size: 16px; --time: 19s; --delay: -13s; --drift: -21px; }
.cosm-new-year-snow > :nth-child(11) { --x: 80%; --size: 24px; --time: 22s; --delay: -6s; --drift: 26px; }
.cosm-new-year-snow > :nth-child(12) { --x: 87%; --size: 16px; --time: 17s; --delay: -14s; --drift: -20px; }
.cosm-new-year-snow > :nth-child(13) { --x: 93%; --size: 16px; --time: 20s; --delay: -2s; --drift: -30px; }
.cosm-new-year-snow > :nth-child(14) { --x: 97%; --size: 24px; --time: 23s; --delay: -17s; --drift: 14px; }

@keyframes cosm-new-year-fall {
  0% { translate: 0 0; opacity: 0; }
  9%, 88% { opacity: .88; }
  100% { translate: 0 calc(100vh + 30px); opacity: 0; }
}

@keyframes cosm-new-year-drift {
  from { transform: translateX(calc(var(--drift) * -1.6)) rotate(-13deg); }
  to { transform: translateX(calc(var(--drift) * 1.6)) rotate(13deg); }
}

@media (max-width: 650px), (pointer: coarse) {
  .cosm-new-year-snow > :nth-child(odd) {
    display: none;
  }
}

/* The illustrated fallback arrow yields to explicit cursors from the store theme. */
@layer cosm-new-year {
  body {
    cursor: url("new-year-tree.png") 1 1, auto;
  }

  :where(p, h1, h2, h3, h4, h5, h6, li, th, td, label, [contenteditable], [draggable="true"]) {
    cursor: auto;
  }

  :where(input, textarea, select) {
    cursor: revert;
  }
}

/* Swiper sets its drag cursor inline on the main banner wrapper. */
.banners-big .main-slider > .main-slider__wrapper {
  cursor: url("new-year-mitten.png") 4 6, grab !important;
}

/* Match the illustrated hover state on links and enabled buttons, including their icons and labels. */
:where(
  a:any-link, button, summary, [role="button"], [role="link"], .btn, .btn-video,
  input:is([type="button"], [type="submit"], [type="reset"], [type="image"])
):not(:disabled, [disabled], .disabled, [aria-disabled="true"], [aria-disabled="true"] *) {
  cursor: url("new-year-mitten.png") 4 6, pointer !important;

  & :where(*) {
    cursor: inherit !important;
  }
}
