.demo__lead code,
.demo__note code {
	font-size: 0.85em;
}
.demo__lead code {
	padding: 0.1rem 0.4rem;
	background: var(--surface);
	border-radius: 4px;
}

.stage {
	--gold: #ffc233;
	--empty: #5b5b5b;
	grid-template-columns: minmax(0, 1fr);
	min-height: 14rem;
}
.stage__hint {
	position: absolute;
	bottom: 0.75rem;
	left: 0;
	right: 0;
	margin: 0;
	text-align: center;
	font-size: 0.72rem;
	color: var(--muted);
}

/* ——— Stelle: una riga di contorni e, sopra, una riga di stelle piene ritagliata da --value ——— */
.stars {
	--size: 1.5rem;
	position: relative;
	width: calc(var(--size) * 5);
}
.stars--lg {
	--size: 2.4rem;
}
.stars--xl {
	--size: clamp(2.2rem, 11vw, 3.6rem);
}
.stars__row {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
}
.stars__row svg {
	display: block;
	width: 100%;
	height: auto;
	fill: none;
	stroke: var(--empty);
	stroke-width: 1.5;
	stroke-linejoin: round;
}
.stars__row--fill {
	position: absolute;
	inset: 0;
	clip-path: inset(0 calc((5 - var(--value)) * 20%) 0 0);
}
.stars__row--fill svg {
	fill: var(--gold);
	stroke: var(--gold);
}

/* ——— Media ——— */
.stage--summary {
	grid-template-columns: auto minmax(0, 20rem);
	justify-content: center;
	gap: clamp(1.5rem, 6vw, 4rem);
	padding: 2.5rem 2rem 3rem;
	min-height: 17rem;
}
.avg {
	display: grid;
	justify-items: center;
	gap: 0.5rem;
}
.avg__number {
	font: 800 4.5rem / 1 var(--font-display);
	letter-spacing: -0.03em;
}
.avg__count {
	font-size: 0.85rem;
	color: var(--muted);
}
.bars {
	display: grid;
	gap: 0.55rem;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}
.bar {
	display: grid;
	grid-template-columns: 4.2rem 1fr 2.6rem;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.8rem;
	color: var(--muted);
}
.bar__pct {
	text-align: end;
	font-variant-numeric: tabular-nums;
}
.bar__track {
	height: 0.55rem;
	overflow: hidden;
	background: #2a2a2a;
	border-radius: 1rem;
}
.bar__fill {
	display: block;
	width: var(--w);
	height: 100%;
	background: var(--gold);
	border-radius: inherit;
	transform-origin: left;
	scale: 0 1;
	transition: scale 0.9s var(--ease-out) calc(var(--i) * 90ms);
}
.is-live .bar__fill {
	scale: 1 1;
}
@media (max-width: 40rem) {
	.stage--summary {
		grid-template-columns: minmax(0, 1fr);
		justify-items: center;
	}
}

/* ——— Voto a cinque stelle ——— */
.pick {
	display: grid;
	justify-items: center;
	gap: 1rem;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}
.pick__legend {
	padding: 0;
	margin: 0 auto 0.25rem;
	font: 600 1.15rem var(--font-display);
}
.pick__row {
	display: flex;
	gap: 0.35rem;
}
.pick__star {
	position: relative;
	display: block;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	--on: clamp(0, calc(var(--shown, 0) - var(--i) + 1), 1);
}
.pick__face {
	position: relative;
	display: block;
	width: clamp(2.6rem, 11vw, 3.4rem);
	transition: scale 0.15s var(--ease-out);
}
.pick__face svg {
	display: block;
	width: 100%;
	height: auto;
	stroke-width: 1.5;
	stroke-linejoin: round;
}
.pick__face svg:first-child {
	fill: none;
	stroke: var(--empty);
}
.pick__face svg:nth-child(2) {
	position: absolute;
	inset: 0;
	fill: var(--gold);
	stroke: var(--gold);
	opacity: var(--on);
	scale: calc(0.6 + 0.4 * var(--on));
	transition: opacity 0.18s var(--ease-out), scale 0.25s var(--ease-out);
}
.pick__star:active .pick__face {
	scale: 0.9;
}
.pick__star:has(input:focus-visible) {
	outline: 2px solid var(--accent);
	outline-offset: 4px;
	border-radius: 0.5rem;
}
.pick__star.is-pop .pick__face {
	animation: star-pop 0.45s var(--ease-out);
}
@keyframes star-pop {
	0% { scale: 1; rotate: 0deg; }
	35% { scale: 1.3; rotate: -12deg; }
	100% { scale: 1; rotate: 0deg; }
}
.spark {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 6px;
	height: 6px;
	margin: -3px 0 0 -3px;
	background: var(--gold);
	border-radius: 50%;
	pointer-events: none;
}
.pick__msg {
	min-height: 1.5em;
	font-size: 0.95rem;
	color: var(--muted);
}

/* ——— Mezze stelle ——— */
.half {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 0.9rem;
}
.half__input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}
.half__stars {
	cursor: pointer;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
}
.half:has(.half__input:focus-visible) .half__stars {
	outline: 2px solid var(--accent);
	outline-offset: 6px;
	border-radius: 0.5rem;
}
.half__out {
	font: 600 1rem var(--font-text);
	font-variant-numeric: tabular-nums;
}
.chip {
	padding: 0.45rem 0.9rem;
	font: 600 0.8rem var(--font-text);
	color: var(--muted);
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 2rem;
	cursor: pointer;
	transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out), scale 0.15s var(--ease-out);
}
.chip:active {
	scale: 0.97;
}
@media (hover: hover) and (pointer: fine) {
	.chip:hover {
		color: var(--text);
		border-color: var(--muted);
	}
}
