@font-face{font-family:IosevkaEtoile;src:local("Iosevka Etoile"),local("Iosevka-Etoile"),url("assets/fonts/etoile.woff") format("woff")}
*{box-sizing:border-box}body{margin:0;color:#000;background:white;font:10px/1.4 IosevkaEtoile,monospace}button,input{font:inherit;color:inherit}button{border:0;background:none;cursor:pointer;padding:0}button:focus-visible,.knob:focus-within{outline:1px dashed #000;outline-offset:3px}
#paper,#drawing{position:fixed;inset:0;width:100%;height:100%;display:block}#drawing{touch-action:none;cursor:crosshair}
h2,h3{font:inherit;margin:0}section{min-width:0}section h2{text-transform:uppercase;text-align:center;height:23px} .box{height:182px;border:1px solid #000}
#toggle{position:absolute;top:100%;left:calc(50% + 7px);transform:translateX(-50%);width:58px;height:24px;display:grid;justify-content:center;align-items:start}#toggle img{display:block}
.badge{position:fixed;left:37px;bottom:41px;width:163px;height:236px;border:1px solid #000;background:#f4f4f4}.badge img,.badge span{position:absolute}.badge .mark{left:26px;top:22px}.badge .rule{left:11px;top:196px}.badge span{left:11px;top:203px;font-size:16px}
dialog{width:min(340px,88vw);border:1px solid black;padding:20px;background:#f4f4f4;font:14px/1.5 IosevkaEtoile,monospace}dialog form{display:flex;justify-content:space-between;gap:15px}dialog h2{text-transform:uppercase}dialog p{margin:14px 0 0}dialog::backdrop{background:#0002}
@media(prefers-reduced-motion:reduce){#drawer{transition:none}}
#spatial{position:fixed;inset:0;width:100%;height:100%;pointer-events:none}
.action-row{display:flex;align-items:center;gap:13px;height:24px}
.commands .circle-action{position:relative;display:block;flex:none;width:15px;height:15px;border-radius:50%}
.circle-action img{display:block}.circle-action::after{content:"";position:absolute;inset:0;border-radius:50%;background:#000;opacity:0}
.circle-action:is(:hover,:focus-visible):enabled::after{opacity:1}
body:is([data-tool=rotate],[data-tool=hand]) #drawing{cursor:grab}body:is([data-tool=rotate],[data-tool=hand]) #drawing:active{cursor:grabbing}
@media(prefers-reduced-motion:reduce){.circle-action::after{transition:none}}
.space-screen{position:relative;background:#000;overflow:hidden}
.space-screen svg{display:block;width:100%;height:100%;visibility:hidden}
.space-panel.powered .space-screen{
  background-color:#031008;
  background-image:linear-gradient(#10582355 1px,transparent 1px),linear-gradient(90deg,#10582355 1px,transparent 1px),radial-gradient(ellipse,#082511,#010803);
  background-size:10px 10px,10px 10px,100% 100%;background-position:center
}
.space-panel.powered svg{visibility:visible}
#cube-edges{stroke:#36ff74;stroke-width:1.05;stroke-linecap:round;filter:drop-shadow(0 0 1.6px #08ff51)}
.power-row{display:flex;align-items:flex-start;padding-top:8px;gap:13px;text-transform:uppercase;white-space:nowrap}
#space-toggle{flex:none;width:15px;height:15px;border:1px solid black;border-radius:50%;background:#fff}
#space-toggle[aria-pressed=false]:hover{background:#000}
#space-toggle[aria-pressed=true]{background:#000}
#orbit-tools button{border:1px solid black}
#orbit-tools button[aria-pressed=true]{background:#000;color:white}
@media(prefers-reduced-motion:reduce){#space-toggle[aria-pressed=true]{animation:none}}
.palette{grid-column:1/-1;display:grid;gap:6px;align-content:start}
.color-row{display:flex;gap:12px;align-items:center;white-space:nowrap}
.swatch{position:relative;display:block;flex:none;width:15px;height:15px;border:1px solid black;border-radius:50%;background:var(--ink,#262320)}
.swatch.unset{background:linear-gradient(135deg,transparent 47%,black 48% 52%,transparent 53%)}
.swatch:focus-within{outline:1px dashed black;outline-offset:2px}
.brushes #clear-secondary{margin-left:auto;flex:none;border:0;width:14px;line-height:14px;font-size:14px}
.swatch:hover{outline:1px solid #000;outline-offset:2px}
#ink-picker{
  position:fixed;inset:auto;margin:0;width:min(310px,calc(100vw - 16px));max-height:calc(100dvh - 16px);
  overflow:auto;padding:12px;border:1px solid #000;background:#f4f4f4;color:#000;
  font:11px/1.4 IosevkaEtoile,monospace;box-shadow:3px 3px 0 #000
}
.ink-heading,.ink-footer,.ink-footer label{display:flex;align-items:center;gap:9px}
.ink-heading{padding-bottom:9px;border-bottom:1px solid #000}
.ink-heading h3{font:inherit;text-transform:uppercase}
#ink-preview{width:15px;height:15px;border:1px solid black;border-radius:50%;background:var(--ink)}
#ink-preview.unset{background:linear-gradient(135deg,transparent 47%,black 48% 52%,transparent 53%)}
#ink-close{margin-left:auto;border:0;width:20px;height:20px;font-size:17px;line-height:1}
#ink-field{
  position:relative;margin:12px 0 7px;height:clamp(120px,30dvh,212px);border:1px solid #000;
  background:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,transparent),hsl(var(--hue,0) 100% 50%);
  cursor:crosshair;touch-action:none
}
#ink-field input{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;pointer-events:none}
#ink-field:has(input:focus-visible){outline:1px dashed black;outline-offset:3px}
#ink-field span{
  position:absolute;left:var(--x);top:var(--y);transform:translate(-50%,-50%);
  width:12px;height:12px;border:2px solid #fff;border-radius:50%;box-shadow:0 0 0 1px black;
  background:var(--selected);pointer-events:none
}
#ink-hue{
  appearance:none;display:block;width:100%;height:22px;margin:0;cursor:pointer;background:transparent;
  --spectrum:linear-gradient(90deg,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00)
}
#ink-hue::-webkit-slider-runnable-track{height:10px;background:var(--spectrum);border:1px solid black}
#ink-hue::-moz-range-track{height:8px;background:var(--spectrum);border:1px solid black}
#ink-hue::-webkit-slider-thumb{appearance:none;width:8px;height:16px;margin-top:-4px;border:1px solid #000;background:#fff}
#ink-hue::-moz-range-thumb{width:6px;height:14px;border:1px solid #000;border-radius:0;background:#fff}
.ink-footer{margin-top:11px;padding-top:9px;border-top:1px solid black;justify-content:space-between}
.ink-footer label{text-transform:uppercase}
#ink-hex,#ink-none{height:22px;background:transparent;border:1px solid black;padding:2px 5px}
#ink-hex{width:73px;font:inherit}
#ink-none:hover,#ink-close:hover{background:#000;color:white}
#paper.mirror-lr::before,#paper.mirror-tb::after{content:"";position:absolute;z-index:1;pointer-events:none}
#paper.mirror-lr::before{left:50%;top:0;bottom:0;border-left:1px dashed #7776}
#paper.mirror-tb::after{top:50%;left:0;right:0;border-top:1px dashed #7776}
body:is([data-tool=rotate],[data-tool=hand]) #paper::before,body:is([data-tool=rotate],[data-tool=hand]) #paper::after{display:none}
.knob{position:relative;display:block;width:44px;height:44px;cursor:ns-resize}.knob img{position:absolute;pointer-events:none}.needle{top:0;left:calc(50% - .5px);transform:rotate(var(--angle,0deg));transform-origin:50% 100%}.knob input{position:absolute;inset:0;opacity:0;margin:0;width:100%;height:100%;cursor:ns-resize;touch-action:none}.knob:is(:hover,:focus-within)::after{content:attr(data-value);position:absolute;bottom:calc(100% + 2px);left:50%;transform:translateX(-50%);background:#f4f4f4;pointer-events:none}
body{overflow:hidden}
#paper{transform:scale(var(--scene-scale,1));transform-origin:center}
#drawer{--strip:12px;position:fixed;z-index:2;left:50%;top:0;transform:translateX(-50%);width:min(906px,calc(100% - 16px));transition:transform .24s ease-out}
#drawer.closed{transform:translate(-50%,calc(-100% + var(--strip)))}
#toggle{left:50%}
#panel{border:1px solid #000;border-top:0;background:#f4f4f4;padding:14px 25px 22px 24px;display:grid;grid-template-columns:minmax(0,186fr) minmax(0,291fr) minmax(0,332fr);grid-template-areas:"brush dials space" "brush scene actions";column-gap:23px;row-gap:14px}
.brush-section{grid-area:brush}.dial-section{grid-area:dials}.space-section{grid-area:space}.scene-section{grid-area:scene}.actions-section{grid-area:actions}
section h2{height:19px} .box{position:relative;border:1px solid black;height:182px;background-image:url("assets/ui/screw.svg"),url("assets/ui/screw.svg"),url("assets/ui/screw.svg"),url("assets/ui/screw.svg");background-repeat:no-repeat;background-position:left 8px top 6px,right 8px top 6px,left 8px bottom 6px,right 8px bottom 6px}
.brushes{height:316px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:25px 25px auto 97px;align-content:start;gap:6px;padding:31px 13px 0}
.brushes>[data-brush],.mirror-tools button,#orbit-tools button{border:1px solid black}
[data-brush][aria-pressed=true],.mirror-tools button[aria-pressed=true],#orbit-tools button[aria-pressed=true]{background:#000;color:#fff}
.brushes .palette{margin:27px 1px 0}.brush-preview{grid-column:1/-1;position:relative;margin:20px 1px 0;height:97px;background:white;border:1px solid black;text-align:center;overflow:hidden}
.brush-preview span,.hand-panel label,.space-screen span{font-size:7px;text-transform:uppercase}
.brush-preview span{display:block;margin:5px auto 0}.brush-preview canvas{width:100%;height:calc(100% - 17px);display:block}
.knobs{display:grid;grid-template-columns:repeat(3,minmax(0,90px));justify-content:center;grid-template-rows:81px 65px;align-content:start;gap:0;padding:22px 6px 0}
.knobs label,.hand-panel label,.mirror-tools,.zoom-control{display:flex;align-items:center;flex-direction:column;gap:6px}
.knobs label{min-width:0}.scene,.commands{height:101px}
.scene{display:grid;grid-template-columns:minmax(0,74fr) minmax(0,141fr);gap:7.3%;align-content:start;padding:21px 11% 0 7.4%}
.scene label,.mirror-tools{gap:7px}.mirror-tools>div{display:flex;gap:6px}.mirror-tools button{width:22px;height:22px}
.zoom-track{display:grid;width:100%;height:22px;align-items:center;position:relative}
.ticks{position:absolute;inset:0 3px;display:flex;justify-content:space-between;align-items:center;pointer-events:none}.zoom-track input{position:relative}
#scene-zoom{appearance:none;width:100%;height:17px;margin:0;background:transparent;cursor:ew-resize}
#scene-zoom::-webkit-slider-runnable-track{height:5px;background:black}
#scene-zoom::-webkit-slider-thumb{appearance:none;width:8px;height:17px;margin-top:-6px;background:white;border:1px solid black;border-radius:0}
#scene-zoom::-moz-range-track{height:5px;background:black}#scene-zoom::-moz-range-thumb{width:6px;height:15px;background:white;border:1px solid black;border-radius:0}
.space-panel{padding:17px 16px 24px 12px;display:grid;grid-template-columns:minmax(0,188fr) minmax(0,97fr);grid-template-rows:77px 37px 25px;column-gap:17px}
.space-screen{grid-column:1;grid-row:1}.space-screen span{position:absolute;top:4px;left:0;right:0;text-align:center;color:#24ff21}.space-screen svg{padding-top:9px}
.power-row{grid-column:1;grid-row:2}#orbit-tools{grid-column:1;grid-row:3;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.hand-panel{grid-column:2;grid-row:1/4;border:1px solid black;display:flex;align-items:center;flex-direction:column;padding-top:13px;gap:20px}
#space-hand{display:grid;place-items:center;width:50px;height:50px;cursor:grab}#space-hand>*{grid-area:1/1}#space-hand svg{display:block;position:relative;color:black}#space-hand[aria-pressed=true]{background:black;border-radius:50%}#space-hand[aria-pressed=true] img{opacity:0}#space-hand[aria-pressed=true] svg{color:white}
.hand-panel label{gap:5px}.knob.mini{width:18px;height:18px}
.commands{display:flex;align-items:center;justify-content:space-between;padding:0 10.8%}.commands .action-row{height:22px}.export-frame{border:1px solid #000;background:white url("assets/ui/stripes.svg") center/cover no-repeat;width:139px;height:41px;display:grid;place-items:center}
.export-frame{margin-top:-9px}.export-frame span{display:grid;place-items:center;width:68%;height:21px;background:black;color:white;text-transform:uppercase}
@media(max-width:760px){
 #drawer{width:min(620px,calc(100% - 12px))}#panel{max-height:calc(100dvh - 60px);overflow:auto;padding:10px;grid-template-columns:minmax(142px,1fr) minmax(0,1.5fr);grid-template-areas:"brush dials" "brush scene" "space space" "actions actions";gap:10px}
 .brushes{padding-left:7px;padding-right:7px}.knobs{padding-inline:0}.scene{padding-inline:7px;gap:6px}.space-panel{grid-template-columns:minmax(0,2fr) minmax(62px,1fr)}.badge{left:14px;bottom:16px;transform:scale(.58);transform-origin:left bottom}
}
@media(max-height:420px){#panel{max-height:calc(100dvh - 46px);overflow:auto}}
@media(prefers-reduced-motion:reduce){#drawer{transition:none}}

#drawer{user-select:none;-webkit-user-select:none}
#preview{touch-action:none;cursor:crosshair}
#reset-preview{position:absolute;right:2px;top:1px;padding:0;width:16px;height:15px;line-height:12px;font-size:11px;background:white;border:0}
#reset-preview[hidden]{display:none}
#light-sphere{display:none;position:absolute;left:var(--lamp-x,32%);top:var(--lamp-y,28%);width:20px;height:20px;padding:0;transform:translate(-50%,-50%);border:none;background:transparent;touch-action:none;cursor:grab}
.space-panel.powered #light-sphere{display:grid;place-items:center}
#light-sphere::before{content:"";width:10px;height:10px;border-radius:50%;background:#fff;box-shadow:0 0 3px 1px #ffffffe0,0 0 8px 3px #e8ffed88,0 0 14px 5px #caffd82e}
#light-sphere:active{cursor:grabbing}

#drawer{left:auto;right:clamp(12px,3.056vw,44px);width:min(579px,calc(100% - 24px));transform:none}
#drawer.closed{transform:translateY(calc(-100% + var(--strip)))}
#panel{padding:9px 17px 17px 19px;grid-template-columns:minmax(0,186fr) minmax(0,332fr);grid-template-areas:"brush space" "brush scene";gap:5px 23px}
.brush-body{height:310px;padding:30px 14px 32px;display:flex;flex-direction:column;justify-content:space-between;gap:8px}
.knobs{grid-template-columns:repeat(3,minmax(0,38px));justify-content:space-between;grid-template-rows:34px 34px;gap:10px 0;padding:0}
.knobs label{gap:6px;font-size:7px;text-transform:uppercase}
.knob:not(.mini){width:18px;height:18px}
.knob:not(.mini) img:first-child{width:100%;height:100%}
.knob:not(.mini) .needle{height:50%;width:1px}
.ink-well{position:relative;min-width:0}
.brush-preview{margin:0;height:101px}
.ink-well .palette,.card-inks{display:flex;gap:6px}
.ink-well .palette{position:absolute;bottom:7px;left:7px}
.color-row>span,#clear-secondary{display:none}
.mirror-tools{flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:8px;text-transform:uppercase;font-size:7px;line-height:9px}
.commands{height:117px;padding:12px 13% 12px 12.65%;gap:12px}.commands .action-row{height:24px}
.scene-files{display:grid;justify-items:stretch;gap:10px;width:139px}.scene-files .export-frame{height:35px}#add-photo{height:25px}
#add-photo,.quick-modes button{border:1px solid #000;padding:4px 6px}
.export-frame{margin:0;width:100%}
.space-panel{height:169px;padding:17px 16px 17px 12px;grid-template-rows:77px 31px 25px}
#quick-card{position:fixed;left:37px;bottom:41px;width:163px;height:236px;z-index:3;perspective:760px;touch-action:none;user-select:none}
.card-turn{width:100%;height:100%;position:relative;transform-style:preserve-3d;transition:transform .5s cubic-bezier(.25,.75,.25,1)}
#quick-card.flipped .card-turn{transform:rotateY(180deg)}
#quick-card .badge,#card-back{position:absolute;inset:0;width:100%;height:100%;border:1px solid black;background:#f4f4f4;backface-visibility:hidden;cursor:grab}
#quick-card .badge{transform:none}
#quick-card .mark{left:16%;top:9%;width:68%;height:66%;object-fit:contain}
#quick-card .rule{left:7%;top:83%;width:86%}
#quick-card .badge span{left:7%;top:86%;font-size:clamp(11px,1.2vw,16px)}
#card-back{transform:rotateY(180deg);display:flex;flex-direction:column;justify-content:space-between;padding:10px;gap:5px}
.card-top,.quick-history,.quick-history button{display:flex;align-items:center}
.card-top{gap:4px}.card-inks{margin-right:auto}
.quick-modes,.quick-history{display:grid;gap:3px}
.quick-modes [aria-pressed=true]{background:black;color:white}
.quick-history button{gap:9px;min-height:18px;text-align:left}
.quick-history img{width:15px;height:15px}
button:disabled{opacity:1;color:#000;cursor:default}
#card-back .export-frame{height:32px}
@media(max-width:620px){
 #drawer{right:50%;width:min(360px,calc(100% - 20px));transform:translateX(50%)}
 #drawer.closed{transform:translate(50%,calc(-100% + var(--strip)))}
 #panel{max-height:calc(100dvh - 78px);overflow:auto;padding:10px 13px 16px;grid-template-columns:minmax(0,1fr);grid-template-areas:"brush" "space" "scene";gap:14px}
 .brush-body{height:153px;padding:17px 11px 9px 8px;display:grid;grid-template-columns:minmax(0,130fr) minmax(0,172fr);grid-template-rows:76px 1fr;gap:10px}
 .ink-well{grid-column:2;grid-row:1/3;align-self:center}
 .mirror-tools{grid-column:1;grid-row:2;gap:6px;padding-left:4px}
 .knobs{row-gap:8px}.ink-well .brush-preview{height:115px}
 .space-panel{grid-template-columns:minmax(0,188fr) minmax(0,97fr);grid-template-rows:64px 35px 25px}
 .mirror-tools button{width:22px}.knobs label{font-size:7px}
 #quick-card{left:16px;bottom:16px}@media(max-height:730px){#quick-card{width:120px;height:177px}}
 #card-back{padding:6px;gap:2px}.quick-modes button{padding:2px}
 #card-back .export-frame{height:25px}#card-back .export-frame span{height:16px}
 .card-top .swatch{width:14px;height:14px}
}
@media(prefers-reduced-motion:reduce){.card-turn{transition:none}}

:is(.mirror-tools,#orbit-tools,.quick-modes) button[aria-pressed=false],#add-photo{background:#fff;color:#000}
#space-hand{border-radius:50%;background:#fff}
#space-hand img:nth-child(2){visibility:hidden}
#space-hand::before{content:"";grid-area:1/1;border:1px solid black;border-radius:50%;width:38px;height:38px}
#space-hand[aria-pressed=true]::before{border-color:white}
@media(min-width:621px),(min-height:731px){
 #card-back{padding:9px 12px 12px 13px}
 .quick-modes{gap:8px}.quick-modes button{height:25px}
 .quick-history{gap:8px}.quick-history button{height:15px;min-height:15px;gap:13px}
 #card-back .export-frame{height:35px}
}
