.fx-stack { --fx-a: 0; --fx-b: 0; --fx-c: 0; --fx-d: 0; display: grid; gap: 16px; }
.fx-stack:has(#fx-stack-a:checked) { --fx-a: 1; }
.fx-stack:has(#fx-stack-b:checked) { --fx-b: 1; }
.fx-stack:has(#fx-stack-c:checked) { --fx-c: 1; }
.fx-stack:has(#fx-stack-d:checked) { --fx-d: 1; }
.fx-stack .fx-note ol { margin: 0; padding-left: 24px; }
.fx-stack .fx-goal, .fx-stack .fx-caption, .fx-stack .fx-removal { margin: 0; color: var(--fx-ink); }
.fx-stack .fx-controls { min-width: 0; margin: 0; padding: 0; border: 0; perspective: 900px; }
.fx-stack .fx-controls legend { padding: 0; margin-bottom: 12px; font-weight: 800; }
.fx-stack .fx-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fx-stack .fx-choice { box-sizing: border-box; min-height: 76px; padding: 12px; color: var(--fx-ink); background: var(--fx-sun-pale); border: 2px solid var(--fx-ink); border-bottom-width: 6px; border-radius: 5px; font-size: 14px; line-height: 1.4; text-align: left; transform-style: preserve-3d; transform: rotateX(3deg); }
.fx-stack .fx-choice:has(input:checked) { color: var(--fx-ink); background: var(--fx-sky-pale); border-color: var(--fx-ink); }
.fx-stack .fx-choice:has(input:focus-visible) { outline: 3px solid var(--fx-ink); outline-offset: 3px; }
.fx-stack .fx-scene { box-sizing: border-box; height: 440px; padding: 12px; perspective: 900px; }
.fx-stack .fx-world { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; height: 100%; transform-style: preserve-3d; }
.fx-stack .fx-tower, .fx-stack .fx-pile { position: relative; min-width: 0; height: 100%; transform-style: preserve-3d; }
.fx-stack .fx-part { position: absolute; top: 0; left: 0; right: 0; text-align: center; font-size: 14px; color: var(--fx-ink); }
.fx-stack .fx-banner { position: absolute; top: 25px; left: 0; right: 0; padding: 4px; text-align: center; font-size: 14px; background: var(--fx-mint); color: var(--fx-ink); visibility: hidden; }
.fx-stack .fx-base { box-sizing: border-box; position: absolute; bottom: 0; left: 0; right: 0; height: 110px; display: grid; align-content: center; gap: 4px; padding: 10px; border: 3px solid var(--fx-ink); border-radius: 8px; background: var(--fx-sun-pale); color: var(--fx-ink); font-size: 13px; line-height: 17px; }
.fx-stack .fx-base strong { font-size: 12px; }
.fx-stack .fx-brick { box-sizing: border-box; position: absolute; left: 4%; width: 92%; height: 78px; display: grid; align-content: center; padding: 6px; font-size: 12px; line-height: 16px; color: var(--fx-ink); border: 2px solid var(--fx-ink); border-bottom-width: 6px; border-radius: 4px; transform-style: preserve-3d; transform: translate3d(0, -35px, -60px) scale(0); visibility: hidden; transition: transform 0.5s, bottom 0.5s, visibility 0.5s; }
.fx-stack .fx-good-brick { bottom: calc(114px + var(--fx-level) * 82px); background: var(--fx-mint-pale); border-color: var(--fx-mint); }
.fx-stack .fx-brick-a { --fx-level: 0; }
.fx-stack .fx-brick-c { --fx-level: var(--fx-a); }
.fx-stack .fx-brick-e { --fx-level: calc(var(--fx-a) + var(--fx-c)); }
.fx-stack .fx-brick-a span { position: absolute; top: 0; right: 3px; font-size: 14px; }
.fx-stack .fx-brick-a { padding-right: 15px; }
.fx-stack .fx-tray { position: absolute; bottom: 0; left: 0; right: 0; height: 260px; border: 2px dashed var(--fx-muted); border-top: 0; border-radius: 0 0 8px 8px; }
.fx-stack .fx-off-brick { bottom: calc(8px + var(--fx-level) * 82px); background: var(--fx-paper); border-color: var(--fx-muted); }
.fx-stack .fx-brick-b { --fx-level: 0; }
.fx-stack .fx-brick-d { --fx-level: var(--fx-b); }
.fx-stack .fx-brick-f { --fx-level: calc(var(--fx-b) + var(--fx-d)); }
.fx-stack:has(#fx-stack-a:checked) .fx-brick-a, .fx-stack:has(#fx-stack-c:checked) .fx-brick-c, .fx-stack:has(#fx-stack-e:checked) .fx-brick-e { visibility: visible; transform: translate3d(0, 0, 8px) rotateX(-4deg) scale(1); }
.fx-stack:has(#fx-stack-b:checked) .fx-brick-b, .fx-stack:has(#fx-stack-d:checked) .fx-brick-d, .fx-stack:has(#fx-stack-f:checked) .fx-brick-f { visibility: visible; transform: translate3d(0, 0, -8px) rotateZ(-3deg) scale(1); }
.fx-stack .fx-responses { display: grid; align-items: start; }
.fx-stack .fx-responses > p, .fx-stack .fx-messages { grid-area: 1 / 1; margin: 0; }
.fx-stack .fx-messages { display: grid; gap: 8px; }
.fx-stack .fx-message-slot { display: grid; }
.fx-stack .fx-message-slot p { grid-area: 1 / 1; margin: 0; }
.fx-stack .fx-item, .fx-stack .fx-finish, .fx-stack .fx-mixed { visibility: hidden; }
.fx-stack:has(input:checked) .fx-start { visibility: hidden; }
.fx-stack:has(#fx-stack-a:checked) .fx-message-a, .fx-stack:has(#fx-stack-b:checked) .fx-message-b, .fx-stack:has(#fx-stack-c:checked) .fx-message-c, .fx-stack:has(#fx-stack-d:checked) .fx-message-d, .fx-stack:has(#fx-stack-e:checked) .fx-message-e, .fx-stack:has(#fx-stack-f:checked) .fx-message-f { visibility: visible; }
.fx-stack:has(#fx-stack-a:checked):has(#fx-stack-c:checked):has(#fx-stack-e:checked) .fx-finish, .fx-stack:has(#fx-stack-a:checked):has(#fx-stack-c:checked):has(#fx-stack-e:checked) .fx-banner { visibility: visible; }
.fx-stack:has(#fx-stack-a:checked):has(#fx-stack-c:checked):has(#fx-stack-e:checked) .fx-item { visibility: hidden; }
.fx-stack:has(#fx-stack-a:checked):has(#fx-stack-c:checked):has(#fx-stack-e:checked):has(.fx-off:checked) .fx-finish, .fx-stack:has(#fx-stack-a:checked):has(#fx-stack-c:checked):has(#fx-stack-e:checked):has(.fx-off:checked) .fx-banner { visibility: hidden; }
.fx-stack:has(#fx-stack-a:checked):has(#fx-stack-c:checked):has(#fx-stack-e:checked):has(.fx-off:checked) .fx-mixed { visibility: visible; }
@container (max-width: 480px) { .fx-stack .fx-choices { grid-template-columns: 1fr; } .fx-stack .fx-scene { height: 760px; } .fx-stack .fx-world { grid-template-columns: 1fr; grid-template-rows: 410px 300px; gap: 24px; } }
@media (prefers-reduced-motion: reduce) { .fx-stack .fx-brick { transition: none; } }