.psy-christmas {
  position: fixed;
  z-index: 100;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

body.admin-bar .psy-christmas {
  top: 32px;
}

.psy-christmas-enabled header #logo {
  position: relative;
}

.psy-christmas-enabled header #logo::after {
  position: absolute;
  inset: 3% 7% auto;
  height: clamp(6px, 1.1vw, 13px);
  background: linear-gradient(#fff 25%, #f3fbff 52%, #a8d7f0);
  clip-path: polygon(0 41%, 5% 22%, 12% 27%, 16% 12%, 28% 22%, 37% 9%, 47% 20%, 61% 8%, 68% 20%, 80% 8%, 92% 23%, 97% 28%, 100% 58%, 94% 69%, 90% 57%, 87% 98%, 84% 61%, 73% 72%, 70% 59%, 66% 91%, 63% 63%, 56% 71%, 48% 57%, 44% 100%, 41% 65%, 34% 72%, 29% 56%, 20% 71%, 17% 61%, 14% 94%, 11% 61%, 5% 74%);
  filter: drop-shadow(0 1px 1px #41637d);
  pointer-events: none;
  content: "";
}

.psy-christmas-enabled .psy-halloween__lights {
  display: none;
}

.psy-christmas__lights {
  --psy-christmas-bulb-width: clamp(11px, 1.4vw, 17px);
  --psy-christmas-bulb-height: clamp(17px, 2vw, 25px);
  position: absolute;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.psy-christmas__lights span {
  position: relative;
  box-sizing: border-box;
  height: clamp(8px, 1.4vw, 14px);
  border-bottom: 3px solid #24493b;
  border-radius: 0 0 50% 50%;
  box-shadow: 0 1px 0 #88a992;
}

.psy-christmas__lights span::before,
.psy-christmas__lights span::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  content: "";
}

.psy-christmas__lights span::before {
  top: calc(100% + 1px);
  width: calc(var(--psy-christmas-bulb-width) - 4px);
  height: 7px;
  border-radius: 3px;
  background: linear-gradient(90deg, #16322a, #58806a 48%, #23483a);
}

.psy-christmas__lights span::after {
  top: calc(100% + 6px);
  width: var(--psy-christmas-bulb-width);
  height: var(--psy-christmas-bulb-height);
  border-radius: 48% 48% 55% 55% / 32% 32% 68% 68%;
  background: radial-gradient(ellipse at 34% 26%, #fffd, transparent 47%), currentColor;
  box-shadow: inset -1px -2px 3px #0004, 0 0 7px 2px currentColor, 0 0 15px currentColor;
  animation: psy-christmas-glow 2.8s ease-in-out infinite alternate;
}

.psy-christmas__lights span:nth-child(3n + 2)::after {
  animation-delay: -1s;
}

.psy-christmas__lights span:nth-child(3n)::after {
  animation-delay: -2s;
}

.psy-christmas__corner {
  position: absolute;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: max(8px, env(safe-area-inset-left));
  display: flex;
  align-items: flex-end;
  gap: 5px;
}

.psy-christmas__tree-wrap {
  position: relative;
}

.psy-christmas__tree {
  position: relative;
  display: block;
  width: clamp(52px, 9vw, 116px);
  height: auto;
}

.psy-christmas__tree-star {
  position: absolute;
  top: 9%;
  left: 50%;
  width: 58%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #fffdfa 1%, #ffeb9acc 25%, #ffd45b69 49%, transparent 72%);
  opacity: 0;
  mix-blend-mode: screen;
}

.psy-christmas--star-lit .psy-christmas__tree-star {
  opacity: 1;
}

.psy-christmas__rudolph {
  position: absolute;
  bottom: 76%;
  left: 63%;
  display: block;
  width: clamp(46px, 7vw, 84px);
  aspect-ratio: 192 / 190;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  animation: psy-christmas-peek .5s ease-out both;
}

.psy-christmas__rudolph img,
.psy-christmas__sleigh img {
  display: block;
  width: 100%;
  height: auto;
}

.psy-christmas__rudolph::before,
.psy-christmas__rudolph::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.psy-christmas__rudolph::before {
  top: 51%;
  left: 62%;
  width: 12%;
  height: 15%;
  border-bottom: 1px solid #633413;
  border-radius: 50%;
  background: #d38941;
  opacity: 0;
  animation: psy-christmas-wink .42s .7s ease-in-out;
}

.psy-christmas__rudolph[aria-pressed="true"]::after {
  top: 71%;
  left: 50%;
  width: 15%;
  height: 12%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 38% 30%, #fff2cc, #ff4b3b 40%, #d3001e 76%);
  box-shadow: 0 0 8px 3px #ff321e, 0 0 16px 5px #ff362d99;
}

.psy-christmas__sleigh {
  position: absolute;
  top: clamp(46px, 9vh, 90px);
  left: 100%;
  width: clamp(125px, 24vw, 300px);
  filter: drop-shadow(0 2px 3px #32170f80);
  animation: psy-christmas-sleigh-flight 8s linear both;
}

.psy-christmas__sleigh-trail {
  position: absolute;
  top: 43%;
  left: 95%;
  color: #ffda77;
  text-shadow: 0 0 5px #b47710, 0 0 9px #ffe9a8;
  white-space: nowrap;
}

.psy-christmas__ornament {
  --psy-christmas-ornament-color: #d62e4a;
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  margin: 4px auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.psy-christmas__ornament[data-ornament="home"] {
  margin-right: 6%;
}

.psy-christmas__ornament[data-ornament="catalog"] {
  --psy-christmas-ornament-color: #147c86;
}

.psy-christmas__ornament[data-ornament="title"] {
  --psy-christmas-ornament-color: #7141b8;
  margin-left: 9%;
}

.psy-christmas__ornament::before,
.psy-christmas__ornament::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  content: "";
}

.psy-christmas__ornament::before {
  top: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid #b5822e;
  border-radius: 50%;
}

.psy-christmas__ornament::after {
  top: 15px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 26%, #fffd, transparent 37%), linear-gradient(160deg, transparent 42%, #ffe195 43% 53%, transparent 54%), var(--psy-christmas-ornament-color);
  box-shadow: inset -2px -3px 4px #0005, 0 1px 3px #0006;
}

.psy-christmas__ornament[aria-disabled="true"] {
  opacity: .5;
  cursor: default;
}

.psy-christmas__hunt-status {
  position: absolute;
  bottom: calc(100% + 45px);
  left: 0;
  width: max-content;
  max-width: min(230px, calc(100vw - 24px));
  margin: 0;
  padding: 7px 10px;
  border-radius: 9px;
  background: #233d32;
  color: #fff3cf;
  font-size: 13px;
  line-height: 1.4;
}

.psy-christmas__hunt-status:empty {
  opacity: 0;
}

.psy-christmas__visit {
  position: relative;
}

.psy-christmas__santa {
  display: block;
  width: clamp(48px, 7vw, 91px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.psy-christmas__santa img {
  display: block;
  width: 100%;
  height: auto;
}

.psy-christmas__santa:focus-visible,
.psy-christmas__rudolph:focus-visible,
.psy-christmas__ornament:focus-visible {
  outline: 2px solid #ffd35a;
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #1e352b;
}

.psy-christmas__greeting {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 0;
  width: min(220px, 59vw);
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #dbb05f;
  border-radius: 12px 12px 12px 3px;
  background: #fff6df;
  color: #482127;
  box-shadow: 0 3px 12px #0004;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.psy-christmas__visit[hidden],
.psy-christmas__greeting[hidden],
.psy-christmas__rudolph[hidden],
.psy-christmas__sleigh[hidden],
.psy-christmas__ornament[hidden] {
  display: none;
}

.psy-christmas__announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes psy-christmas-glow {
  from { opacity: .88; }
  to { opacity: 1; }
}

@keyframes psy-christmas-peek {
  from { transform: translate(-35%, 16%) rotate(-12deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes psy-christmas-wink {
  0%, 100% { opacity: 0; transform: scaleY(.1); }
  40%, 70% { opacity: 1; transform: scaleY(1); }
}

@keyframes psy-christmas-sleigh-flight {
  0% { transform: translate(50%, 16px) rotate(-5deg); }
  50% { transform: translate(calc(-50vw - 50%), -9px) rotate(3deg); }
  100% { transform: translate(calc(-100vw - 150%), 13px) rotate(-4deg); }
}

@media (max-width: 782px) {
  body.admin-bar .psy-christmas {
    top: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .psy-christmas__lights span::after,
  .psy-christmas__rudolph,
  .psy-christmas__rudolph::before {
    animation: none;
  }

  .psy-christmas__sleigh {
    display: none;
  }
}

@media print {
  .psy-christmas,
  .psy-christmas__ornament,
  .psy-christmas-enabled header #logo::after {
    display: none;
  }
}
