/*
 * Die kleine Abenteuerblatt-Elfe: eine unaufdringliche, lebendige Begleiterin
 * ausschließlich für die Startseite. Flug, Blickrichtung und Audio liegen
 * auf getrennten Ebenen, damit sich ihre Transformationen nicht überschreiben.
 */
.ab-fairy-stage {
	position: fixed;
	inset: 0;
	z-index: 80;
	overflow: hidden;
	pointer-events: none;
	contain: layout paint style;
}

.ab-fairy {
	--ab-fairy-bank: 0deg;
	--ab-fairy-facing: 1;
	position: absolute;
	top: 0;
	left: 0;
	width: clamp(78px, 7vw, 108px);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 46%;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	box-shadow: none;
	color: inherit;
	line-height: 0;
	opacity: 0;
	pointer-events: auto;
	cursor: pointer;
	touch-action: manipulation;
	transform: translate3d(calc(100vw - 130px), 150px, 0);
	transform-origin: 50% 50%;
	transition: opacity 420ms ease;
	will-change: transform;
	-webkit-tap-highlight-color: transparent;
}

/*
 * Globale Astra-Buttonstile dürfen beim Berühren oder Anklicken keine Fläche
 * hinter der freigestellten Elfe einblenden.
 */
.ab-fairy:hover,
.ab-fairy:focus,
.ab-fairy:active {
	border-color: transparent !important;
	outline: none;
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	text-decoration: none;
}

.ab-fairy.is-ready {
	opacity: 1;
}

.ab-fairy.is-sheltered {
	opacity: 0;
	pointer-events: none;
}

.ab-fairy__bank,
.ab-fairy__facing,
.ab-fairy__float,
.ab-fairy__picture,
.ab-fairy__sprite {
	display: block;
	width: 100%;
}

.ab-fairy__bank {
	transform: rotate(var(--ab-fairy-bank));
	transform-origin: 50% 56%;
	transition: transform 260ms ease-out;
}

.ab-fairy__facing {
	transform: scaleX(var(--ab-fairy-facing));
	transform-origin: 50% 56%;
	transition: transform 360ms ease;
}

.ab-fairy__float {
	position: relative;
	animation: ab-fairy-bob 2.35s ease-in-out infinite alternate;
}

.ab-fairy__picture {
	position: relative;
	z-index: 2;
}

.ab-fairy__sprite {
	height: auto;
	filter: drop-shadow(0 7px 7px rgba(9, 45, 37, 0.2)) drop-shadow(0 0 8px rgba(251, 205, 104, 0.2));
	pointer-events: none;
	user-select: none;
}

.ab-fairy__aura {
	position: absolute;
	z-index: 1;
	top: 7%;
	left: 1%;
	width: 98%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 229, 151, 0.24) 0 18%, rgba(255, 220, 122, 0.09) 43%, transparent 70%);
	filter: blur(3px);
	opacity: 0.72;
	transform: scale(0.92);
	animation: ab-fairy-glow 3.2s ease-in-out infinite alternate;
}

.ab-fairy:focus-visible {
	outline: 3px solid #f0ba55 !important;
	outline-offset: 4px;
}

.ab-fairy-stage.is-scrolling .ab-fairy {
	opacity: 0.42;
}

@keyframes ab-fairy-bob {
	from { transform: translate3d(0, -2px, 0); }
	to { transform: translate3d(0, 3px, 0); }
}

@keyframes ab-fairy-glow {
	from { opacity: 0.46; transform: scale(0.86); }
	to { opacity: 0.78; transform: scale(1.05); }
}

@media (max-width: 767px) {
	.ab-fairy {
		width: clamp(58px, 17vw, 66px);
		transform: translate3d(calc(100vw - 82px), 128px, 0);
	}

	.ab-fairy__sprite {
		filter: drop-shadow(0 5px 5px rgba(9, 45, 37, 0.18)) drop-shadow(0 0 6px rgba(251, 205, 104, 0.18));
	}
}

@media (prefers-reduced-motion: reduce) {
	.ab-fairy,
	.ab-fairy__bank,
	.ab-fairy__facing {
		transition: none !important;
	}

	.ab-fairy__float,
	.ab-fairy__aura {
		animation: none !important;
	}

	.ab-fairy__aura {
		opacity: 0.44;
	}
}
