:root{color-scheme:light;--ink:#243f36;--muted:#58655d;--paper:#f5f1e7;--green:#275449;--gold:#d6a743;--line:#d4d6c8;--board-size:280px;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--paper)}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}body{height:100dvh;height:var(--viewport-height,100dvh)}button,select,input{font:inherit;color:inherit}button,select{border:1px solid var(--line);border-radius:12px;background:#fffdf7;min-height:44px}button{padding:10px 16px;cursor:pointer;touch-action:manipulation;font-weight:650}button:hover:not(:disabled){background:#e8ebdf}button:disabled{opacity:.46;cursor:default}.primary{background:var(--green);color:#fff;border-color:var(--green)}.primary:hover:not(:disabled){background:#173c32}button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #af7208;outline-offset:3px}select{padding:6px 10px;max-width:100%}[hidden]{display:none!important}#loading{padding:24px;text-align:center;margin:20vh auto}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#app{height:100%;display:flex;flex-direction:column;padding:max(6px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));max-width:1360px;margin:auto;gap:5px}.header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 auto;min-height:44px}.brand{width:160px;height:40px;object-fit:contain;object-position:left center}.language-label{max-width:min(44%,176px)}#language{width:100%}main{min-height:0;min-width:0}#menu{flex:1;overflow:auto;overscroll-behavior:contain;display:flex;align-items:safe center;justify-content:center;padding:12px 4px}.menu-card{border:1px solid var(--line);border-radius:24px;background:#fffdf6;max-width:760px;width:100%;padding:clamp(16px,3vw,32px);box-shadow:0 14px 38px #2c3e2110}.menu-hero{display:grid;grid-template-columns:minmax(110px,180px) 1fr;gap:clamp(16px,4vw,36px);align-items:center}.menu-cat{width:100%;height:auto;max-height:270px;object-fit:contain;align-self:end}.eyebrow{font-size:12px;letter-spacing:.13em;text-transform:uppercase;color:var(--muted);margin:0 0 6px}h1{font-size:clamp(27px,4vw,48px);letter-spacing:-.035em;line-height:1.05;margin:8px 0 16px;overflow-wrap:anywhere}.intro{font-size:clamp(15px,2vw,18px);line-height:1.5;margin:8px 0}.game-mark{width:62px;height:62px}.menu-options{border-top:1px solid var(--line);padding-top:16px;margin-top:20px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.difficulty-label{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.check-options{display:flex;gap:16px;flex-wrap:wrap}.check-options label{display:flex;align-items:center;gap:6px;cursor:pointer;min-height:32px}.check-options input{accent-color:var(--green);width:20px;height:20px}.menu-actions{display:flex;gap:8px;flex-wrap:wrap}.menu-actions .primary{min-width:120px;flex:1}.storage-note{font-size:12px;line-height:1.5;color:var(--muted);margin:10px 0}.menu-actions button{flex-grow:1}.menu-actions~p:empty{display:none}footer{font-size:10px;color:var(--muted);display:flex;justify-content:space-between;gap:8px;flex:0 0 auto;padding:0 2px;line-height:1.4}
#play{display:flex;flex:1;flex-direction:column;gap:5px}.toolbar{display:flex;flex:0 0 auto;gap:5px;max-width:780px;width:100%;margin:0 auto}.toolbar button{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;gap:7px;padding:7px 9px;line-height:1.15}.toolbar button>span:first-child{font-size:21px;line-height:1}.toolbar button>span:last-child{font-size:13px;overflow-wrap:anywhere}.counters{display:flex;flex:0 0 auto;gap:8px 16px;align-items:center;justify-content:center;font-size:13px;line-height:1.5;flex-wrap:wrap}.counters span{white-space:nowrap}.stage{flex:1;min-height:0;min-width:0;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:5px}.board{width:var(--board-size);height:var(--board-size);flex:none;display:grid;grid-template-columns:repeat(var(--n,4),minmax(0,1fr));gap:4px;padding:6px;border-radius:20px;border:1px solid #aeb9a5;background:#d9decf;box-shadow:0 6px 16px #33452912;direction:ltr}.tile{width:100%;height:100%;min-height:0;min-width:0;padding:0;border:1px solid #bac3b2;border-radius:10px;background:#e9ede3;position:relative;display:grid;place-items:center;transition:background-color .16s ease;overflow:visible}.tile:hover:not(:disabled){background:#fff7db}.tile:focus-visible{z-index:1;outline-offset:0}.tile.lit{background:#fff2b8;border-color:#c6ad64}.tile.lit .wire{stroke:#b47d24}.tile.lit .node{fill:#ffdc66;stroke:#8c631f}.tile:disabled{opacity:1}.tile svg{display:block;width:100%;height:100%;overflow:hidden}.wire{fill:none;stroke:#74816e;stroke-width:11;stroke-linecap:butt}.node{fill:#e4e8dc;stroke:#596b55;stroke-width:3}.tile text{fill:#203b30;font-size:22px;font-weight:750;text-anchor:middle;dominant-baseline:central}.tile .source-symbol{font-size:24px}.play-note{display:flex;align-items:center;justify-content:center;gap:8px;flex:0 0 auto;color:var(--muted);max-width:780px;width:100%;margin:auto}.play-note p{font-size:11px;line-height:1.4;margin:0;max-width:620px}.play-note img{flex:none}.win-light{font-size:clamp(16px,4vw,24px);color:#946313;padding:14px 0;text-align:center;direction:ltr}
dialog{color:var(--ink);background:#fffdf6;border:1px solid var(--line);border-radius:20px;padding:clamp(18px,4vw,32px);max-width:min(600px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;box-shadow:0 20px 60px #0003}dialog::backdrop{background:#172b25aa}dialog h2{margin:0 0 12px;font-size:25px}dialog p{line-height:1.6;font-size:15px}.dialog-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.dialog-actions button{flex:1;min-width:min-content}
@media(max-width:540px){.brand{width:132px;height:34px}.header{min-height:40px}#language{font-size:13px;min-height:38px}.menu-card{border-radius:18px;padding:16px}.menu-hero{grid-template-columns:88px 1fr;gap:14px}.menu-cat{max-height:185px}.game-mark{width:42px;height:42px}.eyebrow{font-size:10px}.intro{font-size:14px}.menu-options{gap:8px;margin-top:12px;padding-top:12px}.check-options{gap:12px;font-size:14px}.toolbar button{flex-direction:column;gap:3px;min-height:48px;padding:5px 3px}.toolbar button>span:last-child{font-size:11px}.toolbar button>span:first-child{font-size:18px}.board{gap:3px;padding:5px;border-radius:14px}.tile{border-radius:7px}footer span:first-child{display:none}footer{justify-content:center}.play-note p{max-height:none;overflow:visible;font-size:10px}.play-note{gap:5px}.counters{gap:5px 10px;font-size:12px}}
@media(max-height:420px){#app{gap:2px;padding-top:3px;padding-bottom:2px}#menu{padding:4px 4px}.menu-card{padding:8px 14px}.menu-hero{grid-template-columns:minmax(64px,96px) 1fr;gap:12px}.menu-cat{max-height:120px}h1{font-size:24px;margin:2px 0 6px}.intro{font-size:13px;margin:2px 0}.menu-options{padding-top:6px;margin-top:8px}.storage-note{margin:4px 0;font-size:11px}.menu-actions button{min-height:36px;padding:6px 10px;font-size:14px}.header{min-height:34px}.brand{width:118px;height:30px}#language{min-height:30px;font-size:12px}.toolbar button{min-height:34px;padding:4px;flex-direction:row;gap:4px}.toolbar button>span:last-child{font-size:11px}.toolbar button>span:first-child{font-size:16px}.counters{font-size:11px;line-height:1.2}.play-note{display:none}.stage{padding:3px}.board{padding:4px;gap:3px;border-radius:12px}.tile{border-radius:6px}footer{font-size:9px}.menu-card{margin:auto}.menu-cat{max-height:180px}.menu-options{margin-top:10px;padding-top:10px}.game-mark{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important}}
@media(forced-colors:active){.tile.lit{border:3px solid Highlight}.wire,.node{stroke:CanvasText}.tile text{fill:CanvasText}.tile.lit .wire{stroke:Highlight}.tile.lit .node{stroke:Highlight}.tile.lit::after{content:'✓';position:absolute;top:0;right:2px;font-size:12px}}
