*{box-sizing:border-box}body{margin:0;background:#f8f0dc;color:#333e31;font:650 15px system-ui,sans-serif}main{height:100svh;max-width:600px;margin:auto;display:grid;grid-template-rows:auto minmax(0,1fr) auto;padding:8px;gap:6px}header,footer{display:flex;align-items:center;justify-content:space-between;gap:7px}h1{font-size:clamp(18px,5vw,26px);margin:0}button,select{font:inherit;color:inherit;border:2px solid #47523d;border-radius:13px;background:#f6deb0;padding:6px 10px;min-height:40px;cursor:pointer}#stage{position:relative;border:2px solid #45513d;border-radius:18px;overflow:hidden;background:#e7d8ae}canvas{width:100%;height:100%;display:block;touch-action:none}output{position:absolute;left:9px;top:8px;pointer-events:none;background:#fff6dfeb;border:2px solid #575e47;border-radius:12px;padding:4px 9px;font-variant-numeric:tabular-nums}#panel{position:absolute;bottom:6%;left:50%;transform:translateX(-50%);width:min(90%,380px);border:2px solid #46513e;border-radius:18px;padding:12px;text-align:center;background:#fcf2dff5;box-shadow:0 3px #63725866}#panel strong{font-size:21px}p{margin:5px 0 9px}#start{background:#eda183}footer{justify-content:center;text-align:center;min-height:31px}#panel[hidden],select[hidden]{display:none}

/* Keep the square artwork and its pointer grid aligned on narrow screens. */
#stage{width:min(100%,100cqh);aspect-ratio:1;max-height:100%;align-self:center;justify-self:center}
main{container-type:size;grid-template-rows:auto minmax(0,1fr) auto}
#stage{width:min(100cqw,calc(100cqh - 95px));height:auto}
@media(max-height:390px){main{gap:3px;padding:4px}footer{min-height:20px;font-size:12px}#stage{width:min(100cqw,calc(100cqh - 69px))}#panel{padding:6px;font-size:13px}}
