.fx-door { --fx-four: 0; --fx-zero: 0; --fx-two: 0; display: grid; gap: 14px; }
.fx-door:has(#fx-door-four:checked) { --fx-four: 1; }
.fx-door:has(#fx-door-zero:checked) { --fx-zero: 1; }
.fx-door:has(#fx-door-two:checked) { --fx-two: 1; }
.fx-door .fx-door-steps { list-style: none; margin: 0; padding: 0; font-size: 16px; line-height: 1.5; }
.fx-door .fx-door-goal { margin: 0; font-weight: 700; }
.fx-door .fx-door-controls { min-width: 0; margin: 0; padding: 0; border: 0; }
.fx-door .fx-door-controls legend { max-width: 100%; padding: 0; margin-bottom: 10px; font-weight: 700; }
.fx-door .fx-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-door .fx-btn { box-sizing: border-box; min-height: 44px; min-width: 44px; padding: 10px; flex: 1 1 100px; text-align: center; color: var(--fx-ink); background: var(--fx-paper); }
.fx-door .fx-btn:has(input:checked) { color: var(--fx-ink); background: var(--fx-sun); }
.fx-door .fx-btn:has(input:focus-visible) { outline: 3px solid var(--fx-grape); outline-offset: 3px; }
.fx-door .fx-door-scene { box-sizing: border-box; position: relative; width: 100%; height: 414px; margin: 0; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: center; color: var(--fx-ink); }
.fx-door .fx-door-rig { position: relative; width: 228px; max-width: 100%; height: 390px; margin: auto; perspective: 800px; }
.fx-door .fx-door-build { position: absolute; inset: 0; transform-style: preserve-3d; }
.fx-door .fx-door-panel { position: absolute; inset: 0 0 auto; height: 276px; box-sizing: border-box; border: 3px solid var(--fx-ink); border-radius: 8px 8px 0 0; background: var(--fx-sky); }
.fx-door .fx-door-doorlabel { display: block; margin-top: 12px; text-align: center; font-size: 16px; }
.fx-door .fx-door-holderlabel { position: absolute; top: 43px; left: 0; width: 100%; text-align: center; font-size: 12px; }
.fx-door .fx-door-holder { position: absolute; left: 50%; top: 62px; width: 146px; height: 60px; box-sizing: border-box; transform: translateX(-50%); border: 3px solid var(--fx-ink); border-radius: 5px; background: var(--fx-sun); }
.fx-door .fx-door-hint { position: absolute; top: 139px; left: 12px; right: 12px; text-align: center; font-size: 14px; line-height: 1.4; }
.fx-door .fx-door-letterbox { position: absolute; top: 216px; left: 50%; width: 86px; height: 9px; transform: translateX(-50%); background: var(--fx-ink); border: 3px solid var(--fx-sun); }
.fx-door .fx-door-boxlabel { position: absolute; top: 238px; width: 100%; text-align: center; font-size: 12px; }
.fx-door .fx-door-posted { position: absolute; top: 196px; left: 50%; width: 52px; height: 25px; box-sizing: border-box; border: 2px solid var(--fx-ink); background: var(--fx-paper); text-align: center; font-size: 12px; transform: translate3d(-50%, -18px, 0); transition: transform 0.5s; }
.fx-door .fx-door-homes { position: absolute; top: 300px; left: 50%; width: 198px; max-width: 100%; transform: translateX(-50%); display: flex; justify-content: space-between; }
.fx-door .fx-door-homes span { box-sizing: border-box; width: 40px; height: 44px; border: 1px dashed var(--fx-muted); }
.fx-door .fx-door-shelf { position: absolute; top: 344px; width: 100%; box-sizing: border-box; border-top: 5px solid var(--fx-sun); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fx-door .fx-door-shelf span { padding: 6px 2px 0; font-size: 12px; line-height: 1.3; text-align: center; }
.fx-door .fx-door-tile { position: absolute; top: 300px; left: 50%; width: 40px; height: 44px; box-sizing: border-box; display: grid; place-items: center; margin: 0; border: 2px solid var(--fx-ink); border-radius: 3px; color: var(--fx-ink); background: var(--fx-sun-pale); font-size: 28px; font-weight: 800; line-height: 1; transform-style: preserve-3d; transform: translate3d(calc(-50% + var(--fx-home) * 66px), 0, 0) rotateX(10deg) rotateY(-12deg); transition: transform 0.6s; }
.fx-door .fx-door-tile::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--fx-ink); background: var(--fx-sun); transform: translateZ(-5px); }
.fx-door .fx-door-tile4 { --fx-home: -1; --fx-slot: calc((0 - var(--fx-zero) - var(--fx-two)) / 2); }
.fx-door .fx-door-tile0 { --fx-home: 0; --fx-slot: calc((var(--fx-four) - var(--fx-two)) / 2); }
.fx-door .fx-door-tile2 { --fx-home: 1; --fx-slot: calc((var(--fx-four) + var(--fx-zero)) / 2); }
.fx-door:has(#fx-door-four:checked) .fx-door-tile4, .fx-door:has(#fx-door-zero:checked) .fx-door-tile0, .fx-door:has(#fx-door-two:checked) .fx-door-tile2 { transform: translate3d(calc(-50% + var(--fx-slot) * 40px), -230px, 12px) rotateX(0deg) rotateY(0deg); }
.fx-door .fx-door-person { min-width: 0; height: 242px; display: grid; grid-template-rows: 70px 140px 20px; gap: 6px; justify-items: center; }
.fx-door .fx-door-stack { display: grid; }
.fx-door .fx-door-state { visibility: hidden; }
.fx-door .fx-door-stack > .fx-door-state { grid-area: 1 / 1; margin: 0; }
.fx-door .fx-door-bubble { box-sizing: border-box; width: 100%; max-width: 220px; height: 70px; padding: 8px; align-items: center; border: 2px solid var(--fx-ink); border-radius: 18px; background: var(--fx-paper); text-align: center; font-size: 16px; line-height: 1.3; }
.fx-door .fx-door-postman { width: 110px; max-width: 100%; height: 140px; }
.fx-door .fx-door-coat { fill: var(--fx-sky); stroke: var(--fx-ink); stroke-width: 3; stroke-linejoin: round; }
.fx-door .fx-door-face { fill: var(--fx-sun-pale); stroke: var(--fx-ink); stroke-width: 3; }
.fx-door .fx-door-limbs { fill: none; stroke: var(--fx-ink); stroke-width: 10; stroke-linecap: round; }
.fx-door .fx-door-eye { fill: var(--fx-ink); }
.fx-door .fx-door-line { fill: none; stroke: var(--fx-ink); stroke-width: 2; stroke-linecap: round; }
.fx-door .fx-door-envelope { fill: var(--fx-paper); stroke: var(--fx-ink); stroke-width: 2; }
.fx-door .fx-door-svgtext { fill: var(--fx-ink); font-size: 12px; }
.fx-door .fx-door-hand-letter { transform-box: fill-box; transform-origin: center; transition: transform 0.5s; }
.fx-door .fx-door-messages { font-size: 16px; line-height: 1.5; }
.fx-door .fx-door-action { font-size: 14px; line-height: 1.5; }
.fx-door:not(:has(input:checked)) .fx-door-snone, .fx-door:has(#fx-door-four:checked):not(:has(#fx-door-zero:checked)):not(:has(#fx-door-two:checked)) .fx-door-s4, .fx-door:has(#fx-door-zero:checked):not(:has(#fx-door-four:checked)):not(:has(#fx-door-two:checked)) .fx-door-s0, .fx-door:has(#fx-door-two:checked):not(:has(#fx-door-four:checked)):not(:has(#fx-door-zero:checked)) .fx-door-s2, .fx-door:has(#fx-door-four:checked):has(#fx-door-zero:checked):not(:has(#fx-door-two:checked)) .fx-door-s40, .fx-door:has(#fx-door-four:checked):has(#fx-door-two:checked):not(:has(#fx-door-zero:checked)) .fx-door-s42, .fx-door:has(#fx-door-zero:checked):has(#fx-door-two:checked):not(:has(#fx-door-four:checked)) .fx-door-s02, .fx-door:has(#fx-door-four:checked):has(#fx-door-zero:checked):has(#fx-door-two:checked) .fx-door-s402 { visibility: visible; }
.fx-door:has(#fx-door-four:checked):has(#fx-door-zero:checked):has(#fx-door-two:checked) .fx-door-posted { transform: translate3d(-50%, 0, 0); }
.fx-door:has(#fx-door-four:checked):has(#fx-door-zero:checked):has(#fx-door-two:checked) .fx-door-hand-letter { transform: translateY(18px) scale(0); }
@container (max-width: 480px) { .fx-door .fx-door-scene { grid-template-columns: minmax(0, 1fr); grid-template-rows: 390px 242px; height: 674px; } }
@media (prefers-reduced-motion: reduce) { .fx-door .fx-door-tile, .fx-door .fx-door-posted, .fx-door .fx-door-hand-letter { transition: none; } }