/* ANXA HALLOWEEN 2026 V3: attivo 30–31 ottobre. Solo homepage. */
html.anxa-halloween-active{--bg-page:#07060b;--text-main:#efe9f7;--text-muted:#c4b8d3; color-scheme:dark;}
html.anxa-halloween-active body.homepage{background:#08070b !important;background-image:radial-gradient(ellipse at 18% 22%,#27102b 0%,transparent 38%),radial-gradient(ellipse at 80% 65%,#1b0a20 0%,transparent 46%) !important;color:#f3eaf7;}
html.anxa-halloween-active body.homepage .page-container{background:transparent !important;}
/* L'involucro diventa nero, ma schede e moduli mantengono i propri sfondi e leggibilità. */
html.anxa-halloween-active body.homepage main,
html.anxa-halloween-active body.homepage .main-content,
html.anxa-halloween-active body.homepage .home-content{background-color:transparent !important;}
html.anxa-halloween-active body.homepage h2:not(.ah-message),
html.anxa-halloween-active body.homepage .section-title{ text-shadow:0 1px 14px #0006; }
html.anxa-halloween-active body.homepage .anxa-header{box-shadow:0 12px 40px #000a;}
#anxa-halloween{position:fixed;inset:0;z-index:18000;pointer-events:none;overflow:hidden;font-family:inherit;color:#fff;isolation:isolate}
#anxa-halloween .ah-haze{position:absolute;inset:0;background:radial-gradient(ellipse at 0% 53%,#390c4e32,transparent 42%),radial-gradient(ellipse at 100% 15%,#5f24492e,transparent 40%);}
#anxa-halloween .ah-web{position:absolute;width:clamp(135px,20vw,310px);height:clamp(135px,20vw,310px);opacity:.83;filter:drop-shadow(0 0 6px #c3a3dc4a);}
#anxa-halloween .ah-web svg{width:100%;height:100%}
#anxa-halloween .ah-web.tl{top:-15px;left:-15px}
#anxa-halloween .ah-web.tr{top:-15px;right:-15px;transform:scaleX(-1)}
#anxa-halloween .ah-web.bl{bottom:0;left:0;transform:scaleY(-1)}
#anxa-halloween .ah-web.br{bottom:0;right:0;transform:scale(-1)}
#anxa-halloween .ah-web.mid{left:40%;top:42%;opacity:.17;transform:rotate(30deg) scale(1.2)}
#anxa-halloween .ah-web.mid2{right:8%;top:58%;opacity:.20;transform:rotate(-15deg) scale(.7)}
#anxa-halloween .ah-ghost{position:absolute;left:var(--x);top:var(--y);font-size:var(--s);filter:drop-shadow(0 0 18px #acddff);opacity:0;animation:ah-drift var(--dur) ease-in-out infinite;animation-delay:var(--delay)}
#anxa-halloween .ah-bat{position:absolute;left:-90px;top:var(--y);font-size:var(--s);animation:ah-batfly var(--dur) linear infinite;animation-delay:var(--delay)}
#anxa-halloween .ah-pumpkin{position:absolute;bottom:12px;font-size:clamp(36px,5vw,70px);filter:drop-shadow(0 0 12px #fb79007d);animation:ah-rock 5s ease-in-out infinite;opacity:.9}
#anxa-halloween .ah-pumpkin.a{left:6px}#anxa-halloween .ah-pumpkin.b{right:7px;animation-delay:-2s}
#anxa-halloween .ah-skeleton{position:absolute;right:0;top:37%;font-size:clamp(68px,10vw,134px);transform:translateX(150%);animation:ah-skeleton 22s ease-in-out infinite;filter:drop-shadow(0 0 14px #d3aaffaa)}
#anxa-halloween .ah-skeleton .ah-wave{display:inline-block;transform-origin:40% 75%;animation:ah-wave .8s ease-in-out infinite alternate}
#anxa-halloween .ah-flash{position:absolute;inset:0;background:#f4e9ff;opacity:0;mix-blend-mode:screen;animation:ah-lightning 17s linear infinite}
#anxa-halloween .ah-bolt{position:absolute;left:30%;top:-20%;height:100%;width:30%;opacity:0;background:linear-gradient(115deg,transparent 35%,#fff9 37%,transparent 38%,transparent 55%,#fff8 57%,transparent 58%);filter:blur(5px);animation:ah-lightning 17s linear infinite}
#anxa-halloween .ah-panel{position:absolute;bottom:18px;left:50%;transform:translateX(-50%);pointer-events:auto;display:flex;align-items:center;gap:11px;padding:10px 45px 10px 15px;max-width:calc(100vw - 40px);box-sizing:border-box;border:1px solid #f19b45;border-radius:15px;background:linear-gradient(120deg,#170c20f5,#090913fa);box-shadow:0 10px 36px #000e,0 0 20px #b8495c45}
#anxa-halloween .ah-panel strong{font-size:clamp(13px,1.5vw,18px);line-height:1.3;color:#ffd499}
#anxa-halloween .ah-panel small{display:block;color:#e1cbe6;margin-top:4px;font-size:11px}
#anxa-halloween button{font:inherit;cursor:pointer;min-height:35px;touch-action:manipulation}
#anxa-halloween .ah-play{border-radius:9px;padding:6px 10px;background:#4c2b63;color:#fff;border:1px solid #d6a4ec;white-space:nowrap;font-size:13px}
#anxa-halloween .ah-close{position:absolute;right:5px;top:5px;width:32px;height:32px;border-radius:9px;border:1px solid #ffffff44;background:transparent;color:#fff;font-size:22px}
#anxa-halloween .ah-floating-sound{position:absolute;bottom:12px;right:12px;pointer-events:auto;padding:10px 12px;border-radius:50%;border:1px solid #ffb76e;background:#211024;color:#fff;box-shadow:0 5px 24px #000b}
#anxa-halloween .ah-floating-sound[hidden]{display:none}
@keyframes ah-drift{0%,9%,43%,100%{opacity:0;transform:translateY(22px)}19%,31%{opacity:.90;transform:translateY(-16px)}}
@keyframes ah-batfly{0%{transform:translateX(-120px) rotate(-12deg)}100%{transform:translateX(calc(100vw + 180px)) rotate(6deg)}}
@keyframes ah-rock{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(6deg)}}
@keyframes ah-skeleton{0%,58%,90%,100%{transform:translateX(150%)}63%,77%{transform:translateX(5%)}82%{transform:translateX(150%)}}
@keyframes ah-wave{from{transform:rotate(-19deg)}to{transform:rotate(20deg)}}
@keyframes ah-lightning{0%,23%,24%,24.7%,25.1%,25.6%,26.3%,65%,65.4%,66%,100%{opacity:0}23.3%,24.3%,25.3%,65.2%{opacity:.65}23.5%,25.5%{opacity:.2}}
@media(max-width:700px){#anxa-halloween .ah-panel{bottom:10px;width:calc(100vw - 22px);display:block;padding:10px 44px 10px 11px}#anxa-halloween .ah-panel .ah-play{margin-top:6px}#anxa-halloween .ah-pumpkin{bottom:116px;font-size:39px}#anxa-halloween .ah-skeleton{top:50%;font-size:83px}#anxa-halloween .ah-web{width:165px;height:165px}}
@media(prefers-reduced-motion:reduce){#anxa-halloween .ah-ghost,#anxa-halloween .ah-bat,#anxa-halloween .ah-flash,#anxa-halloween .ah-bolt,#anxa-halloween .ah-skeleton{animation:none;display:none}#anxa-halloween .ah-pumpkin{animation:none}}

/* V3: banner chiudibile su smartphone, al riparo dai pulsanti accessibilità. */
#anxa-halloween .ah-panel{z-index:10;}
#anxa-halloween .ah-close{z-index:12;display:flex;align-items:center;justify-content:center;}
@media(max-width:700px){
 #anxa-halloween .ah-panel{bottom:calc(105px + env(safe-area-inset-bottom, 0px));left:12px;right:12px;transform:none;width:auto;max-width:none;padding:12px 12px 12px 50px;}
 #anxa-halloween .ah-close{right:auto;left:8px;top:8px;width:36px;height:36px;background:#4d253e;border:1px solid #ffca91;}
 #anxa-halloween .ah-floating-sound{bottom:calc(160px + env(safe-area-inset-bottom, 0px));right:auto;left:14px;z-index:10;}
 #anxa-halloween .ah-pumpkin{bottom:calc(210px + env(safe-area-inset-bottom, 0px));}
}

/* V4 - decorazioni alte, area comandi inferiore libera */
#anxa-halloween .ah-web.bl,#anxa-halloween .ah-web.br{display:none!important}
#anxa-halloween .ah-pumpkin{bottom:clamp(125px,17vh,190px)}
/* Fulmini più frequenti: due saette vere, sfalsate, e flash breve */
#anxa-halloween .ah-flash{background:#ded8ff;mix-blend-mode:screen;animation:ah-flash-v4 7.2s steps(1,end) infinite}
#anxa-halloween .ah-bolt{height:85vh;top:-5vh;width:260px;background:none;filter:none;animation:ah-bolt-v4 7.2s steps(1,end) infinite}
#anxa-halloween .ah-bolt-one{left:13%}
#anxa-halloween .ah-bolt-two{left:auto;right:8%;transform:scaleX(-1) scale(.8);animation-delay:-3.6s}
#anxa-halloween .ah-lightning-svg{width:100%;height:100%;overflow:visible}
@keyframes ah-flash-v4{0%,9%,10%,12%,13%,39%,40%,42%,43%,67%,68%,70%,71%,100%{opacity:0}9.5%,12.5%,39.5%,42.5%,67.5%,70.5%{opacity:.32}}
@keyframes ah-bolt-v4{0%,9%,10%,12%,13%,39%,40%,42%,43%,67%,68%,70%,71%,100%{opacity:0}9.5%,12.5%,39.5%,42.5%,67.5%,70.5%{opacity:.88}}
/* Mano che cammina, solo decorativa: non intercetta mai tocchi o click */
#anxa-halloween .ah-thing{position:absolute;bottom:clamp(145px,18vh,235px);left:0;width:clamp(100px,13vw,155px);opacity:0;filter:drop-shadow(0 9px 8px #0009);animation:ah-thing-walk 21s linear infinite;pointer-events:none}
#anxa-halloween .ah-thing svg{display:block;width:100%;animation:ah-thing-steps .46s ease-in-out infinite alternate}
@keyframes ah-thing-walk{0%,15%{opacity:0;transform:translateX(-180px)}18%{opacity:.95}72%{opacity:.95}78%,100%{opacity:0;transform:translateX(calc(100vw + 180px))}}
@keyframes ah-thing-steps{from{transform:rotate(-7deg) translateY(0)}to{transform:rotate(8deg) translateY(-11px)}}
@media(max-width:700px){
 #anxa-halloween .ah-web.mid,#anxa-halloween .ah-web.mid2{display:none}
 #anxa-halloween .ah-pumpkin{bottom:calc(195px + env(safe-area-inset-bottom,0px))}
 #anxa-halloween .ah-thing{bottom:calc(215px + env(safe-area-inset-bottom,0px));width:100px}
 #anxa-halloween .ah-bolt{width:150px}
}
@media(prefers-reduced-motion:reduce){#anxa-halloween .ah-thing,#anxa-halloween .ah-bolt,#anxa-halloween .ah-flash{display:none!important}}

/* V5: Mano in rilievo che corre sulle dita, ispirata al movimento della clip di riferimento. */
#anxa-halloween .ah-thing{width:clamp(93px,12vw,135px);bottom:clamp(165px,20vh,245px);transform-origin:50% 100%;animation:ah-thing-run-v5 18s linear infinite!important;z-index:8}
#anxa-halloween .ah-thing svg{width:100%;height:auto;animation:ah-thing-bob-v5 .34s ease-in-out infinite alternate!important;overflow:visible}
#anxa-halloween .ah-crawl-finger,#anxa-halloween .ah-crawl-thumb{transform-box:fill-box;transform-origin:50% 8%;animation:ah-finger-tap-v5 .35s ease-in-out infinite alternate}
#anxa-halloween .ah-crawl-2,#anxa-halloween .ah-crawl-4{animation-delay:-.175s;animation-direction:alternate-reverse}
#anxa-halloween .ah-crawl-thumb{animation-delay:-.1s}
@keyframes ah-finger-tap-v5{0%{transform:rotate(-13deg) translateY(1px)}100%{transform:rotate(14deg) translateY(-8px)}}
@keyframes ah-thing-bob-v5{from{transform:translateY(1px) rotate(-3deg)}to{transform:translateY(-9px) rotate(4deg)}}
@keyframes ah-thing-run-v5{0%,12%{opacity:0;translate:-170px 0}16%{opacity:1}72%{opacity:1}80%,100%{opacity:0;translate:calc(100vw + 180px) 0}}
@media(max-width:700px){#anxa-halloween .ah-thing{bottom:calc(230px + env(safe-area-inset-bottom,0px));width:89px}}
@media(prefers-reduced-motion:reduce){#anxa-halloween .ah-thing{display:none!important}}

/* V6: mano fotografica ritagliata, non SVG; percorso a piccoli passi */
#anxa-halloween .ah-thing{width:clamp(96px,12vw,160px);bottom:clamp(160px,20vh,245px);animation:ah-hand-travel-v6 21s linear infinite!important;will-change:transform,opacity;pointer-events:none}
#anxa-halloween .ah-thing-photo{display:block;width:100%;height:auto;user-select:none;pointer-events:none;filter:drop-shadow(2px 10px 5px rgba(0,0,0,.65));transform-origin:50% 80%;animation:ah-hand-step-v6 .50s ease-in-out infinite alternate}
@keyframes ah-hand-step-v6{0%{transform:translateY(4px) rotate(-7deg) scaleY(.98)}45%{transform:translateY(-9px) rotate(2deg) scaleY(1.01)}100%{transform:translateY(2px) rotate(8deg) scaleY(.99)}}
@keyframes ah-hand-travel-v6{0%,8%{opacity:0;transform:translateX(-190px)}12%{opacity:1}74%{opacity:1}81%,100%{opacity:0;transform:translateX(calc(100vw + 190px))}}
@media(max-width:700px){#anxa-halloween .ah-thing{width:102px;bottom:calc(215px + env(safe-area-inset-bottom,0px))}}
@media(prefers-reduced-motion:reduce){#anxa-halloween .ah-thing{display:none!important}}

/* V7: la mano danza SUL bordo superiore del ticker notizie, senza coprire le scritte. */
#anxa-halloween .ah-thing{
 bottom:var(--ah-ticker-clearance, 48px)!important;
 width:clamp(86px,10vw,126px)!important;
 z-index:9;
 animation:ah-ticker-dance-travel 17s linear infinite!important;
}
#anxa-halloween .ah-thing-photo{
 transform-origin:50% 92%;
 animation:ah-ticker-dance .78s ease-in-out infinite!important;
 filter:drop-shadow(0 5px 4px rgba(0,0,0,.8));
}
@keyframes ah-ticker-dance{
 0%,100%{transform:translateY(1px) rotate(-15deg) scale(.98,1.02)}
 25%{transform:translateY(-18px) rotate(9deg) scale(1.03,.97)}
 50%{transform:translateY(-3px) rotate(15deg) scale(.98,1.03)}
 75%{transform:translateY(-23px) rotate(-8deg) scale(1.05,.96)}
}
@keyframes ah-ticker-dance-travel{
 0%,7%{opacity:0;transform:translateX(-150px)}
 10%{opacity:1}
 80%{opacity:1}
 87%,100%{opacity:0;transform:translateX(calc(100vw + 150px))}
}
@media(max-width:700px){#anxa-halloween .ah-thing{width:82px!important}}
@media(prefers-reduced-motion:reduce){#anxa-halloween .ah-thing{display:none!important}}

/* V10: solo mobile, pulsante suono affiancato al selettore del Comune. */
@media(max-width:700px){
 .anxa-comune-picker .ah-comune-audio-row{display:inline-flex;align-items:center;gap:7px;max-width:100%;min-width:0;flex:0 1 auto;vertical-align:middle}
 .anxa-comune-picker .ah-comune-audio-row #anxaComuneSelect{flex:1 1 auto;min-width:0;width:auto;max-width:calc(100% - 51px)}
 .anxa-comune-picker .ah-comune-audio-row .ah-floating-sound{position:static!important;inset:auto!important;bottom:auto!important;left:auto!important;right:auto!important;transform:none!important;display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;z-index:auto;pointer-events:auto;border:1px solid #ffb76e;border-radius:50%;background:#211024;color:#fff;font-size:19px;box-shadow:0 3px 12px #0005;cursor:pointer;touch-action:manipulation}
 .anxa-comune-picker .ah-comune-audio-row .ah-floating-sound[hidden]{display:none!important}
}
