*{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.gate{border:3px solid #b2a079}.tile.active-gate{border-color:#ffe49a;box-shadow:inset 0 0 0 2px #8c622d}.gate-number{position:absolute;right:2px;bottom:1px;border-radius:4px;padding:1px 3px;font-size:11px;background:#183849;color:#fff3ca}.tile.matching{outline:3px dashed white;outline-offset:-5px}.tile.swap-end{box-shadow:inset 0 0 0 3px #fff5ca}.recipe{line-height:1.4}.recipe.active{border:2px solid #ffe49a}nav #pick{background:#e4cfad}@media(min-width:360px) and (max-width:759px){nav{grid-template-columns:repeat(2,minmax(0,1fr))}}

.tile.woven{box-shadow:inset 0 0 0 4px #408e70}.tile.new-weave{outline:3px dashed #a4ffd5;outline-offset:-5px}.tile.room{border:3px solid #e6c386}.tile.restored{border-color:#e5ffd3;box-shadow:inset 0 0 0 4px #4c9b72}.room-tag{position:absolute;right:2px;bottom:1px;font-size:11px;border-radius:4px;padding:1px 3px;background:#173f38;color:#fff2bd}.tile.anchor{border:3px solid #f5edc8}@media(min-width:360px) and (max-width:759px){nav{grid-template-columns:repeat(3,minmax(0,1fr))}}

#recipes button.recipe{min-width:44px;min-height:44px;padding:8px 5px;font-size:12px;color:#e9fff6;background:#173b4b}#recipes button.current{outline:2px solid #ffe39a;outline-offset:-2px}#recipes button.engraved{background:#25594f}#detail{font-weight:700}@media(max-width:759px){#preview{min-height:64px}#recipes button.recipe{font-size:11px}}

.tile.trail{box-shadow:inset 0 0 0 3px #fff3bf}.tile.scout{border:3px solid #eaf8ff}.tile.guard{border:3px solid #d77b54}.tile.exit{border-color:#f9df91}.map-tag{position:absolute;bottom:1px;right:2px;padding:1px 2px;background:#163b48;color:#fff5da;font-size:11px;line-height:1.1;border-radius:3px}.t4{background:#f2d59b;color:#193846}#recipes{font-size:12px;color:#d3e4db;margin:10px 0}#bridge-mode[aria-pressed=true]{background:#ffd596}@media(min-width:360px) and (max-width:759px){nav{grid-template-columns:repeat(2,minmax(0,1fr))}}

.map-tag:empty{display:none}

#board{width:279px;min-width:279px;gap:3px}.tile{min-width:44px;min-height:44px;font-size:24px}.c0{background:#173b4b;color:#7f9da7;box-shadow:none}.c1{background:#8fe2ce;color:#163b48}.c2{background:#ffcf8e;color:#163b48}.c3{background:#c9b5ee;color:#163b48}.tile.landing{opacity:1;background:#284d5d;border:2px dashed #e7f9f5;color:#b1efd9}.tile.infection{border:3px solid #ffe39e}.aimed-column{box-shadow:inset 0 0 0 1px #a4c9d1}#recipes{display:flex;gap:12px;margin:8px 0}.pair{display:flex;flex-direction:column;gap:4px;font-size:11px}.pair>div{display:flex;gap:4px}.pair button.half{min-width:44px;width:44px;height:44px;padding:4px;color:#173646;font-size:20px}.half[aria-pressed=true]{outline:2px solid #fff;outline-offset:-4px}#later{font-size:20px;line-height:44px;white-space:nowrap}#preview{min-height:64px}.board-stage{overflow:auto;max-height:calc(100svh - 170px)}@media(max-width:759px){.board-stage{max-height:none}#board{width:279px;min-width:279px;gap:3px}nav{grid-template-columns:repeat(3,minmax(0,1fr))}nav button:not(.tile){padding:6px 3px;font-size:11px}#message{display:none}#preview{font-size:12px;min-height:60px}#detail{margin:4px 0}#recipes{margin:5px 0}}@media(min-width:760px) and (max-height:499px){.board-stage{max-height:calc(100svh - 96px)}#recipes{margin:4px 0}.pair{gap:2px}#preview{font-size:11px}}

.pair button.c1{background:#8fe2ce}.pair button.c2{background:#ffcf8e}.pair button.c3{background:#c9b5ee}

@media(max-width:759px){.game-layout{gap:8px}#message{display:block;font-size:11px;line-height:1.2;min-height:0;margin:4px 0}.game-panel #preview{margin:6px 0}}

.c4{background:#e6eaa3;color:#173646}.tile.lift-source{outline:3px solid #ffda85;outline-offset:-4px}#recipes{justify-content:space-between;gap:8px}.pair strong{font-size:18px;white-space:nowrap;line-height:24px}#later{line-height:24px;font-size:18px}#detail{line-height:1.4}#preview{font-size:12px;line-height:1.4}@media(max-width:759px){#preview{font-size:11px}.pair strong,#later{font-size:17px}}

#recipes{justify-content:flex-start;gap:18px}.pair strong{font-size:17px}#preview{font-size:12px}#detail{font-size:12px}@media(max-width:759px){#preview{font-size:11px;line-height:1.3}#recipes{gap:16px}#detail{font-size:11px}#fresh{grid-column:1 / -1}}

@media(max-width:759px){nav{grid-template-columns:repeat(4,minmax(0,1fr))}#fresh{grid-column:auto}nav button:not(.tile){font-size:11px;padding:5px 3px}}
