/* Actual hand-painted frame textures, nine-sliced; no procedural stripe substitute. */
:root{--metal:#111e2b;--cream:#f2e8cf}
body,h1,h2,h3,button,nav a,.price,.count,.special-name,.special-price,.coupon{font-family:Georgia,'Times New Roman','Nimbus Roman',serif}
body{padding:0;border:12px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5%;border-image-repeat:round;background:#0c1926;}
header{height:58px;min-height:58px;border:0;border-bottom:9px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5%;border-image-repeat:round;gap:2px;padding:0;background:#101923}
header h1,header nav a,header nav button,#vaultBtn{border:6px solid transparent;border-image-source:url('assets/ui/steel-panel.png');border-image-slice:6.5% fill;border-image-repeat:stretch;box-shadow:none;background:transparent;border-radius:0;}
header h1{height:100%;display:flex;align-items:center;padding:0 15px;font-size:34px;letter-spacing:0;gap:8px;flex-shrink:0}
header h1 small{font:8px Arial;letter-spacing:.5px;opacity:.65;margin:0}
header nav{display:flex;gap:2px;align-items:stretch;justify-content:flex-start;flex:1;min-width:0}
header nav a,header nav button,#vaultBtn{height:100%;padding:0 10px;gap:6px;font-size:21px;flex:0 0 auto;min-width:0;white-space:nowrap;color:#e5e3d9;text-shadow:1px 2px 2px #000}
#vaultBtn{margin-left:0;color:#f0d79d;min-width:0}
header .ui-sprite,header .header-gear{width:30px;height:30px;flex-shrink:0;margin:0}
.ui-sprite{display:inline-block;width:100px;height:100px;background-image:url('assets/ui/ledger-sprites.png');background-size:400% 200%;background-repeat:no-repeat;vertical-align:middle;flex-shrink:0}
.ui-journal{background-position:0 0}.ui-trophy{background-position:33.333333% 0}.ui-layers{background-position:66.666667% 0}.ui-toolkit{background-position:100% 0}.ui-pen{background-position:0 100%}.ui-reprint{background-position:33.333333% 100%}.ui-chest{background-position:66.666667% 100%}.ui-blueprint{background-position:100% 100%}
.header-gear{display:inline-block;background-image:url('assets/icons.png');background-size:400% 400%;background-position:66.666667% 100%}
main,body:has(#notice:not([hidden])) main{border:0;grid-template-columns:32% 40% 28%}
.left,.empire{border-right:14px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5%;border-image-repeat:round}
.strip{border-bottom:10px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5%;border-image-repeat:round;height:186px;min-height:186px}
.strip h3{font-family:Georgia,'Times New Roman','Nimbus Roman',serif;font-size:24px;font-weight:bold;background:#06132080;height:33px;line-height:27px;padding:2px 10px}
.strip .machines{height:125px}.strip .cap{bottom:2px}.strip h3 small{font-size:13px}
.workshop,.specials{border-top:10px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5%;border-image-repeat:round;padding-left:5px;padding-right:5px}
.workshop>h2,.specials>h2,.shop>h2,.dialog-head,.buytools,.left footer,#vault{background-image:url('assets/ui/steel-panel.png');background-size:115% 115%;background-position:center;background-color:#101a24}
.workshop>h2,.specials>h2{margin:0 -5px 7px;padding:7px 10px;border:0;font-size:26px}.shop>h2{border:0;font-size:35px;padding:7px 12px}
.buytools{border-bottom:7px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5%;border-image-repeat:round;box-shadow:none;padding:5px 7px}
button,.special,.upgrade,.badge,.bp-node,.producer,.merchant{border:5px solid transparent;border-image-source:url('assets/ui/steel-panel.png');border-image-slice:6.5% fill;box-shadow:none;background:transparent;border-radius:0}
button:hover,nav a:hover{filter:brightness(1.17)}
#pen,#collectFilament{border:0;border-image:none!important;background:none;box-shadow:none}
#pen:focus-visible,#collectFilament:focus-visible{outline:2px solid #d8b56f}
.special.affordable,.upgrade.affordable,.bp-node.affordable,.badge:not(.missing),.merchant,.special.owned,.bp-node.purchased{border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5% fill}
.producer{border:5px solid transparent;border-image-source:url('assets/ui/steel-panel.png');border-image-slice:6.5%;background:linear-gradient(115deg,#e3dfd1,#bebfb4);margin:0 0 2px;min-height:84px}
.producer strong{font-family:Georgia,'Times New Roman','Nimbus Roman',serif;font-size:27px;text-shadow:0 1px #fff7}.producer .count{font:22px Georgia,'Times New Roman','Nimbus Roman',serif}.producer .price{font-size:18px;color:#216336}.producer.short{opacity:.78}.producer .count small{font-size:10px}
.upgrade strong{font-size:13px;min-height:30px}.upgrade .price{font-size:14px}.special-name{font-size:12px}.special .special-price{font-size:13px}.special{height:124px}
.selected{background:#315a88!important;box-shadow:inset 0 0 12px #8cbbff44!important;border-image-slice:6.5%}
#vault{border:0;border-bottom:10px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5%;border-image-repeat:round}
#vaultCards{gap:8px}.merchant{border-width:8px}.coupon{border:1px dashed #aa874b;background:#0d1720}.merchant .logo-plate{border:none}.merchant strong{font:15px Georgia,'Times New Roman','Nimbus Roman',serif}
.toast,dialog,#tooltip{border:10px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5% fill;box-shadow:0 7px 22px #0008;background:transparent;border-radius:0}
#tooltip{border-width:7px}.toast strong{font-size:22px}.toast button{border-width:4px;font-size:22px}.toast{padding:5px 8px}
.dialog-head{border:0;border-bottom:8px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5%;border-image-repeat:round;padding:8px 14px}
.dialog-head h2{font-size:30px}.dialog-head button{border-width:5px;padding:3px 9px}
#dialogBody{padding:15px}#dialogBody h3{font-family:Georgia,'Times New Roman','Nimbus Roman',serif}
/* The approved workshop ledger, using live game values. */
dialog.stats-dialog{width:1120px;max-width:96vw;max-height:94dvh}
.stats-dialog .dialog-head{padding:7px 16px}
.stats-dialog #dialogTitle{display:flex;align-items:center;gap:18px;font:bold 41px/1 Georgia,'Times New Roman','Nimbus Roman',serif}
.stats-dialog #dialogTitle>.ui-sprite{width:122px;height:94px}
.stats-dialog #dialogTitle small{display:block;font:italic 20px/1.3 Georgia,'Times New Roman','Nimbus Roman',serif;color:#c5c9ca;margin-top:7px}
.stats-dialog #closeDialog{align-self:flex-start;margin-top:7px}
.stats-dialog #dialogBody{padding:13px}
.ledger-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:13px}
.ledger-total,.ledger-section{border:9px solid transparent;border-image-source:url('assets/ui/bronze-panel.png');border-image-slice:6.5% fill;box-shadow:1px 3px 5px #0008;min-width:0}
.ledger-total{display:flex;align-items:center;gap:9px;padding:8px 10px;min-height:105px}
.ledger-total>.ui-sprite,.ledger-total>.sprite{width:80px;height:80px}
.ledger-total>div{min-width:0}.ledger-total span:not(.ui-sprite):not(.sprite){font:21px/1.1 Georgia,'Times New Roman','Nimbus Roman',serif;display:block}
.ledger-total b{display:block;font:bold 34px/1.15 Georgia,'Times New Roman','Nimbus Roman',serif;color:#f0d28b;margin-top:7px;overflow-wrap:anywhere}
.ledger-sections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}
.ledger-section{padding:12px 9px}
#dialogBody .ledger-section h3{font:bold 28px/1.1 Georgia,'Times New Roman','Nimbus Roman',serif;color:#f2e8cf;margin:0 0 10px 128px;text-shadow:1px 2px #000}
.ledger-section-body{display:flex;gap:9px;align-items:center}
.ledger-art{width:119px;flex-shrink:0;display:flex;align-items:center;justify-content:center}
.ledger-art>.ui-sprite,.ledger-art>.sprite{width:119px;height:119px}
.ledger-rows{flex:1;min-width:0}.ledger-row{display:flex;gap:8px;align-items:center;justify-content:space-between;border-bottom:1px solid #738a8e33;min-height:39px;padding:7px 4px;font:18px/1.1 Georgia,'Times New Roman','Nimbus Roman',serif;}
.ledger-row:nth-child(odd){background:#08162344}.ledger-row:last-child{border-bottom:0}.ledger-row>span:not(.sprite){flex:1}.ledger-row b{font:bold 22px/1.1 Georgia,'Times New Roman','Nimbus Roman',serif;color:#f0d28b;text-align:right;overflow-wrap:anywhere;max-width:51%}.ledger-row>.sprite{width:23px;height:23px}
@media(max-width:1500px){header h1{font-size:30px;padding:0 10px}header nav a,header nav button,#vaultBtn{font-size:18px;padding:0 6px;gap:3px}header .ui-sprite,header .header-gear{width:26px;height:26px}.producer strong{font-size:23px}.producer .price{font-size:16px}.strip h3{font-size:21px}.strip h3 small{font-size:11px}}
@media(max-width:1200px){header h1{font-size:28px;padding:0 7px}header nav a,header nav button,#vaultBtn{font-size:16px;padding:0 4px}.producer strong{font-size:21px}.ledger-art{width:90px}.ledger-art>.ui-sprite,.ledger-art>.sprite{width:90px;height:100px}#dialogBody .ledger-section h3{margin-left:99px;font-size:25px}.ledger-row{font-size:17px}.ledger-row b{font-size:20px}}
@media(max-width:1050px){header{height:auto;min-height:58px;flex-wrap:wrap}header h1{height:45px;flex:0 0 auto}header nav{flex-basis:100%;width:100%;flex-wrap:wrap;order:2;height:auto}header nav a,header nav button,#vaultBtn{height:42px;flex:0 0 auto;padding:0 9px}header h1 small{display:none}.ledger-summary{gap:6px}.ledger-total{padding:6px}.ledger-total>.ui-sprite,.ledger-total>.sprite{width:55px;height:65px}.ledger-total b{font-size:26px}.ledger-total span:not(.ui-sprite):not(.sprite){font-size:18px}.stats-dialog #dialogTitle{font-size:33px}.ledger-art{width:60px}.ledger-art>.ui-sprite,.ledger-art>.sprite{width:60px;height:75px}#dialogBody .ledger-section h3{margin-left:0;font-size:24px}}
@media(max-width:700px){body{border-width:7px}.left,.empire{border-right:0}.workshop>h2,.specials>h2{font-size:25px}header h1{font-size:31px}header nav{gap:1px}header nav a,header nav button,#vaultBtn{font-size:15px;padding:0 4px;height:40px;border-width:4px}header .ui-sprite,header .header-gear{width:23px;height:23px}.stats-dialog{border-width:7px}.stats-dialog .dialog-head{padding:5px 6px}.stats-dialog #dialogTitle{font-size:27px;gap:7px}.stats-dialog #dialogTitle>.ui-sprite{width:58px;height:58px}.stats-dialog #dialogTitle small{font-size:14px;margin-top:5px}.stats-dialog #closeDialog{padding:2px 6px}.stats-dialog #dialogBody{padding:7px}.ledger-summary{grid-template-columns:1fr;gap:6px;margin-bottom:10px}.ledger-total{min-height:70px;padding:4px 10px;border-width:7px}.ledger-total>.ui-sprite,.ledger-total>.sprite{width:56px;height:56px}.ledger-total>div{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:1}.ledger-total b{font-size:24px;margin:0;text-align:right;max-width:58%}.ledger-sections{grid-template-columns:1fr;gap:9px}.ledger-section{border-width:7px;padding:9px 7px}.ledger-section-body{gap:5px}.ledger-art{width:58px}.ledger-art>.ui-sprite,.ledger-art>.sprite{width:58px;height:78px}.ledger-row{font-size:16px;padding:7px 3px;gap:5px}.ledger-row b{font-size:19px}.ledger-row>.sprite{width:20px;height:20px}.producer strong{font-size:25px}}
/* Long Reprint totals can grow the navigation without overflowing the viewport. */
header{height:auto;align-items:stretch}header h1{height:auto;min-height:49px}header nav{height:auto;flex-wrap:wrap}header nav a,header nav button,#vaultBtn{height:49px}
@media(max-width:1350px) and (min-width:1051px){header h1{font-size:27px;padding:0 6px}header nav a,header nav button,#vaultBtn{font-size:16px;padding:0 4px}header .ui-sprite,header .header-gear{width:23px;height:23px}}
@media(max-width:1050px){header nav a,header nav button,#vaultBtn{height:42px}}
@media(max-width:700px){header nav a,header nav button,#vaultBtn{height:40px}}

/* Beta navigation and public version ledger. */
.brand-logo{display:inline-block;flex:0 0 34px;width:34px;height:34px;background-image:url('assets/ui/mikes-quest-log.png');background-size:145%;background-position:50% 53%;background-repeat:no-repeat}
header h1{gap:7px}header h1 .ui-sprite{flex-shrink:0}
.release-entry{padding:12px 16px;margin:14px 0;background:#102432;border:1px solid #8e734a}
.release-entry h3{margin:0 0 10px;color:#f4d48a}.release-entry h3 small{font:13px Arial,sans-serif;color:#b9ced8;margin-left:12px}
.release-entry ul{margin:0;padding-left:22px}.release-entry li{margin:8px 0;line-height:1.45}
@media(max-width:700px){.brand-logo{width:26px;height:26px;flex-basis:26px}.release-entry{padding:12px}}

/* Beta 0.6: compact counter, workshop and independent notifications. */
.balance{padding:7px 10px 6px;line-height:1.15}
#farmName{display:block;width:100%;margin:0 0 7px;padding:4px 8px;border:0;border-image:none;background:#07121ea8;box-shadow:none;border-radius:0;color:#f2e7d0;font:bold clamp(16px,1.5vw,23px) Georgia,'Nimbus Roman',serif;white-space:normal;overflow-wrap:anywhere;line-height:1.2}
#farmName:hover{background:#162d40c9;color:#ffdb8d}#farmName:focus-visible{outline:2px solid #f3c469;outline-offset:-2px}
.balance strong{font-size:clamp(28px,3vw,44px);line-height:1.04;letter-spacing:-.6px;overflow-wrap:anywhere;text-wrap:balance}
.balance span{display:block;margin-top:4px;font-size:clamp(14px,1.4vw,19px);color:#e4d3a8}.balance small{display:block;margin-top:4px;font:12px/1.2 Arial;color:#c2d7e1}
.upgrade strong{min-height:0;line-height:1.18;margin:2px 0 3px}.upgrade .level{margin-top:0}.upgrade{padding-top:6px;padding-bottom:5px}
#toasts{display:flex;flex-direction:column;gap:8px;bottom:12px;width:min(460px,calc(100vw - 24px));max-height:75dvh;pointer-events:none}
#toasts .toast{position:relative;flex:0 0 auto;margin:0;width:100%;opacity:1;transform:none;transition:opacity .3s ease,transform .3s ease;pointer-events:auto;border-width:6px;padding:7px 9px;gap:8px}
#toasts .toast.fading{opacity:0;transform:translateY(8px);pointer-events:none}
#toasts .toast strong{font-size:18px;line-height:1.15}#toasts .toast small{font-size:12px;line-height:1.35}#toasts .toast>.sprite{flex-shrink:0;width:34px;height:34px}
.toast-actions{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}.toast-actions button{font:12px Arial!important;padding:4px 6px!important;margin:0!important}.dismiss-toast{margin:0!important}
.purchase-hint{position:fixed;z-index:200;pointer-events:none;padding:5px 9px;max-width:220px;background:#1b1111f0;border:1px solid #c78c63;color:#ffe1bd;font:bold 13px Arial;box-shadow:0 2px 7px #0009;animation:purchaseHint 1s ease-out forwards}
@keyframes purchaseHint{0%,55%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-12px)}}
/* Animate the wrapper so the existing press animation on the image remains independent. */
.pen-idle{display:block;width:100%;height:100%;transform-origin:22% 85%;animation:penIdle 4.5s ease-in-out infinite}
@keyframes penIdle{0%,100%{transform:rotate(-.6deg) scale(1)}50%{transform:rotate(.6deg) scale(1.008)}}
.workbench{isolation:isolate}#workbenchEffects{position:absolute;inset:0;z-index:1;overflow:hidden;pointer-events:none}
#workbenchEffects>div{position:absolute;inset:0;opacity:0;pointer-events:none}
#workbenchEffects.gold-active .gold-confetti,#workbenchEffects.curse-active .curse-smoke{opacity:1}
.gold-confetti{background:radial-gradient(ellipse at 50% 30%,#ffc74515,transparent 75%)}.gold-confetti i{position:absolute;top:-15px;left:var(--left);width:6px;height:10px;background:#ffda70;box-shadow:0 0 5px #ffc44099;animation:confettiFall var(--duration) linear var(--delay) infinite;animation-play-state:paused}
.gold-active .gold-confetti i{animation-play-state:running}
@keyframes confettiFall{0%{transform:translate(0,-10px) rotate(0);opacity:0}10%{opacity:1}90%{opacity:.85}100%{transform:translate(22px,410px) rotate(var(--twist));opacity:0}}
.curse-smoke{background:radial-gradient(ellipse at 50% 100%,#b3272420,transparent 75%)}.curse-smoke i{position:absolute;bottom:-20%;left:-20%;width:140%;height:80%;background:radial-gradient(ellipse,#a3232350,transparent 65%);filter:blur(14px);animation:redSmoke 9s ease-in-out infinite;animation-play-state:paused}.curse-smoke i:nth-child(2){left:0;animation-delay:-3s}.curse-smoke i:nth-child(3){left:-40%;animation-delay:-6s}.curse-active .curse-smoke i{animation-play-state:running}
@keyframes redSmoke{0%{transform:translate(-8%,20%) scale(.85);opacity:0}40%{opacity:.6}100%{transform:translate(12%,-100%) scale(1.25);opacity:0}}
.page-hidden .pen-idle,.page-hidden #workbenchEffects i{animation-play-state:paused!important}
.no-motion .pen-idle,.no-motion #workbenchEffects i{animation:none!important}.no-motion #workbenchEffects i{display:none}.no-motion .gold-confetti{background:radial-gradient(ellipse,#ffc74535,transparent 75%)}.no-motion .curse-smoke{background:radial-gradient(ellipse,#b3272435,transparent 75%)}
@media(prefers-reduced-motion:reduce){.pen-idle,#workbenchEffects i{animation:none!important}#workbenchEffects i,.float{display:none!important}.gold-confetti{background:radial-gradient(ellipse,#ffc74535,transparent 75%)}.curse-smoke{background:radial-gradient(ellipse,#b3272435,transparent 75%)}#pen:active img{transform:none}#toasts .toast{transition:opacity .15s}.purchase-hint{animation:none}}
@media(max-width:700px){#toasts{gap:5px}#toasts .toast strong{font-size:16px}#toasts .toast{padding:5px 7px}.balance strong{font-size:36px}#farmName{font-size:21px}.upgrade strong{font-size:12px}}

/* 0.6.2: preserve original painted surfaces and frames; recolor backgrounds only. */
:root{--metal:#292724;--cream:#f2e6cd;--ink:#201e1c;--blue:#39332d;--bronze:#ad7546;--line:#ad7546}
body,header,.left,.empire,.shop{background-color:#292724;background-image:none}
.left,.empire,.shop{scrollbar-color:#ad7546 #24211e}
.workbench::before,.scene-bedslinger .scenery::after{content:'';position:absolute;inset:0 0 23.3%;pointer-events:none;-webkit-backdrop-filter:grayscale(1) sepia(.18) brightness(.72);backdrop-filter:grayscale(1) sepia(.18) brightness(.72)}
.workbench::before{z-index:0}
.scene-bedslinger .scenery::after{bottom:28%}
.workshop>h2,.specials>h2,.shop>h2,.dialog-head,.buytools,.left footer,#vault{background-color:#454039;background-blend-mode:luminosity}
.selected{background:#795838!important;box-shadow:inset 0 0 12px #f5a62322!important}
#farmName{background:#17151299}
.strip h3,#activeBuffs{background:#211e1be8}
.coupon,input,select,textarea{background:#211e1b;color:#f2e6cd}
header h1,header nav a,header nav button,#vaultBtn,button,.special,.upgrade,.badge,.bp-node,.merchant,.toast,dialog,#tooltip,.ledger-total,.ledger-section{border-image-slice:6.5%;background-image:url('assets/ui/steel-panel.png');background-size:115% 115%;background-position:center;background-color:#454039;background-blend-mode:luminosity}
.special.affordable,.upgrade.affordable,.bp-node.affordable,.badge:not(.missing),.special.owned,.bp-node.purchased,.merchant{border-image-slice:6.5%}
#pen,#collectFilament,#farmName{background-image:none}

.gold-confetti i:nth-child(3n){width:8px;height:6px;background:#ffe8a1}.gold-confetti i:nth-child(5n){width:5px;height:12px;background:#ffba32}
