:root{
  --deep:#071f2b;
  --petrol:#103d49;
  --petrol-2:#1b5961;
  --glass:#0c3440e8;
  --cream:#f8e5bd;
  --cream-2:#d7b37e;
  --copper:#a45e35;
  --gold:#d8ae69;
  --mint:#71dfc2;
  --ink:#143a43;
  --muted:#a8c7c5;
  font-family:'Trebuchet MS','Arial Rounded MT Bold',sans-serif;
  color:var(--cream);
  background:var(--deep);
}
*{box-sizing:border-box}
html,body{min-width:320px;min-height:100%;margin:0}
body{background:radial-gradient(circle at 50% -20%,#34727a 0,#123e49 28%,#071f2b 72%);}
button,input{font:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #eafff6;outline-offset:3px}
.workshop{min-height:100dvh;display:grid;grid-template-rows:auto 1fr auto;overflow:hidden}
.workshop-head{min-height:76px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:22px;padding:11px 22px;border-bottom:2px solid #d8ae6966;background:linear-gradient(180deg,#173f49f5,#0a2e38f5);box-shadow:0 8px 30px #00131c80,inset 0 1px #ffffff24}
.brand-lockup strong{display:block;color:#fff0ca;font-size:clamp(20px,2vw,29px);font-style:italic;letter-spacing:-1.5px;text-shadow:0 2px #8e4a2c}
.brand-lockup span{display:block;margin-top:-2px;color:var(--mint);font-size:12px;font-weight:800;letter-spacing:.06em}
.level-identity{text-align:center}.level-identity span{display:block;color:#8de7cf;font-size:11px}.level-identity b{display:block;margin-top:3px;color:#fff3d1;font-size:15px}
.save-state{justify-self:end;padding:9px 13px;border:1px solid #7ddac4aa;border-radius:15px;color:#cbf8ea;background:#0a3039;font-size:12px;box-shadow:inset 0 1px #ffffff19}
.workspace{min-height:0;display:grid;grid-template-columns:minmax(218px,255px) minmax(460px,1fr) minmax(245px,292px);gap:14px;padding:14px}
.recipe-console,.tool-console{min-height:0;overflow:auto;padding:20px 18px;border:1px solid #edcf9c80;background:linear-gradient(145deg,#173f49f5,#0b303aed);box-shadow:inset 0 0 0 3px #0a2a33,0 8px 24px #00141c66}
.recipe-console{border-radius:24px 9px 9px 24px}.tool-console{border-radius:9px 24px 24px 9px}
h1,h2,h3,p{margin-top:0}.recipe-console h1,.tool-console h2{margin-bottom:7px;color:#fff2cc;font-size:20px}.recipe-console>p,.tool-console>p{margin-bottom:18px;color:var(--muted);font-size:12px;line-height:1.45}
fieldset{margin:0;padding:0;border:0}legend{margin-bottom:8px;color:#f1ddb8;font-size:12px;font-weight:800}
.recipe-list{display:grid;gap:7px}.recipe-list button{min-height:58px;display:grid;grid-template-columns:26px minmax(0,1fr) 42px;align-items:center;gap:8px;padding:6px 8px;border:1px solid #5d969777;border-radius:12px;color:#dcece6;background:#0a303a;text-align:left}.recipe-list button>span:first-child{width:26px;color:#83e5cd;font-size:21px;text-align:center}.recipe-list button b{font-size:10px;line-height:1.18}.recipe-list button[aria-pressed=true]{border-color:#ffe5ae;color:#173d46;background:linear-gradient(#fff0c9,#ddb881);box-shadow:0 3px 0 #754329}
.recipe-list button[aria-pressed=true] span{color:#a25631}
.recipe-preview{width:38px;height:46px;margin:0;opacity:.9}.recipe-preview i{width:3px;height:3px}.recipe-list button[aria-pressed=true] .recipe-preview{filter:saturate(1.15) contrast(1.08)}
.mix-controls{display:grid;grid-template-columns:1fr;gap:5px;margin-top:12px;padding:11px;border:1px solid #6caaa777;border-radius:13px;background:#082a34}.mix-controls[hidden]{display:none}.mix-controls label{color:#e9d5af;font-size:10px;font-weight:800}.mix-controls select{width:100%;padding:8px 9px;border:1px solid #77b9ad88;border-radius:9px;color:#f8e5bd;background:#103b45}
.density-control{display:block;margin-top:22px}.density-control>span{display:flex;justify-content:space-between;gap:8px;color:#f3dfba;font-size:12px;font-weight:800}.density-control output{color:#92efd4}.density-control input{width:100%;margin:10px 0 5px;accent-color:#6eddbf}.density-control small{display:block;color:#94b7b6;font-size:10px;line-height:1.35}
.seed-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:17px;color:#e8d3ad;font-size:12px}.seed-row input{width:90px;padding:8px 9px;border:1px solid #87cab877;border-radius:10px;color:#f9e9c8;background:#082a34}
.generate-action{width:100%;min-height:43px;margin-top:12px;border:1px solid #e8fff6;border-radius:12px;color:#123b43;background:linear-gradient(#caffec,#72dcbf);box-shadow:0 3px 0 #386f65;font-size:11px;font-weight:900}.generator-status{margin:9px 0 0;color:#9fc1be;font-size:9px;line-height:1.35}.generator-status.stale{color:#f1d29e}.variant-slots{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:8px}.variant-slots button{position:relative;min-height:54px;padding:4px;border:1px solid #537f83;border-radius:10px;color:#abc9c6;background:#082a34;overflow:hidden}.variant-slots button[aria-pressed=true]{border-color:#ffe0a6;color:#173d46;background:#75ddc0;box-shadow:0 2px 0 #396e63}.variant-slots button:disabled{cursor:default;opacity:.45}.variant-slots small{position:absolute;right:4px;bottom:2px;font-size:8px}.mini-board{position:relative;display:block;width:35px;height:43px;margin:auto}.mini-board i{position:absolute;width:3px;height:3px;border-radius:50%;background:var(--mini-color)}
.generator-note{margin-top:18px;padding:12px 13px;border-left:3px solid var(--gold);color:#9fbfbd;background:#082a34;font-size:10px;line-height:1.45}.generator-note b{display:block;margin-bottom:4px;color:#f4deb5;font-size:11px}
.drafting-stage{min-width:0;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;padding:16px 18px 12px;border:1px solid #f7d9a78c;border-radius:13px;background:linear-gradient(180deg,#e8d0a7,#bd8c59 10px,#0b3540 11px,#0a2d37);box-shadow:0 10px 38px #00131cb3,inset 0 0 0 3px #082a33}
.stage-head{display:flex;align-items:end;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:3px 4px 13px}.stage-head span{color:#8ee6cf;font-size:11px}.stage-head h2{margin:3px 0 0;color:#fff1ca;font-size:19px}
.phase-tabs{display:flex;gap:5px;width:100%;overflow-x:auto}.phase-tabs button{flex:1;min-width:116px;min-height:44px;padding:7px 10px;border:1px solid #6caeaa70;border-radius:11px;color:#b8d4cf;background:#092b35;white-space:normal;text-align:center}.phase-tabs button[aria-selected=true]{border-color:#ffdda1;color:#143b43;background:linear-gradient(#fff0cc,#dbb279);box-shadow:0 3px 0 #7d492e}.phase-recipe{width:100%;margin:0;color:#c8ddd8;font-size:13px}
.board-shell{position:relative;min-height:0;display:grid;place-items:center;overflow:hidden;border:1px solid #78cdbc66;border-radius:8px;background:radial-gradient(ellipse at 50% 36%,#2b748074,#0c3d49 58%,#072a35 100%);box-shadow:inset 0 0 50px #001722a6,inset 0 0 0 4px #d9b57222}
.board-shell:before,.board-shell:after{content:'';position:absolute;z-index:2;top:0;bottom:0;width:18px;background:linear-gradient(90deg,#6b3c28,#e9c890 31%,#56d8bf 45% 58%,#173f49 65%,#8b4d2f);box-shadow:0 0 14px #72f4d480}.board-shell:before{left:0}.board-shell:after{right:0;transform:scaleX(-1)}
.machine-rail{position:absolute;z-index:3;left:15px;right:15px;top:0;height:21px;display:flex;justify-content:space-around;align-items:center;border-bottom:2px solid #d7b174;background:linear-gradient(#f2dbb4,#a86c43);box-shadow:0 4px 10px #001c25}.machine-rail i{width:8px;height:8px;border-radius:50%;background:#6fe4c8;box-shadow:0 0 8px #8dffe6,inset 0 1px #fff}
.board{position:relative;width:min(68vh,94%);max-width:610px;aspect-ratio:11/14.8;margin-top:18px;touch-action:none}
.grid-cell{--x:50%;--y:50%;position:absolute;left:var(--x);top:var(--y);width:8.6%;aspect-ratio:1;translate:-50% -50%;display:grid;place-items:center;padding:0;border:0;border-radius:50%;background:transparent}
.grid-cell:before{content:'';width:15%;aspect-ratio:1;border-radius:50%;background:#a4d8ce52;transition:width .12s ease,background .12s ease}.grid-cell:hover:before,.grid-cell:focus-visible:before{width:68%;background:#c8fff134}.grid-cell.occupied:before{width:88%;background:var(--bubble);box-shadow:inset -5px -7px 10px #00152c52,inset 5px 5px 8px #ffffff4d,0 3px 5px #00131e9c,0 0 7px color-mix(in srgb,var(--bubble),white 18%)}
.grid-cell.occupied:after{content:'';position:absolute;left:31%;top:22%;width:21%;height:13%;border-radius:50%;rotate:-28deg;background:#fff9dd9c;filter:blur(.3px)}
.grid-cell[data-color="0"]{--bubble:#53caa8}.grid-cell[data-color="1"]{--bubble:#dc9b46}.grid-cell[data-color="2"]{--bubble:#d85291}.grid-cell[data-color="3"]{--bubble:#4d70d1}
.grid-cell.locked{box-shadow:0 0 0 2px #ffd98b inset}.grid-cell.locked span{position:absolute;z-index:2;right:4%;bottom:5%;width:22%;aspect-ratio:1;border:2px solid #fff0bd;border-radius:50%;background:#a65c32;box-shadow:0 1px 3px #001c26}
.mirror-axis{position:absolute;z-index:6;pointer-events:auto;touch-action:none;filter:drop-shadow(0 0 5px #73efd2);opacity:.96}.mirror-axis.vertical{top:2%;bottom:1%;width:18px;translate:-50% 0;cursor:ew-resize;background:repeating-linear-gradient(to bottom,#ffe0a5 0 6px,transparent 6px 11px) center/2px 100% no-repeat}.mirror-axis.horizontal{left:1%;right:1%;height:18px;translate:0 -50%;cursor:ns-resize;background:repeating-linear-gradient(to right,#ffe0a5 0 6px,transparent 6px 11px) center/100% 2px no-repeat}.mirror-axis:hover,.mirror-axis:focus-visible{filter:drop-shadow(0 0 7px #efffd4);opacity:1}.board.axis-placement{cursor:crosshair}.board.axis-placement .grid-cell:before{width:36%;background:#ffe4a84d}
.board-depth{position:absolute;z-index:1;top:30px;bottom:12px;left:26px;display:flex;flex-direction:column;justify-content:space-between;color:#a5d5cd80;font-size:9px;writing-mode:vertical-rl}.board-depth span:first-child{transform:rotate(180deg)}
.stage-foot{display:flex;justify-content:center;gap:22px;padding-top:10px;color:#9dbfbd;font-size:11px}.stage-foot b{color:#fff0c6}
.palette{display:grid;grid-template-columns:1fr 1fr;gap:7px}.laundry-color{min-height:53px;display:flex;align-items:center;gap:8px;padding:7px 8px;border:1px solid #5c8b8f;border-radius:13px;color:#dce9e4;background:#082b35;text-align:left}.laundry-color i{width:25px;height:25px;flex:0 0 25px;border-radius:50%;background:var(--swatch);box-shadow:inset 4px 4px #ffffff4a,inset -4px -5px #00152b35}.laundry-color span{font-size:11px;font-weight:800}.laundry-color small{color:#91b4b2;font-size:9px;font-weight:400}.laundry-color.mint{--swatch:#53caa8}.laundry-color.orange{--swatch:#dc9b46}.laundry-color.pink{--swatch:#d85291}.laundry-color.blue{--swatch:#4d70d1}.laundry-color[aria-pressed=true]{border-color:#ffe2a9;color:#143b43;background:#f0dab0;box-shadow:0 3px 0 #77472e}.laundry-color[aria-pressed=true] small{color:#68533d}
.edit-modes,.history-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.edit-modes button,.history-actions button{min-height:39px;padding:7px;border:1px solid #608f91;border-radius:11px;color:#c7dbd7;background:#082b35;font-size:10px;font-weight:800}.edit-modes button[aria-pressed=true]{border-color:#ffe0a4;color:#fff0cd;background:#a65b36}.history-actions button:disabled{cursor:not-allowed;opacity:.38}
.mirror-tools{margin-top:15px;padding:12px;border:1px solid #6fa9a66b;border-radius:14px;background:#082a34}.mirror-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px}.mirror-head h3{margin:0;color:#f5dfb8;font-size:13px}.mirror-head span{color:#8eafad;font-size:8px}.mirror-toggles{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:9px}.mirror-tools button{min-height:34px;border:1px solid #5f8e91;border-radius:9px;color:#c6dbd6;background:#103944;font-size:9px;font-weight:800}.mirror-tools button[aria-pressed=true]{border-color:#ffe0a4;color:#163b42;background:#79dec3}.mirror-tools>button{width:100%;margin-top:6px}.mirror-tools button:disabled{cursor:not-allowed;opacity:.38}.mirror-tools p{margin:8px 0 0;color:#92b4b1;font-size:8px;line-height:1.35}
.rule-check{margin-top:18px;padding-top:15px;border-top:1px solid #d6b77d5c}.rule-head{display:flex;align-items:center;justify-content:space-between}.rule-head h3{margin:0;color:#fff0ca;font-size:15px}.rule-head output{padding:4px 7px;border-radius:9px;color:#173c44;background:#82e3c8;font-size:10px;font-weight:800}.rule-check ul{display:grid;gap:6px;margin:11px 0;padding:0;list-style:none}.rule-check li{display:flex;align-items:center;gap:8px;color:#bad1cc;font-size:10px}.rule-check li b{display:grid;place-items:center;width:19px;height:19px;flex:0 0 19px;border-radius:50%;color:#143c43;background:#77dfc3}.rule-check li.fail b{color:#fff3d3;background:#bd5c42}.rule-check li.fail span{color:#f1c1af}.rule-check p{margin:10px 0 0;color:#88aaa8;font-size:9px;line-height:1.4}
.action-dock{min-height:69px;display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:10px;padding:10px 16px;border-top:1px solid #e8ca9780;background:#082a34;box-shadow:0 -8px 25px #00141c70}.action-dock button{min-height:42px;padding:9px 14px;border:1px solid #d7b67e;border-radius:13px;color:#f7e4bf;background:#143e48;font-size:11px;font-weight:800}.action-dock .primary-action{border-color:#dffff1;color:#133d45;background:linear-gradient(#caffec,#75dfc1 55%,#56bca5);box-shadow:0 3px 0 #376e65}.dock-message{color:#95b6b3;font-size:10px;text-align:center}
@media(max-width:1050px){.workspace{grid-template-columns:220px minmax(430px,1fr)}.tool-console{grid-column:1/-1;display:grid;grid-template-columns:220px 1fr 1fr;gap:12px;align-items:start}.tool-console>h2,.tool-console>p{grid-column:1}.palette{grid-column:2;grid-row:1/3}.edit-modes,.history-actions{grid-column:3;margin-top:0}.rule-check{grid-column:1/-1;margin-top:4px}.board{width:min(61vh,94%)}}
@media(max-width:760px){.workshop{overflow:visible}.workshop-head{grid-template-columns:1fr auto;padding:10px 13px}.level-identity{display:none}.workspace{display:flex;flex-direction:column;padding:9px}.drafting-stage{order:-1;min-height:720px}.recipe-console,.tool-console{border-radius:16px}.tool-console{display:block}.palette{margin-top:10px}.edit-modes,.history-actions{margin-top:10px}.action-dock{position:sticky;z-index:20;bottom:0;grid-template-columns:1fr 1fr}.dock-message{display:none}.board{width:96%}.stage-head{align-items:start;flex-direction:column}.stage-foot{gap:10px;flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}
