:root{font-family:"Hiragino Maru Gothic ProN","Yu Gothic",Meiryo,system-ui,sans-serif;color:#483126;background:#fff9e9;--green:#168269;--orange:#ed572c}*{box-sizing:border-box}body{margin:0;background:linear-gradient(#fffdf7,#fff5db);line-height:1.6}button,select{font:inherit;color:inherit}button,select,summary{cursor:pointer}button{border:2px solid #dfcfae;background:#fffdf7;border-radius:12px;min-height:46px;padding:8px 12px;font-weight:800;box-shadow:0 3px 0 #e3d3b4;touch-action:manipulation}button:disabled{opacity:.45;cursor:default;box-shadow:none}button:not(:disabled):active{transform:translateY(2px);box-shadow:none}:focus-visible{outline:3px solid #167ac1;outline-offset:3px}a{color:var(--green)}h1,h2,p{margin-top:0}.packing-app{max-width:980px;width:calc(100% - 24px);margin:auto}.heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:8px 0 20px}.heading img{width:190px;height:116px;object-fit:cover;border:4px solid white;border-radius:22px;box-shadow:0 4px 0 #ebd8af}.eyebrow{font-size:11px;letter-spacing:.1em;font-weight:900;color:var(--green)}h1{color:var(--orange);font-size:clamp(23px,4.7vw,36px);margin:4px 0;text-shadow:0 2px #fff}h2{font-size:18px;margin-bottom:8px}.heading p{margin:0;font-size:14px}.stage-bar{display:flex;align-items:center;flex-wrap:wrap;gap:12px;background:#fff;border:2px solid #efdfbf;border-radius:16px;padding:10px 14px;margin-bottom:20px}.stage-bar label{font-weight:bold}select{max-width:210px;border:1px solid #cbb988;border-radius:7px;background:#fff;padding:8px;font-size:14px;min-height:44px}#progress{font-size:13px;margin-left:auto}#sound{font-size:12px}.layout{display:grid;grid-template-columns:1.05fr 1fr;align-items:start;gap:28px}.bag-section{min-width:0}.bag-label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:24px}.bag-label h2{font-size:16px;margin:0}#count{font-size:12px;white-space:nowrap}.bag{position:relative;background:linear-gradient(100deg,#e4bb7f,#f9dbab 35%,#ebc58d);border:3px solid #b5824f;border-radius:5px 5px 25px 25px;padding:12px 12px 2px;width:fit-content;max-width:100%;margin:auto;box-shadow:8px 9px 0 #e8c38333}.bag-handle{position:absolute;top:-23px;left:30%;width:40%;height:26px;border:7px solid #bc8d58;border-bottom:0;border-radius:45px 45px 0 0;z-index:0}.bag-smile{color:#865b35;text-align:center;font-weight:900;font-size:22px;line-height:1.2;padding:5px}#board{display:grid;position:relative;isolation:isolate;grid-template-columns:repeat(var(--cols),var(--cell));grid-auto-rows:var(--cell);border:2px solid #9f7247;background:#fff8e7;touch-action:none}.cell{padding:0;min-height:0;width:var(--cell);height:var(--cell);border:0;border-right:1px dashed #ccbc9b;border-bottom:1px dashed #ccbc9b;border-radius:0;background:transparent;box-shadow:none;position:relative;color:#796946;font-size:11px;font-weight:500}.cell:not(:disabled):active{transform:none}.cell.blocked{background:repeating-linear-gradient(135deg,#f2c76b44 0 4px,#fff1d544 4px 9px)}.cell.blocked::after{content:'↟';color:#a5751d;font-size:13px}.tile{position:absolute;z-index:1;width:var(--cell);height:var(--cell);pointer-events:none;background:var(--product);border:0 solid #91663e;display:flex;flex-direction:column;align-items:center;justify-content:center;font-size:10px;line-height:1.1;overflow:hidden;color:#443024;animation:snap .17s ease-out}.tile svg{width:64%;height:62%}.tile small{font-size:9px;white-space:nowrap;font-weight:bold}.tile .mark{position:absolute;top:1px;right:2px;font-weight:900;color:#9b481e;font-size:11px}.tile.preview{z-index:3;background:#16966b85;border:2px solid #087448;color:#fff;font-size:19px;font-weight:900;animation:none}.tile.preview.bad{background:#d7484388;border-color:#a22424}.tile.source{opacity:.36}.tile.hint{outline:2px dashed #4165b3;outline-offset:-4px}.board-note{font-size:11px;text-align:center;color:#7e6543;margin:9px 0 0}.workbench{background:#fff;border:2px solid #f1dfbd;border-radius:20px;padding:16px}.work-title{display:flex;align-items:center;justify-content:space-between;gap:8px}.work-title h2{margin:0}.work-title span{font-size:11px;color:var(--green);font-weight:bold}#tray{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:12px}.product-button{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:102px;padding:5px 3px;touch-action:none;border-color:#e6dbc3;background:#fffdf7;gap:3px;font-size:11px}.product-button.selected{border:3px solid #168269;background:#edf9f1}.product-button.placed{background:#f1f0e9}.product-button .mini{height:44px;max-width:80px;width:100%}.product-button .badge{font-size:10px;color:#587059}.product-button .fragile{color:#9a4b20;font-size:10px}.selection{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid #eee0c4;margin-top:13px;padding-top:10px;min-height:58px;font-size:13px}#selected-shape svg{width:75px;height:48px;display:block}.actions{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px}.actions button{font-size:12px;padding:8px 3px}.confirm-bar{position:sticky;bottom:0;z-index:10;background:#fffcf4f5;backdrop-filter:blur(8px);border:2px solid #e8d2a5;border-radius:16px;padding:10px;display:flex;gap:12px;align-items:center;margin-top:20px;box-shadow:0 -5px 20px #84622a12;padding-bottom:max(10px,env(safe-area-inset-bottom))}#status{flex:1;margin:0;font-size:13px;line-height:1.45;min-height:38px;display:flex;align-items:center}#confirm{flex:0 0 auto;min-width:130px;background:var(--green);color:#fff;border-color:#116c53;box-shadow:0 3px 0 #0b5a44}.save-note{font-size:11px;color:#806e54;text-align:center;margin:10px 0 18px}.instructions{background:#fff7e5;border:1px solid #e7d5ac;border-radius:12px;padding:12px;font-size:13px}.instructions summary{font-weight:bold}.instructions p{margin:12px 0 0}dialog{width:min(440px,calc(100% - 28px));max-height:90dvh;overflow:auto;border:3px solid #e9bf71;border-radius:24px;background:#fffaf0;color:#483126;padding:24px;text-align:center;box-shadow:0 15px 80px #3d29164d}dialog::backdrop{background:#39281788}dialog p{font-size:14px}dialog button{margin:5px;max-width:100%}#close-help,#next,#do-reset{background:var(--green);color:white;border-color:#0d6b53}#clear-dialog img{display:block;width:100%;height:auto;border-radius:15px;margin-bottom:15px}#clear-dialog h2{color:var(--orange);font-size:24px}.rule-picture{display:flex;justify-content:center;gap:12px;margin:15px auto}.rule-picture div{border:2px dashed #c77d3a;border-radius:10px;background:#fff0d3;padding:5px 20px;font-weight:900;color:#b0392b;font-size:23px}.rule-picture div+div{color:var(--green);background:#eaf6df;border-color:var(--green)}.bag.celebrate{animation:lift .7s ease-in-out}.dragging .product-button{touch-action:none}@keyframes snap{from{scale:.9}to{scale:1}}@keyframes lift{35%{transform:translateY(-16px) rotate(-3deg)}70%{transform:translateY(-8px) rotate(3deg)}}
@media(max-width:690px){.layout{grid-template-columns:1fr;gap:14px}.heading{margin:5px 0 14px}.heading img{width:100px;height:90px;border-radius:16px}.heading p{font-size:12px}.heading .eyebrow{font-size:9px}h1{font-size:clamp(20px,4.9vw,30px)}.stage-bar{gap:8px;padding:8px;margin-bottom:16px}.stage-bar label{font-size:12px}select{max-width:175px;font-size:12px}#progress{font-size:11px}#sound{padding:6px;font-size:11px}.bag-label{max-width:440px;margin:0 auto 24px}.bag{padding:7px 7px 0}.bag-smile{font-size:17px}.workbench{padding:12px}#tray{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:8px}.product-button{min-height:84px;font-size:10px}.product-button .mini{height:34px}.product-button .badge,.product-button .fragile{font-size:9px}.selection{margin-top:8px;padding-top:6px;min-height:50px}.actions{margin-top:6px;grid-template-columns:repeat(3,1fr)}.confirm-bar{gap:7px;margin-top:10px;border-radius:12px;padding:8px}#confirm{min-width:110px;font-size:12px}#status{font-size:12px}.game-site-header{flex-direction:row;align-items:center;padding-top:18px;gap:6px}.game-site-brand{font-size:11px;gap:6px}.game-basket-logo{width:31px;height:28px;flex-basis:31px;border-width:3px}.game-basket-logo::before{left:3px;right:3px;top:-13px;height:18px;border-width:3px}.game-home-link{font-size:11px;padding:7px}.board-note{margin-bottom:0}}
@media(max-width:360px){#tray{grid-template-columns:repeat(3,1fr)}.heading img{width:72px;height:78px}.stage-bar{gap:5px}select{max-width:155px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;scroll-behavior:auto!important;transition:none!important}}
@media(max-width:690px){body{padding-bottom:100px}.confirm-bar{position:fixed;left:8px;bottom:0;width:calc(100% - 16px);margin:0;border-radius:14px 14px 0 0;padding-bottom:max(10px,env(safe-area-inset-bottom))}.instructions{margin-bottom:18px}}
