*{box-sizing:border-box}
:root{color-scheme:dark;--paper:#f6efe2;--mute:#beb6a7;--fire:#ff9b45;--edge:#514b40}
body{margin:0;color:var(--paper);background:#171716;font-family:"Segoe UI",Arial,sans-serif}
button,a{font:inherit;touch-action:manipulation}
button{color:inherit;cursor:pointer;border:1px solid var(--edge);border-radius:.45rem;background:#262824;padding:.55rem .8rem;font-size:.9rem;font-weight:650}
button:disabled{cursor:default;opacity:.45}
button:hover:not(:disabled),a:hover{color:#ffe5c0;border-color:#e7a767}
button:focus-visible,a:focus-visible,.board:focus-visible{outline:3px solid #ffe4a9;outline-offset:3px}
[hidden]{display:none!important}
.workshop{min-height:100svh;position:relative;isolation:isolate;overflow:hidden;background:radial-gradient(ellipse at 65% 25%,#67371747,transparent 60%),#171716}
.workshop:before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(95deg,#101311ec 5%,#121410c9 46%,#211b15c4 90%),url("../../launcher-art/foundry-2048.webp") center / cover}
.top{max-width:89rem;padding:.85rem clamp(1rem,4vw,4rem);margin:auto;display:flex;align-items:center;justify-content:space-between}
.back,.tools>button{display:inline-flex;align-items:center;gap:.5rem;border:1px solid #6a64524d;background:#151815cf;min-height:2.75rem;border-radius:.45rem;color:#ede5d7;font-weight:650;padding:.45rem .85rem;text-decoration:none}
.back>span:first-child{font-size:1.5rem;line-height:1}
.tools{display:flex;align-items:center;gap:.5rem}.tools>button{width:2.75rem;justify-content:center}
.stage{width:min(100%,81rem);margin:auto;display:grid;grid-template-columns:minmax(16rem,1.05fr) minmax(16rem,.85fr);gap:clamp(1.6rem,5vw,6rem);padding:clamp(.4rem,3.5vh,2.5rem) clamp(1rem,5vw,5rem) 1.6rem;align-items:center}
.press{--rim:clamp(.6rem,1.15vw,1.2rem);width:min(100%,max(19rem,calc(100svh - 11.8rem)));margin:auto;border:1px solid #74766c;border-radius:.8rem;background:linear-gradient(135deg,#51554d 0,#2f332f 20%,#222622 58%,#42443a 100%);box-shadow:inset 0 1px #b2ad9273,inset 0 -5px #171a16,0 .7rem 1.4rem #0007;padding:0 var(--rim) .25rem}
.press-top,.press-foot{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.75rem .12rem}
.press-name,.counter,.tag,.progress,.job-index{font-family:Consolas,"Courier New",monospace}
.press-name{font-size:.77rem;text-transform:uppercase;letter-spacing:.055em;color:#ddd6c0;display:flex;align-items:center;gap:.48rem}
.press-name i{width:.62rem;height:.62rem;flex:none;background:#ffa855;border-radius:50%;box-shadow:0 0 .58rem #ff942f9e}
.counter{background:#171b16;border-radius:.25rem;border:1px solid #5c5c49;color:#abae9a;display:flex;gap:.55rem;align-items:baseline;padding:.25rem .45rem;font-size:.77rem}
.counter b{color:#ffcc7b;font-size:.9rem;font-variant-numeric:tabular-nums}
.board-frame{padding:clamp(.35rem,.62vw,.65rem);border:1px solid #080b08;box-shadow:inset 0 0 .15rem #f9da8a80,0 1px #96998388;background:repeating-linear-gradient(135deg,#4f4836 0 5px,#252922 5px 10px);border-radius:.62rem}
.board{outline:none;position:relative;aspect-ratio:1;touch-action:none;user-select:none;overflow:hidden;container-type:inline-size;background:#272c26;border:1px solid #101411;border-radius:.33rem;box-shadow:inset 0 0 16px #000}
.beds,.blocks{position:absolute;inset:0}.beds{display:grid;grid-template:repeat(4,1fr)/repeat(4,1fr)}
.cell{position:relative;margin:2.2%;border-radius:7%;border:1px solid #494c40;box-shadow:inset 0 2px 5px #060a06;background:linear-gradient(125deg,#20251f,#1c211c)}
.cell.out{border:2px dashed #f2a858;background:repeating-linear-gradient(-45deg,#7c583045 0 3px,#312a1d40 3px 9px)}
.cell.out:after{content:"⌄";font:bold 2rem/1 Consolas;color:#fbba65b3;position:absolute;right:9%;bottom:2%}
.cell.slag{background:repeating-linear-gradient(135deg,#333730 0 6px,#44483d 6px 9px);box-shadow:inset 1px 1px 3px #949183,2px 2px 2px #030603;border-color:#20231f}
.cell.slag:before,.cell.slag:after{content:"";position:absolute;width:8%;height:8%;border-radius:50%;background:#696b5d;box-shadow:inset -1px -1px #171a16}
.cell.slag:before{left:13%;top:13%}.cell.slag:after{bottom:13%;right:13%}
.block{position:absolute;width:25%;height:25%;left:0;top:0;padding:.97%;transform:translate(calc(var(--x)*100%),calc(var(--y)*100%));will-change:transform}
.ingot{--light:#b9c9bf;--mid:#80938a;--dark:#495d54;position:relative;display:grid;place-items:center;width:100%;height:100%;border-radius:12%;border:1px solid #c3cabaad;background:linear-gradient(144deg,var(--light) 0%,var(--mid) 34%,var(--mid) 66%,var(--dark) 100%);box-shadow:inset 2px 3px 0 #ffffff3d,inset -2px -5px 0 #1b201e69,0 2px 3px #070a0770;overflow:hidden}
.ingot:before{content:"";position:absolute;inset:6%;border:1px solid #ffffff2a;border-bottom-color:#17201e31;border-radius:9%;background:repeating-linear-gradient(174deg,transparent 0 8px,#fff1 8px 9px,transparent 9px 18px);pointer-events:none}
.ingot b{z-index:1;color:#19231f;letter-spacing:-.075em;line-height:1;font:850 clamp(1rem,7.8cqw,3.6rem)/1 "Segoe UI",Arial,sans-serif;font-variant-numeric:tabular-nums;text-shadow:0 1px #ffffff66}
.ingot.f1{--light:#f3d7a5;--mid:#c4ab81;--dark:#817052}.ingot.f2{--light:#f3b687;--mid:#cb8a60;--dark:#945a42}.ingot.f3{--light:#ffd19b;--mid:#eb8d4b;--dark:#ae512c}.ingot.f4{--light:#fff5c1;--mid:#ffb859;--dark:#cd692d}.ingot.f5{--light:#fff8bb;--mid:#ffd85e;--dark:#c48737}.ingot.f6{--light:#ffe6d8;--mid:#ff9a7d;--dark:#ac5039}.ingot.f7{--light:#f1e2ff;--mid:#c4ace7;--dark:#796a99}.ingot.hot{border-color:#ffdb8e;box-shadow:inset 2px 3px 0 #fff6,inset -2px -5px 0 #87482373,0 0 7px #ff9b394a}
.ingot.long b{font-size:clamp(.85rem,5.65cqw,2.6rem)}
.pad{display:flex;gap:.28rem}.pad button{width:clamp(1.8rem,3.6vw,3rem);padding:.3rem 0;min-height:2.25rem;font-size:1.15rem;line-height:1;border-radius:.3rem;background:linear-gradient(#41453c,#30352d);border-color:#666757;box-shadow:0 2px #121812}
.undo{border:0;background:none;font-size:.8rem;padding:.4rem .2rem}
.panel{max-width:33rem;width:100%;align-self:center}
h1,h2,p{margin:0}h1{font-size:clamp(2.35rem,4.65vw,4.9rem);letter-spacing:-.055em;line-height:.98;font-weight:820}h1 b{display:block;color:#ffad59;font:850 clamp(3.4rem,7.9vw,7.6rem)/.91 "Segoe UI",Arial,sans-serif;letter-spacing:-.07em}
.mast{padding-bottom:clamp(1rem,3vh,2rem)}.tabs{display:flex;gap:.32rem;width:max-content;border:1px solid #65605164;border-radius:2rem;background:#1a1c18c4;padding:.22rem;margin-bottom:.72rem}
.tabs button{background:none;border:0;border-radius:2rem;padding:.38rem 1rem}.tabs button[aria-pressed=true]{background:#d4d2bf;color:#20251e}
#jobs{display:grid;grid-template-columns:1fr 1fr;gap:.36rem}.job{text-align:left;display:flex;align-items:center;gap:.5rem;background:#262821e6;color:#e5ddc9;border-color:#5a594b;min-height:2.6rem;padding:.34rem .6rem;line-height:1.15}
.job[aria-pressed=true]{border-color:#ecaf68;background:#453324}.job-index{color:#e9bc80;font-size:.74rem}.job:disabled{opacity:.62}.job-suffix{margin-left:auto;color:#e2c389;font-size:.72rem}
.order{margin:.85rem 0 .8rem}.tag,.progress{font-size:.82rem;color:#e5bf89;letter-spacing:.035em}.tag{text-transform:uppercase}.order h2,.sheet h2{font-size:clamp(1.35rem,2.3vw,2.25rem);line-height:1.13;letter-spacing:-.025em;margin:.22rem 0}
.order p:not(.progress),.sheet p{color:#d0cabd;font-size:1rem;line-height:1.45;max-width:35rem}
.gauge{margin:.9rem 0 .45rem;height:4px;background:#514b3d;overflow:hidden;border-radius:4px}.gauge i{display:block;width:0;height:100%;background:linear-gradient(90deg,#b3683b,#ffba5f);transition:width .2s}
.primary{background:linear-gradient(155deg,#ffc785,#f5a353);border:1px solid #ffd39b;color:#261d11;min-height:2.75rem;min-width:9rem;border-radius:.42rem;font-weight:780}
.primary:hover:not(:disabled){color:#261d11;background:#ffd195}.minor{display:flex;gap:.45rem;flex-wrap:wrap;margin:.65rem 0}.source{display:block;margin-top:.6rem;color:var(--mute);border:0;background:none;font-size:.78rem;padding:.35rem 0;text-decoration:underline;text-underline-offset:.2em}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
dialog{border:1px solid #79705a;border-radius:.7rem;color:var(--paper);background:#21241f;padding:0;max-width:min(28rem,92vw)}dialog::backdrop{background:#080c0bd9}.sheet{padding:1.35rem}.sheet p{margin:.8rem 0}.sheet a{color:#ffc78e}.sheet-actions{display:flex;gap:.5rem;margin-top:.9rem}
@media(max-width:700px){.stage{grid-template-columns:1fr;gap:.75rem;padding:.2rem .8rem 1rem;max-width:34rem}.top{padding:.45rem .8rem}.press{width:min(100%,max(17rem,calc(100svh - 20rem)))}.press-top,.press-foot{padding:.38rem .1rem}.panel{display:block;max-width:none}.mast h1{font-size:1.65rem}.mast h1 b{display:inline;font-size:1.78rem}.mast{padding:.1rem 0 .5rem}.order h2{font-size:1.25rem}.order p:not(.progress){font-size:.92rem}.order{margin:.48rem 0}.gauge{margin:.4rem 0}.job{min-height:2.35rem}.panel .primary{min-height:2.55rem}.source{margin-top:.2rem}.stage[data-view=play] .mast{display:none}}
@media(max-height:570px) and (min-width:701px){.stage{padding-top:.1rem;gap:2rem}.mast h1{font-size:1.65rem}.mast h1 b{display:inline;font-size:2.15rem}.mast{padding-bottom:.5rem}.order{margin:.4rem 0}.press{width:min(100%,max(16rem,calc(100svh - 8rem)))}.press-top,.press-foot{padding:.25rem}.top{padding-top:.35rem;padding-bottom:.35rem}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}


.workshop::before {
  background: linear-gradient(100deg,#16120ae3 7%,#24130b82 42%,#16100cf0 76%),url("../../launcher-art/foundry-2048.webp") center / cover;
}
.stage[data-view="menu"] .press-foot { visibility: hidden; }
.stage[data-view="menu"] .press {
  border-color: #918274; border-radius: 3px; box-shadow: 0 18px 45px #0a0507b3,inset 0 2px #edba6f5c;
}
.stage[data-view="menu"] .mast { padding-bottom: .9rem; }
.stage[data-view="menu"] h1 { font-size: clamp(2rem,3.7vw,4.5rem); text-transform: uppercase; letter-spacing: -.055em; }
.stage[data-view="menu"] h1 b { color: #ffc080; font-stretch: condensed; line-height: .85; }
#picker .tabs { border: 0; padding: 0; border-radius: 0; background: transparent; gap: .75rem; }
#picker .tabs button { border: 0; min-height: 40px; padding: .45em .12em; border-radius: 0; color: #c3b4a3; background: transparent; }
#picker .tabs button[aria-pressed="true"] { border-bottom: 3px solid #ffac69; color: #ffe1b9; }
#jobs { gap: .3rem; }
#jobs .job { border-radius: 1px; border: 1px solid #c0926355; border-left: 3px solid #645345; background: #201911db; }
#jobs .job[aria-pressed="true"] { border-left-color: #ffac68; background: #573721; }
#go { min-width: 12rem; border-radius: 1px; box-shadow: 0 2px #3f1c0a; }
@media (min-width: 850px) and (min-height: 610px) {
  .stage[data-view="menu"] .press { transform: perspective(1200px) rotateY(9deg) rotateZ(-3deg); }
}
@media (max-width: 700px) {
  .stage[data-view="menu"] { grid-template-columns: 1fr; }
  .stage[data-view="menu"] .press { display: none; }
  .stage[data-view="menu"] .panel { margin: clamp(4.4rem,19vh,10rem) 0 1.6rem; padding: 1rem; background: linear-gradient(0deg,#18120ff0,#201812cf 85%,#21140c99); border-top: 2px solid #bd855d; }
  .stage[data-view="menu"] h1 b { display: block; font-size: clamp(3rem,15vw,5rem); }
}
