/* Journey pieces (walls, locks, twins, gates, pins), stars, endless/weekly home cards and the puzzle maker. */
:root{--wall:#a3a3a3;--locked:#bdbdbd}body.dark{--wall:#5e5e5e;--locked:#5a5a5a}
.wall{fill:none;stroke:var(--wall);stroke-width:calc(var(--stroke) * 2.3);stroke-linecap:square;stroke-linejoin:miter}
.link{fill:none;stroke:var(--muted);stroke-width:1.6;stroke-dasharray:1 7;stroke-linecap:round;opacity:.75}
.piece.locked .line{stroke:var(--locked)}.piece.locked .anchor,.piece.locked .tip{fill:var(--locked)}
.lock-glyph rect,.lock-glyph path{fill:var(--paper);stroke:var(--ink);stroke-width:2;stroke-linejoin:round}
.key-ring{fill:none;stroke:var(--ink);stroke-width:2;stroke-dasharray:3 3.5}
.wall.gate{stroke-dasharray:9 5;stroke-linecap:butt}.gate-mark{fill:var(--paper);stroke:var(--wall);stroke-width:2}.gate-link{stroke:var(--wall);opacity:.9}
.pin-ring{fill:none;stroke:var(--ink);stroke-width:1.6;stroke-dasharray:2.5 3}.pin-dot{fill:var(--ink)}.pin.holding .pin-ring{stroke-dasharray:none;stroke-width:2}
.tools #undo.nudge{background:var(--ink);color:var(--paper);animation:nudge 1.2s ease-in-out infinite}
.star-row{display:flex;justify-content:center;gap:14px;margin:6px 0 10px}
.star svg{width:46px;height:46px;fill:none;stroke:var(--line);stroke-width:1.5;stroke-linejoin:round}
.star.earned svg{fill:var(--ink);stroke:var(--ink);animation:star-pop .5s cubic-bezier(.3,1.7,.5,1) both;animation-delay:calc(.42s + var(--i) * .17s)}
.result .star-key{font-size:11px;letter-spacing:.3px;margin:-2px 0 0}
.pips{display:inline-flex;gap:3px;justify-content:center;margin-top:4px;vertical-align:middle}.pips i{width:6px;height:6px;border-radius:50%;border:1px solid var(--muted);box-sizing:border-box}.pips i.on{background:var(--ink);border-color:var(--ink)}
.level-grid button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;line-height:1}
.chapter-card.sealed .chapter-heading{opacity:.55}
.home-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.home-card{border:0;background:var(--soft);border-radius:18px;padding:13px 15px;text-align:left;min-height:58px}.home-card strong{display:block;font-size:13px;font-weight:500}.home-card small{display:block;font-size:11px;color:var(--muted);margin-top:4px}
.home-top-actions{display:flex;gap:0}
.endless-depth{font-size:76px;font-weight:300;letter-spacing:-3px;line-height:1;margin-top:8px}
.result-hearts{justify-content:center;margin:12px 0 4px}
@keyframes star-pop{from{transform:scale(.2) rotate(-30deg);opacity:0}to{transform:none;opacity:1}}
@keyframes nudge{50%{transform:scale(1.05)}}
@media(max-height:700px){.home-card{padding:9px 13px;min-height:48px}.home-row{margin-top:8px}}
/* puzzle maker */
#editor{max-width:560px;height:100%;margin:auto;padding:max(12px,env(safe-area-inset-top)) 22px max(14px,env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:10px;background:var(--paper)}
#editor[hidden]{display:none}
.editor-header{display:flex;align-items:center;justify-content:space-between;font-size:11px;letter-spacing:1.5px;min-height:44px;flex-shrink:0}.editor-header button{border:0;background:none;font-size:13px;letter-spacing:0}#editor-home{font-size:30px;width:44px;padding:0}
.editor-tools{display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:30px;background:var(--soft);align-self:center;flex-shrink:0}.editor-tools button{border:0;border-radius:24px;font-size:12px;padding:8px 20px;min-height:38px;background:transparent;color:var(--muted)}.editor-tools button[aria-pressed=true]{background:var(--ink);color:var(--paper)}
.editor-stage{flex:1;min-height:0;display:grid;place-items:center}.editor-stage{overflow:hidden}.editor-stage svg{display:block;overflow:visible;touch-action:manipulation;cursor:pointer}
.lattice .dot{fill:#cfcfcf}.dark .lattice .dot{fill:#444}
.editor-stage .line{stroke-width:7}.editor-stage .line.draft{stroke:var(--muted)}.editor-stage .joint{stroke-width:3.5}
.draft-start{fill:none;stroke:var(--ink);stroke-width:2;stroke-dasharray:3 4}
.editor-status{text-align:center;font-size:13px;color:var(--muted);min-height:40px;margin:0;line-height:1.5;flex-shrink:0}
.editor-meta{text-align:center;font-size:11px;color:var(--muted);margin:-6px 0 0;flex-shrink:0}
.editor-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;flex-shrink:0}.editor-actions button{min-height:50px;border-radius:17px;font-size:13px}

#board svg{shape-rendering:geometricPrecision}#board .line{stroke-width:calc(var(--stroke) * var(--k,1))}#board .hinted .line{stroke-width:calc((var(--stroke) + 1.5) * var(--k,1))}#board .wall{stroke-width:calc(var(--stroke) * 2.3 * var(--k,1))}

.editor-link{border:0;background:none;padding:0;min-height:0;font-size:inherit;color:var(--ink);text-decoration:underline}
.editor-mine{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;align-content:start;width:100%;max-height:100%;overflow:auto}.editor-mine button{min-height:44px;border-radius:12px}
/* Tool rows share the width among visible buttons, so the daily (no hint) spreads to three. */
.tools{display:flex}.tools>button{flex:1 1 0;min-width:0}.tools>[hidden]{display:none}
/* Swing arrows: the fold direction of every open hinge. */
#board .swing path{fill:none;stroke:var(--muted);stroke-width:calc(2.2px * var(--k,1));stroke-linecap:round;opacity:.9}#board .swing .head{fill:var(--muted);stroke:none}
#board .swing.on path{stroke:var(--ink);opacity:1}#board .swing.on .head{fill:var(--ink)}
#board .ghost{fill:none;stroke:var(--ink);stroke-width:calc(var(--stroke) * var(--k,1));stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 9;opacity:.45}
/* Element tooltips */
.legend{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:10px 0 0}.legend[hidden]{display:none}
.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:100px;padding:4px 11px 4px 9px;font:inherit;font-size:12px;min-height:30px;cursor:pointer}
.chip svg{width:14px;height:14px;overflow:visible}.chip .g-wall{stroke:var(--wall);stroke-width:3.4;fill:none}.chip .g-gate{stroke-dasharray:3 2}.chip .g-line{fill:none;stroke:currentColor;stroke-width:1.6}.chip .g-fill{fill:currentColor}
.chip.new{border-color:var(--ink)}.chip.new::after{content:'';width:6px;height:6px;border-radius:50%;background:var(--ink)}
@keyframes el-pulse{0%,100%{opacity:1}50%{opacity:.15}}
#board.focus-walls .wall:not(.gate),#board.focus-gates .gate,#board.focus-gates .gate-mark,#board.focus-gates .gate-link,#board.focus-locks .piece.locked:not(.pinned),#board.focus-locks .key-ring,#board.focus-twins .piece.twin,#board.focus-twins .twin-link,#board.focus-pins .pin,#board.focus-pins .piece.pinned{animation:el-pulse .9s ease-in-out 3}
