.fx-stack { display: grid; gap: 16px; }
.fx-stack * { box-sizing: border-box; }
.fx-stack .fx-stack-instructions ol { margin: 0; padding-left: 24px; }
.fx-stack .fx-stack-instructions 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; }
.fx-stack .fx-stack-controls legend { padding: 0; margin-bottom: 12px; font-weight: 800; }
.fx-stack .fx-stack-choice-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 210px); gap: 16px; align-items: start; }
.fx-stack .fx-stack-help { color: var(--fx-ink); }
.fx-stack .fx-stack-help p { margin: 0 0 12px; }
.fx-stack .fx-stack-choice-list { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: repeat(6, 60px); gap: 6px; }
.fx-stack .fx-stack-cell { display: grid; grid-row: calc(7 - var(--fx-stack-order)); min-width: 0; }
.fx-stack .fx-stack-cell > * { grid-area: 1 / 1; }
.fx-stack .fx-stack-rest { display: grid; place-items: center; height: 60px; border: 2px solid var(--fx-muted); border-radius: 5px; background: var(--fx-paper); color: var(--fx-ink); font-size: 14px; pointer-events: none; }
.fx-stack .fx-stack-cell:has(input:checked) .fx-stack-rest { background: var(--fx-mint-pale); }
.fx-stack .fx-stack-tap { visibility: hidden; z-index: 1; display: grid; align-content: center; justify-items: center; gap: 2px; min-width: 0; width: 100%; height: 60px; margin: 0; padding: 6px; border: 2px solid var(--fx-sun); border-radius: 5px; background: var(--fx-sun-pale); color: var(--fx-ink); font-size: 14px; box-shadow: 0 0 8px var(--fx-sun); cursor: pointer; }
.fx-stack .fx-stack-cell:first-child .fx-stack-tap, .fx-stack .fx-stack-cell:has(input:checked) + .fx-stack-cell .fx-stack-tap { visibility: visible; }
.fx-stack .fx-stack-cell:has(+ .fx-stack-cell input:checked) .fx-stack-tap { visibility: hidden; }
.fx-stack .fx-stack-tap:has(input:checked) { background: var(--fx-mint-pale); border-color: var(--fx-mint); color: var(--fx-ink); box-shadow: none; }
.fx-stack .fx-stack-tap:has(input:focus-visible) { outline: 3px solid var(--fx-ink); outline-offset: 2px; }
.fx-stack .fx-stack-action { display: grid; font-size: 12px; line-height: 1.25; }
.fx-stack .fx-stack-action > span { grid-area: 1 / 1; }
.fx-stack .fx-stack-undo { visibility: hidden; }
.fx-stack .fx-stack-tap:has(input:checked) .fx-stack-add { visibility: hidden; }
.fx-stack .fx-stack-tap:has(input:checked) .fx-stack-undo { visibility: inherit; }
.fx-stack .fx-stack-stage { display: grid; align-content: start; gap: 12px; height: 540px; padding: 12px; color: var(--fx-ink); overflow: hidden; }
.fx-stack .fx-stack-block-label { text-align: center; font-size: 14px; }
.fx-stack .fx-stack-scene { position: relative; height: 230px; perspective: 650px; overflow: hidden; }
.fx-stack .fx-stack-rig { position: absolute; left: 50%; bottom: 32px; width: 156px; height: 180px; margin-left: -78px; transform-style: preserve-3d; transform: rotateX(-16deg) rotateY(-28deg); }
.fx-stack .fx-stack-base { position: absolute; left: 0; bottom: 0; width: 156px; height: 30px; transform-style: preserve-3d; }
.fx-stack .fx-stack-cube { position: absolute; left: 28px; bottom: calc(30px + var(--fx-stack-layer) * 22px); width: 100px; height: 22px; transform-style: preserve-3d; transform: translate3d(0, -70px, 0) scale(0); opacity: 0; transition: transform 0.45s, opacity 0.45s; }
.fx-stack .fx-stack-face { position: absolute; border: 1px solid var(--fx-ink); background: var(--fx-paper); backface-visibility: hidden; }
.fx-stack .fx-stack-front { display: grid; place-items: center; top: 0; left: 0; width: 100%; height: 100%; transform: translateZ(32px); font-size: 12px; font-weight: 700; }
.fx-stack .fx-stack-top { top: 0; left: 0; width: 100%; height: 64px; background: var(--fx-muted); transform-origin: 50% 0; transform: translateZ(-32px) rotateX(90deg); }
.fx-stack .fx-stack-side { top: 0; left: 100%; width: 64px; height: 100%; background: var(--fx-muted); transform-origin: 0 50%; transform: translateZ(32px) rotateY(90deg); }
.fx-stack .fx-stack-base .fx-stack-front { background: var(--fx-sky-pale); transform: translateZ(45px); }
.fx-stack .fx-stack-base .fx-stack-top { height: 90px; background: var(--fx-sky); transform: translateZ(-45px) rotateX(90deg); }
.fx-stack .fx-stack-base .fx-stack-side { width: 90px; background: var(--fx-sky-pale); transform: translateZ(45px) rotateY(90deg); }
.fx-stack:has(#fx-stack-b1:checked) .fx-stack-cube1, .fx-stack:has(#fx-stack-b2:checked) .fx-stack-cube2, .fx-stack:has(#fx-stack-b3:checked) .fx-stack-cube3, .fx-stack:has(#fx-stack-b4:checked) .fx-stack-cube4, .fx-stack:has(#fx-stack-b5:checked) .fx-stack-cube5, .fx-stack:has(#fx-stack-b6:checked) .fx-stack-cube6 { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
.fx-stack .fx-stack-scale-label { position: absolute; bottom: 0; left: 0; width: 100%; text-align: center; font-size: 14px; }
.fx-stack .fx-stack-swap { display: grid; }
.fx-stack .fx-stack-swap > * { grid-area: 1 / 1; visibility: hidden; margin: 0; }
.fx-stack .fx-stack-display { width: 86px; border: 1px solid var(--fx-ink); border-radius: 3px; background: var(--fx-paper); font-size: 18px; line-height: 24px; text-align: center; }
.fx-stack .fx-stack-meters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.fx-stack .fx-stack-meter { display: grid; align-content: start; gap: 8px; min-width: 0; min-height: 90px; padding: 10px; border: 2px solid var(--fx-sky); border-radius: 6px; background: var(--fx-paper); }
.fx-stack .fx-stack-meter > b { font-size: 14px; line-height: 1.4; }
.fx-stack .fx-stack-meter .fx-score { font-size: 18px; line-height: 1.35; }
.fx-stack:has(#fx-stack-b6:checked) .fx-stack-density { background: var(--fx-mint-pale); border-color: var(--fx-mint); }
.fx-stack .fx-stack-feedback p { line-height: 1.5; }
.fx-stack:not(:has(#fx-stack-b1:checked)) .fx-stack-s0, .fx-stack:has(#fx-stack-b1:checked):not(:has(#fx-stack-b2:checked)) .fx-stack-s1, .fx-stack:has(#fx-stack-b2:checked):not(:has(#fx-stack-b3:checked)) .fx-stack-s2, .fx-stack:has(#fx-stack-b3:checked):not(:has(#fx-stack-b4:checked)) .fx-stack-s3, .fx-stack:has(#fx-stack-b4:checked):not(:has(#fx-stack-b5:checked)) .fx-stack-s4, .fx-stack:has(#fx-stack-b5:checked):not(:has(#fx-stack-b6:checked)) .fx-stack-s5, .fx-stack:has(#fx-stack-b6:checked) .fx-stack-s6 { visibility: visible; }
@container (max-width: 480px) { .fx-stack .fx-stack-choice-layout, .fx-stack .fx-stack-meters { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .fx-stack .fx-stack-cube { transition: none; } }