/* Elfi dispettosi (Walcor, Natale). Caricato solo nelle pagine che contengono il blocco acf/elfi. */

.elfi-scene {
	--elfi-pine: #1e4620;
	--elfi-deep: #10271a;
	--elfi-cream: #fbf3e7;
	--elfi-wine: #8b1e2d;
	--elfi-berry: #df2d46;
	--elfi-gold: #c9a24a;
	--elfi-gold-light: #f3d27a;
	--elfi-ink: #2b2118;
	--elfi-ginger: #b9743d;
	--elfi-ginger-dark: #8a4f24;
	--elfi-radius: 28px;
	--elfi-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

	position: relative;
	overflow: hidden;
	isolation: isolate;
	color: var(--elfi-ink);
	/* Font giocoso per tutta la pagina degli elfi (Google Fonts, caricato da inc/elfi.php):
	   Baloo 2 per i testi, Bagel Fat One per i titoli e per tutto ciò che è in grassetto */
	--elfi-display: 'Bagel Fat One', 'Baloo 2', var(--font-sans, sans-serif);

	font-family: 'Baloo 2', var(--font-sans, sans-serif);
	font-size: 1.125rem;
	line-height: 1.6;
	background:
		radial-gradient(ellipse 80% 50% at 50% 0%, rgba(243, 210, 122, 0.18), transparent 70%),
		linear-gradient(var(--elfi-deep), var(--elfi-pine) 45%, #173a1b);
	padding-bottom: clamp(56px, 8vw, 104px);
}

.elfi-scene :focus-visible {
	outline: 3px solid var(--elfi-gold);
	outline-offset: 3px;
}

.elfi-defs {
	position: absolute;
	width: 0;
	height: 0;
}

.elfi-wrap {
	position: relative;
	z-index: 1;
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Neve (canvas animato da elfi.js) */

.elfi-snow {
	position: absolute;
	inset: 0;
	z-index: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	-webkit-mask-image: linear-gradient(#000 65%, transparent);
	mask-image: linear-gradient(#000 65%, transparent);
}

/* Ghirlanda di lucine */

.elfi-garland {
	position: relative;
	z-index: 2;
	display: block;
	width: min(100%, 1200px);
	height: auto;
	margin: 0 auto;
	overflow: visible;
}

.elfi-garland__wire {
	fill: none;
	stroke: #0b1a0e;
	stroke-width: 3;
}

.elfi-bulb {
	cursor: pointer;
}

.elfi-bulb__body {
	transform-box: fill-box;
	transform-origin: 50% 0;
	animation: elfi-sway 4s ease-in-out infinite alternate;
	animation-delay: calc(var(--i) * -0.45s);
}

.elfi-bulb__socket {
	fill: #c8ccd4;
}

.elfi-bulb__glass {
	--bulb: var(--elfi-berry);
	fill: var(--bulb);
	animation: elfi-twinkle 2.4s ease-in-out infinite;
	animation-delay: calc(var(--i) * 0.27s);
}

.elfi-bulb--1 .elfi-bulb__glass { --bulb: #f5b335; }
.elfi-bulb--2 .elfi-bulb__glass { --bulb: #38b45f; }
.elfi-bulb[data-color='0'] .elfi-bulb__glass { --bulb: var(--elfi-berry); }
.elfi-bulb[data-color='1'] .elfi-bulb__glass { --bulb: #f5b335; }
.elfi-bulb[data-color='2'] .elfi-bulb__glass { --bulb: #38b45f; }
.elfi-bulb[data-color='3'] .elfi-bulb__glass { --bulb: #4fb0ff; }
.elfi-bulb[data-color='4'] .elfi-bulb__glass { --bulb: #c77dff; }

.elfi-bulb__shine {
	fill: none;
	stroke: rgba(255, 255, 255, 0.7);
	stroke-width: 2.5;
	stroke-linecap: round;
}

.elfi-bulb.is-popped .elfi-bulb__body {
	animation: elfi-bulb-pop 0.5s var(--elfi-bounce);
}

@keyframes elfi-twinkle {
	0%, 100% { filter: drop-shadow(0 0 2px var(--bulb)) brightness(0.85); }
	50% { filter: drop-shadow(0 0 12px var(--bulb)) drop-shadow(0 0 22px var(--bulb)) brightness(1.25); }
}

@keyframes elfi-sway {
	from { transform: rotate(-4deg); }
	to { transform: rotate(4deg); }
}

@keyframes elfi-bulb-pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.35) rotate(12deg); }
	100% { transform: scale(1); }
}

/* Testata */

.elfi-hero {
	position: relative;
	z-index: 2;
	color: var(--elfi-cream);
}

/* minmax(0, …): la larghezza delle colonne non dipende dal testo, così mentre si carica il font
   (il sottotitolo su una riga è più largo col font di riserva) gli elfi non vengono spinti a destra */
.elfi-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
	gap: 24px;
	align-items: end;
}

.elfi-hero__title {
	margin: 0;
	color: var(--elfi-gold);
	font-size: clamp(3.25rem, 8.8vw, 6.5rem);
	font-weight: 400;
	font-family: var(--elfi-display);
	line-height: 0.92;
	text-transform: uppercase;
	text-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.elfi-word {
	display: inline-block;
	margin-right: 0.18em;
	white-space: nowrap;
}

.elfi-char {
	display: inline-block;
	transform-origin: 50% 100%;
}

.elfi-scene.is-ready .elfi-char {
	animation: elfi-drop 0.8s var(--elfi-bounce) both;
	animation-delay: calc(var(--i) * 45ms);
}

.elfi-scene.is-ready .elfi-char.is-jiggling {
	animation: elfi-jiggle 0.5s ease;
}

@keyframes elfi-drop {
	from { opacity: 0; transform: translateY(-1.2em) rotate(-18deg) scale(0.6); }
	to { opacity: 1; transform: none; }
}

@keyframes elfi-jiggle {
	0%, 100% { transform: none; }
	30% { transform: translateY(-0.15em) rotate(-8deg); }
	60% { transform: translateY(0.05em) rotate(6deg); }
}

.elfi-hero__lead {
	margin: 18px 0 56px;
	font-size: clamp(1.2rem, 1.8vw, 1.6rem);
	line-height: 1.2;
}

@media (min-width: 1024px) {
	.elfi-hero__lead { white-space: nowrap; }
}

.elfi-hero__stage {
	/*
	 * Lila e Pip seduti sul bordo superiore della card della storia: nella foto il sedere
	 * è al 79% dell'altezza, quindi la card deve iniziare lì (margin-bottom negativo,
	 * meno il margin-top della card). Le gambe pendono sopra la crema della card.
	 */
	--ew: min(420px, 35vw);
	--eh: calc(var(--ew) * 0.6957);

	position: relative;
	/* Più larga della colonna: sborda a sinistra e finisce sul bordo destro della card (i piedi della foto arrivano al 96%) */
	justify-self: start;
	width: var(--ew);
	margin-left: calc(100% - var(--ew) * 0.99 + 30px);
	margin-bottom: calc(var(--eh) * -0.21 - 28px);
	z-index: 3;
	perspective: 900px;
}

.elfi-elves {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: opacity 0.4s ease, transform 0.5s var(--elfi-bounce);
}

/* Gli elfi della testata sono andati a nascondersi altrove */
.elfi-elves.is-away {
	opacity: 0;
	transform: scale(0.4) rotate(-10deg);
	pointer-events: none;
}

.elfi-elves__tilt {
	display: block;
	transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
	transform-style: preserve-3d;
	transition: transform 0.25s ease-out;
}

.elfi-elves__img {
	display: block;
	width: 100%;
	height: auto;
	filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.25));
	transform-origin: 50% 79%;
}

.elfi-elves.is-jumping .elfi-elves__img {
	animation: elfi-jump 0.9s var(--elfi-bounce);
}

.elfi-elves__shadow {
	/* Ombra di contatto stretta e scura, dove i peluche toccano la card */
	position: absolute;
	top: 77%;
	left: 6%;
	right: 6%;
	height: 4.5%;
	border-radius: 50%;
	background: radial-gradient(ellipse at 50% 40%, rgba(40, 20, 10, 0.55), rgba(40, 20, 10, 0.25) 45%, transparent 72%);
	filter: blur(2px);
	z-index: -1;
}

@keyframes elfi-float {
	0%, 100% { transform: translateY(0) rotate(-1deg); }
	50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes elfi-shadow {
	0%, 100% { transform: scaleX(1); opacity: 1; }
	50% { transform: scaleX(0.85); opacity: 0.7; }
}

@keyframes elfi-jump {
	0% { transform: translateY(0) scale(1, 1); }
	15% { transform: translateY(0) scale(1.08, 0.88); }
	45% { transform: translateY(-60px) scale(0.95, 1.06) rotate(-3deg); }
	70% { transform: translateY(0) scale(1.06, 0.92); }
	100% { transform: translateY(0) scale(1, 1); }
}

/* Invito a passarci sopra (o toccarli): manina che pulsa, sparisce alla prima interazione */
.elfi-elves__hint {
	position: absolute;
	left: 50%;
	top: 62%;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	margin: -27px 0 0 -27px;
	border-radius: 50%;
	background: var(--elfi-cream);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;
}

.elfi-elves__hint::before {
	content: '';
	position: absolute;
	inset: -6px;
	border: 3px solid var(--elfi-gold-light);
	border-radius: 50%;
	animation: elfi-hint-ring 1.6s ease-out infinite;
}

.elfi-elves__hint svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: var(--elfi-wine);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	animation: elfi-hint-tap 1.6s ease-in-out infinite;
}

.elfi-scene.is-ready .elfi-hero__stage:not(.is-touched) .elfi-elves__hint {
	opacity: 1;
	transition-delay: 1.6s;
}

@keyframes elfi-hint-ring {
	0% { opacity: 0.9; transform: scale(0.8); }
	100% { opacity: 0; transform: scale(1.5); }
}

@keyframes elfi-hint-tap {
	0%, 100% { transform: translateY(0) scale(1); }
	40% { transform: translateY(3px) scale(0.92); }
}

/* Fumetto degli elfi: a destra, sfondo crema come le card */
.elfi-bubble {
	position: absolute;
	top: -6%;
	right: -40px;
	max-width: 230px;
	margin: 0;
	padding: 12px 16px;
	border-radius: 18px 18px 18px 4px;
	color: var(--elfi-wine);
	background: var(--elfi-cream);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
	font-size: 1.25rem;
	font-weight: 500;
	line-height: 1.15;
	opacity: 0;
	transform: translateY(10px) scale(0.6);
	transform-origin: 0 100%;
	transition: opacity 0.25s ease, transform 0.35s var(--elfi-bounce);
	pointer-events: none;
	z-index: 4;
}

.elfi-bubble::after {
	content: '';
	position: absolute;
	bottom: -10px;
	left: 18px;
	border: 10px solid transparent;
	border-top-color: var(--elfi-cream);
	border-bottom: 0;
	border-left: 0;
}

.elfi-bubble.is-visible {
	opacity: 1;
	transform: none;
}

/* Scintille (create da elfi.js) */

.elfi-spark {
	position: absolute;
	width: var(--s, 10px);
	height: var(--s, 10px);
	margin: calc(var(--s, 10px) / -2) 0 0 calc(var(--s, 10px) / -2);
	background: var(--c, var(--elfi-gold-light));
	clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
	pointer-events: none;
	z-index: 20;
	animation: elfi-spark 0.9s ease-out forwards;
}

.elfi-spark--dot {
	border-radius: 50%;
	clip-path: none;
}

@keyframes elfi-spark {
	from { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); }
	to { opacity: 0; transform: translate(var(--x), var(--y)) scale(0.2) rotate(var(--r, 180deg)); }
}

/* Ingressi allo scroll */

.elfi-in {
	opacity: 0;
	transform: translateY(40px) rotate(-1.5deg);
	transition: opacity 0.7s ease, transform 0.9s var(--elfi-bounce);
	transition-delay: var(--d, 0ms);
}

.elfi-in.is-in {
	opacity: 1;
	transform: none;
}

/* Card */

.elfi-card {
	position: relative;
	margin-top: 28px;
	padding: clamp(26px, 5vw, 56px);
	border-radius: var(--elfi-radius);
	background: var(--elfi-cream);
	box-shadow: 0 24px 50px rgba(0, 0, 0, 0.25);
}

.elfi-card p {
	margin: 0 0 1em;
	max-width: 68ch;
}

.elfi-card strong {
	display: inline-block;
	color: var(--elfi-wine);
	transition: transform 0.3s var(--elfi-bounce);
}

.elfi-card strong:hover {
	transform: rotate(-6deg) scale(1.15);
}

.elfi-card__title {
	margin: 0 0 14px;
	color: var(--elfi-wine);
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 400;
	font-family: var(--elfi-display);
	line-height: 1;
	text-transform: uppercase;
}

.elfi-story {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 28px clamp(20px, 3vw, 40px);
	align-items: stretch;
	padding-top: clamp(84px, 9vw, 108px);
}

/* Due pannelli gemelli, della stessa altezza e con la stessa struttura: titolo, illustrazione, testo */
.elfi-story__legend,
.elfi-story__cast {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 4px clamp(12px, 2vw, 28px);
	text-align: center;
}

/* Niente riquadri: solo una linea tratteggiata tra le due metà */
.elfi-story__cast {
	border-left: 2px dashed rgba(139, 30, 45, 0.18);
}

@media (max-width: 820px) {
	.elfi-story__cast {
		border-left: 0;
		padding-top: 28px;
	}
}

.elfi-story__legend p,
.elfi-story__cast p {
	margin: 0 !important;
	max-width: 46ch;
	font-size: 1.1rem;
	line-height: 1.6;
}

.elfi-story__legend .elfi-cast__photo {
	background: radial-gradient(circle at 50% 35%, #33467e, #1d2a52);
}

.elfi-story__legend .elfi-cast__photo svg {
	display: block;
	width: 100%;
	height: 100%;
}

.elfi-cast__item--night .elfi-cast__name {
	background: #2e3a6b;
}

/* I protagonisti: ritratti di Lila e Pip */
.elfi-cast {
	display: flex;
	gap: 18px;
	justify-content: center;
	margin: 4px 0 20px;
	padding: 0;
	list-style: none;
}

.elfi-cast__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
}

.elfi-cast__photo {
	display: block;
	width: 104px;
	height: 104px;
	overflow: hidden;
	border: 4px solid #fff;
	border-radius: 50%;
	background: radial-gradient(circle at 50% 35%, #fff5d9, #f2d9a4);
	box-shadow: 0 0 0 2px var(--elfi-gold), 0 8px 16px rgba(80, 30, 20, 0.2);
}

.elfi-cast__item--pip .elfi-cast__photo {
	background: radial-gradient(circle at 50% 35%, #e9f6ec, #bfe2c8);
}

.elfi-cast__photo img {
	display: block;
	width: 160%;
	max-width: none;
	margin: -8% 0 0 -30%;
}

.elfi-cast__name {
	padding: 2px 12px;
	border-radius: 999px;
	color: #fff;
	background: var(--elfi-wine);
	font-size: 0.95rem;
	font-weight: 400;
	font-family: var(--elfi-display);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.elfi-cast__item--pip .elfi-cast__name {
	background: var(--elfi-pine);
}

/* Chiusura: citazione su tutta la larghezza */
.elfi-story__quote {
	position: relative;
	grid-column: 1 / -1;
	margin: 8px 0 0;
	padding: 26px clamp(24px, 4vw, 48px);
	border-radius: 20px;
	background: linear-gradient(135deg, #f6ead6, #f1dfc3);
	box-shadow: inset 0 0 0 2px rgba(201, 162, 74, 0.35);
}

.elfi-story__quote p::before,
.elfi-story__quote p::after {
	content: none !important;
}

.elfi-story__quote p {
	margin: 0 !important;
	max-width: none !important;
	color: #5b2a1e;
	font-size: 1.15rem;
	font-style: italic;
}

/* Regole */

.elfi-section-title {
	position: relative;
	z-index: 1;
	margin: 72px 0 0;
	color: var(--elfi-cream);
	font-size: clamp(2.25rem, 5vw, 3.5rem);
	font-weight: 400;
	font-family: var(--elfi-display);
	line-height: 1;
	text-transform: uppercase;
}

.elfi-section-sub {
	position: relative;
	z-index: 1;
	margin: 10px 0 0;
	color: var(--elfi-cream);
}

@media (min-width: 820px) {
	.elfi-section-sub { white-space: nowrap; }
}

.elfi-rules {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
	margin-top: 26px;
}

.elfi-rule {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 20px;
	padding: 26px 28px;
	border-radius: var(--elfi-radius);
	background: var(--elfi-cream);
	box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
	transform-origin: 50% 50%;
}

/* Inclinazione 3D: la prospettiva è di ogni card, così le icone restano alla stessa distanza dal bordo */
.elfi-rule.is-in {
	transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

.elfi-rule.is-tilting {
	transition: opacity 0.7s ease, transform 0.15s ease-out;
	transition-delay: 0ms;
}

.elfi-rule p {
	margin: 0;
}

.elfi-rule__num {
	color: var(--elfi-gold);
	font-size: 0.95rem;
	font-weight: 400;
	font-family: var(--elfi-display);
	letter-spacing: 0.08em;
	line-height: 1;
	text-transform: uppercase;
}

.elfi-rule__icon {
	width: 72px;
	height: 72px;
}

.elfi-rule__bg { fill: #2f8a49; }

.elfi-rule__icon {
	transform: rotate(-4deg);
	filter: drop-shadow(0 6px 8px rgba(20, 60, 30, 0.25));
}

.elfi-rule:nth-child(even) .elfi-rule__icon { transform: rotate(4deg); }

.elfi-rule__stroke { fill: none; stroke: #fdf3e7; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.elfi-rule__dash { fill: none; stroke: #f3d27a; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 5; }
.elfi-rule__gold { fill: #f3d27a; stroke: none; }
.elfi-rule__goldfill { fill: #f3d27a; stroke: none; }
.elfi-rule__goldline { fill: none; stroke: #f3d27a; stroke-width: 2.5; stroke-linecap: round; }
.elfi-rule__red { fill: #e23a4e; stroke: none; }
.elfi-rule__num24 { fill: #f3d27a; stroke: none; font-size: 17px; font-weight: 400; font-family: var(--elfi-display); }

.elfi-rule__lines {
	fill: none;
	stroke: var(--elfi-cream);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.elfi-rule__accent { stroke: var(--elfi-gold); }
.elfi-rule__fill { fill: var(--elfi-cream); stroke: none; }
.elfi-rule__star { fill: var(--elfi-gold); stroke: none; }
.elfi-rule__wave { stroke: var(--elfi-wine); stroke-width: 2.5; }

.elfi-rule__title {
	margin: 6px 0 6px;
	color: var(--elfi-wine);
	font-size: 1.6rem;
	font-weight: 400;
	font-family: var(--elfi-display);
	line-height: 1.05;
	text-transform: uppercase;
}

/* Regole: animazioni leggere e continue sulle icone, la card si solleva al passaggio */
.elfi-rule:hover {
	box-shadow: 0 22px 44px rgba(0, 0, 0, 0.3);
}

.elfi-rule__icon {
	animation: elfi-rule-bob 3.6s ease-in-out infinite;
	animation-delay: calc(var(--n, 0) * -0.9s);
}

.elfi-rule:nth-child(2) .elfi-rule__icon { --n: 1; }
.elfi-rule:nth-child(3) .elfi-rule__icon { --n: 2; }
.elfi-rule:nth-child(4) .elfi-rule__icon { --n: 3; }

.elfi-rule:hover .elfi-rule__icon {
	animation: elfi-rule-wiggle 0.7s ease;
}

@keyframes elfi-rule-bob {
	0%, 100% { translate: 0 0; }
	50% { translate: 0 -5px; }
}

@keyframes elfi-rule-wiggle {
	0%, 100% { translate: 0 0; scale: 1; }
	30% { translate: 0 -6px; scale: 1.08; }
	60% { translate: 0 0; scale: 0.97; }
}

/* Bacchetta: le stelline brillano a turno (solo opacità: nessuna trasformazione sugli elementi SVG) */
.elfi-rule__icon--0 .elfi-rule__gold {
	animation: elfi-rule-sparkle 2.4s ease-in-out infinite;
}

.elfi-rule__icon--0 .elfi-rule__gold:nth-of-type(3) { animation-delay: 0.8s; }
.elfi-rule__icon--0 .elfi-rule__gold:nth-of-type(4) { animation-delay: 1.6s; }

@keyframes elfi-rule-sparkle {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.3; }
}

/* Cambio di posto: la luna si accende e si spegne */
.elfi-rule__icon--1 .elfi-rule__gold {
	animation: elfi-rule-sparkle 3.2s ease-in-out infinite;
}

/* Parlano a modo loro: i puntini "scrivono" */
.elfi-rule__icon--2 .elfi-rule__goldfill {
	animation: elfi-rule-typing 1.4s ease-in-out infinite;
}

.elfi-rule__icon--2 .elfi-rule__goldfill:nth-of-type(2) { animation-delay: 0.2s; }
.elfi-rule__icon--2 .elfi-rule__goldfill:nth-of-type(3) { animation-delay: 0.4s; }

@keyframes elfi-rule-typing {
	0%, 60%, 100% { opacity: 1; }
	30% { opacity: 0.25; }
}

/* Fino alla vigilia: il 24 si illumina */
.elfi-rule__icon--3 .elfi-rule__num24 {
	animation: elfi-rule-glow24 2.2s ease-in-out infinite;
}

@keyframes elfi-rule-glow24 {
	0%, 100% { fill: #f3d27a; }
	50% { fill: #fff6d6; }
}

/* Barra di anteprima (solo utenti loggati con permessi di modifica) */
.elfi-preview {
	position: relative;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0 0 16px;
	padding: 10px 14px;
	border: 2px dashed rgba(243, 210, 122, 0.7);
	border-radius: 14px;
	background: rgba(10, 25, 50, 0.55);
	color: #fbf3e7;
	font-size: 0.95rem;
}

.elfi-preview__label {
	margin-right: 4px;
	font-weight: 400;
	font-family: var(--elfi-display);
}

.elfi-preview__btn {
	padding: 4px 12px;
	border-radius: 999px;
	color: #2b2118;
	background: #fbf3e7;
	font-weight: 400;
	font-family: var(--elfi-display);
	text-decoration: none;
}

.elfi-preview__btn:hover,
.elfi-preview__btn.is-current {
	color: #3b2a0c;
	background: #f3d27a;
}

/* Calendario */

.elfi-cal {
	margin-top: 64px;
}

.elfi-cal__head {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 32px;
	justify-content: space-between;
	align-items: flex-end;
	margin-bottom: 16px;
}

.elfi-cal__big {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 0 !important;
}

.elfi-cal__big b {
	color: var(--elfi-gold);
	font-size: clamp(4.5rem, 11vw, 7.5rem);
	font-weight: 400;
	font-family: var(--elfi-display);
	line-height: 0.85;
}

.elfi-cal__big span {
	color: var(--elfi-wine);
	font-size: clamp(1.2rem, 2.2vw, 1.6rem);
	font-weight: 400;
	font-family: var(--elfi-display);
	line-height: 1;
	text-transform: uppercase;
}

.elfi-cal__status {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	align-items: center;
	margin-bottom: 30px;
}

.elfi-cal__status-text {
	margin: 0 !important;
	color: var(--elfi-pine);
	font-weight: 700;
}

.elfi-cal__progress {
	flex: 1 1 160px;
	height: 10px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(30, 70, 32, 0.15);
}

.elfi-cal__progress span {
	display: block;
	width: var(--p, 0%);
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--elfi-gold), var(--elfi-gold-light), var(--elfi-gold));
	background-size: 200% 100%;
	animation: elfi-shine-bar 2.5s linear infinite;
	transition: width 0.8s var(--elfi-bounce);
}

@keyframes elfi-shine-bar {
	to { background-position: -200% 0; }
}

.elfi-cal__hint {
	margin: 18px 0 0 !important;
	max-width: none !important;
	color: var(--elfi-pine);
	font-size: 1.15rem;
	font-weight: 500;
	text-align: center;
}

/*
 * Card del calendario: cielo notturno fotografico, palazzina con texture reali (Poly Haven, CC0),
 * neve e abeti. Le misure delle finestre usano --u, che vale 1cqw con 3 colonne (mobile)
 * e si riduce con 5 colonne (desktop): lo stesso codice serve entrambe le griglie.
 */

.elfi-cal {
	overflow: hidden;
	padding-bottom: 0;
	color: #fdf3e7;
	background:
		radial-gradient(ellipse 60% 40% at 80% 8%, rgba(255, 236, 170, 0.35), transparent 70%),
		linear-gradient(rgba(70, 110, 210, 0.55), rgba(90, 140, 225, 0.5) 55%, rgba(140, 180, 240, 0.55)),
		url('images/cielo.webp') 50% 0 / cover no-repeat,
		#3c5fb5;
	box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

.elfi-cal > *:not(.elfi-sky) {
	position: relative;
	z-index: 1;
}

/* La città non deve chiudere un piano suo: così gli abeti (z-index più alto) restano
 * sopra la neve, mentre la neve resta davanti al basamento della casa. */
.elfi-cal > .elfi-town {
	z-index: auto;
}

.elfi-cal > .elfi-ground {
	z-index: 3;
}

.elfi-cal .elfi-card__title { color: #fdf3e7; }
.elfi-cal .elfi-cal__head p { color: rgba(253, 243, 231, 0.88); }
.elfi-cal .elfi-cal__big b { color: #f6cf55; }
.elfi-cal .elfi-cal__big span { color: #fdf3e7; }
.elfi-cal .elfi-cal__status-text { color: #fdf3e7; }
.elfi-cal .elfi-cal__progress { background: rgba(255, 255, 255, 0.18); }

/* Neve che cade su due piani di profondità */
.elfi-sky {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
}

.elfi-sky__snow {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Scena: casa, alberi */
.elfi-town {
	--hw: min(100%, 480px);

	position: relative;
	margin-top: 10px;
	padding-top: clamp(40px, 6vw, 64px);
}

.elfi-house {
	--u: 1cqw;
	--frame: #eee6da;
	--frame-dark: #b9ad9c;

	position: relative;
	z-index: 2;
	width: var(--hw);
	margin: 0 auto;
	container-type: inline-size;
	filter: drop-shadow(0 24px 30px rgba(20, 40, 90, 0.35));
}

/* Mansarda in tegole con neve */
.elfi-house__mansard {
	position: absolute;
	top: calc(5 * var(--u));
	left: 11%;
	right: 11%;
	height: calc(39 * var(--u));
}

.elfi-house__mansard::before {
	content: '';
	position: absolute;
	inset: 0;
	clip-path: polygon(9% 0, 91% 0, 100% 100%, 0 100%);
	background:
		linear-gradient(90deg, rgba(60, 10, 10, 0.3), transparent 22%, transparent 78%, rgba(60, 10, 10, 0.32)),
		linear-gradient(rgba(220, 60, 50, 0.35), rgba(200, 50, 45, 0.25)),
		url('images/tex-tiles.webp') 0 0 / calc(26 * var(--u)) auto;
	filter: brightness(1.2) saturate(1.25);
}

/* Cumulo di neve sul colmo */
.elfi-house__mansard::after {
	content: '';
	position: absolute;
	z-index: 1;
	top: calc(-3 * var(--u));
	left: 5%;
	right: 5%;
	height: calc(8 * var(--u));
	background:
		linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 35%, rgba(140, 165, 210, 0.45)),
		radial-gradient(ellipse at 50% 100%, rgba(120, 140, 175, 0.35), transparent 60%),
		linear-gradient(rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.8)), url('images/tex-snow.webp') 0 0 / calc(30 * var(--u)) auto,
		#f4f7fb;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none'%3E%3Cpath d='M0 100 L0 36.0 Q0 30.0 8 30.0 Q56.0 19.8 104.0 30.0 Q152.0 30.0 200.0 30.0 Q248.0 19.0 296.0 30.0 Q344.0 30.0 392.0 30.0 Q400 30.0 400 36.0 L400 100 L376.4 100 L371.4 115.4 L366.4 100 L319.3 100 L314.3 117.2 L309.3 100 L262.1 100 L257.1 108.3 L252.1 100 L205.0 100 L200.0 112.7 L195.0 100 L147.9 100 L142.9 117.4 L137.9 100 L90.7 100 L85.7 114.5 L80.7 100 L33.6 100 L28.6 117.0 L23.6 100 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none'%3E%3Cpath d='M0 100 L0 36.0 Q0 30.0 8 30.0 Q56.0 19.8 104.0 30.0 Q152.0 30.0 200.0 30.0 Q248.0 19.0 296.0 30.0 Q344.0 30.0 392.0 30.0 Q400 30.0 400 36.0 L400 100 L376.4 100 L371.4 115.4 L366.4 100 L319.3 100 L314.3 117.2 L309.3 100 L262.1 100 L257.1 108.3 L252.1 100 L205.0 100 L200.0 112.7 L195.0 100 L147.9 100 L142.9 117.4 L137.9 100 L90.7 100 L85.7 114.5 L80.7 100 L33.6 100 L28.6 117.0 L23.6 100 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}

.elfi-house__chimney {
	position: absolute;
	top: calc(-8 * var(--u));
	right: 15%;
	width: calc(8 * var(--u));
	height: calc(12 * var(--u));
	background:
		linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent 40%, rgba(0, 0, 0, 0.3)),
		url('images/tex-brick.webp') 0 0 / calc(22 * var(--u)) auto;
}

.elfi-house__chimney::before {
	content: '';
	position: absolute;
	top: calc(-2.4 * var(--u));
	left: calc(-1.5 * var(--u));
	right: calc(-1.5 * var(--u));
	height: calc(3.4 * var(--u));
	background:
		linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 35%, rgba(140, 165, 210, 0.45)), linear-gradient(rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.8)), url('images/tex-snow.webp') 0 0 / calc(20 * var(--u)) auto, #f4f7fb;
	box-shadow: 0 calc(0.5 * var(--u)) calc(0.8 * var(--u)) rgba(0, 0, 0, 0.35);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60 L0 24.0 Q0 18.0 8 18.0 Q54.0 11.4 100.0 18.0 Q146.0 18.0 192.0 18.0 Q200 18.0 200 24.0 L200 60 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60 L0 24.0 Q0 18.0 8 18.0 Q54.0 11.4 100.0 18.0 Q146.0 18.0 192.0 18.0 Q200 18.0 200 24.0 L200 60 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}

.elfi-house__snowcap {
	position: absolute;
	z-index: 2;
	bottom: calc(-1.2 * var(--u));
	width: calc(18 * var(--u));
	height: calc(6 * var(--u));
	background:
		linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 35%, rgba(140, 165, 210, 0.45)),
		radial-gradient(ellipse at 50% 100%, rgba(120, 140, 175, 0.4), transparent 60%),
		linear-gradient(rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.8)), url('images/tex-snow.webp') 0 0 / calc(24 * var(--u)) auto,
		#f4f7fb;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100 L0 36.0 Q0 30.0 8 30.0 Q56.0 21.7 104.0 30.0 Q152.0 30.0 200.0 30.0 Q248.0 21.0 296.0 30.0 Q344.0 30.0 392.0 30.0 Q400 30.0 400 36.0 L400 100 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100 L0 36.0 Q0 30.0 8 30.0 Q56.0 21.7 104.0 30.0 Q152.0 30.0 200.0 30.0 Q248.0 21.0 296.0 30.0 Q344.0 30.0 392.0 30.0 Q400 30.0 400 36.0 L400 100 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}

.elfi-house__snowcap--l { left: calc(-5 * var(--u)); border-radius: 60% 40% 30% 20% / 80% 60% 40% 30%; }
.elfi-house__snowcap--r { right: calc(-5 * var(--u)); border-radius: 40% 60% 20% 30% / 60% 80% 30% 40%; }

/* Corpo in mattoni, illuminato da sotto e dalle finestre */
.elfi-house__body {
	position: absolute;
	top: calc(42 * var(--u));
	left: 0;
	right: 0;
	bottom: 0;
	background:
		radial-gradient(ellipse 70% 40% at 50% 100%, rgba(255, 190, 110, 0.3), transparent 70%),
		linear-gradient(90deg, rgba(60, 10, 10, 0.25), transparent 12%, transparent 88%, rgba(60, 10, 10, 0.28)),
		linear-gradient(rgba(255, 120, 90, 0.28), rgba(255, 150, 110, 0.22)),
		url('images/tex-brick.webp') 0 0 / calc(34 * var(--u)) auto;
	background-blend-mode: normal, normal, soft-light, normal;
	filter: brightness(1.18) saturate(1.15);
}

/* Cornicione in pietra con neve */
.elfi-house__body::before {
	content: '';
	position: absolute;
	top: calc(-2 * var(--u));
	left: calc(-2.5 * var(--u));
	right: calc(-2.5 * var(--u));
	height: calc(4 * var(--u));
	background:
		linear-gradient(rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.25)),
		url('images/tex-stucco.webp') 0 0 / calc(30 * var(--u)) auto,
		#ddd2c2;
	box-shadow: 0 calc(0.8 * var(--u)) calc(1.4 * var(--u)) rgba(0, 0, 0, 0.45);
}

.elfi-house__body::after {
	content: '';
	position: absolute;
	top: calc(-3.6 * var(--u));
	left: calc(-2 * var(--u));
	right: calc(-2 * var(--u));
	height: calc(4.5 * var(--u));
	background:
		linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 35%, rgba(140, 165, 210, 0.45)), linear-gradient(rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.8)), url('images/tex-snow.webp') 0 0 / calc(30 * var(--u)) auto, #f4f7fb;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none'%3E%3Cpath d='M0 100 L0 36.0 Q0 30.0 8 30.0 Q56.0 19.8 104.0 30.0 Q152.0 30.0 200.0 30.0 Q248.0 19.0 296.0 30.0 Q344.0 30.0 392.0 30.0 Q400 30.0 400 36.0 L400 100 L376.4 100 L371.4 115.4 L366.4 100 L319.3 100 L314.3 117.2 L309.3 100 L262.1 100 L257.1 108.3 L252.1 100 L205.0 100 L200.0 112.7 L195.0 100 L147.9 100 L142.9 117.4 L137.9 100 L90.7 100 L85.7 114.5 L80.7 100 L33.6 100 L28.6 117.0 L23.6 100 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none'%3E%3Cpath d='M0 100 L0 36.0 Q0 30.0 8 30.0 Q56.0 19.8 104.0 30.0 Q152.0 30.0 200.0 30.0 Q248.0 19.0 296.0 30.0 Q344.0 30.0 392.0 30.0 Q400 30.0 400 36.0 L400 100 L376.4 100 L371.4 115.4 L366.4 100 L319.3 100 L314.3 117.2 L309.3 100 L262.1 100 L257.1 108.3 L252.1 100 L205.0 100 L200.0 112.7 L195.0 100 L147.9 100 L142.9 117.4 L137.9 100 L90.7 100 L85.7 114.5 L80.7 100 L33.6 100 L28.6 117.0 L23.6 100 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}



/* Filo di lucine sotto il cornicione */
.elfi-house__lights {
	position: absolute;
	top: calc(3 * var(--u));
	left: 3%;
	right: 3%;
	z-index: 1;
	display: flex;
	justify-content: space-between;
	height: calc(3 * var(--u));
	border-top: calc(0.25 * var(--u)) solid rgba(20, 20, 20, 0.7);
	border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

.elfi-house__lights i {
	width: calc(1.4 * var(--u));
	height: calc(2.2 * var(--u));
	margin-top: calc(0.2 * var(--u));
	border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
	background: radial-gradient(circle at 40% 35%, #fff, #ffd97a 45%, #e3a82e);
	box-shadow: 0 0 calc(1.6 * var(--u)) calc(0.4 * var(--u)) rgba(255, 210, 110, 0.85);
	animation: elfi-roof-light 2s ease-in-out infinite;
	animation-delay: calc(var(--i) * 0.15s);
}

.elfi-house__lights i:nth-child(3n + 1) { background: radial-gradient(circle at 40% 35%, #fff, #ff7a7a 45%, #c8323a); box-shadow: 0 0 calc(1.6 * var(--u)) calc(0.4 * var(--u)) rgba(255, 100, 100, 0.8); }
.elfi-house__lights i:nth-child(3n + 2) { background: radial-gradient(circle at 40% 35%, #fff, #7fe39a 45%, #2e9a52); box-shadow: 0 0 calc(1.6 * var(--u)) calc(0.4 * var(--u)) rgba(110, 230, 150, 0.8); }

@keyframes elfi-roof-light {
	0%, 100% { opacity: 0.6; }
	50% { opacity: 1; }
}

/* Zoccolo in pietra */
.elfi-house__base {
	position: absolute;
	left: calc(-1 * var(--u));
	right: calc(-1 * var(--u));
	bottom: 0;
	height: calc(4 * var(--u));
	background:
		linear-gradient(rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.35)),
		url('images/tex-stucco.webp') 0 0 / calc(24 * var(--u)) auto,
		#a99c8c;
}

/* Griglia delle finestre */
.elfi-doors {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-template-rows: repeat(7, calc(31 * var(--u))) calc(38 * var(--u));
	margin: 0;
	padding: calc(10 * var(--u)) calc(6 * var(--u)) 0;
	list-style: none;
}

.elfi-door {
	--w: calc(16 * var(--u));
	--h: calc(19 * var(--u));
	--r: calc(0.6 * var(--u));

	position: relative;
	grid-column: var(--c3);
	grid-row: var(--r3);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	padding-bottom: calc(3 * var(--u));
}

.elfi-win--wood {
	--frame: #2f8a49;
	--frame-dark: #1f6534;
}

.elfi-win--red {
	--frame: #b8323a;
	--frame-dark: #7d1a22;
}

.elfi-win--blue {
	--frame: #3a6c9e;
	--frame-dark: #234a72;
}

.elfi-win--cream {
	--frame: #ecd9ae;
	--frame-dark: #b59a5f;
}

.elfi-win--arch { --r: 50% 50% calc(0.6 * var(--u)) calc(0.6 * var(--u)) / 38% 38% calc(0.6 * var(--u)) calc(0.6 * var(--u)); }
.elfi-win--grid { --w: calc(19 * var(--u)); --h: calc(18 * var(--u)); }
.elfi-win--oculus { --w: calc(14 * var(--u)); --h: calc(14 * var(--u)); --r: 50%; }
.elfi-win--door { --w: calc(12.5 * var(--u)); --h: calc(21 * var(--u)); --r: calc(1 * var(--u)) calc(1 * var(--u)) 0 0; padding-bottom: 0; }
.elfi-win--door-main { --w: calc(17 * var(--u)); --h: calc(25 * var(--u)); --r: 50% 50% 0 0 / 30% 30% 0 0; padding-bottom: 0; }

/* In mansarda le finestre laterali rientrano dentro la sagoma del tetto (solo mobile, 3 colonne) */
.elfi-door.is-row-1 { padding-bottom: calc(4 * var(--u)); }
.elfi-door.is-row-1.is-col-1 { left: calc(5 * var(--u)); }
.elfi-door.is-row-1.is-col-3 { left: calc(-5 * var(--u)); }

/* Insegna in legno sopra il portone, appesa con due catenelle */
.elfi-win__sign {
	position: relative;
	z-index: 5;
	margin-bottom: calc(2.6 * var(--u));
	padding: calc(1 * var(--u)) calc(2.6 * var(--u));
	border: calc(0.45 * var(--u)) solid #4a2614;
	border-radius: calc(1 * var(--u));
	background:
		repeating-linear-gradient(176deg, rgba(0, 0, 0, 0.08) 0 calc(0.35 * var(--u)), transparent calc(0.35 * var(--u)) calc(1.4 * var(--u))),
		linear-gradient(#8a4a26, #6b3519);
	box-shadow:
		inset 0 calc(0.3 * var(--u)) 0 rgba(255, 220, 170, 0.25),
		inset 0 calc(-0.4 * var(--u)) 0 rgba(0, 0, 0, 0.25),
		0 calc(0.8 * var(--u)) calc(1.4 * var(--u)) rgba(0, 0, 0, 0.45);
	white-space: nowrap;
}

/* Catenelle */
.elfi-win__sign::before,
.elfi-win__sign::after {
	content: '';
	position: absolute;
	bottom: 100%;
	width: calc(0.4 * var(--u));
	height: calc(2.4 * var(--u));
	background: repeating-linear-gradient(#3a3a3a 0 calc(0.5 * var(--u)), #8a8a8a calc(0.5 * var(--u)) calc(0.8 * var(--u)));
}

.elfi-win__sign::before { left: 18%; }
.elfi-win__sign::after { right: 18%; }


.elfi-win__sign > span {
	color: #fff1c9;
	font-size: calc(2.3 * var(--u));
	font-weight: 400;
	font-family: var(--elfi-display);
	letter-spacing: 0.12em;
	line-height: 1;
	text-shadow: 0 calc(0.2 * var(--u)) 0 rgba(0, 0, 0, 0.45);
	text-transform: uppercase;
}

/* Contenitore finestra + targhetta (niente z-index: la targhetta resta sopra le finestre vicine) */
.elfi-win__box {
	position: relative;
	display: block;
}

.elfi-door__num {
	position: absolute;
	top: calc(-2.6 * var(--u));
	left: calc(-2.6 * var(--u));
	z-index: 20;
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(6.6 * var(--u));
	height: calc(6.6 * var(--u));
	border: calc(0.5 * var(--u)) solid #c9a24a;
	border-radius: 50%;
	color: #8b1e2d;
	background: radial-gradient(circle at 35% 30%, #fffaf0, #f2e6d2);
	box-shadow: 0 calc(0.5 * var(--u)) calc(1 * var(--u)) rgba(0, 0, 0, 0.45);
	font-size: calc(3.5 * var(--u));
	font-weight: 400;
	font-family: var(--elfi-display);
	line-height: 1;
	pointer-events: none;
}

.elfi-door.is-available .elfi-door__num {
	border-color: #fff3cf;
	color: #3b2a0c;
	background: radial-gradient(circle at 35% 30%, #fff1c4, #e2bb5c 50%, #b48b33);
	box-shadow: 0 calc(0.5 * var(--u)) calc(1 * var(--u)) rgba(0, 0, 0, 0.45), 0 0 calc(3 * var(--u)) rgba(243, 210, 122, 0.8);
}

/* Finestra: telaio in legno verniciato, stanza, ante a vetri */
.elfi-door__btn {
	position: relative;
	z-index: 1;
	display: block;
	width: var(--w);
	height: var(--h);
	padding: 0;
	border: calc(1.2 * var(--u)) solid var(--frame);
	border-radius: var(--r);
	background: none;
	box-shadow:
		inset 0 0 0 calc(0.25 * var(--u)) rgba(0, 0, 0, 0.25),
		0 0 0 calc(0.25 * var(--u)) var(--frame-dark),
		calc(0.6 * var(--u)) calc(1 * var(--u)) calc(1.6 * var(--u)) rgba(0, 0, 0, 0.5);
	cursor: pointer;
	font: inherit;
	perspective: calc(60 * var(--u));
	-webkit-tap-highlight-color: transparent;
}

.elfi-door__room {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-radius: inherit;
	background:
		radial-gradient(circle at 50% 30%, rgba(255, 246, 215, 1), rgba(250, 196, 105, 0.95) 45%, rgba(160, 80, 30, 0.95)),
		#7a3d16;
	box-shadow: inset 0 0 calc(3 * var(--u)) rgba(90, 40, 10, 0.6);
}

.elfi-door__icon svg {
	display: block;
	width: calc(8 * var(--u));
	height: calc(8 * var(--u));
	filter: drop-shadow(0 calc(0.4 * var(--u)) calc(0.4 * var(--u)) rgba(0, 0, 0, 0.3));
	opacity: 0;
	transform: scale(0);
}

.elfi-door.is-open .elfi-door__icon svg { animation: elfi-pop-in 0.6s var(--elfi-bounce) 0.55s both; }
.elfi-door.is-open .elfi-door__room { animation: elfi-light-on 0.9s ease 0.3s both; }

@keyframes elfi-pop-in {
	from { opacity: 0; transform: scale(0) rotate(-30deg); }
	to { opacity: 1; transform: none; }
}

@keyframes elfi-light-on {
	0% { filter: brightness(0.4); }
	35% { filter: brightness(1.3); }
	50% { filter: brightness(0.8); }
	100% { filter: none; }
}

.elfi-door__leaf {
	--glass:
		linear-gradient(160deg, rgba(190, 210, 240, 0.35), transparent 35%),
		linear-gradient(200deg, transparent 55%, rgba(150, 175, 220, 0.18) 70%, transparent 80%),
		linear-gradient(#3d5fae, #23397a);
	--bars: 3;

	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 2;
	width: 50%;
	border: calc(0.5 * var(--u)) solid var(--frame);
	background:
		repeating-linear-gradient(180deg, transparent 0 calc(100% / var(--bars) - 0.25 * var(--u)), var(--frame) calc(100% / var(--bars) - 0.25 * var(--u)) calc(100% / var(--bars) + 0.25 * var(--u))),
		var(--deco, linear-gradient(transparent, transparent)),
		var(--glass);
	box-shadow: inset 0 0 0 calc(0.2 * var(--u)) rgba(0, 0, 0, 0.3);
	transition: transform 1s cubic-bezier(0.25, 1.25, 0.45, 1);
}

.elfi-door__leaf--l { --deco: var(--deco-l, linear-gradient(transparent, transparent)); }
.elfi-door__leaf--r { --deco: var(--deco-r, linear-gradient(transparent, transparent)); }
.elfi-door__leaf--l { left: 0; border-radius: var(--r); border-top-right-radius: 0; border-bottom-right-radius: 0; transform-origin: 0 50%; }
.elfi-door__leaf--r { right: 0; border-radius: var(--r); border-top-left-radius: 0; border-bottom-left-radius: 0; transform-origin: 100% 50%; }
.elfi-win--oculus .elfi-door__leaf--l { border-radius: 100% 0 0 100% / 50% 0 0 50%; }
.elfi-win--oculus .elfi-door__leaf--r { border-radius: 0 100% 100% 0 / 0 50% 50% 0; }
.elfi-win--oculus .elfi-door__btn { overflow: hidden; }
.elfi-win--oculus .elfi-door__sill { display: none; }
.elfi-win--grid .elfi-door__leaf { --bars: 4; }
.elfi-win--oculus .elfi-door__leaf { --bars: 2; }
.elfi-win--door .elfi-door__leaf { --bars: 4; }

/* Portone: pannelli in legno */
.elfi-win--door-main .elfi-door__leaf {
	background:
		linear-gradient(transparent 38%, rgba(0, 0, 0, 0.25) 38% 39.5%, transparent 39.5%),
		linear-gradient(90deg, rgba(0, 0, 0, 0.25), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.25)),
		url('images/tex-stucco.webp') 0 0 / calc(20 * var(--u)) auto,
		#c8323a;
	background-blend-mode: normal, normal, multiply, normal;
}

/* Finestre apribili: luce calda di lampada dietro i vetri */
.elfi-door.is-available .elfi-door__leaf {
	--glass:
		linear-gradient(160deg, rgba(255, 255, 255, 0.3), transparent 35%),
		radial-gradient(circle at 50% 35%, rgba(255, 238, 190, 0.96), rgba(246, 186, 90, 0.92) 55%, rgba(190, 105, 35, 0.92));
}

.elfi-door.is-available .elfi-door__btn {
	box-shadow:
		inset 0 0 0 calc(0.25 * var(--u)) rgba(0, 0, 0, 0.25),
		0 0 0 calc(0.25 * var(--u)) var(--frame-dark),
		calc(0.6 * var(--u)) calc(1 * var(--u)) calc(1.6 * var(--u)) rgba(0, 0, 0, 0.5),
		0 0 calc(6 * var(--u)) calc(1 * var(--u)) rgba(255, 180, 80, 0.45);
}

/* Ante aperte: vetro dal lato esterno, freddo e riflettente */
.elfi-door.is-open .elfi-door__leaf {
	--glass: linear-gradient(160deg, #dfe8f2, #9fb2c6 55%, #c6d3e0);
	box-shadow: inset 0 0 0 calc(0.2 * var(--u)) rgba(0, 0, 0, 0.25), 0 calc(0.8 * var(--u)) calc(1.2 * var(--u)) rgba(0, 0, 0, 0.35);
}

.elfi-door.is-open .elfi-door__leaf--l { transform: rotateY(-118deg); }
.elfi-door.is-open .elfi-door__leaf--r { transform: rotateY(118deg); }

@media (hover: hover) {
	.elfi-door.is-available:not(.is-open) .elfi-door__btn:hover .elfi-door__leaf--l { transform: rotateY(-22deg); }
	.elfi-door.is-available:not(.is-open) .elfi-door__btn:hover .elfi-door__leaf--r { transform: rotateY(22deg); }
}

.elfi-door__lock {
	position: absolute;
	right: calc(0.5 * var(--u));
	bottom: calc(0.5 * var(--u));
	z-index: 3;
	display: none;
	width: calc(3.4 * var(--u));
	height: calc(3.4 * var(--u));
	filter: drop-shadow(0 calc(0.2 * var(--u)) calc(0.3 * var(--u)) rgba(0, 0, 0, 0.45));
	transform-origin: 50% 10%;
}

.elfi-door__shackle {
	fill: none;
	stroke: #e9dcc3;
	stroke-width: 2.4;
	stroke-linecap: round;
}

.elfi-door__lockbody {
	fill: #e2b54a;
	stroke: #9a7426;
	stroke-width: 1.2;
}

.elfi-door__keyhole {
	fill: #6b4c12;
}

.elfi-door__keyline {
	stroke: #6b4c12;
	stroke-width: 1.4;
	stroke-linecap: round;
}

@media (hover: hover) {
	.elfi-door.is-locked .elfi-door__btn:hover .elfi-door__lock {
		animation: elfi-lock-swing 0.8s ease-in-out;
	}
}

@keyframes elfi-lock-swing {
	0%, 100% { transform: rotate(0); }
	25% { transform: rotate(14deg); }
	50% { transform: rotate(-10deg); }
	75% { transform: rotate(5deg); }
}

.elfi-door.is-locked .elfi-door__lock { display: block; }
.elfi-door.is-open .elfi-door__lock { display: none; }

/* Davanzale in pietra con neve */
.elfi-door__sill {
	position: relative;
	z-index: 2;
	width: calc(var(--w) + 4 * var(--u));
	height: calc(1.6 * var(--u));
	margin-top: calc(-0.4 * var(--u));
	border-radius: calc(0.3 * var(--u));
	background: linear-gradient(rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.3)), url('images/tex-stucco.webp') 0 0 / calc(20 * var(--u)) auto, #d8ccbc;
	box-shadow: 0 calc(0.6 * var(--u)) calc(1 * var(--u)) rgba(0, 0, 0, 0.45);
}

.elfi-door__sill::before {
	content: '';
	position: absolute;
	left: 5%;
	right: 5%;
	bottom: calc(1.2 * var(--u));
	height: calc(1.6 * var(--u));
	background:
		linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 35%, rgba(140, 165, 210, 0.45)), linear-gradient(rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.8)), url('images/tex-snow.webp') 0 0 / calc(16 * var(--u)) auto, #f4f7fb;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 60 L0 24.0 Q0 18.0 8 18.0 Q54.0 11.8 100.0 18.0 Q146.0 18.0 192.0 18.0 Q200 18.0 200 24.0 L200 60 L155.0 60 L150.0 69.3 L145.0 60 L55.0 60 L50.0 75.0 L45.0 60 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 60 L0 24.0 Q0 18.0 8 18.0 Q54.0 11.8 100.0 18.0 Q146.0 18.0 192.0 18.0 Q200 18.0 200 24.0 L200 60 L155.0 60 L150.0 69.3 L145.0 60 L55.0 60 L50.0 75.0 L45.0 60 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}

.elfi-win--door .elfi-door__sill,
.elfi-win--door-main .elfi-door__sill {
	width: calc(var(--w) + 5 * var(--u));
	height: calc(1.4 * var(--u));
}

.elfi-win--door .elfi-door__sill::before,
.elfi-win--door-main .elfi-door__sill::before { display: none; }

/* Timpano e cornicione in pietra */
.elfi-win__pediment {
	position: relative;
	z-index: 2;
	width: calc(var(--w) + 5 * var(--u));
	height: calc(4.4 * var(--u));
	margin-top: calc(5 * var(--u));
	margin-bottom: calc(-0.2 * var(--u));
	background: linear-gradient(rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.3)), url('images/tex-stucco.webp') 0 0 / calc(20 * var(--u)) auto, #d8ccbc;
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.elfi-win__cornice {
	position: relative;
	z-index: 2;
	width: calc(var(--w) + 4.5 * var(--u));
	height: calc(2 * var(--u));
	margin-bottom: calc(0.4 * var(--u));
	border-radius: calc(0.3 * var(--u));
	background: linear-gradient(rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.3)), url('images/tex-stucco.webp') 0 0 / calc(20 * var(--u)) auto, #d8ccbc;
	box-shadow: 0 calc(0.6 * var(--u)) calc(0.8 * var(--u)) rgba(0, 0, 0, 0.4);
}

.elfi-win__cornice::before {
	content: '';
	position: absolute;
	left: 4%;
	right: 4%;
	top: calc(-1.2 * var(--u));
	height: calc(1.6 * var(--u));
	background:
		linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 35%, rgba(140, 165, 210, 0.45)), linear-gradient(rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.8)), url('images/tex-snow.webp') 0 0 / calc(16 * var(--u)) auto, #f4f7fb;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60 L0 24.0 Q0 18.0 8 18.0 Q54.0 11.4 100.0 18.0 Q146.0 18.0 192.0 18.0 Q200 18.0 200 24.0 L200 60 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60 L0 24.0 Q0 18.0 8 18.0 Q54.0 11.4 100.0 18.0 Q146.0 18.0 192.0 18.0 Q200 18.0 200 24.0 L200 60 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}

.elfi-win__bow,
.elfi-win__bells {
	position: relative;
	z-index: 4;
	width: calc(7 * var(--u));
	height: auto;
	margin-bottom: calc(-3 * var(--u));
	filter: drop-shadow(0 calc(0.4 * var(--u)) calc(0.5 * var(--u)) rgba(0, 0, 0, 0.45));
}

.elfi-win__bells {
	width: calc(8 * var(--u));
	margin-bottom: calc(-2.4 * var(--u));
}

/* Balconcino in ferro battuto */
.elfi-win__balcony {
	position: relative;
	z-index: 3;
	width: calc(var(--w) + 8 * var(--u));
	height: calc(5.4 * var(--u));
	margin-top: calc(-3.6 * var(--u));
	border-top: calc(0.6 * var(--u)) solid #1d1a1a;
	background:
		repeating-linear-gradient(90deg, #1d1a1a 0 calc(0.45 * var(--u)), transparent calc(0.45 * var(--u)) calc(1.7 * var(--u))),
		linear-gradient(transparent calc(100% - 1.4 * var(--u)), #cfc2b1 calc(100% - 1.4 * var(--u)));
	filter: drop-shadow(0 calc(0.6 * var(--u)) calc(0.6 * var(--u)) rgba(0, 0, 0, 0.45));
}

.elfi-win__balcony::before {
	content: '';
	position: absolute;
	left: calc(-1 * var(--u));
	right: calc(-1 * var(--u));
	bottom: calc(-0.6 * var(--u));
	height: calc(1.4 * var(--u));
	background:
		linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 35%, rgba(140, 165, 210, 0.45)), linear-gradient(rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.8)), url('images/tex-snow.webp') 0 0 / calc(16 * var(--u)) auto, #f4f7fb;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60 L0 24.0 Q0 18.0 8 18.0 Q54.0 11.4 100.0 18.0 Q146.0 18.0 192.0 18.0 Q200 18.0 200 24.0 L200 60 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60 L0 24.0 Q0 18.0 8 18.0 Q54.0 11.4 100.0 18.0 Q146.0 18.0 192.0 18.0 Q200 18.0 200 24.0 L200 60 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}

/* Ghirlande */
.elfi-door.has-garland .elfi-win__balcony::after,
.elfi-win--door-main.has-garland .elfi-door__btn::after {
	content: '';
	position: absolute;
	left: -2%;
	right: -2%;
	top: calc(-1.2 * var(--u));
	height: calc(1.8 * var(--u));
	border-radius: calc(0.8 * var(--u));
	background:
		radial-gradient(circle, #e23a4e 0 calc(0.38 * var(--u)), transparent calc(0.45 * var(--u))) calc(0.8 * var(--u)) 50% / calc(3.2 * var(--u)) 100% repeat-x,
		radial-gradient(ellipse at 50% 40%, #2c7a42 0 50%, #1a4f2a 68%, transparent 72%) 0 0 / calc(1.4 * var(--u)) 100% repeat-x;
}

.elfi-win--door-main.has-garland .elfi-door__btn::after {
	top: calc(-2 * var(--u));
	left: 6%;
	right: 6%;
	z-index: 3;
	border-radius: 50% 50% 0 0;
}

.elfi-win__garland {
	position: relative;
	z-index: 4;
	width: calc(var(--w) + 4 * var(--u));
	height: calc(2.4 * var(--u));
	margin-bottom: calc(-1.2 * var(--u));
	border-radius: 0 0 50% 50% / 0 0 100% 100%;
	background:
		radial-gradient(circle, #e23a4e 0 calc(0.4 * var(--u)), transparent calc(0.5 * var(--u))) var(--u) 60% / calc(3.4 * var(--u)) 100% repeat-x,
		radial-gradient(ellipse at 50% 30%, #2c7a42 0 50%, #1a4f2a 68%, transparent 72%) 0 0 / calc(1.5 * var(--u)) 100% repeat-x;
	filter: drop-shadow(0 calc(0.4 * var(--u)) calc(0.4 * var(--u)) rgba(0, 0, 0, 0.35));
}

/* Tende, candela: disegnate sulle ante (si aprono con loro) */
.elfi-door {
	--curt-l: linear-gradient(transparent, transparent);
	--curt-r: linear-gradient(transparent, transparent);
	--cand: linear-gradient(transparent, transparent);
	--deco-l: var(--curt-l);
	--deco-r: var(--cand), var(--curt-r);
	--shutter: #3d8a55;
	--shutter-dark: #245c35;
}

.elfi-door.has-curtains { --curtain: #c8323a; --curtain-dark: #8e1d27; }
.elfi-door.has-curtains-cream { --curtain: #f4e8cf; --curtain-dark: #cbb68a; }

.elfi-door.has-curtains,
.elfi-door.has-curtains-cream {
	--curt-l:
		linear-gradient(var(--curtain-dark), var(--curtain)) 0 0 / 100% 13% no-repeat,
		radial-gradient(ellipse 80% 100% at 0 0, var(--curtain) 0 72%, var(--curtain-dark) 95%, transparent 100%) 0 0 / 100% 92% no-repeat;
	--curt-r:
		linear-gradient(var(--curtain-dark), var(--curtain)) 0 0 / 100% 13% no-repeat,
		radial-gradient(ellipse 80% 100% at 100% 0, var(--curtain) 0 72%, var(--curtain-dark) 95%, transparent 100%) 0 0 / 100% 92% no-repeat;
}

.elfi-door.has-candle {
	--cand:
		radial-gradient(ellipse 6% 9% at 30% 64%, #fffbe6 0 35%, #ffb84a 75%, transparent 100%),
		radial-gradient(circle at 30% 62%, rgba(255, 210, 120, 0.7), transparent 32%),
		linear-gradient(90deg, #e8dcc4, #fffaf0 40%, #d6c6a6) 30% 100% / 22% 28% no-repeat,
		linear-gradient(#c9a24a, #c9a24a) 30% 100% / 40% 5% no-repeat;
}

/* Persiane aperte ai lati */
.elfi-win--blue { --shutter: #ecd9ae; --shutter-dark: #b59a5f; }

.elfi-win__shutter {
	position: absolute;
	top: calc(-0.2 * var(--u));
	bottom: calc(-0.2 * var(--u));
	z-index: 0;
	width: calc(var(--w) * 0.4);
	border: calc(0.4 * var(--u)) solid var(--shutter-dark);
	border-radius: calc(0.3 * var(--u));
	background:
		linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 30%, rgba(0, 0, 0, 0.15)),
		repeating-linear-gradient(180deg, var(--shutter) 0 calc(1 * var(--u)), var(--shutter-dark) calc(1 * var(--u)) calc(1.3 * var(--u)));
	box-shadow: calc(0.4 * var(--u)) calc(0.6 * var(--u)) calc(1 * var(--u)) rgba(0, 0, 0, 0.4);
}

.elfi-win__shutter--l { right: calc(100% + 0.3 * var(--u)); }
.elfi-win__shutter--r { left: calc(100% + 0.3 * var(--u)); }

/* Corona appesa in cima alla finestra */
.elfi-win__wreath {
	position: absolute;
	left: 50%;
	top: calc(-2.6 * var(--u));
	z-index: 4;
	width: calc(7 * var(--u));
	height: auto;
	transform: translateX(-50%);
	filter: drop-shadow(0 calc(0.4 * var(--u)) calc(0.5 * var(--u)) rgba(0, 0, 0, 0.45));
	pointer-events: none;
}

.elfi-win--door .elfi-win__wreath {
	top: calc(3 * var(--u));
	width: calc(7.5 * var(--u));
}

/* Stella di carta appesa dietro il vetro */
.elfi-win__star {
	position: absolute;
	left: 68%;
	top: calc(1 * var(--u));
	z-index: 3;
	width: calc(4.4 * var(--u));
	height: auto;
	transform: translateX(-50%);
	transform-origin: 50% 0;
	filter: drop-shadow(0 0 calc(1 * var(--u)) rgba(255, 220, 120, 0.7));
	animation: elfi-star-swing 4s ease-in-out infinite;
	pointer-events: none;
}

@keyframes elfi-star-swing {
	0%, 100% { transform: translateX(-50%) rotate(-5deg); }
	50% { transform: translateX(-50%) rotate(5deg); }
}

/* Fioriera con stelle di Natale al posto del davanzale */
.elfi-win__planter {
	position: relative;
	z-index: 3;
	display: block;
	width: calc(var(--w) + 3 * var(--u));
	height: calc(4.2 * var(--u));
	margin-top: calc(-2.4 * var(--u));
	filter: drop-shadow(0 calc(0.5 * var(--u)) calc(0.6 * var(--u)) rgba(0, 0, 0, 0.45));
}

.elfi-win__planter svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* Arco in pietra con neve sopra le finestre ad arco della mansarda */
.elfi-win__hood {
	position: absolute;
	left: calc(-2 * var(--u));
	right: calc(-2 * var(--u));
	top: calc(-2.2 * var(--u));
	z-index: 0;
	width: calc(100% + 4 * var(--u));
	height: calc(12.7 * var(--u));
	filter: drop-shadow(0 calc(0.5 * var(--u)) calc(0.6 * var(--u)) rgba(0, 0, 0, 0.4));
	pointer-events: none;
}

/* Neve sopra i telai dritti (finestre senza cornicione o timpano) */
.elfi-win--rect:not(.has-pediment):not(.has-cornice) .elfi-win__box::before,
.elfi-win--grid:not(.has-pediment):not(.has-cornice) .elfi-win__box::before,
.elfi-win--door .elfi-win__box::before {
	content: '';
	position: absolute;
	left: calc(-0.6 * var(--u));
	right: calc(-0.6 * var(--u));
	top: calc(-1.1 * var(--u));
	z-index: 5;
	height: calc(1.6 * var(--u));
	border-radius: calc(1 * var(--u)) calc(1 * var(--u)) calc(0.3 * var(--u)) calc(0.3 * var(--u));
	background: linear-gradient(#ffffff, #eaf1f9 70%, #c9d8ea);
	box-shadow: 0 calc(0.2 * var(--u)) calc(0.4 * var(--u)) rgba(30, 50, 90, 0.25);
	pointer-events: none;
}

/* Lucine calde attorno al telaio, che brillano piano */
.elfi-door.has-lights .elfi-win__box::after {
	content: '';
	position: absolute;
	inset: calc(-1.6 * var(--u));
	z-index: 2;
	border: calc(1 * var(--u)) dotted #ffe08a;
	border-radius: var(--r);
	filter: drop-shadow(0 0 calc(0.6 * var(--u)) rgba(255, 200, 90, 0.95));
	pointer-events: none;
	animation: elfi-win-lights 2.2s ease-in-out infinite;
	animation-delay: calc(var(--i) * -0.37s);
}

.elfi-win--door.has-lights .elfi-win__box::after,
.elfi-win--door-main.has-lights .elfi-win__box::after {
	bottom: 0;
}

@keyframes elfi-win-lights {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.55; }
}

/* Ghiaccioli sotto il davanzale */
.elfi-door.has-icicles .elfi-door__sill::after {
	content: '';
	position: absolute;
	left: 6%;
	right: 6%;
	top: 100%;
	height: calc(2.4 * var(--u));
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='1' stop-color='%23cfe3f7' stop-opacity='.7'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 0h40v2l-3 0-1.5 9L34 2h-5l-2 16-2-16h-5l-1.5 7L17 2h-6l-2 12L7 2H3L1.5 7 0 2z' fill='url(%23g)'/%3E%3C/svg%3E") 0 0 / calc(5 * var(--u)) 100% repeat-x;
	filter: drop-shadow(0 calc(0.2 * var(--u)) calc(0.2 * var(--u)) rgba(30, 60, 110, 0.35));
}

/* Rametto di agrifoglio sull'angolo in alto a destra */
.elfi-win__holly {
	position: absolute;
	right: calc(-3.4 * var(--u));
	top: calc(-3 * var(--u));
	z-index: 6;
	width: calc(8.5 * var(--u));
	height: auto;
	transform: rotate(18deg);
	filter: drop-shadow(0 calc(0.3 * var(--u)) calc(0.4 * var(--u)) rgba(0, 0, 0, 0.4));
	pointer-events: none;
}

/* Finestra di oggi: le ante bussano finché non viene aperta */
.elfi-door.is-today:not(.is-open) .elfi-door__leaf--l { animation: elfi-knock-l 2.6s ease-in-out infinite; }
.elfi-door.is-today:not(.is-open) .elfi-door__leaf--r { animation: elfi-knock-r 2.6s ease-in-out infinite; }

@keyframes elfi-knock-l {
	0%, 70%, 100% { transform: none; }
	78% { transform: rotateY(-22deg); }
	86% { transform: rotateY(-6deg); }
}

@keyframes elfi-knock-r {
	0%, 70%, 100% { transform: none; }
	78% { transform: rotateY(22deg); }
	86% { transform: rotateY(6deg); }
}

.elfi-door.is-shaking .elfi-door__leaf--l { animation: elfi-rattle 0.5s ease; }
.elfi-door.is-shaking .elfi-door__leaf--r { animation: elfi-rattle-r 0.5s ease; }
.elfi-door.is-shaking .elfi-door__lock { animation: elfi-lock 0.5s ease; }

@keyframes elfi-rattle {
	0%, 100% { transform: none; }
	25% { transform: rotateY(-10deg); }
	50% { transform: rotateY(3deg); }
	75% { transform: rotateY(-6deg); }
}

@keyframes elfi-rattle-r {
	0%, 100% { transform: none; }
	25% { transform: rotateY(10deg); }
	50% { transform: rotateY(-3deg); }
	75% { transform: rotateY(6deg); }
}

@keyframes elfi-lock {
	0%, 100% { transform: rotate(0); }
	25% { transform: rotate(-20deg); }
	50% { transform: rotate(16deg); }
	75% { transform: rotate(-10deg); }
}

/* Ingresso a cascata, dall'alto verso il basso (backwards: a fine animazione non resta un transform) */
.elfi-cal.is-in .elfi-door {
	animation: elfi-door-in 0.6s var(--elfi-bounce) backwards;
	animation-delay: calc(var(--i) * 30ms + 200ms);
}

@keyframes elfi-door-in {
	from { opacity: 0; transform: translateY(calc(3 * var(--u))) scale(0.8); }
	to { opacity: 1; transform: none; }
}

/* Abeti natalizi ai lati, un po' dentro la neve: due davanti, due più indietro.
 * Stanno sopra la neve, così le punte dei rami restano intere.
 * Nell'immagine il tronco finisce al 94% dell'altezza (sotto c'è spazio trasparente). */
.elfi-tree {
	--th: clamp(220px, 21vw, 440px);
	--lift: 6px;

	position: absolute;
	bottom: calc(var(--lift) - var(--th) * 0.06);
	z-index: 6;
	width: auto;
	height: var(--th);
	pointer-events: none;
	filter: drop-shadow(0 6px 6px rgba(20, 40, 90, 0.35));
}

@media (min-width: 1300px) {
	.elfi-tree { --th: clamp(260px, 28vw, 440px); }
}

@media (max-width: 1299px) {
	.elfi-tree--bl,
	.elfi-tree--br { display: none; }
}

.elfi-tree--l { right: calc(50% + var(--hw) / 2 - 10px); }
.elfi-tree--r { left: calc(50% + var(--hw) / 2 - 10px); }

.elfi-tree--bl,
.elfi-tree--br {
	--th: clamp(190px, 21vw, 320px);
	--lift: 16px;

	z-index: 5;
	filter: brightness(0.85) saturate(0.9) blur(0.6px);
}

.elfi-tree--bl { right: calc(50% + var(--hw) / 2 + clamp(70px, 7vw, 130px)); transform: scaleX(-1); }
.elfi-tree--br { left: calc(50% + var(--hw) / 2 + clamp(70px, 7vw, 130px)); transform: scaleX(-1); }

/* Pacchi regalo ai piedi degli abeti: stessa ancora e stessi breakpoint degli alberi (--th, --lift). */
.elfi-packs {
	--th: clamp(220px, 21vw, 440px);
	--lift: 6px;
	--sink: 12px; /* quanto i pacchi stanno sotto il bordo superiore della neve */

	position: absolute;
	bottom: calc(var(--lift) - var(--th) * 0.04 - var(--sink));
	z-index: 7;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: calc(var(--th) * 0.634);
	pointer-events: none;
}

@media (min-width: 1300px) {
	.elfi-packs { --th: clamp(260px, 28vw, 440px); }
}

.elfi-packs--l { right: calc(50% + var(--hw) / 2 - 10px); }
.elfi-packs--r { left: calc(50% + var(--hw) / 2 - 10px); }

.elfi-packs--bl,
.elfi-packs--br {
	--th: clamp(190px, 21vw, 320px);
	--lift: 16px;
	--sink: 24px;

	z-index: 7;
	filter: brightness(0.9) saturate(0.95);
}

/* Gruppi esterni: spostati verso il bordo, fuori dall'ingombro dei pacchi degli abeti interni, e come loro davanti ai rami. */
.elfi-packs--bl { right: calc(50% + var(--hw) / 2 + clamp(70px, 7vw, 130px) + clamp(20px, 2.4vw, 60px)); }
.elfi-packs--br { left: calc(50% + var(--hw) / 2 + clamp(70px, 7vw, 130px) + clamp(20px, 2.4vw, 60px)); }

.elfi-pack {
	position: relative;
	display: block;
	width: calc(var(--th) * 0.176 * var(--s));
	height: auto;
	margin: 0 -14% 0 0;
	overflow: visible;
	transform: translateY(calc(var(--th) * var(--d))) rotate(var(--a));
	transform-origin: 50% 90%;
}

.elfi-pack:last-child { margin-right: 0; }

/* Posizione libera (gruppi di sinistra): centro in --x della larghezza del gruppo, quota --y in frazioni di --th. */
.elfi-pack--free {
	position: absolute;
	bottom: calc(var(--th) * var(--y));
	left: calc(var(--x) * 100%);
	margin: 0;
	translate: -50% 0;
}

/* Pacco impilato: appoggia sul coperchio di quello sotto, quindi niente ombra proiettata a terra. */
.elfi-pack--top .elfi-pack__cast { display: none; }

@media (max-width: 1299px) {
	.elfi-packs--bl,
	.elfi-packs--br { display: none; }
}

@media (max-width: 820px) {
	.elfi-packs { display: none; }
}

/* Neve a terra */
.elfi-ground {
	position: relative;
	z-index: 4;
	margin: -18px calc(clamp(26px, 5vw, 56px) * -1) 0;
	padding: 40px clamp(26px, 5vw, 56px) clamp(26px, 4vw, 44px);
	background:
		radial-gradient(ellipse 45% 40px at 50% 0, rgba(70, 85, 120, 0.35), transparent 100%),
		linear-gradient(rgba(255, 255, 255, 0.2), rgba(190, 205, 225, 0.45)),
		linear-gradient(rgba(255, 255, 255, 0.8), rgba(248, 251, 255, 0.8)), url('images/tex-snow.webp') 0 0 / 260px auto,
		#eef3f8;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 120 L0 36.0 Q0 30.0 8 30.0 Q106.7 22.5 205.3 30.0 Q304.0 30.0 402.7 30.0 Q501.3 23.7 600.0 30.0 Q698.7 30.0 797.3 30.0 Q896.0 24.2 994.7 30.0 Q1093.3 30.0 1192.0 30.0 Q1200 30.0 1200 36.0 L1200 120 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 70px no-repeat, linear-gradient(#000, #000) 0 60px / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0 120 L0 36.0 Q0 30.0 8 30.0 Q106.7 22.5 205.3 30.0 Q304.0 30.0 402.7 30.0 Q501.3 23.7 600.0 30.0 Q698.7 30.0 797.3 30.0 Q896.0 24.2 994.7 30.0 Q1093.3 30.0 1192.0 30.0 Q1200 30.0 1200 36.0 L1200 120 Z' fill='%23000'/%3E%3C/svg%3E") 0 0 / 100% 70px no-repeat, linear-gradient(#000, #000) 0 60px / 100% 100% no-repeat;
	filter: drop-shadow(0 -6px 14px rgba(20, 40, 90, 0.25));
}

.elfi-cal .elfi-cal__hint {
	position: relative;
	z-index: 1;
	margin: 0 !important;
	color: #6b1a22;
}

/* Desktop: card a tutta larghezza, casa con 4 finestre in mansarda e 4 piani da 5 */
@media (min-width: 1024px) {
	.elfi-cal {
		width: 100vw;
		margin-left: calc(50% - 50vw);
		border-radius: 0;
		padding-left: max(56px, calc((100vw - 1120px) / 2 + 56px));
		padding-right: max(56px, calc((100vw - 1120px) / 2 + 56px));
	}

	.elfi-ground {
		margin-left: calc(-1 * max(56px, calc((100vw - 1120px) / 2 + 56px)));
		margin-right: calc(-1 * max(56px, calc((100vw - 1120px) / 2 + 56px)));
	}

	.elfi-town {
		--hw: min(100% - 200px, 780px);
	}

	.elfi-house {
		--u: 0.62cqw;
	}

	.elfi-house__mansard {
		left: 8%;
		right: 8%;
	}

	.elfi-doors {
		grid-template-columns: repeat(20, 1fr);
		grid-template-rows: repeat(4, calc(31 * var(--u))) calc(38 * var(--u));
		padding-left: calc(5 * var(--u));
		padding-right: calc(5 * var(--u));
	}

	.elfi-door {
		grid-column: var(--c5) / span 4;
		grid-row: var(--r5);
	}

	/* Le correzioni della mansarda a 3 colonne non servono */
	.elfi-door.is-row-1.is-col-1,
	.elfi-door.is-row-1.is-col-3 {
		left: 0;
	}

	.elfi-door.is-drow-1 {
		padding-bottom: calc(4 * var(--u));
	}

	.elfi-door:not(.is-drow-1) {
		padding-bottom: calc(3 * var(--u));
	}

	.elfi-win--door,
	.elfi-win--door-main {
		padding-bottom: 0 !important;
	}

}

@media (max-width: 820px) {
	.elfi-tree--bl,
	.elfi-tree--br {
		display: none;
	}

	.elfi-tree {
		display: none;
	}
}

/* Popup con lo scherzetto del giorno: al centro su desktop, dal basso su mobile */
.elfi-letter {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 9990;
	display: flex;
	gap: 26px;
	align-items: center;
	width: min(600px, calc(100% - 48px));
	padding: 34px 40px;
	border: 3px solid var(--elfi-gold);
	border-radius: 28px;
	color: var(--elfi-cream);
	background:
		radial-gradient(circle, rgba(255, 255, 255, 0.08) 1.5px, transparent 2px) 0 0 / 40px 36px,
		var(--elfi-pine);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, -46%) scale(0.85) rotate(-2deg);
	transition: opacity 0.25s ease, transform 0.5s var(--elfi-bounce), visibility 0.5s;
}

.elfi-letter.is-open {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, -50%);
}

.elfi-letter__close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	color: var(--elfi-cream);
	background: transparent;
	font-size: 2.2rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.3s var(--elfi-bounce);
}

.elfi-letter__close:hover {
	background: rgba(255, 255, 255, 0.12);
	transform: rotate(90deg);
}

.elfi-letter-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9989;
	background: rgba(10, 25, 14, 0.6);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.elfi-letter-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}

.elfi-letter__media {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 110px;
	height: 140px;
}

/* L'elfo fluttua verso l'alto: lo spazio sopra evita che il cappello venga tagliato */
.elfi-letter__media svg {
	width: 60px;
	height: 104px;
	margin-top: 12px;
	overflow: visible;
	animation: elfi-float 3s ease-in-out infinite;
}

.elfi-letter__media img {
	width: 100%;
	height: 100%;
	border-radius: 16px;
	object-fit: cover;
}

/* Lila o Pip (foto senza sfondo): interi, fluttuano */
.elfi-letter__media img.is-elf {
	border-radius: 0;
	object-fit: contain;
	object-position: 50% 100%;
	animation: elfi-float 3s ease-in-out infinite;
}

.elfi-letter__day {
	margin: 0 0 8px !important;
	padding-right: 36px;
	color: var(--elfi-gold-light);
	font-size: 1.5rem;
	font-weight: 400;
	font-family: var(--elfi-display);
	letter-spacing: 0.04em;
	line-height: 1;
	text-transform: uppercase;
}

.elfi-letter__text p {
	margin: 0 0 0.5em !important;
}

.elfi-letter__text p:last-child {
	margin-bottom: 0 !important;
}

.elfi-letter__text {
	margin: 0 !important;
	font-size: 1.5rem;
	line-height: 1.35;
}

.elfi-type-caret {
	display: inline-block;
	width: 2px;
	height: 1em;
	margin-left: 2px;
	vertical-align: -0.1em;
	background: var(--elfi-gold-light);
	animation: elfi-caret 0.8s steps(1) infinite;
}

@keyframes elfi-caret {
	50% { opacity: 0; }
}

/* Finale */

.elfi-finale {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: clamp(20px, 5vw, 56px);
	align-items: center;
	margin-top: 64px;
}

.elfi-finale__tree {
	position: relative;
	width: clamp(120px, 16vw, 180px);
}

.elfi-finale__tree img {
	display: block;
	width: 100%;
	height: auto;
	transform-origin: 50% 100%;
	animation: elfi-tree 5s ease-in-out infinite;
}

@keyframes elfi-tree {
	0%, 100% { transform: rotate(-1.5deg); }
	50% { transform: rotate(1.5deg); }
}

.elfi-twinkle {
	position: absolute;
	width: 14px;
	height: 14px;
	background: var(--elfi-gold-light);
	clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
	animation: elfi-twinkle-star 2.2s ease-in-out infinite;
	animation-delay: calc(var(--i) * 0.37s);
}

.elfi-twinkle:nth-child(2) { top: 18%; left: 8%; }
.elfi-twinkle:nth-child(3) { top: 36%; right: 4%; }
.elfi-twinkle:nth-child(4) { top: 58%; left: 0; }
.elfi-twinkle:nth-child(5) { top: 8%; right: 14%; }
.elfi-twinkle:nth-child(6) { top: 74%; right: 0; }
.elfi-twinkle:nth-child(7) { top: 46%; left: 30%; }

@keyframes elfi-twinkle-star {
	0%, 100% { opacity: 0; transform: scale(0.3) rotate(0); }
	50% { opacity: 1; transform: scale(1) rotate(90deg); }
}

.elfi-finale__text {
	margin: 0 0 22px !important;
	color: var(--elfi-wine);
	font-size: clamp(2rem, 4vw, 3rem);
	font-weight: 400;
	font-family: var(--elfi-display);
	line-height: 1;
	text-transform: uppercase;
}

.elfi-btn {
	position: relative;
	display: inline-block;
	overflow: hidden;
	padding: 16px 34px;
	border-radius: 999px;
	color: var(--elfi-pine);
	background: var(--elfi-gold);
	box-shadow: 0 5px 0 #8a6a22, 0 10px 20px rgba(0, 0, 0, 0.2);
	font-size: 1.25rem;
	font-weight: 400;
	font-family: var(--elfi-display);
	text-decoration: none;
	text-transform: uppercase;
	transition: transform 0.3s var(--elfi-bounce), background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.elfi-btn::after {
	content: '';
	position: absolute;
	top: 0;
	left: -60%;
	width: 40%;
	height: 100%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent);
	transform: skewX(-20deg);
	animation: elfi-btn-shine 3.2s ease-in-out infinite;
}

@keyframes elfi-btn-shine {
	0%, 60% { left: -60%; }
	100% { left: 130%; }
}

.elfi-btn:hover {
	color: var(--elfi-cream);
	background: var(--elfi-wine);
	box-shadow: 0 5px 0 #4e0f18, 0 14px 24px rgba(0, 0, 0, 0.25);
	transform: translateY(-3px) rotate(-1.5deg);
}

.elfi-btn:active {
	transform: translateY(3px);
	box-shadow: 0 2px 0 #4e0f18;
}

/* Tablet e mobile */

@media (max-width: 820px) {
	.elfi-hero__grid,
	.elfi-story,
	.elfi-rules,
	.elfi-finale {
		grid-template-columns: 1fr;
	}

	.elfi-hero__title {
		font-size: clamp(3rem, 15vw, 5rem);
	}

	.elfi-hero__lead {
		margin-bottom: 4px;
	}

	.elfi-hero__stage {
		--ew: min(100%, 320px);
		--eh: calc(min(100vw - 28px, 320px) * 0.6957);

		justify-self: center;
		margin-left: 0;
	}

	.elfi-bubble {
		top: -14%;
		right: -4px;
		max-width: 170px;
		padding: 10px 14px;
		font-size: 1.1rem;
	}


	.elfi-rule {
		grid-template-columns: 56px 1fr;
		gap: 16px;
		padding: 22px;
	}

	.elfi-rule__icon {
		width: 56px;
		height: 56px;
	}

	.elfi-finale {
		text-align: center;
	}

	.elfi-finale__tree {
		margin: 0 auto;
	}


	/* Su mobile il popup sale dal basso */
	.elfi-letter {
		top: auto;
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		width: auto;
		gap: 18px;
		padding: 22px 20px 24px;
		border-radius: 22px;
		opacity: 1;
		transform: translateY(130%);
		transition: transform 0.45s var(--elfi-bounce), visibility 0.45s;
	}

	.elfi-letter.is-open {
		transform: none;
	}

	.elfi-letter__media {
		width: 64px;
		height: 90px;
	}

	.elfi-letter__media svg {
		width: 46px;
		height: 80px;
		margin-top: 10px;
	}

	.elfi-letter__day {
		font-size: 1.25rem;
	}

	.elfi-letter__text {
		font-size: 1.15rem;
	}
}

@media (max-width: 480px) {
	.elfi-wrap {
		padding: 0 14px;
	}

	.elfi-card {
		border-radius: 22px;
	}


}

/* Movimento ridotto: niente neve, oscillazioni e rimbalzi; le finestre si aprono comunque */
@media (prefers-reduced-motion: reduce) {
	.elfi-scene *,
	.elfi-scene *::before,
	.elfi-scene *::after {
		animation: none !important;
		transition-duration: 0.01ms !important;
	}

	.elfi-in {
		opacity: 1;
		transform: none;
	}

	.elfi-snow {
		display: none;
	}
}

/* Finale: un pacco regalo con il fiocco, da cui saluta Lila */
.elfi-gift {
	position: relative;
	display: grid;
	grid-template-columns: minmax(180px, 30%) 1fr;
	align-items: center;
	margin: 110px auto 0;
	max-width: 960px;
	min-height: 240px;
	padding: 40px clamp(28px, 5vw, 64px) 40px 0;
	border-radius: 26px;
	background:
		linear-gradient(90deg, transparent calc(30% - 22px), #e8b23a calc(30% - 22px), #f3c94a calc(30% - 4px), #d9a233 calc(30% + 22px), transparent calc(30% + 22px)),
		linear-gradient(transparent 0, transparent 100%),
		radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.18), transparent 50%),
		repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 14px, transparent 14px 28px),
		linear-gradient(160deg, #e2404f, #b5192b);
	box-shadow: 0 24px 50px rgba(0, 0, 0, 0.3);
}

/* Fiocco senza ombra: sul nastro dorato sembrava una macchia */
.elfi-gift__bow {
	position: absolute;
	top: -42px;
	left: calc(30% - 60px);
	width: 120px;
	height: auto;
	transform-origin: 50% 70%;
	transition: transform 0.4s var(--elfi-bounce);
}

.elfi-gift:hover .elfi-gift__bow {
	transform: rotate(-6deg) scale(1.06);
}

.elfi-gift__elf {
	position: absolute;
	left: clamp(8px, 3vw, 40px);
	bottom: 0;
	width: clamp(150px, 20vw, 220px);
	height: auto;
	transform-origin: 50% 100%;
	animation: elfi-gift-wave 3.2s ease-in-out infinite;
}

@keyframes elfi-gift-wave {
	0%, 100% { transform: rotate(0); }
	50% { transform: rotate(-3deg); }
}

.elfi-gift__body {
	grid-column: 2;
	padding-left: clamp(28px, 4vw, 56px);
}

.elfi-gift__title {
	margin: 0 0 22px;
	color: #fff4dc;
	font-size: clamp(1.75rem, 3.4vw, 2.75rem);
	font-weight: 400;
	font-family: var(--elfi-display);
	line-height: 1;
	text-shadow: 0 3px 0 rgba(90, 10, 20, 0.35);
	text-transform: uppercase;
}

/* CTA del sito (template-parts/components/cta.php) */
.elfi-gift .btn-cta {
	margin-top: 4px;
	font-size: 1rem;
}

@media (max-width: 820px) {
	.elfi-story {
		grid-template-columns: 1fr;
	}


	.elfi-story__quote {
		padding: 24px;
	}

	.elfi-gift {
		grid-template-columns: 1fr;
		margin-top: 150px;
		padding: 150px 24px 32px;
		text-align: center;
		background:
			radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.18), transparent 50%),
			repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 14px, transparent 14px 28px),
			linear-gradient(160deg, #e2404f, #b5192b);
	}

	.elfi-gift__bow {
		left: auto;
		right: 18px;
		top: -34px;
		width: 90px;
	}

	.elfi-gift__elf {
		left: 50%;
		bottom: auto;
		top: -120px;
		width: 190px;
		margin-left: -95px;
	}

	.elfi-gift__body {
		grid-column: 1;
		padding-left: 0;
	}

	.elfi-gift__cta {
		padding: 12px 12px 12px 20px;
		font-size: 1rem;
		white-space: nowrap;
	}
}

/* Footer verde come la pagina (questo CSS è caricato solo nella pagina degli elfi) */
#colophon.bg-orange {
	background-color: #173a1b;
}

/* Cursore: l'emoji 🎁 (disegnata dal sistema); sulle caselle ancora chiuse con il lucchetto */
@media (hover: hover) and (pointer: fine) {
	body {
		cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='16' y='26' font-size='26' text-anchor='middle'%3E%F0%9F%8E%81%3C/text%3E%3C/svg%3E") 16 16, auto;
	}

	body a,
	body button,
	body label,
	body summary,
	body [role='button'],
	.elfi-bulb {
		cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='16' y='26' font-size='26' text-anchor='middle' transform='rotate%28-12 16 16%29'%3E%F0%9F%8E%81%3C/text%3E%3C/svg%3E") 16 16, pointer;
	}

	.elfi-door.is-locked .elfi-door__btn {
		cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext x='14' y='24' font-size='22' text-anchor='middle' opacity='.55'%3E%F0%9F%8E%81%3C/text%3E%3Ctext x='24' y='31' font-size='13' text-anchor='middle'%3E%F0%9F%94%92%3C/text%3E%3C/svg%3E") 16 16, not-allowed;
	}
}

/* ------------------------------------------------------------------ */
/* Spazio in più nella mansarda per la targa: alza il tetto e abbassa piani e finestre */
.elfi-house {
	--roof-x: calc(16 * var(--u));
}

.elfi-house__mansard {
	height: calc(39 * var(--u) + var(--roof-x));
}

.elfi-house__body {
	top: calc(42 * var(--u) + var(--roof-x));
}

.elfi-doors {
	padding-top: calc(10 * var(--u) + var(--roof-x));
}

@media (min-width: 1024px) {
	.elfi-house {
		--roof-x: calc(7 * var(--u));
	}
}

/* Targa sul tetto, centrata sopra le finestre della mansarda, in tinta con "La casa degli elfi" */
.elfi-roofsign {
	position: absolute;
	top: calc(9 * var(--u));
	left: 50%;
	z-index: 3;
	width: 58%;
	margin: 0 !important;
	text-align: center;
	transform: translateX(-50%);
}

@media (min-width: 1024px) {
	.elfi-roofsign {
		width: 46%;
	}
}

.elfi-roofsign > span {
	position: relative;
	display: block;
	padding: 6px 12px;
	border: 3px solid #4a2614;
	border-radius: 8px;
	color: #fff1c9;
	background:
		repeating-linear-gradient(176deg, rgba(0, 0, 0, 0.08) 0 3px, transparent 3px 11px),
		linear-gradient(#8a4a26, #6b3519);
	box-shadow:
		inset 0 2px 0 rgba(255, 220, 170, 0.25),
		inset 0 -3px 0 rgba(0, 0, 0, 0.25),
		0 6px 12px rgba(0, 0, 0, 0.45);
	font-size: clamp(13px, 3.4 * var(--u), 18px);
	font-weight: 700;
	line-height: 1.2;
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
	text-wrap: balance;
}

/* Due chiodi dorati sulla targa */
.elfi-roofsign > span::after {
	content: '';
	position: absolute;
	inset: 50% 6px auto;
	height: 6px;
	margin-top: -3px;
	background:
		radial-gradient(circle, #f3d27a 0 2px, #8a6512 2.5px, transparent 3px) 0 0 / 6px 6px no-repeat,
		radial-gradient(circle, #f3d27a 0 2px, #8a6512 2.5px, transparent 3px) 100% 0 / 6px 6px no-repeat;
}


/* Spazio sopra la casa per il passaggio della slitta */
.elfi-town {
	padding-top: clamp(90px, 13vw, 170px);
}

/* Fumo dal camino: particelle disegnate da elfi.js, il vento cambia piano direzione */
.elfi-smoke {
	position: absolute;
	right: calc(-2 * var(--u));
	bottom: calc(100% - 8 * var(--u));
	width: calc(72 * var(--u));
	height: calc(56 * var(--u));
	pointer-events: none;
}

.elfi-smoke canvas {
	display: block;
	width: 100%;
	height: 100%;
}

/* Babbo Natale con slitta e renne in volo, dietro la casa */
.elfi-sleigh {
	position: absolute;
	top: 0;
	left: -60vw;
	right: -60vw;
	z-index: 1;
	height: clamp(80px, 12vw, 150px);
	pointer-events: none;
}

.elfi-sleigh__fly {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: clamp(250px, 34vw, 480px);
	opacity: 0;
	animation: elfi-sleigh 22s linear infinite;
	animation-delay: 2s;
}

/* Slitta e scia ondeggiano insieme: la scia resta attaccata alla slitta */
.elfi-sleigh__bob {
	position: relative;
	display: block;
	animation: elfi-sleigh-bob 1.6s ease-in-out infinite alternate;
}

.elfi-sleigh__bob img {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	opacity: 0.88;
}

/* Scia di polvere dorata che esce dal retro della slitta, sulla stessa linea */
.elfi-sleigh__trail {
	position: absolute;
	right: 97%;
	top: 64%;
	width: 70%;
	height: 10px;
	margin-top: -5px;
	border-radius: 10px;
	background:
		radial-gradient(circle, rgba(255, 246, 200, 0.95) 0 1.5px, transparent 2px) 0 0 / 18px 10px repeat-x,
		linear-gradient(90deg, rgba(243, 210, 122, 0), rgba(255, 228, 150, 0.85));
	filter: drop-shadow(0 0 4px rgba(255, 220, 120, 0.9));
	-webkit-mask: linear-gradient(90deg, transparent, #000 70%);
	mask: linear-gradient(90deg, transparent, #000 70%);
	animation: elfi-trail 0.6s linear infinite;
}

@keyframes elfi-trail {
	to { background-position: -18px 0, 0 0; }
}

@keyframes elfi-sleigh {
	0% { opacity: 1; transform: translate(0, 34px) rotate(-4deg); }
	45% { opacity: 1; transform: translate(calc(120vw + 480px), -14px) rotate(-4deg); }
	46%, 100% { opacity: 0; transform: translate(calc(120vw + 480px), -14px) rotate(-4deg); }
}

@keyframes elfi-sleigh-bob {
	from { transform: translateY(-5px) rotate(-1deg); }
	to { transform: translateY(6px) rotate(1deg); }
}

/* Moneta di cioccolato in 3D: due facce e dischi in mezzo per lo spessore */
.elfi-coin3d {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
}

.elfi-coin3d > i {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	backface-visibility: hidden;
}

.elfi-coin3d__face {
	background: var(--coin) 50% 50% / 100% 100% no-repeat;
	transform: translateZ(calc(var(--s, 30px) * 0.06));
}

.elfi-coin3d__face--back {
	transform: rotateY(180deg) translateZ(calc(var(--s, 30px) * 0.06));
}

.elfi-coin3d__edge {
	backface-visibility: visible !important;
	background: radial-gradient(circle, #b8892a 0 60%, #8a6214 70%, #d9a93e 100%);
}

.elfi-coin3d__edge:nth-child(2) { transform: translateZ(calc(var(--s, 30px) * 0.045)); }
.elfi-coin3d__edge:nth-child(3) { transform: translateZ(calc(var(--s, 30px) * 0.03)); }
.elfi-coin3d__edge:nth-child(4) { transform: translateZ(calc(var(--s, 30px) * 0.015)); }
.elfi-coin3d__edge:nth-child(5) { transform: translateZ(0); }
.elfi-coin3d__edge:nth-child(6) { transform: translateZ(calc(var(--s, 30px) * -0.015)); }
.elfi-coin3d__edge:nth-child(7) { transform: translateZ(calc(var(--s, 30px) * -0.03)); }
.elfi-coin3d__edge:nth-child(8) { transform: translateZ(calc(var(--s, 30px) * -0.045)); }
.elfi-coin3d__edge:nth-child(9) { transform: translateZ(calc(var(--s, 30px) * -0.055)); }
.elfi-coin3d__edge:nth-child(10) { transform: translateZ(calc(var(--s, 30px) * 0.055)); }

/* Monete che scendono sullo sfondo, prima del calendario */
.elfi-coinzone {
	position: relative;
}

.elfi-coinfall {
	position: absolute;
	top: -40px;
	/* Scende oltre la sezione: le monete spariscono dietro la card del calendario, senza vuoti */
	bottom: -160px;
	left: 50%;
	z-index: 0;
	width: 100vw;
	margin-left: -50vw;
	overflow: hidden;
	pointer-events: none;
	perspective: 700px;
}

.elfi-coinfall__coin {
	position: absolute;
	top: -60px;
	left: var(--x);
	width: var(--s);
	height: var(--s);
	transform-style: preserve-3d;
	filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.35));
	animation: elfi-coin-fall var(--t) linear infinite;
	animation-delay: var(--d);
}

.elfi-coinfall__coin .elfi-coin3d {
	animation: elfi-coin-tumble 2.6s linear infinite;
	animation-delay: var(--d);
}

@keyframes elfi-coin-fall {
	0% { top: -60px; transform: translateX(0); opacity: 0; }
	8% { opacity: 1; }
	50% { transform: translateX(22px); }
	100% { top: calc(100% + 20px); transform: translateX(-12px); opacity: 1; }
}

@keyframes elfi-coin-tumble {
	from { transform: rotateX(20deg) rotateY(0) rotateZ(0); }
	to { transform: rotateX(20deg) rotateY(360deg) rotateZ(30deg); }
}

/* Lucchetti più grandi */
.elfi-door__lock {
	width: calc(4.6 * var(--u));
	height: calc(4.6 * var(--u));
	min-width: 16px;
	min-height: 16px;
}

/* Storia: la colonna dei protagonisti (testo più lungo) è più larga, così i due testi finiscono alla stessa altezza */
@media (min-width: 821px) {
	.elfi-story {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
	}

	.elfi-story__legend p,
	.elfi-story__cast p {
		max-width: none;
	}

	.elfi-story__quote {
		grid-column: 1 / -1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.elfi-coinfall,
	.elfi-sleigh,
	.elfi-smoke {
		display: none;
	}
}

/* ------------------------------------------------------------------ */
/* Scene animate del popup (scenes.js): una per casella, legata alla marachella del giorno */
.elfi-letter.has-scene {
	flex-direction: column;
	align-items: stretch;
	gap: 14px;
}

.elfi-letter.has-scene .elfi-letter__media {
	/* Stesse proporzioni della scena (2:1): la scena riempie tutto il riquadro, senza bande ai lati */
	width: 100%;
	height: auto;
	aspect-ratio: 2 / 1;
	overflow: hidden;
	border-radius: 16px;
	background: none;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.elfi-letter.has-scene .elfi-letter__media .elfi-anim {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	overflow: visible;
	animation: none;
}

.elfi-anim [class^='ea-'],
.elfi-anim [class*=' ea-'] {
	transform-box: view-box;
}

/* Comuni */
.ea-bokeh { animation: ea-blink 2.2s ease-in-out infinite alternate; }
.ea-glowpulse { animation: ea-blink 2.6s ease-in-out infinite alternate; }
.ea-sparkles path { animation: ea-blink 1.4s ease-in-out infinite alternate; }
.ea-sparkles path:nth-child(2) { animation-delay: 0.5s; }
.ea-sparkles path:nth-child(3) { animation-delay: 1s; }
.ea-flame { animation: ea-flame 0.18s ease-in-out infinite alternate; transform-origin: 50% 100%; transform-box: fill-box !important; }
.ea-swing { animation: ea-swing 2.2s ease-in-out infinite alternate; }
.ea-swing-soft { animation: ea-swing-soft 2.8s ease-in-out infinite alternate; }
.ea-legs { animation: ea-legs 1.8s ease-in-out infinite alternate; }

/* 1 – esce dalla scarpa e la scarpa ondeggia */
.ea-peekshoe { animation: ea-peekshoe 3.2s cubic-bezier(.45,0,.2,1) infinite; }
.ea-rock { animation: ea-rock 3.2s ease-in-out infinite; }
.ea-knot { animation: ea-knot 1.6s ease-in-out infinite alternate; }
/* 2 – lampadario che dondola, l'elfo segue con un po' di ritardo, cristalli che tintinnano */
.ea-dangle { animation: ea-dangle 2.8s ease-in-out 0.35s infinite alternate; }
.ea-jingle { animation: ea-jingle 0.9s ease-in-out infinite alternate; }
/* 3 – i quaderni volano fuori dallo zaino aperto e l'elfo spunta (ea-popup serve anche al cassetto, scena 8) */
.ea-nb1 { animation: ea-nb1 3s cubic-bezier(.3,0,.3,1) infinite; }
.ea-nb2 { animation: ea-nb2 3s cubic-bezier(.3,0,.3,1) 0.2s infinite; }
.ea-popup { animation: ea-popup 3s cubic-bezier(.3,0,.3,1) infinite; }
/* 4 – il rotolo gira finché la carta non è tutta srotolata */
.ea-unroll { stroke-dasharray: 100; stroke-dashoffset: 100; animation: ea-draw 3.2s cubic-bezier(.2,.6,.3,1) 0.2s forwards; }
.ea-rollspin { animation: ea-rollspin 3.2s cubic-bezier(.2,.6,.3,1) 0.2s forwards; }
.ea-giggle { animation: ea-giggle 0.5s ease-in-out infinite alternate; }
/* 5 – calzino che dondola sul termosifone caldo */
.ea-heat path { animation: ea-heat 1.8s ease-in-out infinite; }
.ea-heat path:nth-child(2) { animation-delay: 0.9s; }
/* 6 – l'elfo solleva il cappello da sotto */
.ea-hatpop { animation: ea-hatpop 3.2s cubic-bezier(.45,0,.2,1) infinite; }
.ea-hatwobble { animation: ea-rock 3.2s ease-in-out infinite; }
/* 7 – palline scambiate */
.ea-arrows { animation: ea-blink 1.2s ease-in-out infinite alternate; }
/* 8 – il cassetto si apre e saltano fuori i calzini */
.ea-drawer { animation: ea-drawer 3s ease-in-out infinite; }
.ea-sock1 { animation: ea-sock1 3s ease-out infinite; }
.ea-sock2 { animation: ea-sock2 3s ease-out 0.15s infinite; }
/* 9 – i libri si capovolgono uno dopo l'altro */
.ea-flip { animation: ea-flip 0.7s cubic-bezier(.5,0,.3,1.4) forwards; }
/* 10 – spunta dalla tasca della giacca */
.ea-popsmall { animation: ea-popsmall 2.6s ease-in-out infinite; }
/* 11 – tenda che dondola con l'elfo attaccato, neve fuori */
.ea-sway { animation: ea-sway 3s ease-in-out infinite alternate; }
.ea-sway-big { animation: ea-sway-big 2.4s ease-in-out infinite alternate; }
.ea-snowfall circle { animation: ea-snow 3s linear infinite; }
.ea-snowfall circle:nth-child(2n) { animation-duration: 4s; animation-delay: -1.5s; }
.ea-snowfall circle:nth-child(3n) { animation-duration: 3.5s; animation-delay: -2.5s; }
/* 12 – disegnini tracciati col dito sullo specchio appannato */
.ea-fog { animation: ea-fog 4s ease-in-out infinite alternate; }
.ea-trace path { stroke-dasharray: 100; stroke-dashoffset: 100; animation: ea-draw 1.2s ease-out 0.3s forwards; }
/* 13 – lancia l'ultimo cuscino da dietro la tenda */
.ea-toss { animation: ea-toss 1.2s cubic-bezier(.3,.7,.4,1) 0.3s both; }
.ea-peek { animation: ea-peek 3s ease-in-out infinite alternate; }
/* 14 – renna sulla mensola: piccoli movimenti, naso che brilla */
.ea-tilt { animation: ea-tilt 2.6s ease-in-out infinite alternate; }
.ea-nose { animation: ea-nose 1s ease-in-out infinite alternate; }
/* 15 – coperchio che si alza, pedine che saltano, dado che rotola */
.ea-lid { animation: ea-lid 2.4s ease-in-out infinite; }
.ea-pawn1 { animation: ea-pawn 2.4s ease-out infinite; --px: -26px; }
.ea-pawn2 { animation: ea-pawn 2.4s ease-out 0.2s infinite; --px: 30px; }
.ea-pawn3 { animation: ea-pawn 2.4s ease-out 0.4s infinite; --px: 10px; }
.ea-dice { animation: ea-dice 2.4s ease-out infinite; }
/* 16 – decorazioni che cadono e rimbalzano, l'elfo incastrato che si dimena */
.ea-fall1 { animation: ea-fall 3s cubic-bezier(.5,0,1,.5) infinite; --fy: 76px; }
.ea-fall2 { animation: ea-fall 3s cubic-bezier(.5,0,1,.5) 1s infinite; --fy: 36px; }
.ea-fall3 { animation: ea-fall 3s cubic-bezier(.5,0,1,.5) 2s infinite; --fy: 56px; }
.ea-stuck { animation: ea-stuck 1.2s ease-in-out infinite; }
/* 17 – il campanello suona da solo, ogni tanto */
.ea-ring { animation: ea-ring 2.6s ease-in-out infinite; }
.ea-waves { animation: ea-waves 2.6s ease-in-out infinite; }
/* 18 – il cuscino con l'elfo dentro scivola sul divano */
.ea-slide { animation: ea-slide 3.4s ease-in-out infinite alternate; }
/* 19 – l'elfo, sepolto a metà, si muove appena nella cesta */
.ea-nest { animation: ea-nest 2.8s ease-in-out infinite; }
.ea-towel1 { animation: ea-towel1 3s cubic-bezier(.3,0,.3,1) infinite; }
.ea-towel2 { animation: ea-towel2 3s cubic-bezier(.3,0,.3,1) 0.15s infinite; }
/* 20 – posate che tremano, candela */
.ea-jiggle { animation: ea-jiggle 0.4s ease-in-out infinite alternate; }
/* 21 – pacchetto che saltella */
.ea-hop { animation: ea-hop 1.2s ease-in-out infinite; }
.ea-bow { animation: ea-bow 0.6s ease-in-out infinite alternate; }
/* 22 – lancette impazzite, pendolo */
.ea-handfast { animation: ea-hand-min 4s ease-in-out infinite; }
.ea-handslow { animation: ea-hand-hour 4s ease-in-out infinite; }
.ea-pendulum { animation: ea-pendulum 1.1s ease-in-out infinite alternate; }
/* 23 – la gobba si sposta sotto il tappeto */
.ea-rugbump { animation: ea-rugbump 4.4s ease-in-out infinite; }
.ea-rugpeek { animation: ea-rugpeek 4.4s ease-in-out infinite; }
.ea-boxpop { animation: ea-boxpop 2.8s ease-in-out infinite; }
.ea-sockin { animation: ea-sockin 1.15s cubic-bezier(.2, .75, .3, 1) forwards; }
.ea-drape { animation: ea-drape 3.4s ease-in-out infinite alternate; }
/* 24 – addormentati: respiro e zzz */
.ea-breathe { animation: ea-breathe 2.4s ease-in-out infinite alternate; }
.ea-z1, .ea-z2, .ea-z3 { opacity: 0; animation: ea-z 3s ease-out infinite; }
.ea-z2 { animation-delay: 1s; }
.ea-z3 { animation-delay: 2s; }

@keyframes ea-blink { from { opacity: 0.4; } to { opacity: 1; } }
@keyframes ea-flame { from { transform: scale(0.9, 0.85); opacity: 0.85; } to { transform: scale(1.05, 1.1); opacity: 1; } }
@keyframes ea-swing { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes ea-swing-soft { from { transform: rotate(-3.5deg); } to { transform: rotate(3.5deg); } }
@keyframes ea-legs { from { transform: rotate(-1.5deg); } to { transform: rotate(1.5deg); } }
@keyframes ea-peekshoe { 0%, 12% { transform: translateY(22px); } 38%, 70% { transform: translateY(0); } 92%, 100% { transform: translateY(22px); } }
@keyframes ea-rock { 0%, 30%, 100% { transform: rotate(0); } 36% { transform: rotate(-2.5deg); } 44% { transform: rotate(1.5deg); } 52% { transform: rotate(0); } 86% { transform: rotate(1.5deg); } 94% { transform: rotate(-1deg); } }
@keyframes ea-knot { from { transform: rotate(-6deg) scale(0.96); } to { transform: rotate(6deg) scale(1.06); } }
@keyframes ea-dangle { from { transform: rotate(-11deg); } to { transform: rotate(11deg); } }
@keyframes ea-jingle { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes ea-nb1 { 0%, 10% { transform: translate(14px, 30px) rotate(0); opacity: 0; } 15% { opacity: 1; } 45% { transform: translate(-46px, -30px) rotate(-160deg); } 75% { transform: translate(-70px, 70px) rotate(-320deg); opacity: 1; } 80%, 100% { transform: translate(-70px, 70px) rotate(-320deg); opacity: 0; } }
@keyframes ea-nb2 { 0%, 10% { transform: translate(-14px, 30px) rotate(0); opacity: 0; } 15% { opacity: 1; } 45% { transform: translate(48px, -34px) rotate(170deg); } 75% { transform: translate(74px, 70px) rotate(330deg); opacity: 1; } 80%, 100% { transform: translate(74px, 70px) rotate(330deg); opacity: 0; } }
@keyframes ea-popup { 0%, 10% { transform: translateY(30px); } 30%, 75% { transform: translateY(0); } 95%, 100% { transform: translateY(30px); } }
@keyframes ea-draw { to { stroke-dashoffset: 0; } }
@keyframes ea-rollspin { to { transform: rotate(1080deg); } }
@keyframes ea-giggle { from { transform: rotate(-1deg); } to { transform: rotate(1deg); } }
@keyframes ea-heat { 0% { opacity: 0; transform: translateY(8px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
@keyframes ea-hatpop { 0%, 12% { transform: translateY(38px); } 36%, 70% { transform: translateY(0); } 92%, 100% { transform: translateY(38px); } }
@keyframes ea-drawer { 0%, 10% { transform: translateY(0) scale(1); } 30%, 70% { transform: translateY(10px) scale(1.04); } 90%, 100% { transform: translateY(0) scale(1); } }
@keyframes ea-sock1 { 0%, 28% { transform: translate(0, 8px) rotate(0); opacity: 0; } 32% { opacity: 1; } 50% { transform: translate(-16px, -38px) rotate(-140deg); } 66% { transform: translate(-26px, 40px) rotate(-250deg); } 72% { transform: translate(-27px, 35px) rotate(-258deg); } 78%, 92% { transform: translate(-28px, 40px) rotate(-264deg); opacity: 1; } 100% { transform: translate(-28px, 40px) rotate(-264deg); opacity: 0; } }
@keyframes ea-sock2 { 0%, 28% { transform: translate(0, 8px) rotate(0); opacity: 0; } 32% { opacity: 1; } 50% { transform: translate(18px, -36px) rotate(150deg); } 66% { transform: translate(28px, 40px) rotate(260deg); } 72% { transform: translate(29px, 35px) rotate(266deg); } 78%, 92% { transform: translate(30px, 40px) rotate(270deg); opacity: 1; } 100% { transform: translate(30px, 40px) rotate(270deg); opacity: 0; } }
@keyframes ea-flip { to { transform: rotate(180deg); } }
@keyframes ea-popsmall { 0%, 15% { transform: translateY(24px); } 40%, 70% { transform: translateY(0); } 90%, 100% { transform: translateY(24px); } }
@keyframes ea-sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes ea-sway-big { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes ea-snow { from { transform: translateY(-20px); } to { transform: translateY(100px); } }
@keyframes ea-fog { from { opacity: 0.5; } to { opacity: 0.85; } }
@keyframes ea-toss { 0% { transform: translate(60px, -40px) rotate(40deg); opacity: 0; } 20% { opacity: 1; } 70% { transform: translate(0, 0) rotate(-6deg); } 85% { transform: translate(0, -8px) rotate(-3deg); } 100% { transform: translate(0, 0) rotate(-4deg); } }
@keyframes ea-peek { from { transform: rotate(4deg); } to { transform: rotate(-5deg); } }
@keyframes ea-tilt { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes ea-nose { from { filter: brightness(1); } to { filter: brightness(1.5) drop-shadow(0 0 4px #ff6b6b); } }
@keyframes ea-lid { 0%, 12% { transform: rotateX(0); } 34%, 72% { transform: perspective(480px) rotateX(52deg); } 92%, 100% { transform: rotateX(0); } }
@keyframes ea-pawn { 0%, 25% { transform: translate(0, 18px); opacity: 0; } 30% { opacity: 1; } 50% { transform: translate(calc(var(--px) * 0.6), -40px); } 70% { transform: translate(var(--px), 36px); opacity: 1; } 80%, 100% { transform: translate(var(--px), 36px); opacity: 0; } }
@keyframes ea-dice { 0%, 40% { transform: translateX(-60px) rotate(0); opacity: 0; } 45% { opacity: 1; } 80%, 100% { transform: translateX(0) rotate(360deg); opacity: 1; } }
@keyframes ea-fall { 0%, 20% { transform: translateY(0); opacity: 1; } 45% { transform: translateY(var(--fy)); } 52% { transform: translateY(calc(var(--fy) - 12px)); } 60%, 85% { transform: translateY(var(--fy)); opacity: 1; } 95%, 100% { transform: translateY(var(--fy)); opacity: 0; } }
@keyframes ea-stuck { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-4deg); } 80% { transform: rotate(4deg); } 90% { transform: rotate(-2deg); } }
@keyframes ea-ring { 0%, 50%, 100% { transform: rotate(0); } 56% { transform: rotate(-7deg); } 62% { transform: rotate(6deg); } 68% { transform: rotate(-4deg); } 74% { transform: rotate(2deg); } 82% { transform: rotate(0); } }
@keyframes ea-waves { 0%, 50%, 90%, 100% { opacity: 0; } 58%, 80% { opacity: 1; } }
@keyframes ea-slide { 0%, 10% { transform: translateX(0) rotate(0); } 50% { transform: translateX(90px) rotate(3deg); } 90%, 100% { transform: translateX(150px) rotate(0); } }
@keyframes ea-nest { 0%, 100% { transform: translateY(2.4%); } 50% { transform: translateY(0); } }
@keyframes ea-towel1 { 0%, 10% { transform: translate(0, 0) rotate(0); opacity: 1; } 36% { transform: translate(-30px, -40px) rotate(-70deg); } 58% { transform: translate(-56px, 50px) rotate(-170deg); } 64% { transform: translate(-58px, 44px) rotate(-175deg); } 70%, 90% { transform: translate(-60px, 50px) rotate(-180deg); opacity: 1; } 96% { opacity: 0; } 97% { transform: translate(0, 0); opacity: 0; } 100% { opacity: 1; } }
@keyframes ea-towel2 { 0%, 10% { transform: translate(0, 0) rotate(0); opacity: 1; } 36% { transform: translate(32px, -42px) rotate(70deg); } 58% { transform: translate(58px, 52px) rotate(170deg); } 64% { transform: translate(60px, 46px) rotate(175deg); } 70%, 90% { transform: translate(62px, 52px) rotate(180deg); opacity: 1; } 96% { opacity: 0; } 97% { transform: translate(0, 0); opacity: 0; } 100% { opacity: 1; } }
@keyframes ea-jiggle { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@keyframes ea-hop { 0%, 100% { transform: rotate(-0.4deg); } 50% { transform: rotate(0.4deg); } }
@keyframes ea-bow { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
@keyframes ea-turn { to { transform: rotate(360deg); } }
@keyframes ea-pendulum { from { transform: rotate(-16deg); } to { transform: rotate(16deg); } }
@keyframes ea-rugbump { 0% { transform: translateX(0) scaleY(1); opacity: 1; } 50% { transform: translateX(100px) scaleY(1); } 60%, 88% { transform: translateX(100px) scaleY(0.2); opacity: 1; } 94% { transform: translateX(100px) scaleY(0.2); opacity: 0; } 95% { transform: translateX(0) scaleY(1); opacity: 0; } 100% { transform: translateX(0) scaleY(1); opacity: 1; } }
@keyframes ea-rugpeek { 0%, 52% { transform: translateY(32px); } 66%, 86% { transform: translateY(0); } 96%, 100% { transform: translateY(32px); } }
@keyframes ea-boxpop { 0%, 18% { transform: translateY(9%); } 42%, 68% { transform: translateY(5%); } 88%, 100% { transform: translateY(9%); } }
@keyframes ea-sockin { 0% { transform: translateY(-16%); opacity: 0; } 22% { opacity: 1; } 70% { transform: translateY(1.2%); } 100% { transform: translateY(0); opacity: 1; } }
@keyframes ea-drape { from { transform: rotate(-1.4deg); } to { transform: rotate(1.4deg); } }
@keyframes ea-peek3 { 0%, 40% { transform: translateY(30px); } 70%, 100% { transform: translateY(0); } }
@keyframes ea-breathe { to { transform: scale(1.012, 1.03); } }
@keyframes ea-z { 0% { opacity: 0; transform: translate(0, 0) scale(0.7); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(16px, -34px) scale(1.15); } }

@media (prefers-reduced-motion: reduce) {
	.elfi-anim * {
		animation: none !important;
	}
}

/* La scena non finisce sotto la X di chiusura */
.elfi-letter.has-scene .elfi-letter__media {
	margin-top: 22px;
}

/* Finestre con la scena dentro: dietro le ante si vede la marachella animata */
.elfi-door.has-scene .elfi-door__icon {
	position: absolute;
	inset: 0;
}

.elfi-door.has-scene .elfi-door__icon .elfi-anim {
	display: block;
	width: 100%;
	height: 100%;
	opacity: 1;
	transform: none;
	filter: none;
	animation: none;
}

.elfi-door.has-scene.is-open .elfi-door__icon .elfi-anim {
	animation: elfi-scene-in 0.6s ease 0.35s both;
}

.elfi-door.has-scene .elfi-door__icon .elfi-door__still {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 30%;
}

.elfi-door.has-scene.is-open .elfi-door__icon .elfi-door__still {
	animation: elfi-scene-in 0.6s ease 0.35s both;
}

/* Finché le ante sono chiuse la scena è ferma */
.elfi-door.has-scene:not(.is-open) .elfi-anim * {
	animation-play-state: paused !important;
}

@keyframes elfi-scene-in {
	from { opacity: 0; filter: brightness(0.3); }
	to { opacity: 1; filter: none; }
}

/* ------------------------------------------------------------------ */
/* Lente d'ingrandimento: si posa sulla finestra e mostra la marachella ingrandita */
.elfi-letter-backdrop.is-lens {
	background: rgba(10, 18, 30, 0.45);
}

.elfi-lens {
	--lens: 300px;

	position: fixed;
	z-index: 9991;
	width: var(--lens);
	height: var(--lens);
	margin: calc(var(--lens) / -2) 0 0 calc(var(--lens) / -2);
	pointer-events: none;
	visibility: hidden;
}

.elfi-lens.is-open {
	visibility: visible;
	pointer-events: auto;
}

/* Lente + manico: arriva da in basso a destra e si posa sulla finestra */
.elfi-lens__tool {
	position: absolute;
	inset: 0;
	transform: translate(var(--from-x), var(--from-y)) rotate(25deg) scale(0.6);
	opacity: 0;
}

.elfi-lens.is-open .elfi-lens__tool {
	animation: elfi-lens-in 0.8s cubic-bezier(.2,.8,.25,1) forwards, elfi-lens-hover 3.2s ease-in-out 0.8s infinite alternate;
}

@keyframes elfi-lens-in {
	to { transform: none; opacity: 1; }
}

@keyframes elfi-lens-hover {
	from { transform: translate(0, 0) rotate(0); }
	to { transform: translate(4px, -5px) rotate(-1.5deg); }
}

.elfi-lens__glass {
	position: absolute;
	inset: 0;
	overflow: hidden;
	border-radius: 50%;
	background: #f7e7cf;
	box-shadow: inset 0 0 30px rgba(40, 20, 0, 0.45);
}

/* La scena parte piccola dal punto della finestra e si ingrandisce, come mettendo a fuoco */
.elfi-lens__zoom {
	position: absolute;
	inset: -6%;
	transform-origin: calc(50% + var(--focus-x)) calc(50% + var(--focus-y));
}

.elfi-lens.is-open .elfi-lens__zoom {
	animation: elfi-lens-zoom 1.1s cubic-bezier(.2,.7,.2,1) 0.25s both;
}

@keyframes elfi-lens-zoom {
	from { transform: scale(0.2); filter: blur(4px); }
	60% { filter: blur(0.5px); }
	to { transform: scale(1); filter: none; }
}

.elfi-lens__zoom .elfi-anim,
.elfi-lens__zoom .elfi-lens__video {
	display: block;
	width: 100%;
	height: 100%;
}

.elfi-lens__zoom .elfi-lens__video {
	object-fit: cover;
	object-position: center;
}

/* Riflesso sul vetro e leggera distorsione ai bordi */
.elfi-lens__shine {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background:
		radial-gradient(ellipse 40% 26% at 32% 24%, rgba(255, 255, 255, 0.55), transparent 70%),
		radial-gradient(circle at 50% 50%, transparent 62%, rgba(255, 255, 255, 0.16) 72%, rgba(0, 0, 0, 0.18) 100%);
	pointer-events: none;
}

.elfi-lens__rim {
	position: absolute;
	inset: -14px;
	border-radius: 50%;
	border: 14px solid transparent;
	background:
		linear-gradient(#f7e7cf, #f7e7cf) padding-box,
		conic-gradient(from 210deg, #fff1b8, #c9952f, #8a6214, #e8b23a, #fff1b8, #c9952f, #fff1b8) border-box;
	-webkit-mask: radial-gradient(circle closest-side, transparent calc(100% - 14px), #000 calc(100% - 13px));
	mask: radial-gradient(circle closest-side, transparent calc(100% - 14px), #000 calc(100% - 13px));
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.elfi-lens__handle {
	position: absolute;
	left: 83%;
	top: 83%;
	width: 26px;
	height: calc(var(--lens) * 0.5);
	border-radius: 13px;
	background: linear-gradient(90deg, #5e2f15, #a8683a 40%, #6e3c1c);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(0, 0, 0, 0.15);
	transform: rotate(-45deg);
	transform-origin: 50% 0;
	z-index: -1;
}

.elfi-lens__handle::before {
	content: '';
	position: absolute;
	left: -4px;
	right: -4px;
	top: -6px;
	height: 26px;
	border-radius: 6px;
	background: linear-gradient(90deg, #8a6214, #fff1b8 45%, #c9952f);
}

/* Cartellino con giorno e frase, sotto la lente */
.elfi-lens__card {
	position: absolute;
	left: 38%;
	top: calc(100% + 30px);
	width: min(380px, calc(100vw - 32px));
	padding: 14px 20px;
	border: 3px solid var(--elfi-gold);
	border-radius: 18px;
	color: var(--elfi-cream);
	background: var(--elfi-pine);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: translate(-50%, 10px);
	z-index: -2;
}

.elfi-lens.is-open .elfi-lens__card {
	animation: elfi-lens-card 0.5s ease 0.9s forwards;
}

@keyframes elfi-lens-card {
	to { opacity: 1; transform: translate(-50%, 0); }
}

.elfi-lens__day {
	margin: 0 0 4px !important;
	color: var(--elfi-gold-light);
	font-size: 1.2rem;
	font-weight: 400;
	font-family: var(--elfi-display);
	text-transform: uppercase;
}

.elfi-lens__text p {
	margin: 0 !important;
	font-size: 1.15rem;
	line-height: 1.35;
}

.elfi-lens__close {
	position: absolute;
	right: -10px;
	top: -10px;
	z-index: 2;
	width: 44px;
	height: 44px;
	border: 2px solid var(--elfi-gold);
	border-radius: 50%;
	color: var(--elfi-cream);
	background: var(--elfi-pine);
	font-size: 1.8rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
}

.elfi-lens.is-open .elfi-lens__close {
	animation: elfi-lens-card-fade 0.3s ease 0.8s forwards;
}

@keyframes elfi-lens-card-fade {
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.elfi-lens.is-open .elfi-lens__tool,
	.elfi-lens.is-open .elfi-lens__zoom,
	.elfi-lens.is-open .elfi-lens__card,
	.elfi-lens.is-open .elfi-lens__close {
		animation: none;
		opacity: 1;
		transform: none;
	}

	.elfi-lens.is-open .elfi-lens__card {
		transform: translate(-50%, 0);
	}
}

/* Correzioni scene: movimenti attaccati a qualcosa, niente oggetti che fluttuano */
.ea-nbout { animation: ea-nbout 3s ease-in-out infinite; }
.ea-paperflap { animation: ea-paperflap 1.6s ease-in-out infinite alternate; }
.ea-curtain { animation: ea-curtain 2.8s ease-in-out infinite alternate; }
.ea-pawnhop { animation: ea-pawnhop 2.4s ease-in-out infinite; }
.ea-kick { animation: ea-kick 0.9s ease-in-out infinite alternate; }
.ea-hangcord { animation: ea-hangcord 2.6s ease-in-out infinite; }

@keyframes ea-nbout { 0%, 15% { transform: translateY(14px) rotate(0); } 40%, 70% { transform: translateY(-6px) rotate(-8deg); } 90%, 100% { transform: translateY(14px) rotate(0); } }
@keyframes ea-paperflap { from { transform: rotate(-0.6deg); } to { transform: rotate(0.8deg); } }
/* la tenda è fissata in alto: si piega e ondeggia solo verso il basso */
@keyframes ea-curtain { from { transform: skewX(-4deg); } to { transform: skewX(4deg); } }
/* una pedina salta dalla scatola e atterra sul tabellone */
@keyframes ea-pawnhop { 0%, 30% { transform: translate(0, 10px); opacity: 0; } 35% { opacity: 1; } 55% { transform: translate(-40px, -26px); } 75%, 92% { transform: translate(-74px, 30px); opacity: 1; } 100% { transform: translate(-74px, 30px); opacity: 0; } }
/* l'elfo incastrato scalcia con le gambe fuori dai rami */
@keyframes ea-kick { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
@keyframes ea-hangcord { 0%, 50%, 100% { transform: rotate(0); } 58% { transform: rotate(9deg); } 66% { transform: rotate(-7deg); } 74% { transform: rotate(5deg); } 82% { transform: rotate(-2deg); } }
/* lancette spostate: scattano a orari sbagliati, avanti e indietro, senza girare a vuoto */
@keyframes ea-hand-min { 0%, 18% { transform: rotate(40deg); } 24%, 44% { transform: rotate(-110deg); } 50%, 70% { transform: rotate(200deg); } 76%, 94% { transform: rotate(95deg); } 100% { transform: rotate(40deg); } }
@keyframes ea-hand-hour { 0%, 22% { transform: rotate(-60deg); } 28%, 48% { transform: rotate(150deg); } 54%, 74% { transform: rotate(20deg); } 80%, 96% { transform: rotate(-150deg); } 100% { transform: rotate(-60deg); } }

/* ------------------------------------------------------------------ */
/* Il telefonino di Pip: la marachella delle caselle 1-24 è un video verticale girato dagli elfi */
.elfi-phone {
	/* 90px in alto: l'header del sito resta sopra lo sfondo scuro */
	--sh: min(calc(100svh - 175px), 640px);

	position: fixed;
	inset: 0;
	z-index: 9991;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 64px;
	padding: 90px 24px 24px;
	pointer-events: none;
	visibility: hidden;
}

.elfi-phone.is-open {
	visibility: visible;
	pointer-events: auto;
}

/* La "mano" che lo tiene: sale dal basso, si assesta e ondeggia appena */
.elfi-phone__hand {
	flex: none;
	transform: translate(var(--from-x, 0px), 110vh) rotate(16deg);
	transform-origin: 50% 100%;
}

.elfi-phone.is-open .elfi-phone__hand {
	animation: elfi-phone-in 0.9s cubic-bezier(.2,.85,.25,1) forwards, elfi-phone-sway 3.6s ease-in-out 0.9s infinite alternate;
}

@keyframes elfi-phone-in {
	70% { transform: translate(0, -10px) rotate(-4deg); }
	to { transform: translate(0, 0) rotate(-2deg); }
}

@keyframes elfi-phone-sway {
	from { transform: translate(0, 0) rotate(-2deg); }
	to { transform: translate(3px, -6px) rotate(1deg); }
}

/* Cover rossa con fiocchi di neve, tasti laterali e bordo dorato */
.elfi-phone__device {
	position: relative;
	padding: 11px;
	border-radius: 48px;
	background:
		radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.35) 0 2px, transparent 3px),
		radial-gradient(circle at 78% 64%, rgba(255, 255, 255, 0.3) 0 2px, transparent 3px),
		radial-gradient(circle at 40% 88%, rgba(255, 255, 255, 0.25) 0 1.5px, transparent 2.5px),
		linear-gradient(150deg, var(--elfi-berry), var(--elfi-wine) 70%);
	background-size: 46px 46px, 58px 58px, 38px 38px, auto;
	box-shadow:
		0 0 0 3px var(--elfi-gold),
		0 28px 60px rgba(0, 0, 0, 0.55),
		inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.elfi-phone__device::before,
.elfi-phone__device::after {
	content: '';
	position: absolute;
	width: 5px;
	border-radius: 3px;
	background: var(--elfi-gold);
}

.elfi-phone__device::before {
	right: -7px;
	top: 22%;
	height: 64px;
}

.elfi-phone__device::after {
	left: -7px;
	top: 18%;
	height: 92px;
	background: linear-gradient(var(--elfi-gold) 0 40%, transparent 40% 55%, var(--elfi-gold) 55%);
}

.elfi-phone__screen {
	position: relative;
	height: var(--sh);
	aspect-ratio: 9 / 16;
	overflow: hidden;
	border-radius: 38px;
	background: #000;
}

.elfi-phone__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.elfi-phone__island {
	position: absolute;
	top: 21px;
	left: 50%;
	width: 86px;
	height: 25px;
	border-radius: 14px;
	background: #000;
	transform: translateX(-50%);
}

/* In alto come nelle storie: barra che avanza e chi ha registrato */
.elfi-phone__top {
	position: absolute;
	inset: 0 0 auto;
	padding: 46px 14px 34px;
	color: #fff;
	background: linear-gradient(rgba(0, 0, 0, 0.55), transparent);
	pointer-events: none;
}

.elfi-phone__bar {
	display: block;
	height: 3px;
	overflow: hidden;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.35);
}

.elfi-phone__progress {
	display: block;
	height: 100%;
	background: #fff;
	transform: scaleX(0);
	transform-origin: 0 50%;
	transition: transform 0.25s linear;
}

.elfi-phone__who {
	display: flex;
	align-items: center;
	gap: 9px;
	margin-top: 11px;
	line-height: 1.1;
}

.elfi-phone__avatar {
	flex: none;
	width: 34px;
	height: 34px;
	border: 2px solid var(--elfi-gold-light);
	border-radius: 50%;
	background: var(--elfi-pine) center 20% / cover no-repeat;
}

.elfi-phone__name {
	display: flex;
	flex-direction: column;
	min-width: 0;
	font-size: 0.95rem;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.elfi-phone__when {
	font-size: 0.8rem;
	opacity: 0.8;
}

.elfi-phone__rec {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-left: auto;
	font-size: 0.75rem;
	font-weight: 400;
	font-family: var(--elfi-display);
	letter-spacing: 0.06em;
}

.elfi-phone__rec::before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--elfi-berry);
	animation: elfi-phone-rec 1.2s steps(2, jump-none) infinite;
}

@keyframes elfi-phone-rec {
	50% { opacity: 0.2; }
}

.elfi-phone__sound {
	position: absolute;
	right: 14px;
	bottom: 16px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	color: #fff;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

.elfi-phone__sound svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.elfi-phone__speaker { fill: currentColor; }
.elfi-phone__sound .elfi-phone__on { display: none; }
.elfi-phone__sound[aria-pressed='true'] .elfi-phone__on { display: inline; }
.elfi-phone__sound[aria-pressed='true'] .elfi-phone__off { display: none; }

/* Sonaglino appeso alla cover */
.elfi-phone__charm {
	position: absolute;
	left: 30px;
	top: calc(100% - 4px);
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	transform-origin: 50% 0;
	animation: elfi-phone-charm 1.8s ease-in-out infinite alternate;
	pointer-events: none;
}

.elfi-phone__cord {
	width: 2px;
	height: 26px;
	background: var(--elfi-gold);
}

.elfi-phone__bell {
	position: relative;
	width: 20px;
	height: 20px;
	margin-top: -2px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #fff1b8, var(--elfi-gold) 55%, #8a6214);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
}

.elfi-phone__bell::after {
	content: '';
	position: absolute;
	left: 50%;
	bottom: 4px;
	width: 2px;
	height: 6px;
	border-radius: 1px;
	background: #5e3d0a;
	transform: translateX(-50%);
}

@keyframes elfi-phone-charm {
	from { transform: rotate(-14deg); }
	to { transform: rotate(14deg); }
}

/* Cartellino con giorno e frase, accanto al telefono */
.elfi-phone__card {
	flex: none;
	width: min(340px, calc(100vw - 32px));
	padding: 16px 22px;
	border: 3px solid var(--elfi-gold);
	border-radius: 18px;
	color: var(--elfi-cream);
	background: var(--elfi-pine);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: translateY(12px) rotate(1.5deg);
}

.elfi-phone.is-open .elfi-phone__card {
	animation: elfi-phone-card 0.5s ease 0.8s forwards;
}

@keyframes elfi-phone-card {
	to { opacity: 1; transform: rotate(1.5deg); }
}

.elfi-phone__day {
	margin: 0 0 4px !important;
	color: var(--elfi-gold-light);
	font-size: 1.2rem;
	font-weight: 400;
	font-family: var(--elfi-display);
	text-transform: uppercase;
}

.elfi-phone__text p {
	margin: 0 !important;
	font-size: 1.15rem;
	line-height: 1.35;
}

.elfi-phone__close {
	position: absolute;
	top: -16px;
	right: -18px;
	z-index: 3;
	width: 48px;
	height: 48px;
	border: 2px solid var(--elfi-gold);
	border-radius: 50%;
	color: var(--elfi-cream);
	background: var(--elfi-pine);
	font-size: 1.9rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
}

.elfi-phone.is-open .elfi-phone__close {
	animation: elfi-lens-card-fade 0.3s ease 0.7s forwards;
}

/* Su mobile il telefono prende quasi tutto lo schermo e il cartellino va sotto */
@media (max-width: 899px) {
	.elfi-phone {
		--sh: min(calc(100svh - 330px), (100vw - 130px) * 16 / 9);

		flex-direction: column;
		gap: 30px;
		padding: 86px 16px 16px;
	}

	.elfi-phone__device {
		padding: 8px;
		border-radius: 38px;
	}

	.elfi-phone__screen {
		border-radius: 31px;
	}

	.elfi-phone__island {
		top: 16px;
		width: 70px;
		height: 21px;
	}

	.elfi-phone__top {
		padding-top: 38px;
	}

	.elfi-phone__cord {
		height: 18px;
	}

	.elfi-phone__card {
		padding: 10px 16px;
		transform: translateY(12px);
	}

	@keyframes elfi-phone-card {
		to { opacity: 1; transform: none; }
	}

	.elfi-phone__day {
		font-size: 1rem;
	}

	.elfi-phone__text p {
		font-size: 1rem;
	}

	.elfi-phone__close {
		top: -12px;
		right: -14px;
		width: 44px;
		height: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.elfi-phone.is-open .elfi-phone__hand,
	.elfi-phone.is-open .elfi-phone__card,
	.elfi-phone.is-open .elfi-phone__close,
	.elfi-phone__charm,
	.elfi-phone__rec::before {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

/* Titoli e grassetti nel font display. Bagel Fat One ha un solo peso (già molto pieno): niente grassetto finto. */
.elfi-scene :is(h1, h2, h3, h4, h5, h6, strong, b) {
	font-family: var(--elfi-display);
	font-weight: 400;
}

/* "Lila e Pip" resta sempre sulla stessa riga */
.elfi-nowrap {
	white-space: nowrap;
}
