/* Halloween v2 — standalone overlay. Sits above every theme (including the
   total-conversion templates) and never captures clicks. Independent of the
   original Halloween Mode. */
#nw-hv2{position:fixed;inset:0;z-index:9000;pointer-events:none;overflow:hidden;opacity:0;transition:opacity 1.2s ease}
#nw-hv2.on{opacity:1}
#nw-hv2 *{pointer-events:none}

/* Edge vignette: a faint purple dusk pressing in from the corners */
.hv2-dusk{position:absolute;inset:0;background:
  radial-gradient(ellipse at 0% 100%,rgba(88,28,135,.22),transparent 45%),
  radial-gradient(ellipse at 100% 100%,rgba(88,28,135,.22),transparent 45%),
  radial-gradient(ellipse at 50% 120%,rgba(255,110,20,.10),transparent 55%)}

/* Low ground fog: two slow layers drifting opposite ways along the floor */
.hv2-fog{position:absolute;left:-50%;width:200%;bottom:-4vh;height:26vh;opacity:.55;
  background:
   radial-gradient(ellipse 18% 55% at 10% 70%,rgba(200,195,225,.30),transparent 70%),
   radial-gradient(ellipse 22% 60% at 32% 80%,rgba(190,185,220,.26),transparent 70%),
   radial-gradient(ellipse 16% 50% at 55% 72%,rgba(205,200,230,.30),transparent 70%),
   radial-gradient(ellipse 24% 65% at 78% 82%,rgba(185,180,215,.26),transparent 70%),
   radial-gradient(ellipse 18% 55% at 96% 74%,rgba(200,195,225,.28),transparent 70%);
  filter:blur(14px);animation:hv2Drift 70s linear infinite}
.hv2-fog.b{bottom:-8vh;height:20vh;opacity:.4;animation-duration:110s;animation-direction:reverse}
@keyframes hv2Drift{from{transform:translateX(0)}to{transform:translateX(25%)}}

/* Corner webs + spiders on silk */
.hv2-web{position:absolute;top:0;width:clamp(90px,11vw,150px);height:auto;opacity:.5}
.hv2-web.l{left:0}.hv2-web.r{right:0;transform:scaleX(-1)}
.hv2-spider{position:absolute;top:0;width:2px}
.hv2-spider .silk{position:absolute;left:0;top:0;width:1px;height:var(--drop,140px);background:linear-gradient(rgba(230,230,240,.0),rgba(230,230,240,.45));transform-origin:top;animation:hv2Silk var(--t,9s) ease-in-out infinite;animation-delay:var(--d,0s)}
.hv2-spider svg{position:absolute;left:-11px;top:0;width:22px;height:22px;animation:hv2Bob var(--t,9s) ease-in-out infinite;animation-delay:var(--d,0s)}
.hv2-spider svg .legs{transform-origin:12px 12px;animation:hv2Legs .9s ease-in-out infinite alternate}
@keyframes hv2Silk{0%,12%{transform:scaleY(.12)}45%,62%{transform:scaleY(1)}92%,100%{transform:scaleY(.12)}}
@keyframes hv2Bob{0%,12%{transform:translateY(calc(var(--drop,140px)*.12 - 4px))}45%,62%{transform:translateY(calc(var(--drop,140px) - 4px))}92%,100%{transform:translateY(calc(var(--drop,140px)*.12 - 4px))}}
@keyframes hv2Legs{to{transform:scaleY(.82)}}

/* Jack-o'-lanterns: carved faces glow and flicker like real candles */
.hv2-pumpkin{position:absolute;bottom:6px;filter:drop-shadow(0 6px 10px rgba(0,0,0,.6))}
.hv2-pumpkin .halo{position:absolute;left:50%;top:55%;width:190%;aspect-ratio:1;transform:translate(-50%,-50%);border-radius:50%;
  background:radial-gradient(circle,rgba(255,140,30,.30),rgba(255,90,0,.10) 40%,transparent 68%);animation:hv2Halo 3.1s infinite}
.hv2-pumpkin svg{position:relative;display:block;width:100%;height:auto;overflow:visible}
.hv2-pumpkin .carve{animation:hv2Flicker 2.3s infinite}
.hv2-pumpkin .carve-glow{filter:blur(3px);opacity:.85;animation:hv2Flicker 2.3s infinite}
.hv2-pumpkin.p2 .carve,.hv2-pumpkin.p2 .carve-glow{animation-duration:2.9s;animation-delay:-.7s}
.hv2-pumpkin.p3 .carve,.hv2-pumpkin.p3 .carve-glow,.hv2-pumpkin.p3 .halo{animation-duration:1.9s;animation-delay:-1.3s}
@keyframes hv2Flicker{0%,100%{opacity:1}8%{opacity:.78}11%{opacity:.95}35%{opacity:.86}38%{opacity:1}62%{opacity:.7}66%{opacity:.92}80%{opacity:.84}}
@keyframes hv2Halo{0%,100%{opacity:.9}30%{opacity:.6}55%{opacity:1}75%{opacity:.7}}
.hv2-pumpkin.p1{left:clamp(6px,1.6vw,28px);width:clamp(62px,6.5vw,96px)}
.hv2-pumpkin.p2{left:clamp(58px,6.6vw,118px);width:clamp(40px,4vw,60px);bottom:4px}
.hv2-pumpkin.p3{right:clamp(6px,1.6vw,28px);width:clamp(56px,5.8vw,86px)}

/* Bats */
.hv2-bat{position:absolute;left:0;top:0;width:var(--s,34px);will-change:transform;opacity:.85}
.hv2-bat svg{display:block;width:100%;height:auto;overflow:visible}
.hv2-bat .wl{transform-origin:50px 22px;animation:hv2FlapL .16s ease-in-out infinite alternate}
.hv2-bat .wr{transform-origin:50px 22px;animation:hv2FlapR .16s ease-in-out infinite alternate}
@keyframes hv2FlapL{to{transform:rotate(-38deg) scaleY(.6)}}
@keyframes hv2FlapR{to{transform:rotate(38deg) scaleY(.6)}}

/* Phones: keep it light so nothing crowds the board */
@media (max-width:700px){
  .hv2-pumpkin.p2,.hv2-spider.s2,.hv2-fog.b{display:none}
  .hv2-fog{height:16vh;opacity:.45}
  .hv2-web{width:72px}
}
@media (prefers-reduced-motion:reduce){
  #nw-hv2 *,#nw-hv2 *::before{animation:none!important}
  .hv2-bat{display:none}
}
/* Occasional candle flare on one pumpkin */
.hv2-pumpkin.flare .carve,.hv2-pumpkin.flare .carve-glow{animation:none;filter:brightness(1.45) drop-shadow(0 0 6px #ffcf4a)}
.hv2-pumpkin.flare .halo{animation:none;opacity:1;transform:translate(-50%,-50%) scale(1.25);transition:transform .4s ease}
/* v1.0 tuning: readable silhouettes on dark themes */
.hv2-spider svg{width:28px;height:28px;left:-14px;filter:drop-shadow(0 0 3px rgba(190,150,255,.35))}
.hv2-bat{filter:drop-shadow(0 0 4px rgba(170,120,255,.45))}
.hv2-pumpkin .carve-glow{filter:blur(4px);opacity:1}
