/* A separate material + stacking study; the shared UI tokens remain unchanged. */
.jenga-app .stack-mark{width:34px;height:48px;padding:0;background:none;border-radius:0;flex:none;overflow:visible}
.jenga-app .stack-mark .logo-wood path{stroke:#a78a61;stroke-width:.65}
.jenga-app .stack-mark .logo-squatter path{stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
@media(min-width:768px){.jenga-app .stack-mark{width:40px;height:52px}}
.jenga-app .pieces-stage{height:370px;margin-top:0;isolation:isolate}
.jenga-app .pieces-stage.is-empty{height:280px}
.jenga-app .pieces-empty{top:24px}
.jenga-app .pieces-empty p{font-size:16px;font-weight:500;line-height:1.65;color:var(--muted)}
.jenga-app .pieces-scene{background:transparent;padding:0;border:0;border-radius:0;box-shadow:none}
.jenga-app .pieces-comparison>p{max-width:640px}
.jenga-study-links{display:flex;flex-wrap:wrap;gap:8px 24px}
.jenga-study-links .pieces-back{margin-top:16px}
.jenga-app .pieces-fixtures{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:374px){.jenga-app .pieces-stage{height:340px}}
@media(min-width:768px){.jenga-app .pieces-stage{height:460px}.jenga-app .pieces-fixtures{grid-template-columns:repeat(7,minmax(0,1fr));max-width:680px}.jenga-app .pieces-layout{grid-template-columns:minmax(0,1fr) minmax(0,1.25fr)}}
@media(min-width:768px) and (max-width:900px){.jenga-app .pieces-stage{height:400px}}

/* A translucent wood piece is the recording action, positioned above the tower. */
html:has(.jenga-app){scrollbar-gutter:stable}
body.jenga-entry-open{overflow:hidden}
.jenga-app .pieces-record{padding-bottom:0}
.jenga-app .pieces-scene{overflow:visible}
.jenga-app .pieces-totals{margin-bottom:16px}
.jenga-record-piece{position:absolute;z-index:3;width:176px;height:90px;padding:0;border:0;border-radius:12px;background:transparent;color:#89765f;font-size:16px;font-weight:650;letter-spacing:-.3px;touch-action:manipulation;transition:background-color .18s,color .18s}
.jenga-record-piece img{display:block;width:100%;height:100%;opacity:.48;pointer-events:none;transition:opacity .18s}
.jenga-record-outline{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;fill:none;stroke:#806d53;stroke-width:1.25;stroke-dasharray:4 3.5;stroke-linejoin:round;stroke-linecap:round;opacity:.8}
.jenga-record-piece:disabled{cursor:default}
.jenga-record-piece:focus-visible .jenga-record-outline{stroke:var(--ink);stroke-width:2;opacity:1}
.jenga-record-piece>span{position:absolute;display:inline-flex;align-items:center;gap:5px;line-height:20px;left:calc(var(--piece-label-x,88px) - 3px);top:calc(var(--piece-label-y,45px) - 4px);transform:translate(-50%,-50%) rotate(var(--piece-label-angle,18.636897651deg));white-space:nowrap;pointer-events:none}
.jenga-record-plus{width:13px;height:13px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.jenga-record-piece:not(:disabled):active img{opacity:.75}
.jenga-entry-dialog{position:fixed;inset:var(--entry-center,50%) auto auto 50%;transform:translate(-50%,-50%);margin:0;width:calc(100% - 32px);max-width:420px;max-height:var(--entry-max-height,calc(100dvh - 32px));padding:24px;overflow-y:auto;overscroll-behavior:contain;border-radius:24px}
.jenga-entry-dialog::backdrop{background:#20202066}
.jenga-entry-handle{display:none;width:36px;height:4px;border-radius:2px;background:var(--line);margin:0 auto 12px}
.jenga-entry-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}
.jenga-entry-heading h2{font-size:24px;line-height:1.25;letter-spacing:-.6px}
.jenga-entry-close{display:grid;place-items:center;flex:none;width:44px;height:44px;padding:0;border:0;border-radius:50%;background:var(--subtle);color:var(--ink)}
.jenga-entry-close svg{width:20px;height:20px}
.jenga-entry-dialog .jenga-entry-description{margin:8px 0 24px;font-size:14px;line-height:1.6}
.jenga-entry-dialog .entry-label{display:flex;font-size:14px;margin:0 0 10px;font-weight:650}
.jenga-entry-dialog .record-count-wrap input{min-height:78px;padding:12px 44px 12px 16px;font-size:36px;line-height:1.2}
.jenga-entry-dialog .record-count-wrap span{top:50%;transform:translateY(-50%);right:18px;font-size:16px}
.jenga-entry-dialog .record-error{font-size:13px;line-height:1.6;color:var(--error);margin:10px 0 0;min-height:0}
.jenga-entry-actions{display:grid;grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr);gap:10px;margin-top:24px}
.jenga-entry-cancel{min-height:56px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);font-size:16px;font-weight:600}
.jenga-entry-actions .record-submit{min-height:56px}
.jenga-entry-dialog.is-compact{padding:12px 20px 16px}
.jenga-entry-dialog.is-compact .jenga-entry-description{display:none}
.jenga-entry-dialog.is-compact .jenga-entry-heading{margin-bottom:12px}
.jenga-entry-dialog.is-compact .record-count-wrap input{min-height:64px;font-size:32px}
.jenga-entry-dialog.is-compact .jenga-entry-actions{margin-top:16px}
.jenga-entry-dialog.is-compact .jenga-entry-handle{margin-bottom:8px}
@media(max-width:767px){
 .jenga-entry-dialog{inset:auto 0 var(--entry-bottom,0px);transform:none;width:100%;max-width:none;border-radius:24px 24px 0 0;padding:12px 24px max(24px,env(safe-area-inset-bottom))}
 .jenga-entry-handle{display:block}
 .jenga-entry-dialog.is-compact{padding-bottom:max(16px,env(safe-area-inset-bottom))}
}
@media(hover:hover){.jenga-record-piece:not(:disabled):hover img{opacity:.68}.jenga-record-piece:not(:disabled):hover .jenga-record-outline{stroke:#5f4930;opacity:1}.jenga-entry-close:hover,.jenga-entry-cancel:hover{background:var(--subtle)}}
