
:root{color-scheme:dark;--ink:#edf4fc;--muted:#b7c7dc;--line:#8095b74d;--gold:#f3cd82;--panel:#0c192deE;--cyan:#8ee5f0;--rose:#f7adc9;font-family:"Yu Gothic UI","Hiragino Kaku Gothic ProN",Meiryo,sans-serif;background:#091326;color:var(--ink)}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:linear-gradient(90deg,#071022b3,#0a162584,#071022b3),url('assets/workshop.png') center/cover fixed}button,select,input{font:inherit}button,select{color:var(--ink);background:#23344d;border:1px solid #7186a3;border-radius:9px;min-height:44px;padding:10px 16px;cursor:pointer;transition:background .15s,transform .15s}button:hover:not(:disabled){background:#354d6d}button:active:not(:disabled){transform:translateY(1px)}button:focus-visible,select:focus-visible,input:focus-visible,a:focus-visible{outline:3px solid #fff0ba;outline-offset:3px}button:disabled{opacity:.45;cursor:not-allowed}.primary{background:#e9c580;color:#182235;border-color:#ffe2a7;font-weight:800}.primary:hover:not(:disabled){background:#ffdfa5}.muted{color:var(--muted)}.small{font-size:12px;line-height:1.7}header{max-width:1250px;margin:auto;padding:20px 30px;display:flex;justify-content:space-between;align-items:center}.brand{color:#f2ddb2;text-decoration:none;font-family:serif;font-size:20px;letter-spacing:.12em}.brand small{display:block;font:9px sans-serif;letter-spacing:.3em;margin-top:5px}main{max-width:1220px;margin:10px auto;padding:0 26px 35px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:16px;box-shadow:0 15px 50px #0004}.title{max-width:610px;margin:25px auto;padding:35px 45px;text-align:center;position:relative;overflow:hidden}.title:before{content:"";position:absolute;inset:0;pointer-events:none;border:5px solid #d6b16e0a;border-radius:16px}h1{font-family:"Yu Mincho",serif;font-weight:500;letter-spacing:.14em;margin:10px 0 18px;font-size:40px}h2{font-size:16px;font-weight:700;margin:0 0 18px;letter-spacing:.06em}h2 small{font-size:11px;font-weight:400;color:var(--muted);display:block;margin-top:4px}p{line-height:1.85}.eyebrow{color:#efce91;font-size:11px;letter-spacing:.24em;margin:0 0 8px}.lead{font-size:17px;color:#dce6f5}.title-art{height:128px;margin:15px 0;background:linear-gradient(90deg,#0c192d99,transparent,#0c192d99),url('assets/spools.png') center 52%/cover;border-radius:12px;display:flex;align-items:center;justify-content:center;gap:15px}.title-art>*{display:none}.start-actions{display:grid;gap:10px;margin-top:22px}.difficulty{display:flex;align-items:center;justify-content:center;gap:12px;margin:20px 0;font-size:13px}.difficulty select{font-size:13px}.game-heading{display:flex;gap:25px;align-items:center;margin:5px 0 22px}.game-heading h1{font-size:29px;margin:4px 0}.score{margin-left:auto;display:flex;align-items:baseline;gap:8px}.score strong{font:48px Georgia;color:#ffdfa0}.score span,.turn{font-size:13px;color:var(--muted)}.turn b{font-size:22px;color:var(--ink)}.game-layout{display:grid;grid-template-columns:218px minmax(280px,1fr) 235px;gap:20px;align-items:start}.goals,.tray{padding:22px 18px}.goal{padding:14px 0;border-bottom:1px solid var(--line)}.goal:first-child{padding-top:0}.goal-name{font-size:13px;line-height:1.6}.goal-value{display:flex;justify-content:space-between;align-items:center;margin:8px 0;font-size:12px;color:#d2e1f5}.goal-bar{height:5px;background:#3a4b61;border-radius:8px;overflow:hidden}.goal-bar i{display:block;height:100%;background:var(--gold);transition:width .3s}.goal.done .goal-name{color:#ffe0a3}.goals>button{width:100%;margin-top:5px;font-size:12px}.board-wrap{padding:11px;background:linear-gradient(145deg,#8f734d,#312b29 24%,#725b3f);border:1px solid #b99862;border-radius:13px;box-shadow:0 14px 40px #0009}#board{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;padding:8px;background:#101a2c;border:1px solid #99845b;border-radius:5px}.cell{position:relative;aspect-ratio:1;min-height:0;padding:0;border:1px solid #6b7d984a;border-radius:5px;background:radial-gradient(circle,#263a53,#142338);overflow:hidden}.cell.empty:after{content:"";width:5px;height:5px;border:1px solid #a4b1c56b;position:absolute;left:calc(50% - 3px);top:calc(50% - 3px);transform:rotate(45deg)}.cell.target{outline:3px solid #ffe0a3;outline-offset:0;background:#4d4c48}.cell.filled{cursor:default}.cell.closed{box-shadow:inset 0 0 16px #ffe1a233;border-color:#ffdda5}.cell svg,.choice svg{width:100%;height:100%;display:block}.cell.ghost svg{opacity:.6}.cell.rock{background:radial-gradient(ellipse at 30% 30%,#737e91,#354158 55%,#152135);border-color:#758195}.rock svg{opacity:.8}.board-hint{text-align:center;font-size:12px;margin:12px 0 8px;color:#fff0d9;min-height:22px}.board-legend{display:flex;justify-content:space-around;color:#ead8b8;font-size:10px;padding:3px}.board-legend b{margin-left:4px;color:#fff}#choices{display:flex;gap:8px}.choice{flex:1;padding:3px;min-width:0;height:78px;position:relative;background:#14243d}.choice.selected{border:2px solid #ffe0a3;box-shadow:0 0 12px #ffd28529}.choice .key{position:absolute;left:3px;top:0;font-size:10px;color:#e4edf8}.rotate-actions{display:flex;gap:7px;margin-top:13px}.rotate-actions button{padding:9px 5px;flex:1;font-size:12px}#preview{font-size:13px;min-height:96px;line-height:1.7;background:#192c46;padding:12px;border-radius:8px;margin:15px 0}#preview strong{color:#ffe0a3;font-size:20px}.tray>button{width:100%;margin:4px 0;font-size:13px}.bottom-bar{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-top:22px}.bottom-bar button{font-size:12px}.result{max-width:600px;margin:25px auto;padding:35px;text-align:center}.result-score strong{font:80px Georgia;color:#ffdfa0}.result-score span{margin-left:10px}.result h1{font-size:32px}.result #breakdown{background:#1b2d45;padding:18px;border-radius:10px;line-height:1.9;font-size:14px}.result #advice{font-size:14px;color:#d3e1f3}dialog{color:var(--ink);background:#12213a;border:1px solid #8b9fba;border-radius:15px;max-width:520px;width:calc(100% - 32px);padding:28px;box-shadow:0 20px 80px #0008}dialog::backdrop{background:#020914b8;backdrop-filter:blur(5px)}dialog p{font-size:14px}dialog label{display:flex;align-items:center;gap:14px;margin:22px 0}dialog input[type=range]{flex:1;accent-color:var(--gold)}dialog input[type=checkbox]{width:22px;height:22px;accent-color:var(--gold)}dialog>button{width:100%;margin-top:10px}#tutorialBoard{display:flex;justify-content:center;background:#09172c;padding:22px;border-radius:12px;margin:20px 0}#tutorialBoard svg{width:100px;height:100px}#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);max-width:90vw;background:#f4ddb0;color:#182235;padding:12px 22px;border-radius:10px;box-shadow:0 8px 30px #0008;opacity:0;pointer-events:none;transition:opacity .2s;z-index:10;font-size:14px}#toast.show{opacity:1}[hidden]{display:none!important}.reduce *{transition:none!important;animation:none!important}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}@media(max-width:1000px){.game-layout{grid-template-columns:1fr 240px}.goals{grid-column:1/-1;padding:15px 20px}.goals h2{margin-bottom:10px}.goals #goals{display:flex;gap:20px}.goal{flex:1;border:0;padding:0}.goals>.small,.goals>button{display:none}.board-wrap{max-width:530px}.game-heading{margin-bottom:15px}}@media(max-width:620px){header{padding:14px 17px}.brand{font-size:16px}.brand small{font-size:8px}header button{font-size:12px;padding:7px 12px}main{padding:0 12px 24px;margin-top:4px}.title{margin:10px auto;padding:26px 22px}h1{font-size:32px}.lead{font-size:15px}.title-art{height:110px}.game-heading{gap:12px}.game-heading h1{font-size:22px;letter-spacing:.06em}.score strong{font-size:34px}.turn b{font-size:18px}.turn{font-size:11px}.score span{font-size:11px}.eyebrow{font-size:9px}.game-layout{grid-template-columns:1fr;gap:12px}.goals{padding:12px}.goals h2{font-size:12px;margin-bottom:8px}.goals #goals{gap:12px}.goal-name{font-size:10px}.goal-value{font-size:10px;margin:5px 0}.board-wrap{width:100%;margin:auto;padding:8px}#board{gap:4px;padding:5px}.board-hint{font-size:11px;margin:9px 0 4px}.tray{display:grid;grid-template-columns:1fr 1fr;gap:8px 13px;padding:15px}.tray h2{grid-column:1/-1;font-size:13px;margin:0}.tray h2 small{display:inline;margin-left:10px}#choices{grid-column:1;grid-row:2/4}.choice{height:78px}.rotate-actions{margin:0;grid-column:2}.rotate-actions button{min-height:44px;font-size:10px}#preview{grid-column:1/-1;min-height:0;margin:0;padding:10px;font-size:12px}.tray>button{margin:0}.tray>#undo{grid-column:2;grid-row:3;font-size:11px}.tray>#weave{grid-column:1/-1}.tray>.small{display:none}.bottom-bar{flex-wrap:wrap;margin-top:14px;gap:7px}.bottom-bar .small{font-size:10px}.result{padding:25px 20px}.result h1{font-size:27px}.difficulty{font-size:12px;gap:7px}.difficulty select{max-width:210px}.board-legend{font-size:9px}}@media(max-width:350px){.score{gap:4px}.game-heading{gap:8px}.game-heading h1{font-size:19px}.score strong{font-size:30px}.goal-name{font-size:9px}.tray{padding:12px;gap:8px}.choice{height:65px}#board{gap:3px}.cell{min-width:44px}.brand{font-size:14px}}

@media(min-width:1001px){.game-layout{grid-template-columns:210px minmax(280px,480px) 235px;justify-content:center}.board-wrap{max-width:480px}.cell{min-width:0}}.future{font-size:12px;color:#dce7f7;margin-top:12px}.future summary{cursor:pointer;min-height:28px}.future #upcoming>div{display:flex;align-items:center;gap:4px}.future #upcoming>div>span:first-child{font-size:10px;width:38px}.future #upcoming>div>span:not(:first-child){width:40px;height:40px}.future svg{width:100%;height:100%}@media(max-width:620px){.future{grid-column:1/-1;margin:0}.future #upcoming{display:flex;gap:15px}.future summary{min-height:32px}}

.header-actions{display:flex;gap:8px}@media(max-width:620px){.goal-name{font-size:12px}.goal-value{font-size:11px}.game-heading{flex-wrap:wrap}.game-heading>div:first-child{margin-right:auto}.score{margin-left:0}.header-actions{gap:5px}.header-actions button{padding:7px 10px;font-size:11px}}
main{container-type:inline-size}.game-layout>*{min-width:0}header{flex-wrap:wrap;gap:12px}
@container(max-width:900px){.game-layout{grid-template-columns:minmax(0,1fr) 235px}.goals{grid-column:1/-1}.goals #goals{display:flex;gap:16px}.goal{flex:1;border:0;padding:0}.game-heading{flex-wrap:wrap}}
@container(max-width:700px){.game-layout{grid-template-columns:minmax(0,1fr)}.board-wrap{width:100%;margin:auto}.goals #goals{flex-wrap:wrap}.goal{min-width:100px}.game-heading{gap:12px}.game-heading h1{font-size:22px}.score strong{font-size:34px}.bottom-bar{flex-wrap:wrap}.tray{width:100%}}
