:root{color-scheme:dark;--bg:#15201c;--paper:#f5efdf;--muted:#b7c1b3;--gold:#dfbc83;--rule:#536055;--stage-w:354px;--stage-h:231px;font-family:"Avenir Next","Segoe UI",system-ui,sans-serif}
*{box-sizing:border-box}
html,body{width:100%;height:100%;margin:0;overflow:hidden;overscroll-behavior:none}
body{background:var(--bg);color:var(--paper);-webkit-text-size-adjust:100%;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
button,a{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent}
button{cursor:pointer}
button:focus-visible,a:focus-visible,#engine-host:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
#lab{position:fixed;inset:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;isolation:isolate;background:radial-gradient(ellipse at 50% 48%,#2d3e32 0,#202e26 38%,#17231e 70%,#141e1a 100%)}
.topbar,footer{width:min(100%,620px);margin-inline:auto;z-index:5}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:calc(env(safe-area-inset-top) + 14px) 18px 15px;position:relative}
.topbar:after{content:"";position:absolute;height:1px;bottom:0;left:20px;right:20px;background:linear-gradient(90deg,#73816c55,#7a89692a)}
.arrow{display:grid;place-items:center;background:#202d26;border:1px solid #5b675a;border-radius:50%;width:46px;height:46px}
.arrow svg,.gesture-hints svg,.brand svg{fill:none;stroke:currentColor;stroke-width:1.45;stroke-linecap:round;stroke-linejoin:round}
.arrow svg{width:22px;height:22px}.arrow:active,.about:active{background:#354337}
.brand{display:flex;align-items:center;gap:9px;white-space:nowrap;font-family:Georgia,"Times New Roman",serif;font-size:22px;letter-spacing:-.85px}
.brand svg{width:18px;height:23px;color:var(--gold);stroke-width:1.3}
#bench{position:relative;min-height:0}
#instrument{position:absolute;left:50%;top:51%;transform:translate(-50%,-50%);width:var(--stage-w)}
.mast{position:absolute;bottom:calc(100% + clamp(22px,5.4vh,56px));width:100%;text-align:center}
.eyebrow{display:flex;align-items:center;justify-content:center;gap:12px;font-size:12px;font-weight:650;letter-spacing:.14em;text-transform:uppercase;color:var(--gold);font-variant-numeric:tabular-nums}
.hair{width:24px;height:1px;background:#bc9d6d91}
h1,h2,.card-name{font-family:Georgia,"Times New Roman",serif;font-weight:400}
h1{margin:9px 0 6px;font-size:clamp(33px,9.2vw,49px);line-height:1.08;letter-spacing:-1.8px}
#tech{font-size:14px;margin:0;color:var(--muted);line-height:1.3}
#plate{position:relative;height:var(--stage-h);width:100%}
.corner{position:absolute;width:8px;height:8px;border:solid #a3ac8b77;pointer-events:none}
.nw{left:-4px;top:-4px;border-width:1px 0 0 1px}.ne{right:-4px;top:-4px;border-width:1px 1px 0 0}.sw{left:-4px;bottom:-4px;border-width:0 0 1px 1px}.se{right:-4px;bottom:-4px;border-width:0 1px 1px 0}
#engine-host{position:absolute;inset:0;z-index:4;outline-offset:6px;cursor:grab}
#engine-host:active{cursor:grabbing}
#surface{position:fixed;inset:0;pointer-events:none;z-index:3;overflow:hidden}
.caption{position:absolute;top:calc(100% + clamp(24px,4.5vh,44px));width:100%;padding-inline:3px}
.ruler{height:7px;position:relative;background:repeating-linear-gradient(90deg,#85927a60 0 1px,transparent 1px calc(100% / 51));background-size:100% 3px;background-position:center;background-repeat:no-repeat}
.ruler i{position:absolute;top:0;height:7px;width:2px;left:var(--position,0%);background:var(--gold)}
.card-line{margin-top:10px;display:flex;align-items:baseline;justify-content:space-between;gap:9px}
.card-name{font-size:23px;letter-spacing:-.7px;line-height:1.12}
.counter{font-family:ui-monospace,Menlo,monospace;font-size:13px;letter-spacing:.06em;color:var(--muted);white-space:nowrap}.counter b{color:var(--gold);font-weight:500}
footer{padding:8px 20px calc(8px + env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px}
.gesture-hints,.gesture-hints span,.about,.source-links{display:flex;align-items:center;justify-content:center}
.gesture-hints{gap:14px;color:#d8dfcf;font-size:14px}.gesture-hints span{gap:8px}.gesture-hints svg{width:18px;height:18px;color:var(--gold)}.gesture-hints i{height:13px;width:1px;background:#61705f}
.about{background:transparent;border:0;min-height:40px;gap:7px;font-size:13px;color:var(--muted);border-radius:12px;padding:0 12px}
.info-icon{border:1px solid #9aa990;border-radius:50%;height:14px;width:14px;display:grid;place-items:center;font:italic 11px Georgia,serif}
dialog{background:#243329;color:var(--paper);border:1px solid #78846c;border-radius:18px;padding:20px 23px 24px;width:min(420px,calc(100% - 30px));max-height:calc(100dvh - 28px);overflow:auto;box-shadow:0 20px 70px #0006}
dialog::backdrop{background:#07110ed4}.sheet-heading,.source-links{display:flex;justify-content:space-between;align-items:center}.sheet-heading .eyebrow{gap:7px}
#close{width:42px;height:42px;background:none;border:1px solid var(--rule);border-radius:50%;font-size:25px;line-height:1}
h2{font-size:32px;margin:12px 0 8px;letter-spacing:-1px}dialog p{color:#d8dfcf;font-size:16px;line-height:1.45;margin:10px 0}h3{font-size:16px;font-weight:600;color:var(--gold);margin:20px 0 0}
dialog .hold-hint{font-size:14px;color:#c0cbb9}.source-links{border-top:1px solid var(--rule);padding-top:15px;margin-top:19px;gap:10px;flex-wrap:wrap}.source-links a{font-size:14px;color:var(--gold);text-underline-offset:3px}
@media(max-height:550px){.topbar{padding-block:6px}.arrow{height:40px;width:40px}.mast{bottom:calc(100% + 12px)}h1{font-size:28px;margin:3px 0}.caption{top:calc(100% + 12px)}footer{flex-direction:row;gap:18px;padding-block:4px}}
