html,body{background:#fdfbf5;height:100%;margin:0;font-family:system-ui,sans-serif;overflow:hidden}#stage{touch-action:none;cursor:crosshair;width:100%;height:100%;display:block;position:fixed;inset:0}#toolbar{top:calc(12px + env(safe-area-inset-top,0px));-webkit-user-select:none;user-select:none;background:#ffffffe6;border-radius:20px;gap:10px;padding:8px;display:flex;position:fixed;left:50%;transform:translate(-50%);box-shadow:0 4px 16px #0002}#toolbar button,#tool-menu button{cursor:pointer;background:#f1efe8;border:3px solid #0000;border-radius:14px;flex-direction:column;align-items:center;gap:2px;min-width:72px;padding:8px 12px;font-size:30px;line-height:1;display:flex}#toolbar button span,#tool-menu button span{color:#444;font-size:14px;font-weight:600}#toolbar button:hover,#tool-menu button:hover{background:#e8e5da}#toolbar button:disabled{opacity:.4;cursor:default}#toolbar button:disabled:hover{background:#f1efe8}#toolbar button.active,#tool-menu button.active{background:#dbeafe;border-color:#3b82f6}#tool-menu{-webkit-user-select:none;user-select:none;background:#fffe;border-radius:18px;gap:8px;padding:8px;display:flex;position:fixed;box-shadow:0 4px 16px #0003}#tool-menu[hidden]{display:none}#toolbar .divider{background:#e4dfd2;border-radius:1px;width:2px;margin:6px 2px}.toolbar-compact #toolbar{gap:3px;padding:5px}.toolbar-compact #toolbar button,.toolbar-compact #tool-menu button{border-width:2px;min-width:0;padding:5px 4px;font-size:20px}.toolbar-compact #toolbar button span,.toolbar-compact #tool-menu button span{font-size:10px}.toolbar-tight #toolbar{gap:2px;padding:4px}.toolbar-tight #toolbar button{padding:5px 2px}.toolbar-tight #toolbar .divider{margin:6px 1px}.toolbar-rows #toolbar{box-sizing:border-box;flex-wrap:wrap;justify-content:center;width:max-content;max-width:calc(100vw - 32px)}.toolbar-rows #toolbar .divider{flex-basis:100%;height:0;margin:0}#hint{bottom:calc(12px + env(safe-area-inset-bottom,0px));text-align:center;white-space:pre-line;color:#555;pointer-events:none;-webkit-user-select:none;user-select:none;background:#fffc;border-radius:10px;width:max-content;max-width:calc(100vw - 160px);margin:0;padding:6px 12px;font-size:13px;position:fixed;left:50%;transform:translate(-50%)}#bg-button,#saves-button{right:16px;bottom:calc(12px + env(safe-area-inset-bottom,0px));cursor:pointer;background:#ffffffe6;border:none;border-radius:50%;width:52px;height:52px;font-size:26px;position:fixed;box-shadow:0 4px 16px #0002}#bg-picker{right:16px;bottom:calc(76px + env(safe-area-inset-bottom,0px));background:#fffe;border-radius:16px;grid-template-columns:repeat(4,52px);gap:8px;padding:10px;display:grid;position:fixed;box-shadow:0 4px 16px #0002}#bg-picker[hidden]{display:none}#bg-picker button{cursor:pointer;border:3px solid #0001;border-radius:12px;width:52px;height:52px}#bg-picker button.active{border-color:#3b82f6}#saves-button{left:16px;right:auto}#saves-panel{left:16px;bottom:calc(76px + env(safe-area-inset-bottom,0px));box-sizing:border-box;overscroll-behavior:contain;-webkit-user-select:none;user-select:none;background:#fffe;border-radius:16px;width:max-content;max-width:calc(100vw - 32px);padding:10px;position:fixed;overflow-y:auto;box-shadow:0 4px 16px #0002}#saves-panel[hidden]{display:none}#saves-panel .tiles{grid-template-columns:repeat(3,132px);gap:10px;display:grid}#saves-panel .tiles[data-columns="1"]{grid-template-columns:132px}#saves-panel .tiles[data-columns="2"]{grid-template-columns:repeat(2,132px)}#saves-panel .note{color:#555;margin:0 0 8px;font-size:13px}#saves-panel .note:empty{display:none}.save-tile{aspect-ratio:4/3;position:relative}.save-tile>button:first-child{cursor:pointer;background:#f1efe8 50%/cover no-repeat;border:3px solid #0001;border-radius:12px;flex-direction:column;justify-content:center;align-items:center;gap:4px;width:100%;height:100%;padding:0;font-size:30px;display:flex}.save-tile>button:first-child span{color:#444;font-size:14px;font-weight:600}.save-tile>button:first-child:disabled{opacity:.4;cursor:default}.save-tile.just-saved>button:first-child{border-color:#3b82f6;animation:.4s ease-out saved}@keyframes saved{40%{transform:scale(1.08)}}.save-tile .remove{cursor:pointer;background:#fff;border:none;border-radius:50%;width:28px;height:28px;padding:0;font-size:13px;position:absolute;top:-6px;right:-6px;box-shadow:0 2px 6px #0003}.save-tile .remove.armed{background:#fecaca;width:36px;height:36px;font-size:18px}@media (width<=480px){#saves-panel .tiles:not([data-columns="1"]){grid-template-columns:repeat(2,minmax(0,132px))}}#toolbar button[hidden]{display:none}.supply{background:#e4dfd2;border-radius:3px;width:44px;height:6px;margin-top:2px;display:block;overflow:hidden}.supply b{background:#3b82f6;border-radius:3px;height:100%;display:block}.supply.count{letter-spacing:1px;color:#3b82f6;background:0 0;width:auto;height:auto;font-size:11px;font-style:normal;line-height:1;overflow:visible}.supply.empty{box-shadow:0 0 0 1.5px #ef4444}.supply.count.empty{box-shadow:none;color:#ef4444}.toolbar-compact .supply{width:32px;height:4px}#toolbar #go{background:#bbf7d0}#toolbar #go:hover{background:#86efac}.level-mode #toolbar #pause,.level-mode #saves-button,.level-mode #saves-panel{display:none}.toolbar-rows #toolbar .divider.minor{flex-basis:auto;width:2px;height:auto;margin:6px 1px}.screen{z-index:10;-webkit-user-select:none;user-select:none;background:#fdfbf5cc;justify-content:center;align-items:center;padding:16px;display:flex;position:fixed;inset:0}.screen[hidden]{display:none}.screen .card{box-sizing:border-box;text-align:center;background:#fff;border-radius:24px;max-width:100%;max-height:100%;padding:24px;overflow-y:auto;box-shadow:0 8px 32px #0002}.screen h1,.screen h2{color:#2b2b2b;margin:0 0 20px}.screen h1{font-size:32px}.screen h2{font-size:24px}.screen .choices{flex-wrap:wrap;justify-content:center;gap:16px;display:flex}.screen .choices button{cursor:pointer;background:#f1efe8;border:3px solid #0000;border-radius:20px;flex-direction:column;align-items:center;gap:6px;min-width:140px;padding:20px 24px;font-size:44px;line-height:1;display:flex}.screen .choices button[hidden]{display:none}.screen .choices button:hover{background:#e8e5da}.screen button span{color:#444;font-size:18px;font-weight:600}.screen small{color:#f43f5e;font-size:14px}.screen small:empty{display:none}.screen header{position:relative}.screen .back{cursor:pointer;background:#f1efe8;border:none;border-radius:50%;width:44px;height:44px;font-size:22px;position:absolute;top:-4px;left:0}.screen .levels{grid-template-columns:repeat(4,120px);gap:12px;display:grid}.screen .levels button{cursor:pointer;background:#f1efe8;border:3px solid #0000;border-radius:16px;flex-direction:column;align-items:center;gap:4px;padding:12px 6px;display:flex}.screen .levels button:hover{background:#e8e5da}.screen .levels button.current{border-color:#3b82f6}.screen .levels button:disabled{opacity:.45;cursor:default}.screen .number{color:#2b2b2b;font-size:30px;font-weight:700}.screen .levels button span.name{font-size:13px;line-height:1.2}.screen button .heart-row{letter-spacing:2px;color:#d6d3cb;font-size:16px}.heart-row b{color:#f43f5e;font-weight:400}@media (width<=560px){.screen .levels{grid-template-columns:repeat(2,minmax(0,130px))}}#incoming .about{color:#444;margin:0 0 20px;font-size:18px;line-height:1.5}#incoming .hearts{color:#f43f5e}#win .hearts{letter-spacing:8px;color:#d6d3cb;margin:0 0 20px;font-size:56px}#win .hearts span{animation:.4s ease-out backwards heart-pop;display:inline-block}#win .hearts span.won{color:#f43f5e}@keyframes heart-pop{0%{transform:scale(0)}70%{transform:scale(1.3)}}.screen .tabs{background:#f1efe8;border-radius:14px;gap:4px;margin-bottom:20px;padding:4px;display:inline-flex}.screen .tabs button{font:inherit;color:#666;cursor:pointer;background:0 0;border:none;border-radius:10px;padding:8px 16px;font-size:18px;font-weight:600}.screen .tabs button.active{color:#2b2b2b;background:#fff;box-shadow:0 1px 4px #0002}#level-map .note{color:#666;margin:-8px 0 16px}#level-map .note:empty{display:none}.screen .levels .tile{flex-direction:column;gap:4px;display:flex}.screen .levels .tile>button{flex:1}.screen .levels .actions{justify-content:center;gap:6px;display:flex}.screen .levels .actions button{cursor:pointer;background:#f1efe8;border:none;border-radius:10px;width:36px;height:32px;padding:0;font-size:16px}.screen .levels .actions button.armed{background:#fecaca}.screen .levels button span.id{color:#888;font-size:12px;font-weight:400}#editor-panel{display:none}.editor-mode #editor-panel{box-sizing:border-box;-webkit-user-select:none;user-select:none;background:#fffe;border-radius:18px;flex-direction:column;gap:8px;width:260px;max-width:calc(100vw - 32px);padding:12px 14px;font-size:15px;display:flex;position:fixed;top:120px;bottom:80px;left:16px;overflow-y:auto;box-shadow:0 4px 16px #0002}.editor-mode #editor-panel.collapsed{width:auto;bottom:auto}#editor-panel.collapsed .body,#editor-panel.collapsed strong{display:none}#editor-panel header{justify-content:space-between;align-items:center;gap:8px;display:flex}#editor-panel .body{flex-direction:column;gap:10px;display:flex}#editor-panel label{color:#444;flex-direction:column;gap:3px;font-weight:600;display:flex}#editor-panel label[hidden]{display:none}#editor-panel input{font:inherit;border:1px solid #d6d3cb;border-radius:10px;padding:8px 10px;font-weight:400}#editor-panel .heading{color:#444;margin:4px 0 0;font-weight:600}#editor-panel button{font:inherit;cursor:pointer;background:#f1efe8;border:2px solid #0000;border-radius:12px;font-weight:600}#editor-panel button:disabled{opacity:.4;cursor:default}#editor-panel .choices{gap:8px;display:flex}#editor-panel .choices button{flex:1;padding:10px 0}#editor-panel .choices button.active{background:#dbeafe;border-color:#3b82f6}#editor-panel .stepper{grid-template-columns:1fr 40px 56px 40px;align-items:center;gap:4px;display:grid}#editor-panel .stepper button{height:40px;font-size:20px}#editor-panel .stepper output{text-align:center;font-variant-numeric:tabular-nums}#editor-panel .collapse{width:40px;height:40px}#editor-panel>.body>button{padding:10px}#editor-panel .status{color:#555;margin:0;font-size:14px}#editor-panel .buttons{gap:8px;display:flex}#editor-panel .buttons button{flex:1;padding:12px 8px}.editor-mode #saves-button,.editor-mode #saves-panel{display:none}
