@font-face{font-family:Studio;src:url('assets/studio-pixel.ttf') format('truetype');font-display:swap}
:root{--ink:#0e3854;--muted:#426578;--glass:#ddf8f5;--line:#538ea2;--blue:#0879a8;--rain:#12a9e3;--leaf:#64a82a;--gold:#e9ac30;--st:env(safe-area-inset-top,0px);--sb:env(safe-area-inset-bottom,0px);--sl:env(safe-area-inset-left,0px);--sr:env(safe-area-inset-right,0px);color-scheme:light}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#d9f4f3;color:var(--ink);font-family:system-ui,sans-serif}body{background:radial-gradient(ellipse at 20% 0%,#f7ffed 0%,#d9f5f6 52%,#a3d7df 100%)}[hidden]{display:none!important}button{min-width:44px;min-height:44px;border:1px solid #4b849a;border-radius:7px;padding:6px 8px;color:var(--ink);background:linear-gradient(#fbffff 0 43%,#d8eff3 44% 100%);font:650 12px system-ui,sans-serif;box-shadow:inset 0 1px #fff,0 2px #34677b27;touch-action:manipulation;cursor:pointer;-webkit-tap-highlight-color:transparent}button:active{background:#b5e7ed;box-shadow:inset 0 2px #36708544}button:disabled{opacity:.58;cursor:default}button.primary{background:linear-gradient(#edffc3 0 43%,#b9e879 44% 100%);border-color:#5f9638;color:#183d32}button[aria-pressed=true]{background:linear-gradient(#e1ffd4 0 43%,#c1e8a5 44% 100%);border-color:#73a476}button:focus-visible,input:focus-visible{outline:3px solid #00638e;outline-offset:-4px}p{line-height:1.6}h1,h2,h3,.site-header,.deck,.eyebrow,.coord,.tile-mark{font-family:Studio,monospace;font-weight:400}canvas{image-rendering:pixelated}.site-frame{max-width:1140px;margin:auto;padding:calc(var(--st) + 8px) calc(var(--sr) + 6px) calc(var(--sb) + 6px) calc(var(--sl) + 6px)}.site-header{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:34px;padding:0 3px 8px}.site-header>div{display:flex;align-items:center;gap:8px}.site-header img{image-rendering:pixelated}.site-header strong{font-weight:400;font-size:11px}.site-header span,.site-header small{font-size:7px;white-space:nowrap;color:#3f6372}.cabinet{height:calc(100dvh - var(--st) - var(--sb) - 76px);max-height:850px;min-height:0;background:#d8f6f2;border:2px solid #3d7d94;border-radius:12px;box-shadow:0 0 0 2px #f4ffff,0 7px 21px #32728e3b;position:relative;display:grid;grid-template-rows:48px minmax(0,1fr);overflow:hidden}.topbar{display:flex;align-items:center;justify-content:space-between;gap:5px;padding:1px 5px;background:linear-gradient(#e7fffc 0 48%,#addce9 49% 100%);border-bottom:1px solid #4f879e}.deck{display:flex;flex-direction:column;gap:5px;min-width:0}.deck strong{font-size:10px;font-weight:400;white-space:nowrap}.deck span{font-size:5px;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#2d6480}.topbar nav{display:flex;gap:4px;flex-shrink:0}.topbar button{font-size:10px;padding:3px;min-width:46px}.arena{position:relative;min-height:0;overflow:hidden;background:#9edbdc}#scene{position:absolute;inset:0;width:100%;height:100%;display:block}.menu{position:absolute;inset:0;display:flex;align-items:flex-end}.menu-panel{width:100%;padding:12px 12px 10px;background:linear-gradient(143deg,#f2fff4f7,#c4f3f4f5);border-top:2px solid #68a8ad;box-shadow:0 -2px #f9ffffaa}.eyebrow{display:block;font-size:6px;color:#36677a;margin-bottom:7px;line-height:1.5}h1{font-size:27px;white-space:nowrap;letter-spacing:-1px;line-height:1.25;margin:2px 0 6px;color:#124a66;text-shadow:0 2px #f9ffff}.tagline{font-size:14px;color:#215b62;margin:5px 0 11px;font-weight:600}.menu-description{display:none;font-size:14px;color:#3b6273;line-height:1.8}.menu-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}.menu-actions button{font-size:12px}.wide{grid-column:1/-1}.micro{font-size:8px;color:#456b77;line-height:1.5;margin:8px 0 0}.menu-brand{font-size:8px;color:#456b77;line-height:1.55;margin:8px 0 0}.menu-brand span{color:#174d60}.site-footer{display:flex;justify-content:space-between;gap:8px;padding:11px 3px 0;font-size:8px;color:#40657b}
.play-view{position:absolute;inset:0;display:flex;flex-direction:column;padding:6px;gap:5px;--row:clamp(44px,12vw,68px)}.work{min-height:0;flex:1;display:flex;flex-direction:column;gap:5px}.stage-head{flex-shrink:0;background:#e8fffaee;border:1px solid #6da1ad;border-radius:7px;padding:7px 8px;box-shadow:inset 0 1px white}.stage-head .eyebrow{margin-bottom:3px}.stage-head h2{font-size:14px;margin:0;line-height:1.5}.board-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;align-items:flex-start;justify-content:flex-start;touch-action:pan-x pan-y;scrollbar-width:thin}.board{flex-shrink:0;width:min(100%,620px);min-width:284px;margin:auto;display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));grid-template-rows:repeat(4,var(--row));gap:2px;padding:4px;background:#17607ccf;border:1px solid #f7ffff;border-radius:8px;box-shadow:0 2px 6px #103d6380;touch-action:pan-x pan-y}.tile{display:block;position:relative;border-radius:4px;min-height:44px;min-width:44px;width:100%;height:100%;padding:0;background:linear-gradient(#f4fffd,#cdeef1);border:1px solid #72a9b7;overflow:hidden;box-shadow:inset 0 1px #fff;touch-action:pan-x pan-y;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.tile:active{background:#e2fbdd}.tile.void{background:#69aab8c2;box-shadow:inset 0 1px #87bec6;cursor:default;border-color:#8bc1c5}.tile.pin{background:linear-gradient(#e8f3fa,#c4dbe6)}.tile.fault{border:2px solid #bb621d;background:linear-gradient(#fff2c7,#ffd29d)}.tile.ready-crop{background:linear-gradient(#f4ffe6,#c6efb6);border-color:#62974f}.tile svg{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.coord{position:absolute;left:3px;top:3px;font-size:7px;color:#305e73;pointer-events:none}.tile.void .coord{color:#134256}.tile-mark{position:absolute;right:3px;bottom:3px;font-size:6px;color:#194d62;background:#edfffae8;padding:2px;pointer-events:none;line-height:1}.tile .sprite{position:absolute;width:min(60%,44px);height:64%;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none}.tile .sprite img{display:block;width:100%;height:100%;image-rendering:pixelated}.tile .fault-dot{position:absolute;right:3px;top:3px;width:6px;height:6px;background:#a74a15;pointer-events:none}.controlwell{display:flex;flex-direction:column;gap:5px;background:#e9fffaef;border:1px solid #5e98aa;border-radius:8px;padding:6px;flex-shrink:0;min-height:0}.readout{display:flex;align-items:center;justify-content:space-between;gap:5px;font-size:10px;white-space:nowrap;color:#2a5c70}.readout strong{color:#0c536d}.control-grid{display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));gap:4px}.control-grid button{font-size:11px;padding:4px;min-height:48px}.control-grid small{display:block;margin-top:2px;font-size:6px;white-space:nowrap;font-weight:600;color:#3c6572}.feedback{font-size:10px;color:#365f70;line-height:1.45;min-height:14px;max-height:32px;overflow:hidden;margin:0}
#sheet-layer{position:absolute;inset:0 0 var(--save-reserve,0px);z-index:20;padding:7px;background:#164b6380;display:flex;align-items:center;justify-content:center}#sheet{width:100%;max-width:690px;max-height:100%;min-height:0;display:flex;flex-direction:column;background:#f0fffb;border:2px solid #4f91a4;border-radius:10px;box-shadow:0 3px 17px #123d5266;overflow:hidden}.sheet-header{display:flex;align-items:center;justify-content:space-between;gap:4px;padding:4px 5px;flex-shrink:0;background:linear-gradient(#ebfff8,#c0eaf0);border-bottom:1px solid #73a9b7}.sheet-header h2{font-size:9px;line-height:1.55;margin:0;min-width:0;overflow-wrap:anywhere}.sheet-header nav{display:flex;gap:3px;flex-shrink:0}.sheet-header button{font-size:9px;min-width:44px;padding:3px}#sheet-body{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;padding:14px;font-size:13px}#sheet-body>p:first-child{margin-top:0}#sheet-body>button{display:block;width:100%;margin:9px 0 0}#sheet-body h3{font-size:10px;line-height:1.7;margin:18px 0 8px;color:#125876}.keyline{display:flex;flex-direction:column;gap:7px;padding:10px;margin:10px 0;background:#e0f6f3;border:1px solid #82b3bd;border-radius:6px}.keyline strong{color:#124e65}.keyline span,.keyline small{line-height:1.6}.keyline small{font-size:11px;color:#476d7b}.button-row{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:9px 0}.button-row button{width:100%}.notice{padding:9px 11px;border:1px solid #c08a49;background:#fff2cc;color:#663d1d;border-radius:5px;line-height:1.6;font-size:12px}.tuple{border-left:3px solid #66a45c;padding:3px 10px;margin:13px 0}.tuple h4{font-size:11px;color:#146284;margin:3px 0 6px}.tuple p{font-size:12px;margin:3px 0}.tuple small{font-size:11px;line-height:1.7;color:#4e6977}.setting{display:block;line-height:1.8;margin:4px 0 14px}.setting input{display:block;width:100%;height:44px;margin:0;accent-color:#1b8bac}.art-card{display:flex;align-items:center;gap:10px;margin:8px 0 12px}.art-card canvas{width:82px;height:70px;flex-shrink:0;border:1px solid #8eb7be;border-radius:5px}.art-card p{margin:0}.expanded{position:fixed;inset:0;z-index:100;height:100dvh!important;max-height:none!important;min-height:0!important;padding:var(--st) var(--sr) var(--sb) var(--sl);border:0;border-radius:0;box-shadow:none}.expanded #sheet-layer{inset:var(--st) var(--sr) calc(var(--sb) + var(--save-reserve,0px)) var(--sl)}.is-expanded{overflow:hidden}.expanded:fullscreen{width:100%;height:100%;background:#d8f6f2}#save-status{margin:0;padding:5px 7px;border-top:1px solid #bd8a52;background:#fff1c9;color:#573d29;font-size:11px;line-height:1.35}.has-save-error{grid-template-rows:48px minmax(0,1fr) auto}
@media(min-width:740px) and (min-height:521px){.site-frame{padding-left:calc(var(--sl) + 10px);padding-right:calc(var(--sr) + 10px)}.topbar{padding:1px 10px}.deck strong{font-size:14px}.deck span{font-size:7px;max-width:240px}.topbar button{font-size:12px;min-width:62px}.menu{align-items:stretch;justify-content:flex-end}.menu-panel{width:47%;display:flex;flex-direction:column;justify-content:center;padding:24px;border-left:2px solid #65a4ad;border-top:0}h1{font-size:35px}.tagline{font-size:16px}.menu-description{display:block}.menu-brand{font-size:10px}.play-view{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:9px;padding:9px}.work{min-width:0}.stage-head{padding:9px}.stage-head h2{font-size:17px}.controlwell{align-self:center;padding:9px}.control-grid{grid-template-columns:1fr 1fr}.control-grid button{font-size:13px}.readout{font-size:11px}.feedback{max-height:45px}}
@media(max-width:580px){.site-header span{display:none}.site-header small{font-size:6px}.deck span{max-width:110px}}
@media(max-height:620px) and (max-width:499px){.menu-panel{padding:9px 9px 8px}h1{font-size:24px}.tagline{font-size:12px;margin:4px 0 8px}.menu-brand,.micro{font-size:7px}.eyebrow{margin-bottom:4px}}
@media(max-height:520px){.site-header,.site-footer{display:none}.site-frame{padding:calc(var(--st) + 4px) calc(var(--sr) + 6px) calc(var(--sb) + 4px) calc(var(--sl) + 6px)}.cabinet{height:calc(100dvh - var(--st) - var(--sb) - 8px);max-height:none;grid-template-rows:46px minmax(0,1fr)}.has-save-error{grid-template-rows:46px minmax(0,1fr) auto}.topbar{padding:0 4px}.play-view{--row:44px;padding:4px;gap:3px}.stage-head{padding:4px 5px}.stage-head h2{font-size:11px}.stage-head .eyebrow{display:none}.controlwell{padding:4px}.control-grid button{min-height:44px}#sheet-layer{padding:5px}#sheet-body{padding:10px}}
@media(max-height:520px) and (min-width:500px){.play-view{display:grid;grid-template-columns:minmax(0,1fr) 176px;gap:5px;padding:4px}.work{min-width:0;gap:2px}.controlwell{align-self:stretch;justify-content:center}.control-grid{grid-template-columns:1fr 1fr}.control-grid small{font-size:6px}.deck{flex-direction:row;align-items:center;gap:10px}.deck span{max-width:200px}.menu{align-items:stretch;justify-content:flex-end}.menu-panel{width:52%;display:flex;flex-direction:column;justify-content:center;border-left:1px solid #68a8ad;border-top:0;padding:5px 8px}h1{font-size:22px;margin:0}.tagline{font-size:11px;line-height:1.4;margin:4px 0 7px}.menu-actions{gap:4px}.menu-actions button{font-size:10px;padding:3px}.menu-description,.menu-panel .micro{display:none}.menu-brand{font-size:7px;margin-top:6px}}
@media(max-height:440px) and (max-width:499px){.stage-head,.readout,.feedback{display:none}.menu{justify-content:flex-end;align-items:stretch}.menu-panel{width:66%;display:flex;flex-direction:column;justify-content:center;padding:5px 7px;border-left:1px solid #68a8ad;border-top:0}.menu-panel .eyebrow,.menu-panel .micro{display:none}.menu-panel h1{font-size:20px;margin:0}.menu-panel .tagline{font-size:11px;margin:4px 0 7px}.menu-actions{gap:4px}.menu-actions button{font-size:10px;padding:3px}.menu-brand{font-size:7px;margin-top:5px}.has-save-error #save-status{font-size:10px;padding:3px 5px}}
.wet-path{stroke-dasharray:3 5;animation:current .95s linear infinite}.gentle .wet-path{animation-duration:5s}@keyframes current{to{stroke-dashoffset:-24}}
@media(max-height:320px) and (min-width:500px){.stage-head{padding:1px 5px}.stage-head h2{font-size:9px;line-height:1.2}}

.cabinet[data-phase=flow] .wet-path{animation:current .95s linear infinite,water-arrives .23s ease-out var(--arrival,0ms) both}.cabinet.gentle[data-phase=flow] .wet-path{animation:current 5s linear infinite,water-arrives .65s ease-out var(--arrival,0ms) both}@keyframes water-arrives{from{opacity:0}to{opacity:1}}
