*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at top left,#24545b,#0b2434 65%);color:#edf7f5;font:16px system-ui,sans-serif;min-height:100svh}main{max-width:1240px;margin:auto;padding:20px 28px}.topline{display:flex;align-items:center;gap:8px}.eyebrow{font-size:11px;letter-spacing:.16em;color:#8dd8c5;margin-right:auto}h1{font-size:clamp(28px,4vw,40px);letter-spacing:-.04em;margin:8px 0}header p{color:#b7d8df;margin:4px 0 16px;font-size:14px}.game-layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(330px,1fr);gap:28px}.board-stage{padding:16px;background:#102f3a;border:1px solid #376273;border-radius:22px;align-self:start}#board{display:grid;grid-template-columns:repeat(6,1fr);gap:6px;width:min(100%,calc(100svh - 220px));min-width:294px;margin:auto}.tile{aspect-ratio:1;min-width:44px;min-height:44px;border:2px solid transparent;border-radius:12px;font-size:clamp(20px,3vw,30px);font-weight:800;color:#102c3b;padding:0;box-shadow:inset 0 -4px #0002}.t0{background:#f5a98e}.t1{background:#7fd1ea}.t2{background:#d6bef9}.t3{background:#dbe98b}.selected{outline:3px solid #fff;outline-offset:-5px}.available{border-color:#fff;box-shadow:inset 0 0 0 2px #153849}.game-panel{min-width:0;max-height:calc(100svh - 175px);overflow:auto;padding:4px 6px 6px 0}#status{font-weight:750;font-size:14px}#detail{font-size:13px;color:#a6edcf}#recipes{display:flex;gap:8px;margin:12px 0}.recipe{flex:1;padding:10px 8px;border:1px solid #567b86;border-radius:10px;font-size:13px;background:#173b4b}.recipe.current{border-color:#ffd18e;background:#365147}.recipe.packed{border-color:#77ddbf;color:#a6edcf}#message,#preview{font-size:13px;line-height:1.4;min-height:36px;margin:10px 0;overflow-wrap:anywhere}#preview{color:#d1e9f5;padding:8px;background:#193b4d;border-radius:10px;min-height:64px}nav{display:flex;flex-wrap:wrap;gap:8px}button{cursor:pointer;touch-action:manipulation;font:inherit}button:not(.tile){min-height:44px;background:#c6f3dc;border:0;border-radius:10px;padding:9px 12px;color:#153849;font-weight:700;font-size:13px}#restart{background:#ffce8d}button:disabled{cursor:default;opacity:.6}button:focus-visible{outline:3px solid #fff;outline-offset:2px}#help{margin-top:16px;border-top:1px solid #42616d;padding-top:12px;color:#b6d0d8;font-size:12px;line-height:1.55}#help h2{font-size:13px;text-transform:uppercase;letter-spacing:.1em;color:#8dd8c5;margin:0}#help p{margin:8px 0}.fine{font-size:11px}#help-open{display:none}dialog{color:#edf7f5;background:#123445;border:1px solid #5f8490;border-radius:20px 20px 0 0;padding:16px 20px;margin:auto auto 0;width:min(100%,620px);max-height:85svh;overflow:auto}dialog::backdrop{background:#020e19b8}.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.sheet-head h2{font-size:20px;margin:0}dialog[open]{animation:rise .16s ease-out}@keyframes rise{from{transform:translateY(30px)}to{transform:translateY(0)}}
@media(max-width:759px){main{padding:12px 14px 20px}.eyebrow{font-size:9px;letter-spacing:.08em}h1{font-size:30px}header p{margin-bottom:12px}.game-layout{display:flex;flex-direction:column;gap:12px}.board-stage{width:100%;padding:10px;border-radius:16px}#board{width:min(100%,360px);min-width:0;gap:5px}.tile{min-width:44px;min-height:44px;border-radius:9px}.game-panel{max-height:none;overflow:visible;padding:0}#help-open{display:block}#recipes{margin:0 0 8px}#status{margin-bottom:8px}#detail{margin:6px 0}#message{min-height:20px;margin:8px 0}#preview{min-height:52px;margin:8px 0}#help-home{display:none}nav button{font-size:12px}}
@media(max-width:359px){main{padding:10px 8px}.topline{gap:5px}.topline button{padding:8px}.eyebrow{max-width:88px}.board-stage{padding:6px}#board{gap:3px}.tile{min-width:44px;min-height:44px}h1{font-size:27px}}
@media(min-width:760px) and (max-height:499px){main{padding:10px 18px}header p{display:none}h1{font-size:26px;margin:5px 0 10px}.board-stage{padding:8px}#board{width:294px;gap:6px}.game-panel{max-height:calc(100svh - 105px)}#help-open{display:block}#help-home{display:none}.game-layout{gap:18px}}
@media(prefers-reduced-motion:reduce){dialog[open]{animation:none}}

@media(min-width:760px) and (max-height:499px){main{padding:8px 18px}h1{font-size:22px;line-height:1;margin:4px 0 6px}.board-stage{padding:6px}#board{width:279px;min-width:279px;gap:3px}.game-panel{max-height:calc(100svh - 96px)}}
@media(min-width:760px) and (min-height:500px){#board{width:min(100%,calc(100svh - 245px))}.game-panel{max-height:calc(100svh - 205px)}}
@media(min-width:760px) and (max-height:499px){#message{min-height:0;margin:5px 0}#preview{min-height:44px;margin:5px 0}#recipes{margin:8px 0}.recipe{padding:6px}#detail{margin:6px 0}}
@media(max-width:759px){nav button:not(.tile){font-size:12px;padding:8px 10px}}

.marked{border-color:#ffde80;box-shadow:inset 0 0 0 3px #80622f}.marked::after{content:'⚓';display:block;font-size:11px;line-height:1}.tile{position:relative}.tile.marked::after{position:absolute;right:3px;bottom:3px}.available{outline:2px dashed white;outline-offset:-5px}
@media(max-width:759px){#board{width:min(100%,310px)}#preview{min-height:52px}}
@media(max-width:759px){header p{display:none}#board{width:min(100%,294px)}}
@media(min-width:760px) and (max-height:499px){nav button:not(.tile){font-size:11px;padding:8px}}
@media(min-width:760px) and (max-height:499px){#detail,#message,#preview,.recipe{font-size:11px}#preview{line-height:1.3}}

.empty{background:#173b4c;color:#a6cbd5;box-shadow:none}.landing{border:2px dashed #8dd8c5}.aimed{outline:2px solid #fff;outline-offset:-4px}.empty.aimed{color:#ffdc99}.marked::after{content:'✦'}

.courier{background:#ffd28c;color:#153849;border-color:#fff0ba;font-size:34px}.aimed{outline:2px solid #fff;outline-offset:-4px}

.ghost{background:#386b5d;color:#c8f5d8}.blocked{outline:2px dashed #f5a98e;outline-offset:-3px}.held{box-shadow:inset 0 0 0 4px #efb84f}.clearing{outline:3px solid #f7df9b;outline-offset:-4px}#shapes{display:flex;gap:8px;margin:6px 0}.shape-card{flex:1;display:flex;align-items:center;justify-content:center;gap:8px;font-size:11px;padding:4px;background:#183b49;border-radius:8px}.footprint-grid{display:grid;grid-template-columns:repeat(3,7px);gap:2px}.footprint-grid i{width:7px;height:7px;background:#ffffff12}.footprint-grid i.filled{background:#92e3c7}@media(max-width:759px){nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}nav button{width:100%}}@media(min-width:360px) and (max-width:759px){nav{grid-template-columns:repeat(3,minmax(0,1fr))}nav button:not(.tile){padding:7px 4px;font-size:11px}}
@media(min-width:760px) and (max-height:499px){.footprint-grid{grid-template-columns:repeat(3,5px);gap:1px}.footprint-grid i{width:5px;height:5px}.shape-card{font-size:10px;padding:3px}}

.tile.pin{box-shadow:inset 0 0 0 3px #e6bc62}.pin-label{position:absolute;right:2px;bottom:1px;font-size:11px;line-height:1;background:#183849;color:#fff5cf;padding:2px;border-radius:3px}.dye-group{outline:2px solid #e9e0f2;outline-offset:-4px}.ghost{color:#c8f5d8}.tile.clearing{outline:3px solid #f6dfa3;outline-offset:-4px}#thread0{background:#f5a98e}#thread1{background:#7fd1ea}#thread2{background:#d6bef9}

.carve-target{outline:3px dashed #f4d69a;outline-offset:-4px}.recipe.engraved{background:#25594f;color:#e0fff1}

.tile.blast{outline:3px solid #ffe39a;outline-offset:-5px}.tile.crowd{box-shadow:inset 0 0 0 2px #95dfcb}.tile.marked{border:3px solid #e7bd61}.tile.marked::after{content:'★';font-size:11px;position:absolute;right:2px;top:1px}.tile.aimed{outline:3px solid white;outline-offset:-4px}nav #commit{grid-column:1/-1}nav button[aria-pressed="true"]{box-shadow:inset 0 0 0 2px #183b4c;background:#ffe1a6}
