#joe-halloween-layer {
    position: fixed;
    inset: 0;
    z-index: 30;
    overflow: hidden;
    pointer-events: none;
    contain: layout paint;
}

#joe-halloween-layer *,
#joe-halloween-layer *::before,
#joe-halloween-layer *::after {
    box-sizing: border-box;
    pointer-events: none !important;
}

#joe-halloween-layer img {
    display: block;
    max-width: none;
    border: 0;
    background: none;
    box-shadow: none;
    user-select: none;
    -webkit-user-drag: none;
}

.joe-halloween-pumpkins {
    position: absolute;
    bottom: max(52px, calc(env(safe-area-inset-bottom) + 44px));
    right: max(18px, calc(env(safe-area-inset-right) + 8px));
    width: 88px;
    height: 85px;
    transform: rotate(-7deg);
    filter: drop-shadow(0 3px 3px rgb(64 36 24 / 14%));
}

.joe-halloween-pumpkins > img:first-child {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 70px;
    height: auto;
}

.joe-halloween-pumpkins > img + img {
    position: absolute;
    right: -7px;
    bottom: -1px;
    width: 43px;
    height: auto;
    transform: rotate(16deg);
}

a.joe-halloween-logo {
    position: relative;
    overflow: visible;
}

a.joe-halloween-logo > .joe-halloween-logo__pumpkin {
    position: absolute;
    right: -20px;
    bottom: -5px;
    z-index: 1;
    display: block;
    width: clamp(25px, 30%, 40px);
    aspect-ratio: 101.29 / 99.15;
    background: var(--joe-halloween-pumpkin-art, url("pumpkin.svg")) center / contain no-repeat;
    transform: rotate(12deg);
    pointer-events: none;
}

.joe-halloween-spider {
    position: absolute;
    top: 0;
    left: max(14px, env(safe-area-inset-left));
    width: 52px;
    filter: drop-shadow(0 0 1px #e9d8c3);
}

.joe-halloween-spider > img {
    width: 100%;
    height: auto;
}

.joe-halloween-ghost {
    position: absolute;
    top: var(--ghost-top);
    left: var(--ghost-left);
    width: var(--ghost-size);
    opacity: 0;
    will-change: transform, opacity;
    animation: joe-halloween-drift var(--ghost-duration) linear both;
}

.joe-halloween-ghost > img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 5px rgb(52 40 63 / 15%));
    animation: joe-halloween-bob 2.8s ease-in-out infinite;
}

.joe-halloween-witch {
    position: absolute;
    top: var(--witch-top);
    left: 0;
    width: var(--witch-size);
    opacity: 0;
    will-change: transform, opacity;
    animation: joe-halloween-fly var(--witch-duration) linear both;
}

.joe-halloween-witch > img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 3px 3px rgb(52 40 63 / 18%));
}

.joe-halloween-witch--reverse {
    animation-direction: reverse;
}

.joe-halloween-witch--reverse > img {
    transform: scaleX(-1);
}

#joe-halloween-hide {
    position: fixed;
    bottom: max(10px, env(safe-area-inset-bottom));
    right: max(10px, env(safe-area-inset-right));
    z-index: 31;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    min-width: 0;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #e1d7ce;
    border-radius: 20px;
    background: #fffbf5;
    color: #594432;
    box-shadow: none;
    font: 500 11px/1.3 system-ui, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

#joe-halloween-hide:hover {
    border-color: #ba7637;
    background: #fff0dc;
    color: #382a20;
}

#joe-halloween-hide:focus-visible {
    outline: 2px solid #a85d1d;
    outline-offset: 3px;
}

@keyframes joe-halloween-drift {
    0% { opacity: 0; transform: translate3d(0, 20px, 0); }
    12% { opacity: .94; }
    85% { opacity: .94; }
    100% { opacity: 0; transform: translate3d(var(--ghost-drift), -100px, 0); }
}

@keyframes joe-halloween-bob {
    0%, 100% { transform: translateY(0) rotate(-6deg); }
    50% { transform: translateY(-10px) rotate(6deg); }
}

@keyframes joe-halloween-fly {
    0% { opacity: 0; transform: translate3d(-180px, 12px, 0) rotate(-4deg); }
    6% { opacity: 1; }
    50% { transform: translate3d(calc(50vw - 60px), -24px, 0) rotate(3deg); }
    94% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(calc(100vw + 180px), 0, 0) rotate(-4deg); }
}

@media (max-width: 767px) {
    .joe-halloween-spider { width: 36px; }
    .joe-halloween-pumpkins { width: 57px; height: 60px; opacity: .9; }
    .joe-halloween-pumpkins > img:first-child { width: 49px; }
    .joe-halloween-pumpkins > img + img { width: 30px; right: -7px; }
}

@media (prefers-reduced-motion: reduce), print {
    .joe-halloween-ghost,
    .joe-halloween-witch { display: none !important; animation: none !important; }
    .joe-halloween-ghost > img { animation: none !important; }
}

@media print {
    #joe-halloween-layer, #joe-halloween-hide, .joe-halloween-logo__pumpkin { display: none !important; }
}
