:root{color-scheme:light;--bg:#f5f7f8;--surface:#fff;--ink:#23333d;--muted:#78868e;--line:#e5ecef;--accent:#00b9d9;--accent-soft:#e6f9fc;--board:#fff;--grid:#dbe3e7;--shadow:0 14px 45px #1936420a;--radius:20px;font-family:"Segoe UI",system-ui,sans-serif;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);min-width:300px}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button{color:inherit}button:disabled{cursor:default;opacity:.35}button:focus-visible,a:focus-visible,summary:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid #f7b340;outline-offset:4px}button{border:0}button svg{pointer-events:none}a{color:inherit}h1,h2,h3,p{margin:0}h1,h2{letter-spacing:-.035em}h1{font-size:31px;font-weight:650;line-height:1.2}h2{font-size:30px;font-weight:650;line-height:1.2}.icon-definitions{position:absolute;width:0;height:0;overflow:hidden}.icon{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.flip{transform:rotate(180deg)}.muted{color:var(--muted);font-size:13px}.eyebrow{font-size:10px;letter-spacing:.16em;font-weight:750;color:var(--muted)}.badge{font-size:10px;letter-spacing:.04em;background:var(--line);padding:4px 8px;border-radius:20px;white-space:nowrap}.topbar{height:88px;background:var(--accent);display:flex;align-items:center;justify-content:space-between;padding:0 max(32px,calc((100vw - 1250px)/2));color:white}.brand{text-decoration:none;display:flex;align-items:center;gap:13px;font-weight:750;font-size:28px;letter-spacing:-1.3px;line-height:1}.brand-light{font-weight:350}.brand small{font-size:8px;letter-spacing:2.2px;font-weight:650;display:block;margin-top:8px}.topbar nav{display:flex;align-items:center;gap:9px}.header-button{display:flex;align-items:center;gap:9px;background:transparent;border-radius:12px;padding:12px 15px;font-size:13px;font-weight:600;color:#fff}.header-button:hover{background:#ffffff25}.layout{max-width:1250px;margin:0 auto;display:grid;grid-template-columns:270px minmax(0,660px);gap:80px;padding:42px 32px 38px;justify-content:center}.sidebar{min-width:0;align-self:start}.sidebar-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.intro{margin-top:8px}.overall-progress{margin:28px 0 24px}.progress-copy{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted);margin-bottom:10px}.progress-copy strong{color:var(--ink);font-weight:600}.progress-track{height:4px;border-radius:8px;background:var(--line);overflow:hidden}.progress-track span{height:100%;display:block;border-radius:8px;background:var(--accent);transition:width .2s}.pack-list{display:flex;flex-direction:column;gap:7px;max-height:calc(100vh - 420px);overflow-y:auto;scrollbar-width:thin;padding:2px}.pack-card{width:100%;display:flex;align-items:center;gap:12px;background:transparent;padding:12px;border-radius:13px;text-align:left;border:1px solid transparent}.pack-card:hover{background:var(--surface)}.pack-card.active{background:var(--surface);border-color:var(--line);box-shadow:0 4px 12px #1b394606}.pack-color{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;font-size:10px;font-weight:750;flex:none}.pack-text{min-width:0;flex:1}.pack-text strong{display:block;font-size:13px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pack-text small{display:block;font-size:10px;color:var(--muted);margin-top:4px}.pack-chevron{font-size:20px;color:var(--muted)}.sidebar-foot{margin:24px 0 0;display:flex;align-items:center;gap:8px;font-size:11px;color:var(--muted)}.status-dot{width:6px;height:6px;border-radius:50%;background:#79bc43}.game{min-width:0}.level-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}.pack-link{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:12px;background:transparent;padding:0 0 8px;font-weight:600;max-width:450px;text-align:left}.pack-link:hover{color:var(--accent)}.level-arrows{display:flex;gap:8px}.icon-button{height:39px;width:39px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--surface);border:1px solid var(--line)}.icon-button:hover{border-color:var(--accent);color:var(--accent)}.metrics{display:flex;align-items:center;justify-content:space-between;padding:0 8px 19px;gap:8px}.metrics>div{text-align:left}.metric-label{display:block;font-size:9px;letter-spacing:.12em;color:var(--muted);font-weight:700;margin-bottom:5px}.metrics strong{font-size:21px;font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:-.04em}.metrics strong span{font-size:15px}.board-shell{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:22px 22px 0;box-shadow:var(--shadow)}.board{position:relative;width:100%;margin:0 auto;aspect-ratio:1;touch-action:none;user-select:none;outline:none;border-radius:6px;overflow:hidden}.board:focus-visible{box-shadow:0 0 0 3px #f7b340}.board>svg{width:100%;height:100%;display:block;touch-action:none}.board-message{font-size:11px;color:var(--muted);text-align:center;min-height:43px;padding:14px 0;line-height:1.4}.tools{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:17px}.tool-button{background:var(--surface);border:1px solid var(--line);padding:13px 12px;display:flex;align-items:center;justify-content:center;gap:9px;border-radius:12px;font-size:12px;font-weight:600}.tool-button:hover{border-color:#a6c9d1;transform:translateY(-1px)}.tool-button .icon{width:18px;height:18px;color:var(--muted)}.hint-button{background:var(--accent-soft);border-color:#b7e8f0;color:#09879d}.hint-button .icon{color:#09879d}.unlimited{font-size:17px;line-height:1;margin-left:3px}kbd{font:9px "Segoe UI",sans-serif;background:var(--bg);color:var(--muted);padding:2px 4px;border:1px solid var(--line);border-radius:4px;font-weight:400}.tool-button kbd{margin-left:4px}.below-board{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:24px}.below-board .muted{font-size:11px;line-height:1.6}.primary{display:inline-flex;align-items:center;justify-content:center;gap:13px;padding:13px 21px;background:var(--accent);color:#fff;font-weight:650;font-size:13px;border-radius:12px;min-height:45px;white-space:nowrap;box-shadow:0 4px 10px #00b9d91b}.primary:hover{filter:brightness(.95);transform:translateY(-1px)}.primary .icon{width:18px}.keyboard-help{margin-top:22px;text-align:center;font-size:10px;color:var(--muted)}.keyboard-help kbd{margin-left:8px}.secondary{padding:11px 16px;background:var(--bg);border:1px solid var(--line);border-radius:9px;font-size:12px;font-weight:600}.secondary:hover{border-color:var(--accent)}.text-button{background:transparent;color:var(--muted);font-size:12px;padding:13px 4px}.text-button:hover{color:var(--accent)}dialog{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:24px;padding:30px;box-shadow:0 30px 120px #14384935;max-height:calc(100dvh - 40px);overflow:auto;max-width:calc(100vw - 28px)}dialog::backdrop{background:#18313f70;backdrop-filter:blur(6px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:25px}.dialog-heading h2{font-size:26px;margin-top:8px}.dialog-heading .icon-button{flex-shrink:0}.levels-dialog{width:690px}.settings-dialog{width:490px}.level-controls{display:flex;gap:14px;margin-bottom:20px}.level-controls label{display:flex;flex-direction:column;gap:7px;color:var(--muted);font-size:11px;font-weight:600;flex:1}.level-controls .jump-label{flex:0 0 120px}select,input[type=number]{padding:12px;border:1px solid var(--line);background:var(--bg);border-radius:9px;color:var(--ink);min-width:0;width:100%;font-size:13px}.collection-details{font-size:12px;color:var(--muted);margin-bottom:16px}.level-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:8px}.level-cell{position:relative;aspect-ratio:1;background:var(--bg);border:1px solid var(--line);border-radius:10px;font-size:13px;font-weight:600;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}.level-cell:hover{border-color:var(--accent)}.level-cell.current{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent)}.level-cell.solved{background:var(--accent-soft);border-color:transparent;color:#09879d}.level-cell small{font-size:7px;letter-spacing:1px;color:#d4aa43}.pagination{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted);margin-top:14px}.setting-row{display:flex;justify-content:space-between;align-items:center;padding:17px 0;gap:20px;border-bottom:1px solid var(--line);cursor:pointer}.setting-row strong{display:block;font-size:13px;font-weight:650}.setting-row small{display:block;font-size:11px;color:var(--muted);margin-top:5px;line-height:1.6}.setting-row input{appearance:none;flex-shrink:0;width:39px;height:23px;background:var(--line);border-radius:20px;position:relative;cursor:pointer;margin:0;transition:background .2s}.setting-row input:after{content:"";position:absolute;top:3px;left:3px;width:17px;height:17px;background:var(--surface);border-radius:50%;box-shadow:0 1px 4px #0002;transition:transform .2s}.setting-row input:checked{background:var(--accent)}.setting-row input:checked:after{transform:translateX(16px);background:white}.save-section{margin:23px 0}.save-section h3{font-size:13px;font-weight:650}.save-section p{font-size:11px;color:var(--muted);margin-top:7px;line-height:1.6}.save-buttons{display:flex;gap:9px;margin-top:13px}.how-to{font-size:12px;border-top:1px solid var(--line);padding-top:18px;line-height:1.7}.how-to summary{cursor:pointer;font-weight:600}.how-to p{margin-top:12px;color:var(--muted)}.about-note{font-size:10px;color:var(--muted);margin-top:23px;line-height:1.6}.win-dialog{width:400px;text-align:center;padding:35px 35px 22px;overflow:visible}.win-close{position:absolute;right:15px;top:15px;width:30px;height:30px}.win-close .icon{width:15px}.win-art{width:110px;height:100px;margin:4px auto 20px;position:relative;display:grid;place-items:center}.win-art span{position:absolute;width:72px;height:72px;border-radius:22px;background:#c3ed3c;left:0;top:0;transform:rotate(-18deg)}.win-art span:nth-child(2){background:#ffce45;left:35px;top:22px;transform:rotate(20deg)}.win-art span:nth-child(3){background:var(--accent);left:17px;top:10px;transform:rotate(-1deg)}.win-art svg{width:40px;height:40px;fill:none;stroke:white;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;position:relative;top:-4px;left:-1px}.win-dialog h2{font-size:28px;margin:9px 0 8px}.stars{color:#f2ba39;letter-spacing:8px;font-size:26px;margin-left:8px}.win-dialog p{font-size:12px;line-height:1.6;color:var(--muted);margin:8px 0}.win-stats{display:flex;justify-content:center;gap:60px;margin:23px 0}.win-stats strong{display:block;font-size:25px;font-weight:600;font-variant-numeric:tabular-nums}.win-stats span{display:block;font-size:10px;color:var(--muted);margin-top:4px}.wide{width:100%}.win-dialog>.text-button{margin-top:8px}#toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,20px);max-width:calc(100vw - 30px);padding:12px 20px;background:var(--ink);color:var(--surface);border-radius:12px;font-size:12px;z-index:20;opacity:0;pointer-events:none;transition:.2s;box-shadow:var(--shadow);text-align:center}#toast.visible{opacity:1;transform:translate(-50%,0)}.fatal{padding:30px;text-align:center;line-height:1.8}.dark{color-scheme:dark;--bg:#15212a;--surface:#1d2c36;--ink:#e5edf2;--muted:#96a8b3;--line:#30434e;--accent-soft:#173d47;--board:#22333e;--grid:#425662;--shadow:0 14px 45px #0002}.dark .topbar{background:#168ba0}.dark .hint-button{border-color:#286071;color:#5ccee2}.dark .hint-button .icon{color:#5ccee2}.dark .level-cell.solved{color:#69d1e2}.dark .board{background:var(--board)}
@media(min-width:1100px) and (min-height:950px){.layout{padding-top:55px}.pack-list{max-height:calc(100vh - 440px)}}
@media(min-width:900px) and (max-height:900px){.layout{grid-template-columns:250px minmax(0,530px);gap:60px;padding-top:28px}.topbar{height:76px}.level-heading{margin-bottom:18px}.board-shell{padding:18px 18px 0}.board{max-width:440px}.tools{margin-top:12px}.below-board{margin-top:16px}.keyboard-help{margin-top:12px}}
@media(max-width:899px){.layout{display:block;max-width:650px;padding:27px 24px}.sidebar{display:none}.topbar{height:76px;padding:0 24px}.brand{font-size:25px}.brand svg{width:32px}.header-button{padding:10px}.topbar nav{gap:3px}.desktop-label{display:none}.level-heading h2{font-size:28px}.board{max-height:min(58dvh,600px)}.board-shell{padding:19px 19px 0}.board-message{font-size:11px}.keyboard-help{margin-top:18px}}
@media(max-width:480px){.topbar{height:68px;padding:0 16px}.brand{font-size:22px;gap:8px}.brand svg{width:28px;height:28px}.brand small{font-size:6px;letter-spacing:1.6px}.header-button{gap:5px;padding:8px;font-size:11px}.header-button .icon{width:17px}.layout{padding:20px 15px}.level-heading{margin-bottom:19px}.level-heading h2{font-size:27px}.pack-link{font-size:11px;max-width:240px}.metrics{padding:0 7px 16px}.metrics strong{font-size:20px}.metric-label{font-size:8px}.board-shell{padding:13px 13px 0;border-radius:15px}.board-message{font-size:10px;min-height:40px;padding:13px 0}.board{max-height:none}.tools{gap:8px;margin-top:12px}.tool-button{padding:12px 7px;font-size:11px;gap:7px}.tool-button kbd{display:none}.below-board{margin-top:19px;gap:12px}.below-board .muted{font-size:10px;max-width:150px}.primary{padding:12px 17px;font-size:12px}.keyboard-help{display:none}dialog{padding:22px;max-width:calc(100vw - 20px)}.dialog-heading{gap:12px}.dialog-heading h2{font-size:23px}.dialog-heading .eyebrow{font-size:8px}.level-grid{grid-template-columns:repeat(6,1fr);gap:7px}.level-controls{gap:10px}.level-controls .jump-label{flex-basis:90px}.level-controls select,.level-controls input{padding:10px 8px;font-size:12px}.level-cell{font-size:12px;border-radius:8px}.win-dialog{padding:30px 27px 20px;width:360px}.win-dialog h2{font-size:26px}.save-buttons{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;scroll-behavior:auto!important}}
/* Keep the SVG viewport and pointer coordinates identical on every screen. */
.board{max-height:none}.topbar{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}.layout{padding-bottom:max(28px,env(safe-area-inset-bottom))}
@media(min-width:1300px){.topbar{padding-left:calc((100vw - 1186px)/2);padding-right:calc((100vw - 1186px)/2)}}
@media(max-width:700px){.topbar nav{gap:1px}.topbar nav .header-button{width:39px;height:42px;padding:9px;justify-content:center}.topbar nav .header-button span{display:none}.topbar nav .header-button .icon{width:21px;height:21px}.brand{flex-shrink:0}.icon-button{min-width:42px;min-height:42px}.tool-button{min-height:44px}.level-cell{min-height:40px}.settings-dialog input{min-width:39px}}
@media(max-width:359px){.topbar{padding-left:10px;padding-right:10px}.brand{font-size:20px;gap:5px}.brand svg{width:23px}.brand small{letter-spacing:1px}.topbar nav .header-button{width:36px;padding:7px}.layout{padding-left:11px;padding-right:11px}.level-controls .jump-label{flex-basis:78px}.levels-dialog{padding:17px}}
@media(orientation:landscape) and (max-height:550px){.topbar{height:60px}.layout{padding-top:16px}.board{max-width:340px}.level-heading{margin-bottom:15px}}
