.fx-piles { --fx-k: 0; display: grid; gap: 14px; }
.fx-piles:has(#fx-piles-n2:checked) { --fx-k: 1; }
.fx-piles:has(#fx-piles-n4:checked) { --fx-k: 2; }
.fx-piles:has(#fx-piles-n5:checked) { --fx-k: 3; }
.fx-piles:has(#fx-piles-n9:checked) { --fx-k: 4; }
.fx-piles:has(#fx-piles-n10:checked) { --fx-k: 5; }
.fx-piles .fx-piles-steps { list-style: none; padding: 0; margin: 0; }
.fx-piles .fx-piles-steps li + li { margin-top: 6px; }
.fx-piles .fx-piles-goal { margin: 0; color: var(--fx-ink); }
.fx-piles .fx-piles-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
.fx-piles .fx-piles-controls legend { padding: 0; margin-bottom: 10px; font-weight: 700; }
.fx-piles .fx-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-piles .fx-btn { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 40px; padding: 8px 12px; color: var(--fx-ink); background: var(--fx-paper); }
.fx-piles .fx-btn:has(input:checked) { color: var(--fx-ink); background: var(--fx-sun); }
.fx-piles .fx-btn:focus-within { outline: 3px solid var(--fx-grape); outline-offset: 3px; }
.fx-piles .fx-piles-machine { min-width: 0; }
.fx-piles .fx-piles-caption { display: block; text-align: center; font-size: 14px; color: var(--fx-ink); }
.fx-piles .fx-piles-dial { position: relative; height: 156px; perspective: 600px; }
.fx-piles .fx-piles-axle { position: absolute; left: 50%; top: 50%; width: 90px; height: 52px; transform: translate(-50%, -50%) rotateY(-18deg); transform-style: preserve-3d; }
.fx-piles .fx-piles-drum { width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(calc(var(--fx-k) * -60deg)); transition: transform 0.65s steps(4, end); }
.fx-piles .fx-piles-face { position: absolute; inset: 0; display: grid; place-items: center; box-sizing: border-box; border: 2px solid var(--fx-ink); background: var(--fx-paper); color: var(--fx-ink); font-size: 26px; font-weight: 800; backface-visibility: hidden; transform: rotateX(calc(var(--fx-i) * 60deg)) translateZ(45px); }
.fx-piles .fx-piles-cog { position: absolute; width: 116px; height: 116px; left: -13px; top: -32px; background: var(--fx-sun); clip-path: polygon(40% 0%,60% 0%,63% 10%,72% 14%,82% 9%,94% 25%,87% 33%,91% 42%,100% 45%,100% 61%,90% 64%,85% 73%,91% 82%,75% 94%,67% 87%,58% 91%,55% 100%,39% 100%,36% 90%,27% 85%,18% 91%,6% 75%,13% 67%,9% 58%,0% 55%,0% 39%,10% 36%,15% 27%,9% 18%,25% 6%,33% 13%,39% 9%); transform: rotateY(90deg) translateZ(45px); }
.fx-piles .fx-piles-cog::after { content: ""; position: absolute; inset: 24%; border-radius: 50%; border: 3px solid var(--fx-ink); background: var(--fx-sun-pale); }
.fx-piles .fx-piles-back { transform: rotateY(90deg) translateZ(-45px); }
.fx-piles .fx-piles-pointer { position: absolute; left: calc(50% + 68px); top: calc(50% - 16px); color: var(--fx-ink); font-size: 26px; line-height: 32px; }
.fx-piles .fx-piles-scene { position: relative; box-sizing: border-box; height: 345px; padding: 0; color: var(--fx-ink); }
.fx-piles .fx-piles-money { position: absolute; top: 8px; left: 0; width: 100%; text-align: center; font-size: 16px; }
.fx-piles .fx-piles-table { position: absolute; top: 38px; left: 2%; width: 96%; height: 64px; box-sizing: border-box; border: 2px solid var(--fx-ink); border-bottom-width: 6px; border-radius: 8px; background: var(--fx-sun-pale); }
.fx-piles .fx-piles-tray { position: absolute; top: 135px; height: 190px; box-sizing: border-box; border: 2px solid var(--fx-ink); border-radius: 8px; background: var(--fx-paper); }
.fx-piles .fx-piles-tray b { display: block; padding: 8px 5px; text-align: center; font-size: 14px; line-height: 20px; }
.fx-piles .fx-piles-simon { left: 2%; width: 37%; }
.fx-piles .fx-piles-luca { left: 41%; width: 37%; }
.fx-piles .fx-piles-left { left: 80%; width: 18%; }
.fx-piles .fx-piles-empty { position: absolute; top: 66px; left: 0; width: 100%; text-align: center; font-size: 14px; }
.fx-piles .fx-piles-empty-simon, .fx-piles .fx-piles-empty-luca { visibility: hidden; }
.fx-piles:has(#fx-piles-n1:checked) .fx-piles-empty-simon, .fx-piles:has(#fx-piles-n1:checked) .fx-piles-empty-luca, .fx-piles:has(#fx-piles-n2:checked) .fx-piles-empty-luca, .fx-piles:has(#fx-piles-n4:checked) .fx-piles-empty-luca { visibility: visible; }
.fx-piles:has(#fx-piles-n10:checked) .fx-piles-empty-left { visibility: hidden; }
.fx-piles:has(#fx-piles-n9:checked) .fx-piles-share { background: var(--fx-mint-pale); border-color: var(--fx-mint); box-shadow: 0 0 0 2px var(--fx-mint); }
.fx-piles .fx-piles-piles { position: absolute; inset: 0; }
.fx-piles .fx-piles-pile { --fx-a: 0; position: absolute; left: calc(50% + (var(--fx-x) - 50%) * var(--fx-a)); top: calc(52px + (var(--fx-y) - 52px) * var(--fx-a)); width: 68px; height: 28px; box-sizing: border-box; display: grid; place-items: center; border: 1px solid var(--fx-ink); border-radius: 3px; background: var(--fx-mint-pale); color: var(--fx-ink); box-shadow: 0 2px 0 var(--fx-paper), 0 4px 0 var(--fx-ink); transform: translateX(-50%); opacity: var(--fx-a); transition: left 0.65s, top 0.65s; }
.fx-piles .fx-piles-pile span { grid-area: 1 / 1; visibility: hidden; font-size: 12px; font-weight: 800; }
.fx-piles:has(#fx-piles-n1:checked) .fx-piles-pile:first-child, .fx-piles:has(#fx-piles-n2:checked) .fx-piles-pile:nth-child(-n + 2), .fx-piles:has(#fx-piles-n4:checked) .fx-piles-pile:nth-child(-n + 4), .fx-piles:has(#fx-piles-n5:checked) .fx-piles-pile:nth-child(-n + 5), .fx-piles:has(#fx-piles-n9:checked) .fx-piles-pile:nth-child(-n + 9), .fx-piles:has(#fx-piles-n10:checked) .fx-piles-pile { --fx-a: 1; }
.fx-piles:has(#fx-piles-n1:checked) .fx-piles-pile { left: 50%; top: 52px; }
.fx-piles:has(#fx-piles-n1:checked) .fx-piles-v1, .fx-piles:has(#fx-piles-n2:checked) .fx-piles-v2, .fx-piles:has(#fx-piles-n4:checked) .fx-piles-v4, .fx-piles:has(#fx-piles-n5:checked) .fx-piles-v5, .fx-piles:has(#fx-piles-n9:checked) .fx-piles-v9, .fx-piles:has(#fx-piles-n10:checked) .fx-piles-v10 { visibility: visible; }
.fx-piles .fx-piles-says { display: grid; min-width: 0; }
.fx-piles .fx-piles-says p { grid-area: 1 / 1; visibility: hidden; box-sizing: border-box; margin: 0; padding: 12px; font-size: 16px; line-height: 1.5; color: var(--fx-ink); }
.fx-piles:has(#fx-piles-n1:checked) .fx-piles-s1, .fx-piles:has(#fx-piles-n2:checked) .fx-piles-s2, .fx-piles:has(#fx-piles-n4:checked) .fx-piles-s4, .fx-piles:has(#fx-piles-n5:checked) .fx-piles-s5, .fx-piles:has(#fx-piles-n9:checked) .fx-piles-s9, .fx-piles:has(#fx-piles-n10:checked) .fx-piles-s10 { visibility: visible; }
@container (max-width: 480px) { .fx-piles .fx-piles-scene { height: 525px; } .fx-piles .fx-piles-tray { left: 2%; width: 96%; } .fx-piles .fx-piles-simon { top: 132px; height: 112px; } .fx-piles .fx-piles-luca { top: 258px; height: 151px; } .fx-piles .fx-piles-left { top: 423px; height: 86px; } .fx-piles .fx-piles-empty { top: 50px; } .fx-piles .fx-piles-pile { left: calc(50% + (var(--fx-mx) - 50%) * var(--fx-a)); top: calc(52px + (var(--fx-my) - 52px) * var(--fx-a)); } }
@media (prefers-reduced-motion: reduce) { .fx-piles .fx-piles-drum, .fx-piles .fx-piles-pile { transition: none; } }