.fx-stack { display: grid; gap: 16px; --fx-v0: visible; }
.fx-stack .fx-stack-steps { list-style: none; padding: 0; margin: 0; }
.fx-stack .fx-stack-steps li + li { margin-top: 6px; }
.fx-stack .fx-stack-goal { margin: 0; }
.fx-stack .fx-stack-controls { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: 10px; }
.fx-stack .fx-stack-controls legend { padding: 0; margin-bottom: 10px; font-weight: 800; }
.fx-stack .fx-stack-caption { margin: 0; }
.fx-stack .fx-stack-controls small { font-size: 14px; }
.fx-stack .fx-stack-choice { min-height: 40px; min-width: 70px; box-sizing: border-box; color: var(--fx-ink); }
.fx-stack .fx-stack-choice:has(input:checked) { background: var(--fx-mint); color: var(--fx-ink); }
.fx-stack .fx-stack-choice:has(input:focus-visible) { outline: 3px solid var(--fx-ink); outline-offset: 3px; }
.fx-stack .fx-stack-first { animation: fx-stack-pulse 1.2s 3; }
@keyframes fx-stack-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.fx-stack .fx-stack-scene { height: 330px; box-sizing: border-box; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 16px; color: var(--fx-ink); }
.fx-stack .fx-stack-view { height: 292px; display: block; text-align: center; position: relative; }
.fx-stack .fx-stack-view > .fx-stack-caption { display: block; height: 24px; }
.fx-stack .fx-stack-perspective { perspective: 850px; position: absolute; inset: 24px 0 0; }
.fx-stack .fx-stack-tower { position: absolute; width: 24px; height: 240px; left: calc(50% - 12px); bottom: 16px; transform-style: preserve-3d; transform: rotateX(-14deg) rotateY(-28deg); transition: transform 0.5s; }
.fx-stack .fx-stack-base { position: absolute; bottom: -6px; left: -27px; width: 78px; height: 6px; transform-style: preserve-3d; }
.fx-stack .fx-stack-base-top { position: absolute; width: 78px; height: 64px; background: var(--fx-muted); border: 1px solid var(--fx-ink); box-sizing: border-box; transform-origin: top; transform: rotateX(90deg) translateY(-32px); }
.fx-stack .fx-stack-base-front { position: absolute; width: 78px; height: 6px; background: var(--fx-muted); border: 1px solid var(--fx-ink); box-sizing: border-box; transform: translateZ(32px); }
.fx-stack .fx-stack-cube { position: absolute; bottom: calc(var(--fx-level) * 24px); left: 0; width: 24px; height: 24px; transform-style: preserve-3d; transform: translateY(-30px) scale(0); opacity: 0; transition: transform 0.45s, opacity 0.45s; }
.fx-stack .fx-stack-cube span { position: absolute; width: 24px; height: 24px; border: 1px solid var(--fx-ink); box-sizing: border-box; }
.fx-stack .fx-stack-front { background: var(--fx-sky); transform: translateZ(12px); }
.fx-stack .fx-stack-side { background: var(--fx-mint); transform: rotateY(90deg) translateZ(12px); }
.fx-stack .fx-stack-top { background: var(--fx-sun-pale); transform: rotateX(90deg) translateZ(12px); }
.fx-stack:has(#fx-stack-c1:checked) .fx-stack-b1, .fx-stack:has(#fx-stack-c2:checked) .fx-stack-b2, .fx-stack:has(#fx-stack-c3:checked) .fx-stack-b3, .fx-stack:has(#fx-stack-c4:checked) .fx-stack-b4, .fx-stack:has(#fx-stack-c5:checked) .fx-stack-b5, .fx-stack:has(#fx-stack-c6:checked) .fx-stack-b6, .fx-stack:has(#fx-stack-c7:checked) .fx-stack-b7, .fx-stack:has(#fx-stack-c8:checked) .fx-stack-b8, .fx-stack:has(#fx-stack-c9:checked) .fx-stack-b9, .fx-stack:has(#fx-stack-c10:checked) .fx-stack-b10 { transform: translateY(0) scale(1); opacity: 1; }
.fx-stack .fx-stack-card { display: grid; gap: 6px; padding: 12px; background: var(--fx-paper); border: 2px solid var(--fx-ink); border-radius: 12px; text-align: center; min-width: 0; }
.fx-stack .fx-stack-layer { display: grid; }
.fx-stack .fx-stack-layer > * { grid-area: 1 / 1; }
.fx-stack .fx-stack-digits { font-size: 48px; line-height: 1.1; }
.fx-stack .fx-stack-words { font-size: 26px; font-weight: 800; }
.fx-stack .fx-stack-messages > p { margin: 0; }
.fx-stack .fx-stack-gap { visibility: hidden; }
.fx-stack .fx-stack-n0 { visibility: var(--fx-v0, hidden); }
.fx-stack .fx-stack-n1 { visibility: var(--fx-v1, hidden); }
.fx-stack .fx-stack-n2 { visibility: var(--fx-v2, hidden); }
.fx-stack .fx-stack-n3 { visibility: var(--fx-v3, hidden); }
.fx-stack .fx-stack-n4 { visibility: var(--fx-v4, hidden); }
.fx-stack .fx-stack-n5 { visibility: var(--fx-v5, hidden); }
.fx-stack .fx-stack-n6 { visibility: var(--fx-v6, hidden); }
.fx-stack .fx-stack-n7 { visibility: var(--fx-v7, hidden); }
.fx-stack .fx-stack-n8 { visibility: var(--fx-v8, hidden); }
.fx-stack .fx-stack-n9 { visibility: var(--fx-v9, hidden); }
.fx-stack .fx-stack-n10 { visibility: var(--fx-v10, hidden); }
.fx-stack:has(.fx-stack-choice:nth-child(1 of :has(input:checked))) { --fx-v0: hidden; --fx-v1: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(2 of :has(input:checked))) { --fx-v1: hidden; --fx-v2: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(3 of :has(input:checked))) { --fx-v2: hidden; --fx-v3: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(4 of :has(input:checked))) { --fx-v3: hidden; --fx-v4: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(5 of :has(input:checked))) { --fx-v4: hidden; --fx-v5: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(6 of :has(input:checked))) { --fx-v5: hidden; --fx-v6: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(7 of :has(input:checked))) { --fx-v6: hidden; --fx-v7: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(8 of :has(input:checked))) { --fx-v7: hidden; --fx-v8: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(9 of :has(input:checked))) { --fx-v8: hidden; --fx-v9: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(10 of :has(input:checked))) { --fx-v9: hidden; --fx-v10: visible; }
.fx-stack:has(.fx-stack-choice:nth-child(10 of :has(input:checked))) .fx-stack-cube span { box-shadow: 0 0 10px var(--fx-sun); }
.fx-stack:has(.fx-stack-choice:not(:has(input:checked)) ~ .fx-stack-choice:has(input:checked)) .fx-stack-messages .fx-stack-state { visibility: hidden; }
.fx-stack:has(.fx-stack-choice:not(:has(input:checked)) ~ .fx-stack-choice:has(input:checked)) .fx-stack-gap { visibility: visible; }
@container (max-width: 480px) { .fx-stack .fx-stack-scene { grid-template-columns: minmax(0, 1fr); grid-template-rows: 292px 190px; height: 530px; gap: 12px; } .fx-stack .fx-stack-card { padding: 10px; gap: 4px; } }
@media (prefers-reduced-motion: reduce) { .fx-stack .fx-stack-first { animation: none; } .fx-stack .fx-stack-cube, .fx-stack .fx-stack-tower { transition: none; } }