:root{color-scheme:dark;--bg:#0e1523;--panel:#182538;--border:rgba(197,225,250,.13);--text:#f3f7ff;--muted:#a2b2c8;--accent:#77e8c8;--head-h:76px;--footer-h:25px;--cols:4;--rows:2;--tile-gap:12px}*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--text)}button{font:inherit}button:focus-visible,a:focus-visible{outline:3px solid var(--accent);outline-offset:3px}.ambient{position:fixed;z-index:-1;border-radius:50%;pointer-events:none;filter:blur(85px);opacity:.3}.ambient-a{width:45vw;height:45vw;background:#174f73;left:-14vw;top:-20vw}.ambient-b{width:33vw;height:33vw;background:#185547;right:-16vw;bottom:-18vw}.app{height:100vh;height:100dvh;max-width:1460px;margin:auto;padding:max(13px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));display:flex;flex-direction:column;min-height:0}.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:var(--head-h);flex:none}.brand{display:flex;align-items:center;gap:12px;min-width:0}.brand-logo{display:grid;place-items:center;width:51px;height:51px;flex:none;color:#d3fdec;border-radius:16px;background:linear-gradient(145deg,#254b57,#1a3347);border:1px solid #3d6868}.brand-logo svg{width:34px;height:34px}.brand-copy{min-width:0}.brand-copy h1{font-size:clamp(22px,2.5vw,30px);letter-spacing:-1.1px;line-height:1.1;margin:0;font-weight:800;white-space:nowrap}.brand-copy h1 span{color:var(--accent)}.brand-copy p{margin:5px 0 0;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.toolbar{display:flex;gap:8px;flex:none}.tool-button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:41px;padding:0 13px;border:1px solid var(--border);border-radius:13px;background:rgba(255,255,255,.055);color:#e9f3ff;cursor:pointer;font-size:13px;font-weight:650;transition:background .16s,border .16s}.tool-button:hover,.tool-button[aria-pressed=true]{background:#25483f;border-color:#6ad9b3}.tool-button svg{width:18px;height:18px}.tool-button.icon-only{width:42px;padding:0}.grid-area{flex:1;min-height:0;position:relative;display:flex;padding:9px 0 5px}.puzzle-grid{width:100%;height:100%;min-height:0;display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:repeat(var(--rows),minmax(0,1fr));gap:var(--tile-gap);align-content:stretch}.tile{position:relative;display:flex;min-width:0;min-height:0;flex-direction:column;justify-content:center;align-items:center;text-align:center;gap:clamp(4px,1.6vh,13px);padding:9px 5px;border:1px solid var(--border);border-radius:19px;background:linear-gradient(145deg,rgba(34,51,72,.97),rgba(23,35,53,.96));color:inherit;text-decoration:none;cursor:pointer;box-shadow:0 7px 19px rgba(0,0,0,.14);transition:transform .15s,border-color .15s,background .15s;overflow:hidden;isolation:isolate}.tile:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 50% 0%,rgba(114,232,200,.12),transparent 60%);pointer-events:none}.tile:hover{transform:translateY(-2px);border-color:#5b9d92;background:linear-gradient(145deg,#243e50,#1a3142)}.tile-icon-wrap{display:grid;place-items:center;width:min(76px,37%,47%);height:min(76px,56%);max-height:76px;flex:none;min-height:0}.tile-icon{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 3px 5px rgba(0,0,0,.16));border-radius:14px}.fallback-icon{width:min(70px,100%);height:auto;aspect-ratio:1;border-radius:16px;display:grid;place-items:center;background:linear-gradient(145deg,#55d7b9,#3789a2);color:#103043;font-size:clamp(20px,4vmin,32px);font-weight:850}.tile-title{font-weight:750;font-size:clamp(11px,1.18vw,16px);letter-spacing:-.15px;line-height:1.16;max-width:95%;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;z-index:1}.tile-arrow{position:absolute;top:10px;right:11px;opacity:.4;font-size:15px}.tile:hover .tile-arrow{opacity:.9}.tile.dragging{opacity:.4;transform:scale(.97)}.tile.drop-target{border:2px solid #80f9d5;background:#25453f}.tile.editing{cursor:grab;border-style:dashed;border-color:rgba(119,232,200,.43);touch-action:none}.tile.editing:active{cursor:grabbing}.edit-tools{position:absolute;top:5px;left:6px;right:6px;display:flex;justify-content:space-between;z-index:2;gap:4px}.move-btn{display:grid;place-items:center;height:28px;min-width:29px;border-radius:9px;border:1px solid rgba(150,239,216,.3);background:#1b423e;color:#e3fff6;font-weight:800;cursor:pointer}.move-btn:disabled{opacity:.22;cursor:default}.tile-grip{color:#a5fae4;font-size:15px;letter-spacing:-2px;align-self:center}.bottom{flex:none;min-height:var(--footer-h);display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:11px;color:#8497af}.bottom .version{opacity:.8}.toast{position:fixed;bottom:46px;left:50%;transform:translate(-50%,10px);padding:9px 16px;border-radius:12px;border:1px solid #45776f;background:#24463e;color:white;font-size:13px;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:8;white-space:nowrap}.toast.show{opacity:1;transform:translate(-50%,0)}.empty{margin:auto;text-align:center;max-width:380px;padding:25px;color:var(--muted)}.empty-art{font-size:65px;color:var(--accent)}.empty h2{color:white;font-size:19px}.empty p{font-size:13px;line-height:1.7}.empty code{color:#bdffe7}.drag-ghost{position:fixed;pointer-events:none;z-index:100;opacity:.85;border:2px solid #85e9cd;background:#243e50;border-radius:16px;display:grid;place-items:center;box-shadow:0 12px 30px rgba(0,0,0,.45);overflow:hidden}.drag-ghost img{width:55%;height:55%;object-fit:contain}.drag-ghost strong{font-size:12px;max-width:95%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:700px){:root{--head-h:67px;--footer-h:21px;--tile-gap:8px}.app{padding-left:10px;padding-right:10px}.brand-logo{width:42px;height:42px;border-radius:12px}.brand-logo svg{width:29px;height:29px}.brand{gap:9px}.brand-copy h1{font-size:21px}.brand-copy p{font-size:10px}.tool-button{min-height:37px;padding:0 10px;border-radius:10px}.tool-button.icon-only{width:37px}.toolbar{gap:5px}.grid-area{padding:5px 0 3px}.tile{border-radius:14px;padding:4px 2px;gap:5px}.tile-icon-wrap{width:min(60px,48%);height:min(60px,56%)}.tile-title{font-size:clamp(10px,2.7vw,13px)}.tile-arrow{display:none}.bottom{font-size:10px}.bottom #hint{display:none}.move-btn{height:23px;min-width:23px;font-size:12px}.tile-grip{font-size:12px}}
@media(max-width:390px){.brand-copy h1{font-size:18px}.brand-copy p{font-size:9px}.brand-logo{width:37px;height:37px}.tool-button span{display:none}.tool-button{width:37px;padding:0}.tile-title{font-size:10px}}
@media(max-height:570px){:root{--head-h:48px;--footer-h:15px;--tile-gap:6px}.brand-logo{width:34px;height:34px;border-radius:10px}.brand-logo svg{width:25px;height:25px}.brand-copy h1{font-size:19px}.brand-copy p{display:none}.tool-button{min-height:33px}.tool-button.icon-only{width:34px}.grid-area{padding:2px 0}.tile{gap:2px;border-radius:12px}.tile-icon-wrap{height:min(45px,52%);width:min(45px,45%)}.tile-title{font-size:clamp(9px,1.8vh,13px)}.bottom{font-size:9px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important}}
