:root{color-scheme:light;--ink:#263c35;--paper:#f5f4ed;--green:#315e4b}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif}button,select,input{font:inherit}button,select{touch-action:manipulation}button{cursor:pointer;color:inherit;border:1px solid #c9d0c2;background:#fffefa;border-radius:8px;padding:12px 18px;min-height:44px}button:hover{background:#e9ede4}button:disabled{opacity:.4;cursor:default}button:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:3px solid #b88b43;outline-offset:3px}header{max-width:1200px;margin:auto;padding:25px 36px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #dce0d5}.brand{font-size:21px;letter-spacing:3px;font-weight:800;text-decoration:none;color:var(--ink)}.brand span{display:block;font-size:10px;letter-spacing:2px;margin-top:6px;font-weight:500}header button{font-size:12px;background:transparent}main{max-width:1160px;margin:auto;padding:0 28px}.intro{padding:36px 0 25px}.eyebrow{font-size:10px;letter-spacing:2.5px;font-weight:700;color:#6f826e}h1{font-family:"Yu Mincho",serif;font-size:48px;letter-spacing:4px;margin:15px 0;font-weight:600}.intro>p:last-child{color:#67756b;line-height:1.9;font-size:14px}.mobile{display:none}.toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;font-size:13px}.tabs{display:flex;background:#e7eade;padding:4px;border-radius:9px}.tabs button{background:transparent;border:0;padding:10px 22px;font-size:13px}.tabs button.active{background:#fffefa;box-shadow:0 2px 5px #263c3510}.toolbar select{margin:0 6px;background:#fffefa;padding:8px 12px;border:1px solid #cbd2c5;border-radius:6px;color:var(--ink)}.game{background:#fffef9;border:1px solid #dedfd3;border-radius:16px;box-shadow:0 15px 45px #3c42290a;padding:22px 25px;overflow:hidden}.game-top{display:flex;justify-content:space-between;font-size:9px;letter-spacing:2px;color:#8b907f}.stats{display:flex;justify-content:center;gap:65px;padding:20px 0 10px}.stats>div{display:flex;align-items:center;flex-direction:column;gap:7px}.stats strong{font-size:32px;font-weight:400;font-variant-numeric:tabular-nums}.stats span{font-size:10px;color:#7c8677}.gesture-tip{font-size:12px;line-height:1.8;text-align:center;color:#576957}.board-scroll{overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;background:#f2eee3;border:1px solid #dedbcc;border-radius:9px;padding:4px 0}.mechanism{display:block;width:100%;height:340px;overflow:hidden;user-select:none;-webkit-user-select:none}.rail-part{stroke:#3a4c3d;stroke-width:.8;pointer-events:none}.annotation{fill:none;stroke:#5b6756;stroke-width:.8;pointer-events:none}.part-label{font-size:10px;fill:#495947;pointer-events:none}.disk{cursor:pointer}.disk-shape{stroke:#674a25;stroke-width:.8}.disk .rotor{transition:transform .32s ease;transform-origin:0 0}.flat-edge{fill:none;stroke:#604124;stroke-width:2}.direction-arrow{fill:#62461f}.axle{fill:#87704a;stroke:#f6dfa3;stroke-width:1.8}.screw{stroke:#44341d;stroke-width:1.5}.disk-number{fill:#344b37;font-size:11px;font-weight:700;paint-order:stroke;stroke:#f8f5e6;stroke-width:3px;pointer-events:none}.disk.selected .axle{stroke:#faf6e6;stroke-width:3}.disk:focus-visible{outline:none}.disk:focus-visible .disk-shape{stroke:#146aa1;stroke-width:3}.disk.hinted .disk-shape{stroke:#167a9c;stroke-width:2.2}.collision{stroke:#bd3e25!important;stroke-width:2!important}.disk.collision .disk-shape{stroke:#bd3e25;stroke-width:2}.contact-ring{fill:#fff7e0cc;stroke:#c74225;stroke-width:1.5}.contact-cross{fill:none;stroke:#c74225;stroke-width:2;stroke-linecap:round}.hint-line{stroke:#197999;stroke-width:2;stroke-dasharray:4 3;fill:none}.hint-window{stroke:#197999;stroke-width:1.5;stroke-dasharray:4 3;fill:none}.contact-ring,.contact-cross,#guide{pointer-events:none}#carrier,#handle{touch-action:none;cursor:grab}#handle rect{fill:#4e6753;stroke:#263f2d;stroke-width:1.3}#handle path{stroke:#c9d7c6;stroke-width:2}#handle text{fill:#435942;font-size:10px;pointer-events:none}.dragging #carrier,.dragging #handle{cursor:grabbing}.cleared #slide{opacity:1}.mechanical-controls{display:flex;justify-content:center;align-items:center;gap:16px;margin-top:12px;font-size:11px}.mechanical-controls button{font-size:11px}.mechanical-controls span{min-width:180px;text-align:center}.rotation-controls{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;font-size:11px}.rotation-controls button{font-size:14px;padding:9px 18px}.rotation-controls small{font-size:10px;color:#687360}#message{min-height:64px;display:flex;justify-content:center;align-items:center;text-align:center;font-size:13px;line-height:1.8;padding:10px;color:#536451}.actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.actions button{font-size:12px}.actions .primary{background:var(--green);color:white;border-color:var(--green);padding-left:24px;padding-right:24px}.speed{margin-top:18px;display:flex;gap:15px;justify-content:center;align-items:center;font-size:10px;color:#798473}.speed input{width:130px;accent-color:var(--green)}.speed output{min-width:90px}.instructions{margin:25px 0 40px;font-size:12px;line-height:2;color:#687566}.instructions summary{cursor:pointer;color:#485e4a}.instructions a{color:var(--green)}#study{border-top:1px solid #d5dccf;padding:30px 0}h2{font-family:"Yu Mincho",serif;font-size:25px}#study p{font-size:13px;line-height:2}.binary{font-size:28px;letter-spacing:4px;padding:22px;background:#e6ebdf;border-radius:8px;font-family:monospace}.study-grid{display:grid;grid-template-columns:1fr 2fr;gap:30px;margin:20px 0}h3{font-size:14px}table{border-collapse:collapse;width:100%;font-size:13px}th,td{padding:10px 12px;border-bottom:1px solid #d3d9cd;text-align:left}#history{max-height:260px;overflow:auto;background:#eeeee4;padding:15px 20px;list-style:none;font-family:monospace;font-size:12px;line-height:2}h3 small{font-size:10px;font-weight:400}footer{padding:25px 0 35px;border-top:1px solid #dce0d5;font-size:11px;letter-spacing:2px;display:flex;justify-content:space-between;color:#7c8776}footer span{font-size:10px;letter-spacing:1px}[hidden]{display:none!important}@media(max-width:700px){header{padding:20px}.brand{font-size:17px}.brand span{font-size:9px}main{padding:0 14px}.intro{padding:25px 4px 20px}h1{font-size:37px}.game{padding:18px 10px}.stats{gap:26px}.stats strong{font-size:26px}.stats span{font-size:9px}.toolbar{font-size:12px}.tabs button{padding:10px 14px}.gesture-tip{font-size:10px}.mechanical-controls{gap:7px;flex-wrap:wrap}.mechanical-controls span{min-width:140px;font-size:10px}.mechanical-controls button{padding:10px;font-size:10px}.rotation-controls{gap:7px}.rotation-controls small{width:100%;text-align:center}.actions{gap:7px}.actions button{padding:12px 13px}.actions .primary{padding:12px 18px}.study-grid{grid-template-columns:1fr}h2{font-size:21px}.binary{font-size:24px;letter-spacing:2px}.speed{gap:8px}footer{letter-spacing:1px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}

#slide{transition:none}

.hub-number{fill:#fff4d4;font-size:8px;font-weight:700;paint-order:stroke;stroke:#4b3a25;stroke-width:1.3;pointer-events:none}.disk-label{font-size:11px;fill:#40563e;pointer-events:none}.handle-arrow{font-size:20px!important;fill:#e0e8d8!important}#labels{pointer-events:none}

.board-canvas{position:relative;min-width:680px}
.handle-controls{position:absolute;display:flex;gap:6px;z-index:3;width:94px}
.handle-controls button{width:44px;height:44px;min-height:44px;padding:0;font-size:22px;line-height:1;border-color:#9cae98;background:#fffdf3;box-shadow:0 2px 6px #263c3520}
.handle-controls button:disabled{opacity:.45;box-shadow:none}
.position-label{text-align:center;font-size:11px;min-height:18px;margin:12px 0 6px;color:#566952}
.empty-label{font-size:17px;fill:#f1ddaf;letter-spacing:1px;paint-order:stroke;stroke:#563f2d;stroke-width:.5}
.exit-line{stroke:#f6dfa4;stroke-width:2.5;stroke-dasharray:4 3}
.clear-banner{position:fixed;inset:0;z-index:20;display:grid;place-items:center;pointer-events:none;padding:20px}
.clear-card{pointer-events:auto;text-align:center;width:min(390px,100%);background:#fffef6f5;border:1px solid #c8b172;border-radius:22px;padding:22px 24px 28px;box-shadow:0 18px 70px #28382744;animation:clear-pop .48s cubic-bezier(.2,.8,.3,1) both}
.clear-card h2{font-family:inherit;font-size:48px;margin:4px 0 12px;letter-spacing:4px;color:#315e4b}
.clear-card p{font-size:13px;line-height:1.8;margin-bottom:22px}
.clear-star{display:inline-block;color:#b28b3d;font-size:40px;animation:clear-star .65s ease-out both}
.clear-card button{margin:3px;font-size:12px}.clear-card .primary{background:#315e4b;color:white;border-color:#315e4b}
@keyframes clear-pop{from{opacity:0;transform:translateY(14px) scale(.88)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes clear-star{from{opacity:0;transform:rotate(-35deg) scale(.4)}to{opacity:1;transform:rotate(0) scale(1)}}
@media(prefers-reduced-motion:reduce){.clear-card,.clear-star{animation:none}}
