.fx-stack { --fx-stack-a: 0; --fx-stack-b: 0; --fx-stack-c: 0; --fx-stack-d: 0; --fx-stack-e: 0; display: grid; gap: 16px; }
.fx-stack .fx-stack-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.fx-stack .fx-stack-goal, .fx-stack .fx-stack-caption { margin: 0; }
.fx-stack .fx-stack-controls { min-width: 0; border: 0; padding: 0; margin: 0; }
.fx-stack .fx-stack-controls legend { padding: 0; margin-bottom: 10px; font-weight: 800; }
.fx-stack .fx-stack-controls .fx-stack-caption { margin-bottom: 10px; }
.fx-stack .fx-stack-choices { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding-bottom: 8px; border-bottom: 3px solid var(--fx-muted); }
.fx-stack .fx-stack-choices .fx-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 132px; padding: 8px 4px; box-sizing: border-box; font-size: 14px; line-height: 1.3; color: var(--fx-ink); background: var(--fx-paper); cursor: pointer; }
.fx-stack .fx-stack-choices small { font-size: 12px; }
.fx-stack .fx-stack-bottle { width: 36px; height: 58px; fill: var(--fx-sky); stroke: var(--fx-ink); stroke-width: 1.5; }
.fx-stack .fx-stack-bottle text { fill: var(--fx-ink); stroke: none; text-anchor: middle; font-size: 16px; font-weight: 800; }
.fx-stack .fx-stack-tick { width: 22px; height: 22px; border: 2px solid var(--fx-ink); border-radius: 4px; display: grid; place-items: center; box-sizing: border-box; }
.fx-stack .fx-stack-tick span { visibility: hidden; }
.fx-stack .fx-stack-choices > input:checked + label { background: var(--fx-mint-pale); color: var(--fx-ink); }
.fx-stack .fx-stack-choices > input:checked + label .fx-stack-tick { background: var(--fx-mint); }
.fx-stack .fx-stack-choices > input:checked + label .fx-stack-tick span { visibility: visible; }
.fx-stack .fx-stack-choices > input:checked + label .fx-stack-bottle path { fill: var(--fx-sky-pale); }
.fx-stack .fx-stack-choices > input:focus-visible + label { outline: 3px solid var(--fx-ink); outline-offset: 2px; }
.fx-stack .fx-stack-work { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fx-stack .fx-stack-reading { min-width: 0; display: grid; gap: 12px; }
.fx-stack .fx-stack-swap { display: grid; min-width: 0; margin: 0; }
.fx-stack .fx-stack-state { grid-area: 1 / 1; visibility: hidden; margin: 0; }
.fx-stack .fx-stack-description { font-size: 14px; }
.fx-stack .fx-stack-stage { margin: 0; padding: 12px; box-sizing: border-box; height: 460px; display: grid; grid-template-rows: 48px 260px 88px 28px; gap: 4px; min-width: 0; color: var(--fx-ink); }
.fx-stack .fx-stack-stage figcaption { text-align: center; font-size: 14px; }
.fx-stack .fx-stack-rig { position: relative; width: min(100%, 240px); height: 260px; margin: auto; perspective: 700px; perspective-origin: 180% -30%; overflow: hidden; }
.fx-stack .fx-stack-tank { position: absolute; left: 8px; bottom: 0; width: 114px; height: 244px; box-sizing: border-box; border: 2px solid var(--fx-ink); border-top: 0; background: var(--fx-paper); }
.fx-stack .fx-stack-tower { position: absolute; left: 10px; bottom: 2px; width: 110px; height: 240px; transform-style: preserve-3d; }
.fx-stack .fx-stack-piece { --fx-stack-rank: 0; position: absolute; left: 0; bottom: calc(var(--fx-stack-rank) * 30px); width: 110px; height: 30px; box-sizing: border-box; border: 1px solid var(--fx-ink); background: var(--fx-sky-pale); text-align: center; font-size: 14px; line-height: 28px; transform-style: preserve-3d; transform: translate3d(0, -190px, -40px) scale(0); opacity: 0; transition: transform 0.45s, opacity 0.45s, bottom 0.45s; }
.fx-stack .fx-stack-piece span { display: block; transform: translateZ(1px); }
.fx-stack .fx-stack-piece::before { content: ""; position: absolute; left: -1px; top: -1px; width: 110px; height: 14px; box-sizing: border-box; border: 1px solid var(--fx-ink); background: var(--fx-sky); transform-origin: center top; transform: rotateX(-90deg); }
.fx-stack .fx-stack-piece::after { content: ""; position: absolute; right: -1px; top: -1px; width: 14px; height: 30px; box-sizing: border-box; border: 1px solid var(--fx-ink); background: var(--fx-sky); transform-origin: right center; transform: rotateY(-90deg); }
.fx-stack .fx-stack-p2 { --fx-stack-rank: var(--fx-stack-a); }
.fx-stack .fx-stack-p3 { --fx-stack-rank: calc(var(--fx-stack-a) + var(--fx-stack-b)); }
.fx-stack .fx-stack-p4 { --fx-stack-rank: calc(var(--fx-stack-a) + var(--fx-stack-b) + var(--fx-stack-c)); }
.fx-stack .fx-stack-p5 { --fx-stack-rank: calc(var(--fx-stack-a) + var(--fx-stack-b) + var(--fx-stack-c) + var(--fx-stack-d)); }
.fx-stack .fx-stack-p6 { --fx-stack-rank: calc(var(--fx-stack-a) + var(--fx-stack-b) + var(--fx-stack-c) + var(--fx-stack-d) + var(--fx-stack-e)); }
.fx-stack:has(#fx-stack-b1:checked) { --fx-stack-a: 1; }
.fx-stack:has(#fx-stack-b2:checked) { --fx-stack-b: 1; }
.fx-stack:has(#fx-stack-b3:checked) { --fx-stack-c: 1; }
.fx-stack:has(#fx-stack-b4:checked) { --fx-stack-d: 1; }
.fx-stack:has(#fx-stack-b5:checked) { --fx-stack-e: 1; }
.fx-stack:has(#fx-stack-b1:checked) .fx-stack-p1, .fx-stack:has(#fx-stack-b2:checked) .fx-stack-p2, .fx-stack:has(#fx-stack-b3:checked) .fx-stack-p3, .fx-stack:has(#fx-stack-b4:checked) .fx-stack-p4, .fx-stack:has(#fx-stack-b5:checked) .fx-stack-p5, .fx-stack:has(#fx-stack-b6:checked) .fx-stack-p6 { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
.fx-stack .fx-stack-marks { position: absolute; bottom: 2px; left: 8px; width: calc(100% - 8px); height: 240px; }
.fx-stack .fx-stack-mark { position: absolute; left: 0; right: 0; bottom: calc(var(--fx-stack-mark) * 30px); border-top: 1px solid var(--fx-muted); }
.fx-stack .fx-stack-mark span { position: absolute; left: 122px; top: -9px; font-size: 12px; line-height: 18px; background: var(--fx-paper); color: var(--fx-ink); }
.fx-stack .fx-stack-max { border-top: 2px dashed var(--fx-ink); }
.fx-stack .fx-stack-line { position: relative; height: 88px; min-width: 0; }
.fx-stack .fx-stack-line svg { display: block; width: 100%; height: 52px; fill: none; stroke: var(--fx-ink); stroke-width: 2; }
.fx-stack .fx-stack-jump { visibility: hidden; stroke: var(--fx-grape); }
.fx-stack .fx-stack-number { position: absolute; top: 52px; left: calc(5% + var(--fx-stack-x) * 15%); transform: translateX(-50%); font-size: 12px; }
.fx-stack .fx-stack-line-label { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: 12px; }
.fx-stack .fx-stack-step { margin: 0; text-align: center; font-size: 14px; }
.fx-stack:not(:has(input:checked)) .fx-stack-s0, .fx-stack:has(input:nth-child(1 of :checked)):not(:has(input:nth-child(2 of :checked))) .fx-stack-s1, .fx-stack:has(input:nth-child(2 of :checked)):not(:has(input:nth-child(3 of :checked))) .fx-stack-s2, .fx-stack:has(input:nth-child(3 of :checked)):not(:has(input:nth-child(4 of :checked))) .fx-stack-s3, .fx-stack:has(input:nth-child(4 of :checked)):not(:has(input:nth-child(5 of :checked))) .fx-stack-s4, .fx-stack:has(input:nth-child(5 of :checked)):not(:has(input:nth-child(6 of :checked))) .fx-stack-s5, .fx-stack:has(input:nth-child(6 of :checked)) .fx-stack-s6 { visibility: visible; }
.fx-stack:has(input:nth-child(1 of :checked)) .fx-stack-j1, .fx-stack:has(input:nth-child(2 of :checked)) .fx-stack-j2, .fx-stack:has(input:nth-child(3 of :checked)) .fx-stack-j3, .fx-stack:has(input:nth-child(4 of :checked)) .fx-stack-j4, .fx-stack:has(input:nth-child(5 of :checked)) .fx-stack-j5, .fx-stack:has(input:nth-child(6 of :checked)) .fx-stack-j6 { visibility: visible; }
@container (max-width: 480px) { .fx-stack .fx-stack-work { grid-template-columns: 1fr; } .fx-stack .fx-stack-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); } }