/* Local art-direction controls: dust and frost remain separate from foreground art. */
.craft{background:rgb(var(--hero-black,0) var(--hero-black,0) var(--hero-black,0))}
.craft .grain{background:none;opacity:1;mix-blend-mode:screen}
.craft .grain:before,.craft .grain:after{content:'';position:absolute;inset:0;background-repeat:repeat;pointer-events:none}
.craft .grain:before{background-image:var(--dust-image);background-size:var(--dust-size,1000px);opacity:var(--dust-opacity,.15)}
.craft .grain:after{background-image:var(--frost-image);background-size:var(--frost-size,900px);opacity:var(--frost-opacity,0)}
.craft.texture-hidden .grain{visibility:hidden}
.texture-tuner{position:fixed;left:18px;bottom:18px;z-index:1000;width:310px;color:#eee6d5;background:#181818f5;border:1px solid #565047;border-radius:12px;box-shadow:0 12px 44px #0008;font:14px/1.5 Tahoma,Arial,sans-serif;backdrop-filter:blur(18px);direction:rtl}
.texture-tuner summary{min-height:0;display:flex;justify-content:space-between;padding:13px 16px;gap:12px;list-style:none;cursor:pointer;color:#ff8546;font-weight:700}
.texture-tuner summary:after{content:'+';font-size:20px;line-height:1}.texture-tuner[open] summary:after{content:'−'}
.texture-tuner summary::-webkit-details-marker{display:none}
.texture-tuner .tuner-body{max-height:min(68vh,610px);overflow-y:auto;padding:0 16px 16px;overscroll-behavior:contain}
.texture-tuner .tuner-note{font-size:12px;line-height:1.7;color:#bab4a8;margin:0 0 12px}
.texture-tuner .tuner-row{display:block;border-top:1px solid #ffffff15;padding:10px 0 7px}
.texture-tuner .tuner-row>span{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:13px}
.texture-tuner output{font:12px/1.5 monospace;color:#ffad7d;direction:ltr}
.texture-tuner input[type=range]{display:block;width:100%;margin:9px 0 0;height:22px;accent-color:#ff6818;cursor:pointer;direction:ltr}
.texture-tuner .tuner-check{display:flex;align-items:center;gap:9px;margin:12px 0;font-size:12px;cursor:pointer}.texture-tuner input[type=checkbox]{accent-color:#ff6818;width:17px;height:17px}
.texture-tuner .tuner-actions{display:flex;flex-wrap:wrap;gap:7px}
.texture-tuner button{font:12px/1.4 Tahoma,Arial,sans-serif;min-height:36px;padding:8px 10px;color:#eee6d5;background:#333;border:1px solid #555;border-radius:5px;cursor:pointer}
.texture-tuner button:hover{background:#444}.texture-tuner button:first-child{background:#a93818;border-color:#d6532d}
.texture-tuner :focus-visible{outline:2px solid #ff8546;outline-offset:3px}
.texture-tuner .tuner-status{font-size:12px;color:#c9c1b0;min-height:18px;margin:8px 0 0}
.texture-tuner textarea{width:100%;min-height:100px;margin-top:8px;background:#111;color:#eee6d5;border:1px solid #777;padding:8px;direction:ltr;font:12px monospace}
@media(max-width:600px){.texture-tuner{left:10px;bottom:10px;width:min(290px,calc(100vw - 20px))}.texture-tuner .tuner-body{max-height:53svh}.texture-tuner summary{padding:11px 14px}}

/* Multiply the speckles by a static cloudy edge mask: clean centre, broken worn patches. */
.craft .grain:before{mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221000%22%20height%3D%221000%22%20viewBox%3D%220%200%201000%201000%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3CradialGradient%20id%3D%22edge%22%20cx%3D%2248%25%22%20cy%3D%2251%25%22%20r%3D%2271%25%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22white%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%22.48%22%20stop-color%3D%22white%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%22.72%22%20stop-color%3D%22white%22%20stop-opacity%3D%22.38%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22white%22%20stop-opacity%3D%221%22%2F%3E%3C%2FradialGradient%3E%3Cfilter%20id%3D%22wear%22%20x%3D%22-20%25%22%20y%3D%22-20%25%22%20width%3D%22140%25%22%20height%3D%22140%25%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.007%20.012%22%20numOctaves%3D%222%22%20seed%3D%2224%22%20result%3D%22cloud%22%2F%3E%3CfeColorMatrix%20in%3D%22cloud%22%20type%3D%22matrix%22%20values%3D%220%200%200%200%201%200%200%200%200%201%200%200%200%200%201%208%200%200%200%20-3.4%22%20result%3D%22patches%22%2F%3E%3CfeDisplacementMap%20in%3D%22SourceGraphic%22%20in2%3D%22cloud%22%20scale%3D%22125%22%20xChannelSelector%3D%22R%22%20yChannelSelector%3D%22G%22%20result%3D%22unevenEdge%22%2F%3E%3CfeComposite%20in%3D%22unevenEdge%22%20in2%3D%22patches%22%20operator%3D%22in%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cpath%20d%3D%22M0%200h1000v1000H0z%22%20fill%3D%22url(%23edge)%22%20filter%3D%22url(%23wear)%22%2F%3E%3C%2Fsvg%3E");mask-size:100% 100%;mask-repeat:no-repeat;mask-mode:alpha;-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%221000%22%20height%3D%221000%22%20viewBox%3D%220%200%201000%201000%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3CradialGradient%20id%3D%22edge%22%20cx%3D%2248%25%22%20cy%3D%2251%25%22%20r%3D%2271%25%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22white%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%22.48%22%20stop-color%3D%22white%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%22.72%22%20stop-color%3D%22white%22%20stop-opacity%3D%22.38%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22white%22%20stop-opacity%3D%221%22%2F%3E%3C%2FradialGradient%3E%3Cfilter%20id%3D%22wear%22%20x%3D%22-20%25%22%20y%3D%22-20%25%22%20width%3D%22140%25%22%20height%3D%22140%25%22%20color-interpolation-filters%3D%22sRGB%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.007%20.012%22%20numOctaves%3D%222%22%20seed%3D%2224%22%20result%3D%22cloud%22%2F%3E%3CfeColorMatrix%20in%3D%22cloud%22%20type%3D%22matrix%22%20values%3D%220%200%200%200%201%200%200%200%200%201%200%200%200%200%201%208%200%200%200%20-3.4%22%20result%3D%22patches%22%2F%3E%3CfeDisplacementMap%20in%3D%22SourceGraphic%22%20in2%3D%22cloud%22%20scale%3D%22125%22%20xChannelSelector%3D%22R%22%20yChannelSelector%3D%22G%22%20result%3D%22unevenEdge%22%2F%3E%3CfeComposite%20in%3D%22unevenEdge%22%20in2%3D%22patches%22%20operator%3D%22in%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cpath%20d%3D%22M0%200h1000v1000H0z%22%20fill%3D%22url(%23edge)%22%20filter%3D%22url(%23wear)%22%2F%3E%3C%2Fsvg%3E");-webkit-mask-size:100% 100%;-webkit-mask-repeat:no-repeat}
