.fx-endings { --fx-turn: 0deg; display: grid; }
.fx-endings:has(#fx-endings-al:checked) { --fx-turn: -90deg; }
.fx-endings:has(#fx-endings-el:checked) { --fx-turn: -180deg; }
.fx-endings:has(#fx-endings-le:checked) { --fx-turn: -270deg; }
.fx-endings * { box-sizing: border-box; }
.fx-endings .fx-endings-content { display: grid; gap: 16px; min-width: 0; color: var(--fx-ink); font-size: 16px; line-height: 1.5; }
.fx-endings .fx-note, .fx-endings .fx-right, .fx-endings .fx-wrong { margin: 0; padding: 12px; border: 2px solid var(--fx-ink); color: var(--fx-ink); font-size: 16px; line-height: 1.5; }
.fx-endings .fx-note { background: var(--fx-sky-pale); }
.fx-endings .fx-right { background: var(--fx-mint-pale); }
.fx-endings .fx-wrong { background: var(--fx-coral-pale); }
.fx-endings .fx-endings-steps { margin: 0; padding-left: 24px; }
.fx-endings .fx-endings-goal { margin: 0; }
.fx-endings .fx-endings-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.fx-endings .fx-endings-group { min-width: 0; padding: 0; margin: 0; border: 0; }
.fx-endings .fx-endings-group legend { width: 100%; padding: 0; margin-bottom: 10px; font-size: 16px; font-weight: 800; }
.fx-endings .fx-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-endings .fx-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 10px 12px; border: 2px solid var(--fx-ink); background: var(--fx-paper); color: var(--fx-ink); font-size: 16px; font-weight: 700; line-height: 1.3; cursor: pointer; }
.fx-endings .fx-btn:has(input:checked) { background: var(--fx-sun); color: var(--fx-ink); border-color: var(--fx-ink); }
.fx-endings .fx-btn:has(input:focus-visible) { outline: 3px solid var(--fx-ink); outline-offset: 3px; }
.fx-endings .fx-endings-scene { position: relative; height: 244px; padding: 18px; display: grid; align-content: center; gap: 16px; }
.fx-endings .fx-endings-machine { width: 100%; max-width: 440px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fx-endings .fx-endings-part { min-width: 0; }
.fx-endings .fx-endings-caption { display: block; font-size: 16px; line-height: 1.5; text-align: center; }
.fx-endings .fx-endings-wordslot { height: 124px; display: grid; place-items: center; }
.fx-endings .fx-endings-wood { width: 100%; max-width: 180px; height: 88px; display: grid; place-items: center; border: 3px solid var(--fx-ink); border-radius: 6px; background: var(--fx-sun-pale); box-shadow: 5px 5px 0 var(--fx-sun); font-size: 28px; font-weight: 800; }
.fx-endings .fx-endings-wood > span { grid-area: 1 / 1; visibility: hidden; }
.fx-endings:has(#fx-endings-music:checked) .fx-endings-root-m, .fx-endings:has(#fx-endings-trav:checked) .fx-endings-root-t, .fx-endings:has(#fx-endings-examp:checked) .fx-endings-root-x { visibility: visible; }
.fx-endings .fx-endings-perspective { height: 124px; display: grid; place-items: center; perspective: 600px; }
.fx-endings .fx-endings-mount { width: 88px; height: 88px; transform: rotateX(-8deg) rotateY(-12deg); transform-style: preserve-3d; }
.fx-endings .fx-endings-drum { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(var(--fx-turn)); transition: transform 0.65s; }
.fx-endings .fx-endings-face, .fx-endings .fx-endings-drum::before, .fx-endings .fx-endings-drum::after { position: absolute; inset: 0; border: 2px solid var(--fx-ink); background: var(--fx-sun-pale); backface-visibility: hidden; }
.fx-endings .fx-endings-face { display: grid; place-items: center; font-size: 30px; font-weight: 800; }
.fx-endings .fx-endings-face-q { transform: rotateX(0deg) translateZ(44px); }
.fx-endings .fx-endings-face-al { transform: rotateX(90deg) translateZ(44px); }
.fx-endings .fx-endings-face-el { transform: rotateX(180deg) translateZ(44px); }
.fx-endings .fx-endings-face-le { transform: rotateX(270deg) translateZ(44px); }
.fx-endings .fx-endings-drum::before, .fx-endings .fx-endings-drum::after { content: ""; background: var(--fx-sun); }
.fx-endings .fx-endings-drum::before { transform: rotateY(90deg) translateZ(44px); }
.fx-endings .fx-endings-drum::after { transform: rotateY(-90deg) translateZ(44px); }
.fx-endings .fx-endings-ear { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; }
.fx-endings .fx-endings-ear svg { width: 24px; height: 32px; flex-shrink: 0; stroke-width: 2.5; stroke-linecap: round; }
.fx-endings .fx-endings-card { display: grid; gap: 12px; min-width: 0; padding: 12px; border: 2px solid var(--fx-ink); border-radius: 8px; background: var(--fx-paper); }
.fx-endings .fx-endings-spelling, .fx-endings .fx-endings-feedback { display: grid; min-width: 0; }
.fx-endings .fx-endings-spelling > p, .fx-endings .fx-endings-feedback > p { grid-area: 1 / 1; visibility: hidden; margin: 0; }
.fx-endings .fx-endings-result { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 70px; padding: 12px; border: 2px solid var(--fx-ink); border-radius: 6px; font-size: 28px; line-height: 1.4; color: var(--fx-ink); }
.fx-endings .fx-endings-good { background: var(--fx-mint-pale); box-shadow: 0 0 0 3px var(--fx-mint); }
.fx-endings .fx-endings-bad { background: var(--fx-coral-pale); }
.fx-endings .fx-endings-bad > span[aria-hidden=true] { color: var(--fx-coral); }
.fx-endings .fx-endings-hint { min-height: 70px; display: grid; align-items: center; text-align: center; }
.fx-endings:has(#fx-endings-q:checked) .fx-endings-hint, .fx-endings:has(#fx-endings-music:checked):has(#fx-endings-q:checked) .fx-endings-mq, .fx-endings:has(#fx-endings-music:checked):has(#fx-endings-al:checked) .fx-endings-ma, .fx-endings:has(#fx-endings-music:checked):has(#fx-endings-el:checked) .fx-endings-me, .fx-endings:has(#fx-endings-music:checked):has(#fx-endings-le:checked) .fx-endings-ml, .fx-endings:has(#fx-endings-trav:checked):has(#fx-endings-q:checked) .fx-endings-tq, .fx-endings:has(#fx-endings-trav:checked):has(#fx-endings-al:checked) .fx-endings-ta, .fx-endings:has(#fx-endings-trav:checked):has(#fx-endings-el:checked) .fx-endings-te, .fx-endings:has(#fx-endings-trav:checked):has(#fx-endings-le:checked) .fx-endings-tl, .fx-endings:has(#fx-endings-examp:checked):has(#fx-endings-q:checked) .fx-endings-xq, .fx-endings:has(#fx-endings-examp:checked):has(#fx-endings-al:checked) .fx-endings-xa, .fx-endings:has(#fx-endings-examp:checked):has(#fx-endings-el:checked) .fx-endings-xe, .fx-endings:has(#fx-endings-examp:checked):has(#fx-endings-le:checked) .fx-endings-xl { visibility: visible; }
@container (max-width: 480px) { .fx-endings .fx-endings-controls, .fx-endings .fx-endings-machine { grid-template-columns: minmax(0, 1fr); } .fx-endings .fx-endings-machine { gap: 8px; } .fx-endings .fx-endings-scene { height: 402px; padding: 12px; gap: 12px; } .fx-endings .fx-endings-wordslot { height: 104px; } }
@media (prefers-reduced-motion: reduce) { .fx-endings .fx-endings-drum { transition: none; } }