.fx-foldend { --fx-turn: 0deg; --fx-result: var(--fx-mint-pale); --fx-card: var(--fx-paper); --fx-isword: 1; --fx-isnot: 0; display: grid; }
.fx-foldend:has(#fx-foldend-fold:checked) { --fx-turn: 180deg; --fx-card: var(--fx-result); }
.fx-foldend:has(#fx-foldend-w4:checked), .fx-foldend:has(#fx-foldend-w5:checked), .fx-foldend:has(#fx-foldend-w6:checked) { --fx-result: var(--fx-sun-pale); --fx-isword: 0; --fx-isnot: 1; }
.fx-foldend .fx-foldend-content { display: grid; gap: 14px; min-width: 0; color: var(--fx-ink); font-size: 16px; line-height: 1.5; }
.fx-foldend .fx-foldend-steps { margin: 0; padding-left: 24px; }
.fx-foldend .fx-foldend-steps li + li { margin-top: 6px; }
.fx-foldend .fx-foldend-goal, .fx-foldend .fx-foldend-read, .fx-foldend .fx-foldend-reminder { margin: 0; }
.fx-foldend .fx-foldend-controls { margin: 0; padding: 0; border: 0; min-width: 0; }
.fx-foldend .fx-foldend-controls legend { padding: 0; margin-bottom: 8px; font-size: 16px; font-weight: 800; }
.fx-foldend .fx-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 4px; }
.fx-foldend .fx-btn { box-sizing: border-box; min-height: 40px; max-width: 100%; padding: 8px 12px; color: var(--fx-ink); background: var(--fx-paper); font-size: 16px; white-space: normal; cursor: pointer; }
.fx-foldend .fx-btn:has(input:checked) { color: var(--fx-ink); background: var(--fx-sky-pale); border-color: var(--fx-ink); }
.fx-foldend .fx-btn:has(input:focus-visible) { outline: 3px solid var(--fx-ink); outline-offset: 3px; }
.fx-foldend .fx-foldend-foldcontrol { display: inline-flex; align-items: center; gap: 12px; margin: 4px; }
.fx-foldend .fx-foldend-foldcontrol:has(input:checked) { background: var(--fx-mint-pale); }
.fx-foldend .fx-foldend-dash { display: inline-block; width: 0; height: 26px; border-left: 3px dashed var(--fx-ink); }
.fx-foldend .fx-foldend-scene { box-sizing: border-box; height: 260px; padding: 16px 12px; display: grid; grid-template-rows: 24px 160px 24px; gap: 8px; align-content: center; color: var(--fx-ink); background: var(--fx-sky-pale); }
.fx-foldend .fx-foldend-scenehead { display: flex; justify-content: space-between; gap: 8px; width: 100%; max-width: 440px; margin: 0 auto; font-size: 14px; }
.fx-foldend .fx-foldend-camera { position: relative; width: 100%; max-width: 440px; height: 160px; margin: 0 auto; perspective: 800px; }
.fx-foldend .fx-foldend-card { position: absolute; top: 12px; left: 2%; width: 96%; height: 112px; transform-style: preserve-3d; transform: rotateX(8deg) rotateY(-5deg); }
.fx-foldend .fx-foldend-base { position: absolute; top: 0; left: 0; box-sizing: border-box; width: 70%; height: 100%; display: grid; align-items: center; border: 2px solid var(--fx-ink); border-right: 2px dashed var(--fx-ink); border-radius: 8px 0 0 8px; background: var(--fx-card); }
.fx-foldend .fx-foldend-wordstack, .fx-foldend .fx-foldend-endingstack { display: grid; align-items: center; font-size: 28px; font-weight: 800; line-height: 1.3; }
.fx-foldend .fx-foldend-wordstack { padding-right: 4px; text-align: right; }
.fx-foldend .fx-foldend-wordstack > span, .fx-foldend .fx-foldend-endingstack > span { grid-area: 1 / 1; visibility: hidden; white-space: nowrap; }
.fx-foldend .fx-foldend-flap { position: absolute; top: 0; left: 70%; width: 30%; height: 100%; transform-origin: left center; transform-style: preserve-3d; transform: translateZ(-1px) rotateY(var(--fx-turn)); transition: transform 0.8s; }
.fx-foldend .fx-foldend-front, .fx-foldend .fx-foldend-back { position: absolute; box-sizing: border-box; width: 100%; height: 100%; border: 2px solid var(--fx-ink); border-left: 0; border-radius: 0 8px 8px 0; backface-visibility: hidden; }
.fx-foldend .fx-foldend-front { display: grid; align-items: center; background: var(--fx-sun); transform: translateZ(0.2px); }
.fx-foldend .fx-foldend-back { background: var(--fx-sun-pale); transform: rotateY(180deg) translateZ(0.2px); }
.fx-foldend .fx-foldend-endingstack { padding-left: 4px; }
.fx-foldend .fx-foldend-hitline { position: absolute; top: 10px; left: 69.2%; z-index: 2; width: 32px; height: 116px; transform: translateX(-50%); cursor: pointer; }
.fx-foldend .fx-foldend-hitline > span { position: absolute; top: 126px; left: 50%; transform: translateX(-50%); box-sizing: border-box; min-height: 24px; padding: 1px 4px; border-bottom: 2px dashed var(--fx-ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.fx-foldend:has(#fx-foldend-fold:focus-visible) .fx-foldend-hitline { outline: 3px solid var(--fx-ink); outline-offset: 3px; }
.fx-foldend .fx-foldend-leftlabel { position: absolute; bottom: 0; left: 2%; font-size: 12px; font-weight: 700; }
.fx-foldend .fx-foldend-hint { margin: 0; text-align: center; font-size: 14px; }
.fx-foldend .fx-foldend-mark { position: absolute; top: 6px; left: 8px; display: grid; width: 26px; height: 26px; place-items: center; font-size: 20px; font-weight: 800; opacity: 0; }
.fx-foldend .fx-foldend-mark > span { grid-area: 1 / 1; }
.fx-foldend .fx-foldend-tick { opacity: var(--fx-isword); }
.fx-foldend .fx-foldend-query { opacity: var(--fx-isnot); }
.fx-foldend:has(#fx-foldend-fold:checked) .fx-foldend-mark { opacity: 1; }
.fx-foldend .fx-foldend-e { display: inline-block; border: 2px solid var(--fx-paper); border-radius: 50%; text-decoration: underline; }
.fx-foldend:has(#fx-foldend-fold:checked) .fx-foldend-e { border-color: var(--fx-ink); text-decoration: none; }
.fx-foldend .fx-foldend-says { display: grid; min-width: 0; }
.fx-foldend .fx-foldend-says p { grid-area: 1 / 1; visibility: hidden; box-sizing: border-box; margin: 0; padding: 12px; border: 2px solid var(--fx-ink); border-radius: 10px; color: var(--fx-ink); font-size: 16px; line-height: 1.5; }
.fx-foldend:has(#fx-foldend-w1:checked) .fx-foldend-w1, .fx-foldend:has(#fx-foldend-w2:checked) .fx-foldend-w2, .fx-foldend:has(#fx-foldend-w3:checked) .fx-foldend-w3, .fx-foldend:has(#fx-foldend-w4:checked) .fx-foldend-w4, .fx-foldend:has(#fx-foldend-w5:checked) .fx-foldend-w5, .fx-foldend:has(#fx-foldend-w6:checked) .fx-foldend-w6, .fx-foldend:has(#fx-foldend-w7:checked) .fx-foldend-w7, .fx-foldend:has(#fx-foldend-w8:checked) .fx-foldend-w8 { visibility: visible; }
.fx-foldend:has(#fx-foldend-fold:checked) .fx-foldend-says .fx-foldend-open { visibility: hidden; }
.fx-foldend:has(#fx-foldend-w1:checked):has(#fx-foldend-fold:checked) .fx-foldend-f1, .fx-foldend:has(#fx-foldend-w2:checked):has(#fx-foldend-fold:checked) .fx-foldend-f2, .fx-foldend:has(#fx-foldend-w3:checked):has(#fx-foldend-fold:checked) .fx-foldend-f3, .fx-foldend:has(#fx-foldend-w4:checked):has(#fx-foldend-fold:checked) .fx-foldend-f4, .fx-foldend:has(#fx-foldend-w5:checked):has(#fx-foldend-fold:checked) .fx-foldend-f5, .fx-foldend:has(#fx-foldend-w6:checked):has(#fx-foldend-fold:checked) .fx-foldend-f6, .fx-foldend:has(#fx-foldend-w7:checked):has(#fx-foldend-fold:checked) .fx-foldend-f7, .fx-foldend:has(#fx-foldend-w8:checked):has(#fx-foldend-fold:checked) .fx-foldend-f8 { visibility: visible; }
@container (max-width: 480px) { .fx-foldend .fx-row { grid-template-columns: minmax(0, 1fr); } .fx-foldend .fx-foldend-wordstack, .fx-foldend .fx-foldend-endingstack { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { .fx-foldend .fx-foldend-flap { transition: none; } }