/* The world keeps the native phone proportions. Wide screens give it black
   breathing room rather than stretching the cube into a rectangular piano. */
html{height:var(--shell-extent-height,100%);overflow:hidden;overscroll-behavior:none;background:#000}
body{height:var(--shell-extent-height,100dvh);bottom:auto;overflow:hidden;overscroll-behavior:none;-webkit-user-select:auto;user-select:auto;background:#000}
#app{height:var(--shell-height,100dvh);max-width:none;width:var(--shell-width,100%);margin:0;position:absolute;left:var(--shell-left,0px);top:var(--shell-top,0px);padding:0;gap:0}
body[data-performance=true] .masthead{display:none}
body[data-performance=false] #app{padding:8px;gap:8px}
#cube-shell{width:100%;max-width:none!important;height:100%;gap:calc(var(--one-pixel)*2)}
#cube-shell .room-viewport{--wall-height:var(--native-header,152px);--world-stage-height:var(--native-stage,78px)}
#cube-shell .room-cube>.composer,#cube-shell .room-cube>.song-room{grid-template-rows:var(--native-header,152px) var(--native-stage,78px) minmax(0,1fr);min-height:0}
#cube-shell .room-footer{height:var(--native-footer,104px);min-height:var(--native-footer,104px)}
#cube-shell .room-footer>.controls,#cube-shell .room-footer>.song-controls{grid-template-rows:repeat(2,minmax(0,1fr))}
#cube-shell .pad-grid,#cube-shell .heartland-board,#cube-shell .song-grid{min-height:0}
#cube-shell,#cube-shell *,#game-area,#game-area *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:none;-webkit-user-drag:none}
#cube-shell button:active{transform:none}
input,textarea,[contenteditable=true],[contenteditable=""],dialog p,dialog a{-webkit-user-select:text!important;user-select:text!important;-webkit-touch-callout:default}
input,textarea,select,dialog button{touch-action:manipulation}
dialog{max-width:min(94vw,520px);max-height:calc(var(--shell-viewport-height,100dvh) - 24px);overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
dialog input:not([type=range]):not([type=checkbox]),dialog textarea,dialog select{font-size:16px}
.recent-room{overflow:auto;overscroll-behavior:contain;touch-action:pan-y}
.shell-safe-area{position:fixed;visibility:hidden;pointer-events:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.shell-tools{position:fixed;right:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));display:flex;flex-direction:column;gap:2px;width:104px;z-index:15}
.shell-tools button,.shell-tools a{text-decoration:none;text-align:center;display:grid;place-items:center;background:#000;border:var(--one-pixel) solid #f2f0e933;border-radius:2px;font-size:13px;font-weight:400;min-height:44px;padding:6px;color:#f2f0e9}
body:not([data-shell-margin=true]) .shell-tools{display:none}
body[data-shell-alignment=right] .shell-tools{right:auto;left:max(12px,env(safe-area-inset-left))}
.shell-position{position:fixed;transform:translate(-50%,-50%);width:48px;height:52px;min-width:48px;min-height:52px;z-index:16;padding:4px;border:0;border-radius:0;background:#000;color:#fff6e58c;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.shell-position[hidden]{display:none}.shell-position svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.shell-position:active{transform:translate(-50%,-50%);color:#fff6e5}.shell-position:focus-visible{outline:1px solid #fff6e580;outline-offset:2px}
@media(prefers-reduced-motion:reduce){#cube-shell *{scroll-behavior:auto!important}}
/* Native control positions: tempo/pause/erase/metro, record/undo/redo/grid/mic. */
#make-controls>#record-toggle{position:relative;inset:auto;width:auto;height:auto;grid-column:1;grid-row:2;border:var(--one-pixel) solid var(--footer-line);font-size:30px}
#make-controls>.rocker:not(.tempo){grid-column:2 / span 2;grid-row:2}
#quantize{grid-column:4;grid-row:2;color:var(--paper)}
#quantize svg{width:78%;height:90%;display:block;margin:auto}
#quantize[aria-pressed=true]{color:#fff6e5;background:#fff6e510}
#hold-sing{grid-column:5;grid-row:2}
.room-billboards #keep{background:black;border-radius:50%}
.capture-options{position:absolute;left:0;bottom:0;z-index:18;display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(6,1fr);width:40%;height:calc(var(--native-footer,104px)*3);background:#000;box-shadow:0 0 0 var(--one-pixel) #fff6e580}
.capture-options[hidden]{display:none}
.capture-options button{min-height:0;padding:0;background:#060606;border:var(--one-pixel) solid #fff6e530;border-radius:0;font-size:clamp(12px,3.2vw,16px);font-weight:400;color:var(--paper)}
.capture-options button[aria-pressed=true]{background:#fff6e522;box-shadow:inset 0 -2px #fff6e5}
.capture-options .blank{border:0;opacity:0}
.arp-footer-editor{position:absolute;inset:0;display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(2,1fr);pointer-events:none;z-index:10}
.arp-footer-editor button{pointer-events:auto;border-radius:0;border:1px solid #fff6e52c;background:#080808;padding:2px;color:#fff6e5;min-width:0;min-height:0}
.arp-wheel{grid-column:4;grid-row:1;display:flex;flex-direction:column;justify-content:center;gap:3px;overflow:hidden}
.arp-wheel span{font-size:10px;line-height:12px;opacity:.42;white-space:nowrap}.arp-wheel strong{font-size:13px;line-height:17px;font-weight:500;white-space:nowrap}
.arp-xy{grid-column:3;grid-row:1;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
.arp-xy svg{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke:#fff6e580;stroke-width:.65;pointer-events:none}
.arp-xy span{font-size:9px;line-height:12px;font-family:ui-monospace,monospace;max-width:90%;text-align:center;pointer-events:none}

/* A one-device-pixel bitmap avoids WebKit16 rounding fractional CSS borders to zero. */
.shell-footer-ink{position:absolute;inset:0;width:100%;height:100%;z-index:8;pointer-events:none}
.room-footer .controls>button,.room-footer .song-controls>button,.room-footer .rocker,.room-footer .rocker.tempo,.room-footer .rocker:not(.tempo) button+button,#make-controls>#record-toggle{border-color:transparent}

#project-tools{grid-column:1;grid-row:2}#song-quantize{grid-column:5;grid-row:1}#song-quantize svg{width:82%;height:90%}
.heartland-board .wuncle-barrel,.heartland-board .wuncle-hint,.heartland-board .wuncle-restart{grid-column:1;position:relative;z-index:9;min-height:0;border:0;border-radius:0;padding:0;align-self:stretch;justify-self:stretch;background:#050606;color:#e5dfcb;font:20px ui-monospace,monospace}
.heartland-board .wuncle-barrel,.heartland-board .wuncle-hint{grid-row:2}.heartland-board .wuncle-restart{grid-row:3;font-size:27px}.heartland-board .wuncle-hint{background:transparent;pointer-events:none;display:grid;place-items:center;color:#b6b2a378;font-size:11px}
.song-alignment{position:absolute;left:0;right:0;top:0;height:calc(var(--native-header,152px) + var(--native-stage,78px));background:#050606;z-index:24;padding:12px 6px 0;touch-action:none}.song-alignment canvas{width:100%;height:100%;touch-action:none}.music-pad.arp-held.down{background:color-mix(in srgb,var(--lane) 30%,#000)}.music-pad.arp-held.flash{background:color-mix(in srgb,var(--lane) 70%,#000)}

#clear-all{position:relative;overflow:hidden}#clear-all:not(.erase-all)>span{position:absolute;right:0;top:1px}.picture-eraser{width:min(44.2px,calc(var(--native-cell)*1.014));height:min(44.2px,calc(var(--native-cell)*1.014));overflow:visible}.erase-all .picture-eraser{width:min(35.1px,calc(var(--native-cell)*.845));height:min(35.1px,calc(var(--native-cell)*.845))}
.erase-instrument{inset:auto auto 3px 3px;width:72%;height:78%;opacity:.7;filter:grayscale(1);clip-path:polygon(evenodd,0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,29% 31%,40% 27%,93% 16%,90% 22%,59% 28%,43% 33%,29% 31%,0% 0%,12% 54%,23% 49%,94% 34%,89% 41%,52% 48%,28% 55%,12% 54%,0% 0%,22% 75%,32% 70%,83% 59%,88% 63%,59% 68%,36% 75%,22% 75%,0% 0%)}
#quantize svg{width:calc(100% - 8px);height:calc(100% - 6px)}

#hold-sing svg{width:54%;height:72%;display:block;margin:auto;color:var(--paper)}#hold-sing.recording{background:#e9a5ce24}#hold-sing.recording svg{color:#e9a5ce}
/* Billboard positioning is geometric, not button-press decoration. Retain it
   while active so a mouse press cannot move the target out from under itself. */
#cube-shell .room-billboards button:active{transform:translate(-50%,-50%)}

#project-tools{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:2px;touch-action:none;color:var(--paper)}
#project-tools .control-ink{width:25px;height:25px}#project-tools span{font-size:13px;line-height:1.1;font-weight:500}
