.halloween-decor {
  --halloween-orange: #f28a2e;
  --halloween-purple: #7951a4;
  position: fixed;
  inset: 0;
  z-index: 45;
  overflow: hidden;
  pointer-events: none;
}

.halloween-decor__item {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.halloween-decor__item:focus-visible {
  outline: 2px solid var(--halloween-orange);
  outline-offset: 2px;
  z-index: 1;
}

.halloween-decor__visual {
  display: inline-block;
  pointer-events: none;
}

.halloween-web {
  position: absolute;
  top: calc(var(--topbar-h, var(--pt-topbar-h, 60px)) + 2px);
  right: -6px;
  width: clamp(78px, 12vw, 156px);
  aspect-ratio: 1;
  height: auto;
  line-height: 0;
}

.halloween-web img {
  display: block;
  width: 100%;
  height: auto;
  opacity: .62;
  filter: drop-shadow(0 2px 5px rgba(59, 33, 68, .16));
  transform-origin: 100% 0;
  animation: halloween-web-idle 8s ease-in-out infinite;
}

.halloween-spider-thread {
  position: absolute;
  top: calc(var(--topbar-h, var(--pt-topbar-h, 60px)) + 3px);
  right: clamp(31px, 5.7vw, 72px);
  height: clamp(28px, 5vh, 52px);
  border-left: 1px solid rgba(121, 81, 164, .55);
}

.halloween-spider {
  position: absolute;
  top: calc(var(--topbar-h, var(--pt-topbar-h, 60px)) + 14px);
  right: calc(clamp(31px, 5.7vw, 72px) - 22px);
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--halloween-purple);
}

.halloween-spider__icon {
  width: 24px;
  height: 24px;
  transform-origin: 50% 0;
  animation: halloween-spider-sway 3.2s ease-in-out infinite;
}

.halloween-hanger {
  position: absolute;
  top: var(--topbar-h, var(--pt-topbar-h, 60px));
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%);
}

.halloween-hanger__line {
  width: 1px;
  height: clamp(22px, 4vh, 42px);
  background: linear-gradient(var(--halloween-purple), var(--halloween-orange));
  opacity: .65;
}

.halloween-hanger__pumpkin {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border-radius: 50%;
  font-size: clamp(30px, 4vw, 44px);
}

.halloween-hanger__pumpkin .halloween-decor__visual {
  filter: drop-shadow(0 4px 6px rgba(76, 39, 65, .24));
  transform-origin: 50% -30px;
  animation: halloween-pumpkin-sway 4.8s ease-in-out infinite;
}

.halloween-hanger__bat {
  position: absolute;
  top: clamp(34px, 5vh, 54px);
  left: calc(100% + 10px);
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border-radius: 50%;
  font-size: clamp(19px, 2.5vw, 27px);
}

.halloween-hanger__bat .halloween-decor__visual {
  animation: halloween-bat-float 3.6s ease-in-out infinite;
}

.halloween-pumpkins {
  position: absolute;
  left: clamp(10px, 2.5vw, 30px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(64px, 9vh, 94px));
  display: flex;
  align-items: flex-end;
  gap: clamp(1px, .5vw, 7px);
  opacity: .64;
  filter: drop-shadow(0 2px 5px rgba(58, 30, 50, .18));
}

.halloween-pumpkins button {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  border-radius: 50%;
}

.halloween-pumpkins .halloween-decor__visual {
  transform-origin: 50% 100%;
}

.halloween-pumpkin--large .halloween-decor__visual {
  animation: halloween-pumpkin-idle 5.2s ease-in-out infinite;
}

.halloween-pumpkin--medium .halloween-decor__visual {
  animation: halloween-pumpkin-idle 5.2s ease-in-out -1.7s infinite;
}

.halloween-pumpkin--small .halloween-decor__visual {
  animation: halloween-pumpkin-idle 5.2s ease-in-out -3.4s infinite;
}

.halloween-pumpkin--large { font-size: clamp(38px, 5vw, 58px); }
.halloween-pumpkin--medium { font-size: clamp(29px, 4vw, 44px); }
.halloween-pumpkin--small { font-size: clamp(22px, 3vw, 33px); }

@keyframes halloween-web-idle {
  0%, 100% { transform: rotate(0) scale(1); }
  50% { transform: rotate(-1.5deg) scale(1.02); }
}

@keyframes halloween-pumpkin-idle {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-2px) rotate(2deg); }
}

@keyframes halloween-spider-sway {
  0%, 100% { transform: translateY(0) rotate(-7deg); }
  50% { transform: translateY(12px) rotate(7deg); }
}

@keyframes halloween-pumpkin-sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

@keyframes halloween-bat-float {
  0%, 100% { transform: translate(0, 0) rotate(-5deg); }
  50% { transform: translate(7px, -8px) rotate(5deg); }
}

.halloween-web:hover img,
.halloween-web:focus-visible img {
  animation: halloween-web-hover .8s ease-in-out;
}

.halloween-spider:hover .halloween-spider__icon,
.halloween-spider:focus-visible .halloween-spider__icon {
  animation: halloween-spider-hover .55s ease-in-out;
}

.halloween-hanger__pumpkin:hover .halloween-decor__visual,
.halloween-hanger__pumpkin:focus-visible .halloween-decor__visual,
.halloween-pumpkins button:hover .halloween-decor__visual,
.halloween-pumpkins button:focus-visible .halloween-decor__visual {
  animation: halloween-pumpkin-hover .42s ease-in-out;
}

.halloween-hanger__bat:hover .halloween-decor__visual,
.halloween-hanger__bat:focus-visible .halloween-decor__visual {
  animation: halloween-bat-hover .32s ease-in-out;
}

.halloween-web.is-activated img { animation: halloween-interaction-web .75s ease-in-out; }
.halloween-spider.is-activated .halloween-spider__icon { animation: halloween-interaction-spider .75s ease-in-out; }
.halloween-hanger__pumpkin.is-activated .halloween-decor__visual,
.halloween-pumpkins button.is-activated .halloween-decor__visual { animation: halloween-interaction-pumpkin .75s ease-in-out; }
.halloween-hanger__bat.is-activated .halloween-decor__visual { animation: halloween-interaction-bat .75s ease-in-out; }

@keyframes halloween-web-hover {
  to { opacity: .95; transform: scale(1.07); filter: drop-shadow(0 0 9px rgba(242, 138, 46, .72)); }
}

@keyframes halloween-spider-hover {
  to { transform: translateY(8px) rotate(15deg); }
}

@keyframes halloween-pumpkin-hover {
  to { transform: translateY(-5px) rotate(8deg) scale(1.08); }
}

@keyframes halloween-bat-hover {
  to { transform: translate(5px, -6px) rotate(14deg) scale(1.08); }
}

@keyframes halloween-interaction-web {
  0%, 100% { transform: scale(1) rotate(0); }
  45% { transform: scale(1.14) rotate(-5deg); filter: drop-shadow(0 0 12px rgba(242, 138, 46, .9)); }
}

@keyframes halloween-interaction-spider {
  0%, 100% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(13px) rotate(-18deg); }
  70% { transform: translateY(-3px) rotate(18deg); }
}

@keyframes halloween-interaction-pumpkin {
  0%, 100% { transform: translateY(0) rotate(0) scale(1); }
  45% { transform: translateY(-9px) rotate(-12deg) scale(1.16); }
  75% { transform: translateY(2px) rotate(8deg) scale(.98); }
}

@keyframes halloween-interaction-bat {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(-5px, -6px) rotate(-18deg) scale(1.12); }
  75% { transform: translate(7px, -12px) rotate(18deg) scale(1.12); }
}

@media (max-width: 640px) {
  .halloween-web { width: 82px; }
  .halloween-web img { opacity: .54; }
  .halloween-spider-thread { right: 35px; height: 30px; }
  .halloween-spider { top: calc(var(--topbar-h, var(--pt-topbar-h, 60px)) + 14px); right: 13px; }
  .halloween-spider__icon { width: 22px; height: 22px; }
  .halloween-hanger__pumpkin { font-size: 32px; }
  .halloween-hanger__bat { top: 37px; left: calc(100% + 4px); font-size: 20px; }
  .halloween-pumpkins { left: 7px; }
  .halloween-pumpkin--large { font-size: 38px; }
  .halloween-pumpkin--medium { font-size: 29px; }
  .halloween-pumpkin--small { font-size: 22px; }
}

@media (max-height: 520px) {
  .halloween-hanger__line { height: 18px; }
  .halloween-hanger__pumpkin { font-size: 28px; }
  .halloween-hanger__bat { top: 31px; font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .halloween-decor__visual {
    animation: none !important;
  }
}
