.page,.page *{box-sizing:border-box}
body{margin:0;font-family:sans-serif;font-size:1em;line-height:1.4;color:#222;background:#fff}
.page .puzzle-nav{list-style:none;margin:10px 0 16px;padding:0;font-size:13px}
.puzzle-nav li{display:inline-block;margin:0 12px 4px 0}
.puzzle-nav a{color:#075f91;text-decoration:none}
.puzzle-nav a:hover{text-decoration:underline}
.puzzle-nav a[aria-current=page]{color:#222;font-weight:700}
@media (scripting:enabled){.page .puzzle-nav{display:none}}
.pnav{position:relative;z-index:20;margin:10px 0 16px}
.pnav-tabs{display:flex;flex-wrap:wrap;gap:6px}
.pnav-tab{display:inline-flex;align-items:center;gap:6px;margin:0;padding:4px 12px 4px 5px;border:1px solid #d5dce6;border-radius:20px;background:#fff;color:#222;font-family:inherit;font-size:13px;font-weight:700;line-height:1.2;text-decoration:none;cursor:pointer}
.pnav-tab:hover,.pnav-tab.is-open{border-color:#3960a1;background:#eef3fb;color:#222;text-decoration:none}
.pnav-tab.is-current{border-color:#3960a1;box-shadow:inset 0 0 0 1px #3960a1}
.pnav-ico{display:inline-block;flex:none;width:28px;height:28px;background:url(https://ruwix.com/pics/simulators/puzzle-nav.png) no-repeat;background-size:800% 600%}
.pnav-panel{position:absolute;left:0;right:0;top:calc(100% + 6px);padding:12px 14px 14px;border:1px solid #d5dce6;border-radius:12px;background:#fff;box-shadow:0 10px 28px rgba(0,0,0,.18)}
.pnav-title{margin:0 0 8px;font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#3960a1}
.pnav-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:4px}
.pnav-item{display:flex;align-items:center;gap:8px;padding:4px 8px 4px 4px;border-radius:8px;color:#075f91;font-size:13px;line-height:1.25;text-decoration:none}
.pnav-item:hover{background:#eef3fb;text-decoration:none}
.pnav-item.is-current{background:#3960a1;color:#fff}
.pnav-item .pnav-ico{width:44px;height:44px}
.page .pnav a,.page .pnav a:hover{text-decoration:none}
.page .pnav-item{color:#075f91}
.page .pnav-item.is-current{color:#fff}
.embed .pnav{display:none}
.grid section{display:block;margin-bottom:16px}
.sim-stage{position:relative}
.align-badge,.mode-toggle--stage,.stage-toggles{position:absolute;top:10px;z-index:3}
.align-badge{left:10px;max-width:44%;font-size:12px;font-weight:700;color:#3960a1;pointer-events:none}
.align-badge.is-ok{color:#2e7d43}
.mode-toggle--stage,.stage-toggles{right:10px}
.stage-toggles{text-align:right}
.stage-toggles .mode-toggle--stage{position:static;display:block;margin-bottom:8px}
.stage-toggles details{margin-left:auto;text-align:left;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.18)}
.hint-panel{border-radius:10px}
.hint-panel summary{cursor:pointer;padding:8px 12px;font-size:13px;font-weight:700;color:#222}
.hint-panel>img{display:block;margin:0 12px 12px}
.pic-form{width:min(300px,70vw);padding:0 12px 12px;font-size:13px}
.pic-form label{display:block;margin:0 0 4px;font-weight:700}
.pic-form input[type=url]{width:100%;margin:0 0 8px;padding:5px 8px;border:1px solid #bbb;border-radius:8px;font:inherit}
.pic-form .pic-check{margin:0 0 8px;font-weight:400}
.pic-form .btn{display:inline-block;width:auto;margin:0 6px 0 0}
.sp-board{position:absolute;left:50%;top:50%;width:min(420px,80%);aspect-ratio:1;transform:translate(-50%,-50%);background:#2b2520;border-radius:8px;box-shadow:0 4px 18px rgba(0,0,0,.25)}
.sp-tile{position:absolute;left:0;top:0;width:calc(100%/var(--n));height:calc(100%/var(--n));box-sizing:border-box;border:1px solid #17120e;border-radius:4px;background-color:#f4ecd8;cursor:pointer;transition:transform .09s ease;touch-action:none}
.sp-tile span{position:absolute;right:6%;bottom:4%;font:800 clamp(12px,3vw,22px)/1 sans-serif;color:#fff;text-shadow:0 1px 3px #000,0 0 2px #000;pointer-events:none}
.hr-ball{cursor:grab}
.key-guide{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:16px 28px;margin:12px 0 0;padding:16px 14px;border:1px solid #d5dce6;border-radius:12px;background:#f7f9fc}
.kg-group{display:flex;align-items:center;gap:14px}
.kg-rings{width:68px;height:42px;flex:none}
.kg-rings circle{fill:none;stroke:#c9cfd8;stroke-width:5}
.kg-rings .kg-on{stroke:#3960a1}
.kg-key{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:12px;line-height:1.3;color:#444;text-align:center}
.kg-key span{display:flex;flex-direction:column;align-items:center}
.key-guide kbd{display:inline-flex;align-items:center;justify-content:center;min-width:52px;height:52px;padding:0 10px;box-sizing:border-box;border:1px solid #b9c2cf;border-bottom-width:5px;border-radius:10px;background:linear-gradient(#fff,#e9eef5);font:800 24px/1 monospace;color:#222;box-shadow:0 2px 5px rgba(0,0,0,.12)}
.key-guide svg{fill:none;stroke:#3960a1;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.kg-key span svg{width:22px;height:22px;margin-bottom:2px}
.kg-key kbd+span{min-height:48px}
.kg-arrows{display:grid;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,48px);gap:5px;flex:none}
.kg-arrows kbd{min-width:0;width:48px;height:48px;padding:0}
.kg-arrows svg{width:24px;height:24px;stroke:#222}
.kg-up{grid-column:2;grid-row:1}
.kg-left{grid-column:1;grid-row:2}
.kg-down{grid-column:2;grid-row:2}
.kg-right{grid-column:3;grid-row:2}
.kg-text,.kg-tip{max-width:330px;font-size:13px;line-height:1.5;color:#444}
.kg-text kbd,.kg-tip kbd{min-width:0;height:auto;padding:1px 6px;border-bottom-width:3px;border-radius:5px;font-size:12px;vertical-align:1px}
.kg-tip{display:flex;align-items:center;gap:10px}
.kg-tip>svg{width:30px;height:30px;flex:none}
.embed .key-guide{display:none}
.mode-toggle{display:inline-block;font-size:13px;font-weight:700;cursor:pointer}
.mode-toggle input,.mode-toggle select{cursor:pointer;vertical-align:middle}
.mode-toggle input{accent-color:#3960a1}
.mode-toggle select{-webkit-appearance:none;appearance:none;height:32px;margin:0;padding:0 28px 0 10px;border:1px solid #bbb;border-radius:10px;font:inherit;font-size:13px;line-height:30px;color:#222;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%233960a1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center/10px 7px}
.mode-toggle select:hover,.mode-toggle select:focus,.mode-toggle--stage:has(>input[type=checkbox]):hover{outline:0;border-color:#3960a1}
.mode-toggle select:disabled{cursor:default;opacity:.55;border-color:#bbb}
.mode-toggle input[type=checkbox]{-webkit-appearance:none;appearance:none;width:18px;height:18px;margin:-2px 2px 0 0;border:1px solid #bbb;border-radius:5px;background:#fff no-repeat center/12px 10px}
.mode-toggle input[type=checkbox]:checked{border-color:#3960a1;background-color:#3960a1;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1.5 5l3 3 6-6.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
.mode-toggle input[type=checkbox]:focus-visible{outline:0;border-color:#3960a1;box-shadow:0 0 0 2px rgba(57,96,161,.3)}
.mode-toggle--stage:has(>input[type=checkbox]){height:32px;padding:0 10px;border:1px solid #bbb;border-radius:10px;line-height:30px;color:#222;background:#fff}
.stage-toggles .mode-toggle--stage:has(>input[type=checkbox]){display:inline-block}
#viewport3d{position:relative;height:560px;perspective:1500px;cursor:grab;touch-action:none;overflow:hidden;user-select:none;-webkit-user-select:none}
#viewport3d.dragging{cursor:grabbing}
#viewport3d>svg{display:block}
#move-indicator{position:absolute;left:10px;bottom:10px;font-family:monospace;font-size:28px;font-weight:700;line-height:1;min-width:50px;text-align:center;padding:7px 12px;color:#fff;background:#3960a1;border-radius:10px;pointer-events:none;opacity:0;transition:opacity 130ms}
#move-indicator.show{opacity:1}
#cubeRoot{position:absolute;left:50%;top:50%;width:0;height:0;transform-style:preserve-3d}
#cubeShift{width:0;height:0;transform-style:preserve-3d}
.mcubie{position:absolute;left:0;top:0;width:0;height:0;transform-style:preserve-3d;pointer-events:none}
.m-face{position:absolute;left:0;top:0;box-sizing:border-box;transform-origin:0 0;border:3px solid #17120e;border-radius:6px;background:#241f19;box-shadow:inset 0 0 7px rgba(0,0,0,.2);pointer-events:auto}
.size-x{font-weight:800;opacity:.55;padding:0 2px}
.c-face,.cubie{position:absolute}
.cubie{left:-32px;top:-32px;width:64px;height:64px;transform-style:preserve-3d;pointer-events:none}
.c-face{inset:0;border:3px solid #17120e;border-radius:6px;background:#241f19;box-shadow:inset 0 0 7px rgba(0,0,0,.2);pointer-events:auto}
.c-face.f-F{transform:translateZ(32px)}
.c-face.f-B{transform:rotateY(180deg) translateZ(32px)}
.c-face.f-R{transform:rotateY(90deg) translateZ(32px)}
.c-face.f-L{transform:rotateY(-90deg) translateZ(32px)}
.c-face.f-U{transform:rotateX(90deg) translateZ(32px)}
.c-face.f-D{transform:rotateX(-90deg) translateZ(32px)}
.sticker3d{cursor:pointer}
.sticker3d:hover{filter:brightness(1.12)}
.c-face.hidden{opacity:0;pointer-events:none}
[data-col="0"]{background:#fdfcf3}
[data-col="1"]{background:#d02b20}
[data-col="2"]{background:#1e9e4f}
[data-col="3"]{background:#ffd23f}
[data-col="4"]{background:#f07d1a}
[data-col="5"]{background:#2456a6}
.sim-btns,.sim-controls .status{display:inline-block;vertical-align:top}
.sim-btns{width:170px;margin:0 14px 8px 0}
.sim-controls .status{width:calc(100% - 190px);min-width:220px}
.btn{display:block;width:100%;margin-bottom:8px;padding:5px 14px;border:0;border-radius:10px;background:#3960a1;color:#fff;cursor:pointer;font:inherit;font-weight:700;line-height:20px;text-align:center}
.btn:hover,#btn-timer.is-running{background:#254780}
.btn:disabled{opacity:.55;cursor:wait;background:#3960a1}
.btn svg{width:16px;height:16px;vertical-align:-3px;margin-right:6px}
.btn b{font-size:13px}
.sim-alg{display:block;clear:both;margin-top:4px}
.sim-alg input,.sim-alg .btn{display:inline-block;vertical-align:top;margin:0}
.sim-alg input{width:calc(100% - 110px);min-width:180px;padding:5px 10px;border:1px solid #bbb;border-radius:10px;font:inherit;font-size:13px;line-height:20px;color:#222;background:#fff}
.sim-alg input:focus{outline:0;border-color:#3960a1}
.sim-alg .btn{width:100px;margin-left:10px}
.sim-alg.sim-play{margin-top:8px}
.sim-link{margin-top:12px}
.sim-link label{display:block;margin-bottom:4px;font-size:13px;font-weight:700;color:#222}
.sim-alg.sim-link input{width:calc(100% - 220px);color:#555;background:#f7f9fc}
.sim-embed textarea{display:inline-block;vertical-align:top;width:calc(100% - 110px);min-width:180px;height:70px;margin:0;padding:5px 10px;border:1px solid #bbb;border-radius:10px;font:12px/1.4 monospace;color:#555;background:#f7f9fc;resize:vertical;word-break:break-all}
.sim-embed textarea:focus{outline:0;border-color:#3960a1}
a.btn{box-sizing:border-box;color:#fff;text-decoration:none}
a.btn:hover{color:#fff}
.alg-player{display:none;padding:8px 10px 0;text-align:center}
.alg-player.is-on{display:block}
.ap-moves{margin-bottom:8px;font-family:monospace;font-size:20px;font-weight:700;line-height:1.6;color:#222;word-break:break-word}
.ap-mv{display:inline-block;padding:0 5px;border-radius:6px;cursor:pointer}
.ap-mv:hover{background:#e3e9f3}
.ap-mv.is-done{color:#9a9a9a}
.ap-mv.is-cur{color:#fff;background:#3960a1}
.ap-ctrl{display:inline-flex;align-items:center;gap:8px}
.ap-btn{display:inline-flex;align-items:center;justify-content:center;width:42px;height:34px;padding:0;border:0;border-radius:8px;background:#3960a1;color:#fff;cursor:pointer}
.ap-btn:hover{background:#254780}
.ap-btn:disabled{opacity:.4;cursor:default;background:#3960a1}
.ap-btn svg{width:18px;height:18px}
.ap-count{min-width:48px;font:700 13px monospace;color:#3960a1;text-align:left}
.alg-err{display:none;font-size:13px;line-height:1.6;color:#c9282d;margin-top:4px;word-break:break-word}
.page .alg-notes{margin:14px 0 0;font-size:13px;line-height:1.6;color:#444}
.alg-notes b{color:#222}
.alg-demos{margin-top:10px;font-size:13px;line-height:1.6;color:#444}
.page .alg-demos p{margin:0 0 6px}
.alg-demos b{color:#222}
.page .alg-demos ol{margin:0;padding:0 0 0 22px}
.alg-demos li{margin:0 0 4px}
.alg-demo{display:inline-block;padding:2px 8px;border:1px solid #d5dce6;border-radius:8px;background:#f7f9fc;color:#222;font:inherit;text-align:left;cursor:pointer}
.alg-demo:hover{border-color:#3960a1;background:#e3e9f3}
.alg-demo span{margin-right:8px;font-weight:700;color:#3960a1}
.alg-demo code{font-family:monospace;font-size:13px;font-weight:700;word-break:break-word}
.page .sim-shot{margin:16px 0 0;text-align:center}
.page .sim-shot img{display:inline-block;max-width:100%;height:auto}
.page .sim-article{margin:28px 0 0;padding-top:18px;border-top:1px solid #d5dce6;font-size:15px;line-height:1.65;color:#333}
.page .sim-article h1{margin:0 0 12px;padding:0;font-size:26px;line-height:1.25;color:#222}
.page .sim-article h2{margin:0 0 10px;padding:0;font-size:22px;line-height:1.3;color:#222}
.page .sim-article h3{margin:20px 0 8px;padding:0;font-size:17px;line-height:1.35;color:#222}
.page .sim-article p,.page .sim-article ul,.page .sim-article ol{margin:0 0 12px}
.page .sim-article ul,.page .sim-article ol{padding-left:22px}
.page .sim-article li{margin:0 0 4px}
.page .sim-article a{color:#075f91}
.page .sim-article figure{margin:6px 0 16px;text-align:center}
.page .sim-article img{display:inline-block;max-width:100%;height:auto;border-radius:6px}
.page .sim-article figcaption{margin-top:6px;font-size:13px;line-height:1.5;color:#666}
.status{font-size:13px;line-height:1.6;min-height:60px;word-break:break-word}
.status[data-kind=err]{color:#c9282d}
.status[data-kind=ok]{color:#2e7d43}
.sw-timer{display:block;width:fit-content;font-family:monospace;font-size:clamp(28px,6.5vw,36px);font-weight:700;line-height:1.04;margin-bottom:4px;color:#3960a1;font-variant-numeric:tabular-nums;cursor:pointer}
.sw-timer.is-running{color:#2e7d43}
@media (max-width:880px){#viewport3d{height:450px}}
@media (max-width:480px){#viewport3d{height:350px;perspective:1100px}}
.embed #tabsContent,.embed #sidebarContent,.embed #preventMouseHoverOnPageLoad,.embed #sidebar,.embed #footerContent,.embed #back2Top,.embed .puzzle-nav,.embed .sim-alg,.embed .sim-alg~*,.embed .sim-controls~*,.embed .panel--controls,.embed .stage-toggles{display:none}
.embed-edit{position:absolute;top:10px;left:10px;z-index:4;display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:8px;background:#3960a1;color:#fff;opacity:.5;transition:opacity 130ms}
.embed .align-badge{left:56px}
.embed-edit:hover{background:#254780;color:#fff;opacity:1}
.embed-edit svg{width:18px;height:18px;stroke:#fff}
.embed,.embed body{margin:0;background:#fff;overflow-x:hidden}
.embed .mainsection{margin:0;padding:0}
.embed #content{width:auto;float:none}
.embed .article{padding:8px;border:0;background:#fff}
.page .widgets-intro{margin:0 0 16px;line-height:1.5}
.page .widgets-intro a{color:#075f91}
.page .widgets,.page .widgets .widget-card{display:block;margin:0 0 16px}
.page .widgets .widget-card{padding:16px;border:1px solid #d5dce6;border-radius:10px;background:#f7f9fc}
.page .widgets h2{margin:0 0 8px;padding:0;font-size:18px;line-height:24px;color:#222}
.page .widgets textarea{display:block;width:100%;max-width:100%;height:84px;margin:0 0 8px;padding:8px;border:1px solid #c4cdd9;border-radius:6px;background:#fff;color:#222;font:12px/1.4 monospace;resize:vertical;word-break:break-all}
.page .widgets .btn{display:inline-block;width:auto;margin:0 8px 0 0;vertical-align:top}
.page .widgets .widget-frame{margin:16px 0 0}
.page .widgets .widget-frame iframe{display:block;width:100%;max-width:100%;border:0}
