:root{--page:#f4efe6;--ink:#3a3530;--btn-bg:#fffaf2;--btn-edge:#cfc5b4;--accent:#3a6db5}html,body{background:var(--page);height:100%;color:var(--ink);overscroll-behavior:none;margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif}#app{-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden}[hidden]{display:none!important}button{min-width:44px;min-height:44px;font:inherit;color:var(--ink);background:var(--btn-bg);border:2px solid var(--btn-edge);cursor:pointer;touch-action:manipulation;border-radius:10px;padding:0 12px;font-size:16px}button:disabled{opacity:.4;cursor:default}button:focus-visible{outline:3px solid var(--accent);outline-offset:2px}button.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}.screen{position:absolute;top:0;bottom:0;left:0;right:0}.hud{box-sizing:border-box;align-items:center;gap:6px;padding:6px 8px;display:flex;position:absolute}.hud button{align-items:center;gap:4px;font-size:18px;display:flex}.hud button span{font-size:14px}.hud-title{flex-direction:column;flex:1;align-items:center;min-width:0;line-height:1.2;display:flex}.hud-title strong{text-overflow:ellipsis;white-space:nowrap;max-width:100%;overflow:hidden}.board{touch-action:none;position:absolute}.pad{grid-template-columns:repeat(3, var(--btn));grid-template-rows:repeat(3, var(--btn));gap:4px;display:grid;position:absolute}.pad button{padding:0;font-size:20px}.pad [data-dir=U]{grid-area:1/2}.pad [data-dir=L]{grid-area:2/1}.pad [data-dir=R]{grid-area:2/3}.pad [data-dir=D]{grid-area:3/2}.panel{box-sizing:border-box;text-align:center;flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:16px;display:flex;overflow-y:auto}.panel button{min-width:200px}.overlay{background:#f4efe6e0}.painting{object-fit:cover;filter:saturate(.4)contrast(.8)brightness(1.08);opacity:.5;width:100%;height:100%;transition:filter 1.4s,opacity 1.4s;position:absolute;top:0;bottom:0;left:0;right:0}.revealed .painting{filter:none;opacity:1}.hud{background:#f6f0e4d1}.board,.hud,.pad{transition:opacity .9s}.revealed .board,.revealed .hud,.revealed .pad{opacity:0;pointer-events:none}.screen.panel[data-screen=solved]{pointer-events:none;justify-content:flex-end}.solved-card{pointer-events:auto;box-sizing:border-box;background:#faf6eef0;border-radius:16px;flex-direction:column;align-items:center;gap:6px;width:min(100%,420px);padding:12px 14px;animation:.6s 1.7s both card-in;display:flex;box-shadow:0 6px 24px #281e142e}.solved-card h2,.solved-card p{margin:0}.solved-card h2{font-size:20px}.solved-card .row{width:100%;margin-top:4px}.solved-card .primary{flex:1.4}.row{gap:8px;display:flex}.row button{flex:1;min-width:0}@keyframes card-in{0%{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}.gallery{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;width:min(100%,720px);display:grid}.gallery figure{flex-direction:column;gap:4px;margin:0;display:flex}.gallery canvas{aspect-ratio:4/5;border-radius:6px;width:100%;height:auto;box-shadow:0 2px 8px #281e1426}.gallery figcaption{font-size:14px}.screen.panel[data-screen=gallery]{justify-content:flex-start}@media (prefers-reduced-motion:reduce){.solved-card{animation-delay:.3s}}.overlay{position:absolute;top:0;bottom:0;left:0;right:0}.levels{flex-direction:column;gap:8px;display:flex}dl{text-align:left;grid-template-columns:auto auto;gap:6px 16px;margin:0;display:grid}dt{font-weight:600}dd{margin:0}#result-code{box-sizing:border-box;text-align:center;border:2px solid var(--btn-edge);-webkit-user-select:text;user-select:text;background:#fff;border-radius:8px;width:min(100%,360px);padding:10px;font:16px ui-monospace,monospace}.note{min-height:1.2em;margin:0;font-size:14px}@media (max-width:430px){.hud button span{display:none}}
