/* Passify · Tema Halloween (inyectado por controllers/seasonal_theme.php) */
:root {
	--pfy-h-orange: #ff7a1a;
	--pfy-h-amber: #ffb347;
	--pfy-h-purple: #8b5cf6;
	--pfy-h-night: #140b24;
}

::selection { background: rgba(255, 122, 26, .28); }

#pfy-halloween {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 1035;
	overflow: hidden;
	contain: strict;
}
#pfy-halloween * { pointer-events: none; }

/* Barra superior con brillo */
.pfy-h-bar {
	position: absolute; top: 0; left: 0; right: 0; height: 3px;
	background: linear-gradient(90deg, var(--pfy-h-orange), var(--pfy-h-purple), var(--pfy-h-amber), var(--pfy-h-orange));
	background-size: 300% 100%;
	animation: pfyHBar 8s linear infinite;
	box-shadow: 0 0 12px rgba(255, 122, 26, .55);
}
@keyframes pfyHBar { to { background-position: 300% 0; } }

/* Telaraña en la esquina */
.pfy-h-web {
	position: absolute; top: 0; left: 0;
	width: 190px; height: 190px;
	opacity: .32;
	transform-origin: 0 0;
	animation: pfyHWeb 7s ease-in-out infinite;
}
.pfy-h-web path { fill: none; stroke: #6b6b7b; stroke-width: 1; }
@keyframes pfyHWeb { 50% { transform: rotate(1.2deg) scale(1.01); } }

/* Araña colgando */
.pfy-h-spider {
	position: absolute; top: 0; right: 9%;
	width: 26px;
	animation: pfyHDrop 11s cubic-bezier(.45, 0, .25, 1) infinite;
	transform-origin: 50% 0;
}
.pfy-h-spider::before {
	content: ''; position: absolute; left: 50%; bottom: 100%;
	width: 1px; height: 100vh; margin-left: -.5px;
	background: linear-gradient(to bottom, rgba(120, 120, 135, .15), rgba(120, 120, 135, .6));
}
.pfy-h-spider svg { display: block; width: 26px; height: 26px; animation: pfyHSway 3.2s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes pfyHDrop {
	0%, 12% { transform: translateY(-40px); }
	38%, 62% { transform: translateY(150px); }
	88%, 100% { transform: translateY(-40px); }
}
@keyframes pfyHSway { 50% { transform: rotate(6deg); } }

/* Murciélagos */
.pfy-h-bat {
	position: absolute; left: 0; top: 0;
	width: 46px; height: 23px;
	opacity: 0;
	will-change: transform, opacity;
	filter: drop-shadow(0 4px 10px rgba(20, 11, 36, .35));
}
.pfy-h-bat svg { width: 100%; height: 100%; display: block; fill: var(--pfy-h-night); animation: pfyHFlap .22s ease-in-out infinite alternate; transform-origin: 50% 45%; }
@keyframes pfyHFlap { from { transform: scaleY(1); } to { transform: scaleY(.45); } }

/* Brasas flotando */
.pfy-h-ember {
	position: absolute; bottom: -12px;
	width: 6px; height: 6px; border-radius: 50%;
	background: radial-gradient(circle, #fff3d6 0%, var(--pfy-h-amber) 35%, rgba(255, 122, 26, 0) 70%);
	opacity: 0;
	animation: pfyHEmber linear infinite;
	will-change: transform, opacity;
}
.pfy-h-ember.is-purple { background: radial-gradient(circle, #f3e8ff 0%, var(--pfy-h-purple) 35%, rgba(139, 92, 246, 0) 70%); }
@keyframes pfyHEmber {
	0% { transform: translate3d(0, 0, 0) scale(.6); opacity: 0; }
	12% { opacity: .85; }
	70% { opacity: .5; }
	100% { transform: translate3d(var(--pfy-drift, 30px), -62vh, 0) scale(1.1); opacity: 0; }
}

/* Niebla inferior */
.pfy-h-fog {
	position: absolute; left: -50%; right: -50%; bottom: -40px; height: 170px;
	background:
		radial-gradient(ellipse 30% 60% at 20% 70%, rgba(139, 92, 246, .16), transparent 70%),
		radial-gradient(ellipse 28% 55% at 55% 75%, rgba(120, 120, 140, .16), transparent 70%),
		radial-gradient(ellipse 30% 60% at 85% 70%, rgba(255, 122, 26, .10), transparent 70%);
	filter: blur(6px);
	animation: pfyHFog 26s ease-in-out infinite alternate;
}
.pfy-h-fog.is-back { animation-duration: 38s; animation-direction: alternate-reverse; opacity: .7; bottom: -60px; }
@keyframes pfyHFog { to { transform: translateX(18%); } }

/* Calabaza que asoma */
.pfy-h-pumpkin {
	position: absolute; right: 22px; bottom: -6px;
	width: 54px; height: 54px;
	animation: pfyHPeek 9s ease-in-out infinite;
}
.pfy-h-pumpkin .pfy-h-face { fill: #ffe7a3; animation: pfyHGlow 2.6s ease-in-out infinite; }
@keyframes pfyHPeek {
	0%, 20% { transform: translateY(70%) rotate(-4deg); }
	32%, 70% { transform: translateY(8%) rotate(3deg); }
	82%, 100% { transform: translateY(70%) rotate(-4deg); }
}
@keyframes pfyHGlow {
	0%, 100% { fill: #ffd36b; filter: drop-shadow(0 0 2px #ffb347); }
	45% { fill: #fff2c4; filter: drop-shadow(0 0 7px #ff9a3c); }
	55% { fill: #ffc25a; }
}

@media (max-width: 768px) {
	.pfy-h-web { width: 120px; height: 120px; }
	.pfy-h-spider { right: 18%; }
	.pfy-h-pumpkin { width: 44px; height: 44px; right: 14px; }
	.pfy-h-fog { height: 110px; }
}

@media (prefers-reduced-motion: reduce) {
	#pfy-halloween *, #pfy-halloween *::before { animation: none !important; }
	.pfy-h-bat, .pfy-h-ember { display: none; }
	.pfy-h-spider { transform: translateY(60px); }
	.pfy-h-pumpkin { transform: translateY(10%); }
}

@media print { #pfy-halloween { display: none !important; } }
