/*
 * Decoracion de temporada (19-10-2026). La pinta public/assets/js/decoracion-temporada.js
 * dentro de #dt-capa; ver templates/partials/decoracion-temporada.html.twig.
 *
 * La capa va por encima de la pagina pero no captura clics y queda por debajo de los
 * modales (1050). No toca ningun estilo de la aplicacion: todo cuelga de #dt-capa o de
 * #dt-boton.
 */
#dt-capa {
	--dt-nieve: #9ccbee; --dt-tela: rgba(70, 70, 80, .32); --dt-bicho: #2b2730; --dt-toro: #3a2a22; --dt-linea: #333; --dt-letra: #3f4254; --dt-insecto: #3b2a1a;
	position: fixed; inset: 0; z-index: 1040; pointer-events: none; overflow: hidden;
}
[data-bs-theme="dark"] #dt-capa {
	--dt-nieve: rgba(255, 255, 255, .9); --dt-tela: rgba(225, 225, 235, .28); --dt-bicho: #cfc8d8; --dt-toro: #cdbfb3; --dt-linea: #ddd; --dt-letra: #cdd0dc; --dt-insecto: #9c7a55;
}
#dt-capa[hidden] { display: none; }
#dt-capa svg { display: block; overflow: visible; }
#dt-capa .dt-cae svg, #dt-capa .dt-sube svg, #dt-capa .dt-telarana svg, #dt-capa .dt-arana svg, #dt-capa .dt-fijo svg { width: 100%; height: 100%; }

/* Lo que cae o sube: el span se desplaza, la i se mece y la b gira. */
#dt-capa .dt-cae, #dt-capa .dt-sube { position: absolute; top: 0; animation: dt-caer 12s linear infinite; }
#dt-capa .dt-sube { animation-name: dt-subir; }
#dt-capa .dt-cae > i, #dt-capa .dt-sube > i { display: block; width: 100%; height: 100%; animation: dt-mecer var(--dt-mec) ease-in-out infinite alternate; }
#dt-capa .dt-cae b, #dt-capa .dt-sube b { display: block; width: 100%; height: 100%; animation: dt-girar var(--dt-vuelta) linear infinite; }
#dt-capa .dt-voltea b { animation-name: dt-voltear; }
#dt-capa .dt-quieta b { animation: none; }
#dt-capa .dt-confeti b { border-radius: 2px; }
#dt-capa .dt-bola b { border-radius: 50%; background: var(--dt-nieve); filter: blur(.6px); animation: none; }
#dt-capa .dt-copo { color: var(--dt-nieve); }
#dt-capa .dt-chispa b { border-radius: 50%; background: #ffb300; box-shadow: 0 0 6px 1px #ff6a00; animation: none; }
#dt-capa .dt-texto b { display: flex; align-items: center; justify-content: center; white-space: nowrap; font-size: inherit; line-height: 1; font-weight: 700; color: var(--dt-letra); animation: none; }
#dt-capa .dt-cifra b { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
#dt-capa .dt-letra b { font-family: Georgia, 'Times New Roman', serif; }

/* Lo que cruza la pantalla de vez en cuando. Sale y entra entero, mida lo que mida. */
#dt-capa .dt-cruza { position: absolute; left: 0; animation: dt-cruzar var(--dt-ciclo) linear var(--dt-espera) infinite both; }
#dt-capa .dt-cruza > i { display: block; animation: dt-ondear 1.8s ease-in-out infinite alternate; }
#dt-capa .dt-aleteo-v { animation: dt-aletear-v .2s ease-in-out infinite alternate; transform-origin: 50% 40%; }
#dt-capa .dt-aleteo-h { animation: dt-aletear-h .25s ease-in-out infinite alternate; transform-origin: 50% 50%; }
#dt-capa .dt-desfile { bottom: 4px; display: flex; align-items: flex-end; gap: 22px; }
#dt-capa .dt-desfile > i { display: contents; }
#dt-capa .dt-desfile svg { animation: dt-trotar .3s ease-in-out infinite alternate; }
#dt-capa .dt-desfile svg:nth-child(even) { animation-delay: -.15s; }
#dt-capa .dt-desfile svg.dt-estrella { margin-bottom: 70px; animation: dt-brillar 1.2s ease-in-out infinite alternate; }
#dt-capa .dt-pata { animation: dt-galopar .3s ease-in-out infinite alternate; }
#dt-capa .dt-pata-b { animation-delay: -.3s; }
#dt-capa .dt-caravana svg { animation-duration: .6s; }
#dt-capa .dt-caravana .dt-pata { animation-duration: .6s; }
#dt-capa .dt-caravana .dt-pata-b { animation-delay: -.6s; }
#dt-capa .dt-pelota { bottom: 4px; }
#dt-capa .dt-pelota > i { animation: dt-botar .5s ease-out infinite alternate; }
#dt-capa .dt-pelota svg { animation: dt-girar 1.1s linear infinite; }

/* Fuegos artificiales y el chupinazo. */
#dt-capa .dt-cohete { position: absolute; top: 0; width: 3px; height: 18px; margin-left: -1.5px; border-radius: 2px; background: linear-gradient(to bottom, #ffb300, rgba(255, 179, 0, 0)); animation: dt-lanzar .9s ease-out both; }
#dt-capa .dt-cohete.dt-chupinazo { width: 4px; height: 34px; margin-left: -2px; background: linear-gradient(to bottom, #d7141e 0, #d7141e 25%, rgba(140, 140, 140, .7) 25%, rgba(140, 140, 140, 0)); }
#dt-capa .dt-fuego { position: absolute; width: 0; height: 0; }
#dt-capa .dt-fuego i { position: absolute; left: -2.5px; top: -2.5px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 0 6px currentColor; animation: dt-estallar 1.6s cubic-bezier(.15, .7, .3, 1) both; }
#dt-capa .dt-humo { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: rgba(150, 150, 150, .45); animation: dt-humear 1.8s ease-out both; }

/* Halloween: telaranas en las esquinas y una arana que baja de su hilo. */
#dt-capa .dt-telarana { position: absolute; top: 0; width: var(--dt-tam-tela); height: var(--dt-tam-tela); color: var(--dt-tela); }
#dt-capa .dt-telarana.dt-izq { left: 0; }
#dt-capa .dt-telarana.dt-der { right: 0; transform: scaleX(-1); }
#dt-capa .dt-arana { position: absolute; top: 0; right: calc(var(--dt-tam-tela) * .4); width: 30px; height: 30px; color: var(--dt-bicho); transform: translateY(55px); animation: dt-colgar 16s ease-in-out 2s infinite; }
#dt-capa .dt-arana::before { content: ''; position: absolute; left: 50%; bottom: 72%; width: 1px; height: 100vh; background: currentColor; opacity: .55; }
#dt-capa .dt-arana svg { animation: dt-balancear 3s ease-in-out infinite alternate; transform-origin: 50% 0; }

/* Lo que se queda en su sitio: monigotes, hogueras, el sol. */
#dt-capa .dt-fijo { position: absolute; }
#dt-capa .dt-monigote { width: 56px; height: 82px; transform: rotate(var(--dt-giro)); }
#dt-capa .dt-monigote svg { animation: dt-balancear 2.6s ease-in-out infinite alternate; transform-origin: 50% 4px; }
#dt-capa .dt-hoguera { bottom: -4px; width: 54px; height: 76px; margin-left: -27px; }
#dt-capa .dt-llama { transform-box: fill-box; transform-origin: 50% 100%; animation: dt-llamear .45s ease-in-out infinite alternate; }
/* En el centro de la cabecera, que esta vacio: en las esquinas tapaba el logo o el menu del usuario. */
#dt-capa .dt-sol { top: -26px; left: 50%; width: 130px; height: 130px; margin-left: -65px; }
#dt-capa .dt-rayos { transform-origin: 60px 60px; animation: dt-girar 40s linear infinite; }
/* 1 de abril: el bicho. El JS lo mueve con transform; las patas se paran cuando se para el. */
#dt-capa .dt-insecto { position: absolute; top: 0; left: 0; width: 18px; height: 24px; margin: -12px 0 0 -9px; will-change: transform; }
#dt-capa .dt-pata-i { animation: dt-patita .12s linear infinite alternate; }
#dt-capa .dt-pata-ib { animation-delay: -.12s; }
#dt-capa .dt-parado .dt-pata-i { animation-play-state: paused; }

/* 4 de mayo: estrellas que titilan, espadas laser que se encienden y naves. */
#dt-capa .dt-estrellita { animation: dt-titilar 2.5s ease-in-out infinite alternate; }
#dt-capa .dt-hoja { transform-box: fill-box; transform-origin: 50% 100%; animation: dt-encender 7s ease-in-out infinite; }
#dt-capa .dt-motor { animation: dt-parpadear .1s steps(2) infinite alternate; }
#dt-capa .dt-rayo { animation: dt-disparar .5s linear infinite; }
#dt-capa .dt-rayo-b { animation-delay: -.25s; }
#dt-capa .dt-flota > i { display: flex; align-items: center; gap: 4px; }

/* Barbie: el descapotable (ruedas que giran y corazones por el escape). */
#dt-capa .dt-coche { bottom: 4px; }
#dt-capa .dt-coche > i { animation: dt-trotar .25s ease-in-out infinite alternate; }
#dt-capa .dt-rueda { transform-box: fill-box; transform-origin: center; animation: dt-girar .5s linear infinite; }
#dt-capa .dt-escape { animation: dt-escape 1.2s ease-out infinite; }
#dt-capa .dt-escape-b { animation-delay: -.6s; }

/* Error 404: la hoja perdida anda despacio y mira a todos lados. */
#dt-capa .dt-paseo svg, #dt-capa .dt-paseo .dt-pata { animation-duration: .45s; }
#dt-capa .dt-paseo .dt-pata-b { animation-delay: -.45s; }
#dt-capa .dt-ojos { animation: dt-mirar 3s ease-in-out infinite; }
#dt-capa .dt-duda { animation: dt-trotar .6s ease-in-out infinite alternate; }

/* Programador, cafe, television, ninja y el Bug misterioso. */
#dt-capa .dt-terminal { display: inline-block; padding: 4px 10px; border: 1px solid #3f4254; border-radius: 6px; background: #1e1e2d; color: #50cd89; font: 600 13px/1.4 ui-monospace, Consolas, monospace; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
#dt-capa .dt-terminal b { animation: dt-cursor 1s step-end infinite; }
#dt-capa .dt-taza { bottom: -2px; width: 58px; height: 72px; margin-left: -29px; }
#dt-capa .dt-vapor { animation: dt-vapor 2.6s ease-in-out infinite; }
#dt-capa .dt-antena { transform-box: fill-box; transform-origin: 50% 100%; animation: dt-balancear 2s ease-in-out infinite alternate; }
#dt-capa .dt-barrido { animation: dt-barrido 2s linear infinite; }
#dt-capa .dt-nieve-tv { animation: dt-nieve-tv .12s steps(2) infinite alternate; }
#dt-capa .dt-ninja { position: absolute; width: 56px; height: 64px; margin: -32px 0 0 -28px; transition: opacity .15s; }
#dt-capa .dt-ninja.dt-oculto { opacity: 0; }
[data-bs-theme="dark"] #dt-capa .dt-ninja svg { filter: drop-shadow(0 0 2px rgba(255, 255, 255, .55)); }
#dt-capa .dt-cinta { transform-box: fill-box; transform-origin: 0 50%; animation: dt-ondear-cinta .3s ease-in-out infinite alternate; }
#dt-capa .dt-esfumado { animation: dt-esfumar .5s steps(5) both; }
#dt-capa .dt-aparece { animation: dt-esfumar .5s steps(5) reverse both; }
#dt-capa .dt-pregunta { position: absolute; margin: -14px 0 0 -6px; font: 700 20px/1 Georgia, serif; color: #7239ea; animation: dt-pregunta 1.6s ease-out both; }

@media (max-width: 767px) {
	#dt-capa .dt-sol { width: 92px; height: 92px; top: -18px; margin-left: -46px; }
}

@keyframes dt-caer { from { transform: translateY(-15vh); } to { transform: translateY(110vh); } }
@keyframes dt-subir { 0% { transform: translateY(105vh); opacity: 0; } 10% { opacity: 1; } 75% { opacity: .9; } 100% { transform: translateY(-10vh); opacity: 0; } }
@keyframes dt-mecer { from { transform: translateX(calc(var(--dt-amp) * -1)) rotate(calc(var(--dt-giro) * -1)); } to { transform: translateX(var(--dt-amp)) rotate(var(--dt-giro)); } }
@keyframes dt-girar { to { transform: rotate(360deg); } }
@keyframes dt-voltear { to { transform: rotate3d(1, .5, .2, 360deg); } }
@keyframes dt-cruzar { 0% { transform: translateX(calc(-100% - 20px)); } 30%, 100% { transform: translateX(calc(100vw + 20px)); } }
@keyframes dt-ondear { from { transform: translateY(-22px); } to { transform: translateY(22px); } }
@keyframes dt-aletear-v { to { transform: scaleY(.25); } }
@keyframes dt-aletear-h { to { transform: scaleX(.2); } }
@keyframes dt-trotar { to { transform: translateY(-5px); } }
@keyframes dt-galopar { from { transform: rotate(-26deg); } to { transform: rotate(26deg); } }
@keyframes dt-brillar { from { transform: scale(1); opacity: .85; } to { transform: scale(1.12); opacity: 1; } }
@keyframes dt-botar { from { transform: translateY(0); } to { transform: translateY(-70px); } }
@keyframes dt-colgar { 0%, 15% { transform: translateY(55px); } 40%, 60% { transform: translateY(32vh); } 85%, 100% { transform: translateY(55px); } }
@keyframes dt-balancear { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes dt-llamear { from { transform: scale(1, 1) skewX(-3deg); } to { transform: scale(.94, 1.1) skewX(3deg); } }
@keyframes dt-lanzar { from { transform: translateY(100vh); } to { transform: translateY(var(--dt-alto)); } }
@keyframes dt-estallar { 0% { transform: translate(0, 0); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(var(--dt-dx), calc(var(--dt-dy) + 28px)); opacity: 0; } }
@keyframes dt-humear { to { transform: scale(5); opacity: 0; } }
@keyframes dt-patita { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes dt-titilar { from { opacity: .25; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes dt-encender { 0%, 8% { transform: scaleY(0); } 14%, 85% { transform: scaleY(1); } 92%, 100% { transform: scaleY(0); } }
@keyframes dt-parpadear { to { opacity: .55; } }
@keyframes dt-disparar { from { transform: translateX(0); opacity: 1; } to { transform: translateX(76px); opacity: .2; } }
@keyframes dt-escape { from { transform: translate(0, 0); opacity: .9; } to { transform: translate(-22px, -10px); opacity: 0; } }
@keyframes dt-mirar { 0%, 20% { transform: translateX(-1.5px); } 50%, 70% { transform: translateX(1.5px); } 100% { transform: translateX(-1.5px); } }
@keyframes dt-cursor { 50% { opacity: 0; } }
@keyframes dt-vapor { 0% { transform: translateY(4px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-8px); opacity: 0; } }
@keyframes dt-barrido { from { transform: translateY(0); } to { transform: translateY(23px); } }
@keyframes dt-nieve-tv { from { opacity: .04; } to { opacity: .16; } }
@keyframes dt-ondear-cinta { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
@keyframes dt-esfumar { 0% { opacity: 1; } 20% { opacity: .15; } 40% { opacity: .9; } 60% { opacity: .1; } 80% { opacity: .5; } 100% { opacity: 0; } }
@keyframes dt-pregunta { from { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-36px) scale(1.1); opacity: 0; } }

/* Con "reducir movimiento" solo queda lo que esta quieto (el JS tampoco lanza fuegos). */
@media (prefers-reduced-motion: reduce) {
	#dt-capa .dt-cae, #dt-capa .dt-sube, #dt-capa .dt-cruza, #dt-capa .dt-cohete, #dt-capa .dt-fuego, #dt-capa .dt-humo { display: none; }
	#dt-capa .dt-arana, #dt-capa .dt-arana svg, #dt-capa .dt-monigote svg, #dt-capa .dt-llama, #dt-capa .dt-rayos,
	#dt-capa .dt-pata-i, #dt-capa .dt-estrellita, #dt-capa .dt-hoja, #dt-capa .dt-motor, #dt-capa .dt-rayo,
	#dt-capa .dt-rueda, #dt-capa .dt-escape, #dt-capa .dt-ojos, #dt-capa .dt-duda, #dt-capa .dt-vapor, #dt-capa .dt-antena,
	#dt-capa .dt-barrido, #dt-capa .dt-nieve-tv, #dt-capa .dt-cinta, #dt-capa .dt-terminal b { animation: none; }
}

#dt-boton {
	position: fixed; left: 14px; bottom: 14px; z-index: 1041; width: 38px; height: 38px; padding: 0;
	display: flex; align-items: center; justify-content: center; font-size: 18px; line-height: 1;
	border: 1px solid var(--bs-gray-300); border-radius: 50%; background: var(--bs-body-bg); color: var(--bs-gray-800);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .15); opacity: .8; cursor: pointer;
}
#dt-boton:hover, #dt-boton:focus-visible { opacity: 1; }
#dt-boton:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
#dt-boton.dt-apagada { filter: grayscale(1); opacity: .45; }

@media print {
	#dt-capa, #dt-boton { display: none !important; }
}
