/* Lattice's sunlit toy workshop. The scene scales as one unit, including hit areas. */
:root{color-scheme:light;--ink:#082977;--u:min(.2564102564vw,.1184834123svh,1.18px)}
*{box-sizing:border-box}
body{margin:0;background:#ece5db;color:var(--ink);font-family:ui-rounded,"Arial Rounded MT Bold","Trebuchet MS",system-ui,sans-serif}
button,select{font:inherit;color:inherit;cursor:pointer}
button{touch-action:manipulation}
button:disabled{cursor:default}
button:focus-visible,select:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid #ed1747;outline-offset:3px}
main{margin:0 auto;max-width:900px}
.la-scene{position:relative;width:calc(390 * var(--u));height:calc(844 * var(--u));margin:0 auto;background:#fff5e9 url('../assets/play/lattice/workshop.webp') center/100% 100% no-repeat;isolation:isolate}
h1{position:absolute;top:calc(2 * var(--u));left:calc(44 * var(--u));width:calc(302 * var(--u));height:calc(85 * var(--u));margin:0;filter:drop-shadow(0 calc(4 * var(--u)) calc(2 * var(--u)) #9d744852)}
h1 img{display:block;width:100%;height:100%;object-fit:contain}
.levelbar{position:absolute;top:calc(91 * var(--u));left:calc(48 * var(--u));width:calc(294 * var(--u));height:calc(42 * var(--u));display:flex;align-items:center;border:calc(2 * var(--u)) solid #fff9f3;border-radius:calc(23 * var(--u));background:linear-gradient(#fffdfa,#eee5dc);box-shadow:0 calc(4 * var(--u)) calc(4 * var(--u)) #7e58382b,inset 0 calc(-3 * var(--u)) calc(3 * var(--u)) #bca68d35}
.levelbar label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.levelbar select{width:100%;height:100%;padding:0 calc(14 * var(--u));font-size:calc(16 * var(--u));font-weight:800;text-align:center;border:0;background:transparent;border-radius:inherit}
.hud{position:absolute;left:calc(28 * var(--u));top:calc(145 * var(--u));width:calc(126 * var(--u));height:calc(95 * var(--u));display:grid;gap:calc(6 * var(--u));z-index:2}
.chip{display:flex;align-items:center;justify-content:space-between;background:linear-gradient(#fffefc,#f0e9e2);border:calc(1.5 * var(--u)) solid #fffaf6;border-radius:calc(16 * var(--u));padding:0 calc(10 * var(--u));font-size:calc(13 * var(--u));font-weight:800;box-shadow:0 calc(3 * var(--u)) calc(3 * var(--u)) #76503026}
.chip b{font-size:calc(18 * var(--u));font-variant-numeric:tabular-nums;white-space:nowrap}
.stage{position:absolute;left:calc(20 * var(--u));top:calc(145 * var(--u));width:calc(350 * var(--u));height:calc(588 * var(--u));touch-action:none}
[data-stage],.stick{touch-action:none}
.targetbar{position:absolute;right:calc(8 * var(--u));top:0;width:calc(204 * var(--u));height:calc(95 * var(--u));display:flex;align-items:center;gap:calc(4 * var(--u));padding:calc(10 * var(--u));border:calc(2 * var(--u)) solid #fffaf6;border-radius:calc(18 * var(--u));background:linear-gradient(135deg,#fffdfa,#f2eae3);box-shadow:0 calc(4 * var(--u)) calc(4 * var(--u)) #76503026}
.targetcopy{flex:1;min-width:0}
.targetcopy h2{font-size:calc(16 * var(--u));line-height:1.15;margin:0;font-weight:900}
.mini{position:relative;flex:0 0 calc(90 * var(--u));width:calc(90 * var(--u));border-bottom:calc(2 * var(--u)) solid #8bbf97;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(20% - 1px),#14395109 calc(20% - 1px),#14395109 20%)}
.mini-stick{position:absolute;height:calc(7 * var(--u));background:var(--target-art) center/100% 100% no-repeat;filter:saturate(1.5) brightness(.9) drop-shadow(0 calc(1 * var(--u)) calc(.5 * var(--u)) #4b815a55)}
.status{position:absolute;top:calc(105 * var(--u));left:calc(15 * var(--u));width:calc(320 * var(--u));height:calc(38 * var(--u));margin:0;padding:calc(6 * var(--u)) calc(12 * var(--u));display:flex;align-items:center;justify-content:center;text-align:center;font-size:calc(12 * var(--u));line-height:1.3;font-weight:800;color:white;background:linear-gradient(#0b89fa,#0042cc);border:calc(2 * var(--u)) solid #7cc8ff;border-radius:calc(17 * var(--u));box-shadow:0 calc(3 * var(--u)) calc(3 * var(--u)) #072e7960;z-index:2}
.board-frame{position:absolute;left:0;top:calc(138 * var(--u));width:100%;height:calc(388 * var(--u));padding:calc(12 * var(--u));border:calc(2 * var(--u)) solid #63baff;border-radius:calc(29 * var(--u));background:linear-gradient(110deg,#0076f6,#0062f2 50%,#0042c9);box-shadow:inset 0 calc(3 * var(--u)) calc(3 * var(--u)) #d5f3ff,inset 0 calc(-5 * var(--u)) calc(3 * var(--u)) #002799,0 calc(7 * var(--u)) calc(6 * var(--u)) #5e402d42}
.board-inset{height:100%;padding:calc(1 * var(--u)) calc(8 * var(--u)) 0 calc(24 * var(--u));border:calc(2 * var(--u)) solid #003b9c;border-radius:calc(17 * var(--u));background:linear-gradient(125deg,#fffaf3,#ede0d5);box-shadow:inset 0 calc(3 * var(--u)) calc(5 * var(--u)) #8b725455}
.board{--rows:8;--row:calc(354 * var(--u) / (var(--rows) + 1));position:relative;height:calc(354 * var(--u));width:100%;margin:0;padding:0;background:repeating-linear-gradient(90deg,#bca38d66 0 calc(1 * var(--u)),transparent calc(1 * var(--u)) 20%);border-right:calc(1 * var(--u)) solid #bca38d66}
.board:focus-visible{outline:calc(3 * var(--u)) solid #f51b55;outline-offset:calc(3 * var(--u))}
.floor-label{position:absolute;bottom:calc(5 * var(--u));font-size:calc(17 * var(--u));font-weight:900;text-align:center;width:20%;pointer-events:none}
.row-label{position:absolute;left:calc(-20 * var(--u));height:var(--row);display:flex;align-items:center;font-size:calc(14 * var(--u));font-weight:900;pointer-events:none}
.board-line{position:absolute;left:0;width:100%;border-top:calc(1 * var(--u)) solid #bca38d66;pointer-events:none}
.stick{position:absolute;border:0;background:transparent;padding:0 calc(2 * var(--u));min-height:0;height:var(--row);border-radius:calc(9 * var(--u));cursor:pointer;color:#06236c;font-size:calc(17 * var(--u));font-weight:1000;isolation:isolate;display:flex;align-items:center;justify-content:center}
.stick::before{content:'';position:absolute;inset:calc(var(--row) * .2) calc(2 * var(--u));background:var(--stick-art) center/100% 100% no-repeat;filter:drop-shadow(0 calc(3 * var(--u)) calc(2 * var(--u)) #8f642c66);z-index:-1;pointer-events:none}
.stick span{pointer-events:none;line-height:1;text-shadow:0 1px #ffed7299}
.stick.selected{outline:calc(3 * var(--u)) solid #f2104b;outline-offset:calc(-2 * var(--u));background:#fff9e8a6}
.stick.selected::before{filter:drop-shadow(0 calc(2 * var(--u)) calc(1 * var(--u)) #86532766) brightness(1.12)}
.stick:disabled{opacity:1}
.stick:focus-visible{outline:calc(3 * var(--u)) solid #f2104b;outline-offset:calc(-2 * var(--u))}
.primary,.toolbar button,.secondary-tools button{border:0;background:transparent url('../assets/play/lattice/button-yellow.webp') center/100% 100% no-repeat;font-weight:900;filter:drop-shadow(0 calc(4 * var(--u)) calc(2 * var(--u)) #7a553b40);white-space:nowrap}
#la-go{position:absolute;left:calc(8 * var(--u));top:calc(534 * var(--u));width:calc(334 * var(--u));height:calc(52 * var(--u));padding:0 calc(12 * var(--u));font-size:calc(22 * var(--u))}
#la-go:disabled{color:#253e79;filter:drop-shadow(0 calc(4 * var(--u)) calc(2 * var(--u)) #7a553b40) saturate(.8)}
.toolbar{position:absolute;top:calc(747 * var(--u));left:calc(24 * var(--u));width:calc(342 * var(--u));height:calc(47 * var(--u));display:flex;gap:calc(7 * var(--u))}
.toolbar button{flex:1;min-width:0;padding:0 calc(4 * var(--u));font-size:calc(19 * var(--u));color:#fff;text-shadow:0 calc(1 * var(--u)) calc(1 * var(--u)) #00215a66}
#la-new{flex:1.34;background-image:url('../assets/play/lattice/button-red.webp')}
#la-hint{background-image:url('../assets/play/lattice/button-blue.webp')}
#la-undo{background-image:url('../assets/play/lattice/button-white.webp');color:var(--ink);text-shadow:none}
.toolbar button:disabled{filter:drop-shadow(0 calc(3 * var(--u)) calc(2 * var(--u)) #7a553b30) saturate(.45);color:#7d879c;text-shadow:none}
.secondary-tools{position:absolute;top:calc(801 * var(--u));left:calc(25 * var(--u));width:calc(340 * var(--u));height:calc(36 * var(--u));display:flex;align-items:center;justify-content:space-between;font-size:calc(12 * var(--u));font-weight:800}
.secondary-tools button{order:-1;background-image:url('../assets/play/lattice/button-white.webp');height:100%;padding:0 calc(12 * var(--u));font-size:inherit;color:var(--ink)}
.progress{padding:calc(5 * var(--u)) calc(12 * var(--u));border-radius:calc(20 * var(--u));background:#fffcf8e6}
.over{position:absolute;left:calc(14 * var(--u));right:calc(14 * var(--u));top:calc(175 * var(--u));bottom:calc(92 * var(--u));display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(17 * var(--u));padding:calc(24 * var(--u));background:#fffaf3f5;border:calc(4 * var(--u)) solid #1b65da;border-radius:calc(24 * var(--u));box-shadow:0 calc(5 * var(--u)) calc(10 * var(--u)) #00215a44;z-index:5;text-align:center}
.over[hidden]{display:none}
.over h2{font-size:calc(30 * var(--u));line-height:1.1;margin:0}
.over p{font-size:calc(16 * var(--u));line-height:1.45;margin:0}
.over .primary{font-size:calc(19 * var(--u));height:calc(54 * var(--u));width:100%;padding:0 calc(10 * var(--u))}
.stage[data-outcome="loss"] .over{border-color:#ed1747}
.stage[data-outcome="loss"] .over h2{color:#b30c36}
.game-guide{max-width:640px;margin:0 auto;padding:24px 22px 44px;background:#fffaf3;color:#344767;font-size:14px;line-height:1.6}
.game-guide header{font-size:12px;padding-bottom:22px}
a{color:#154fa6}
.game-guide h2{color:var(--ink);font-size:22px;margin:22px 0 8px}
.eyebrow{letter-spacing:2px;text-transform:uppercase;font-size:11px;font-weight:800}
.intro{font-size:17px}
.board-note{font-size:12px}
.rules{padding-left:20px}.rules li{margin:9px 0}.footnote{font-size:12px}
details{margin:18px 0}summary{cursor:pointer;min-height:32px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(min-width:650px){.la-scene{box-shadow:0 0 60px #977a5c33}.game-guide{margin-top:20px;border-radius:20px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto;animation:none!important;transition:none!important}}

/* Chunky labels echo the painted toy lettering without baking state into art. */
.stick,.floor-label,.row-label,.toolbar button,.primary,.chip b{font-family:"Arial Black",system-ui,sans-serif;font-weight:900}
