:root{font-family:"Hiragino Maru Gothic ProN","Yu Gothic",system-ui,sans-serif;color:#304654;background:#f6f8f3;color-scheme:light}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at top,#f9e9df,transparent 65%),linear-gradient(140deg,#fff9ef,#e8f4f0);min-height:100vh}button,input{font:inherit}button{cursor:pointer;border:0;border-radius:18px;background:#fff;color:#304654;padding:12px 18px;font-weight:700;box-shadow:0 3px 12px #274a4810}button:hover{background:#edf7f2}button:focus-visible,input:focus-visible,[tabindex]:focus-visible{outline:3px solid #27858a;outline-offset:3px}button:disabled{opacity:.4;cursor:default}h1,h2,p{margin:0}header{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid #30465412}header h1{font-size:20px}main{max-width:960px;margin:auto}.home{text-align:center;padding:70px 22px}.home h1{font-size:clamp(40px,8vw,68px);margin:18px}.home p{line-height:1.9;color:#637b80;margin:12px auto 28px;max-width:480px}.mark{font-size:70px;color:#f47b78;letter-spacing:-15px}.primary{background:#35999d;color:white}.primary:hover{background:#267e83}.tabs{display:flex;gap:8px;margin:22px}.tabs button{flex:1}.tabs .active{background:#35999d;color:white}.intro{margin:22px}.intro p{margin-top:6px;color:#687e82}.cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;padding:0 22px 30px}.card{text-align:left;padding:18px}.card svg{width:100%;height:130px;display:block;margin:10px 0 18px}.card small{color:#7c8d90}.card b{display:block;font-size:17px}.card span{display:block;margin-top:6px;color:#788d8b;font-size:12px}.board-wrap{position:relative;padding:8px 12px}.board{display:block;width:100%;max-height:68vh;min-height:340px;background:#ffffff96;border-radius:28px;touch-action:none;box-shadow:inset 0 0 0 1px #4a736416}.piece{cursor:grab;stroke:#fff;stroke-width:.006;stroke-linejoin:round;filter:drop-shadow(0px .009px .006px #334d4522)}.piece.selected{stroke:#345c66;stroke-width:.012}.piece.invalid{stroke:#d45356;stroke-width:.012}.target{fill:#d9e3de}.status{padding:4px 20px 10px;min-height:36px;color:#607b7b;text-align:center;font-size:14px}.controls{padding:8px 20px 24px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center}.controls button{min-height:44px}.rotation{display:flex;align-items:center;gap:8px;flex-basis:100%;justify-content:center;min-height:44px}.rotation input{width:min(260px,50vw);accent-color:#35999d}.rotation output{min-width:42px}.help{font-size:13px;color:#6a8183;line-height:1.7;text-align:center;padding:0 18px 16px}.ring{fill:none;stroke:#537f86;stroke-width:.006;stroke-dasharray:.014 .014;pointer-events:none}.handle{fill:#fff;stroke:#537f86;stroke-width:.008;cursor:crosshair}.overlay{position:fixed;inset:0;background:#2d4c4c55;display:grid;place-items:center;z-index:5;padding:20px}.dialog{background:#fffdf6;padding:36px;border-radius:30px;text-align:center;max-width:420px}.dialog h2{font-size:30px;margin:12px}.dialog p{line-height:1.8;margin-bottom:20px}.dialog button{margin:5px}.badge{color:#35999d;font-size:14px}.hint{fill:none;stroke:#648e8d;stroke-dasharray:.018 .012;stroke-width:.007;pointer-events:none}.counter{white-space:nowrap;font-size:14px}.piece-list{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;padding:0 15px 8px}.piece-list button{font-size:12px;padding:7px 10px;min-height:38px;border-bottom:4px solid var(--piece)}.piece-list [aria-pressed=true]{background:#dcefeb}@media(max-width:600px){.cards{grid-template-columns:repeat(2,1fr);gap:10px;padding:0 14px 24px}.card{padding:12px}.card b{font-size:15px}.card svg{height:105px}.board{max-height:none;min-height:0;aspect-ratio:360/530}header{padding:12px}header h1{font-size:17px}.controls{padding:8px 10px 20px;gap:6px}.controls button{padding:11px 12px;font-size:14px}.home{padding-top:45px}.board-wrap{padding:6px}.counter{font-size:12px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
/* Drag pieces without trapping article scrolling on the empty board. */
.board{touch-action:pan-y}.piece,.handle{touch-action:none}button,input{touch-action:manipulation}
#flip:not(:disabled){background:#35999d;color:white;min-width:92px}
@media(max-width:600px){
 .board{height:min(57svh,510px);min-height:320px;aspect-ratio:auto}
 .controls .rotation{order:-1;flex-wrap:wrap;gap:6px}
 .controls .rotation input{width:min(180px,40vw)}
 .piece-list button{min-height:44px;padding:8px 10px}
 .status{font-size:13px;padding:4px 10px 8px}
 .help{font-size:12px}.controls button{min-height:44px}
}
@media(max-width:600px){
 .controls .rotation{display:grid;grid-template-columns:48px minmax(70px,1fr) 48px 76px;gap:6px;width:100%}
 .rotation label{display:none}.controls .rotation input{width:100%;min-width:0;grid-column:2;grid-row:1}
 #rotLeft{grid-column:1;grid-row:1}#rotRight{grid-column:3;grid-row:1}
 .rotation #flip{grid-column:4;grid-row:1;min-width:0;padding-inline:5px}
 .rotation output{grid-column:1/-1;grid-row:2;font-size:12px;text-align:center}
 .controls .rotation button{padding-inline:4px}
}
