* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 13px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif; color: #222; background: #f3f1ee; overflow: hidden; }
button, .btn { font: inherit; background: #fff; border: 1px solid #ccc8c2; border-radius: 6px; padding: 5px 9px; cursor: pointer; color: #222; white-space: nowrap; }
button:hover, .btn:hover { border-color: #888; }
button.on { background: #222; color: #fff; border-color: #222; }
button:disabled { opacity: .4; cursor: default; }
kbd { font: 10px ui-monospace, monospace; color: #888; margin-left: auto; }
button.on kbd { color: #bbb; }
header { height: 48px; display: flex; align-items: center; gap: 14px; padding: 0 12px; background: #fff; border-bottom: 1px solid #e2ded8; }
.brand { font-weight: 600; font-size: 15px; margin-right: auto; }
.brand .sub { font-weight: 400; color: #888; font-size: 12px; margin-left: 6px; }
.grp { display: flex; gap: 5px; align-items: center; }
.views button { border-radius: 0; margin-left: -6px; }
.views button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.views button:last-child { border-radius: 0 6px 6px 0; }
.chk { display: flex; gap: 6px; align-items: center; cursor: pointer; }
#body { position: absolute; top: 48px; bottom: 26px; left: 0; right: 0; display: flex; }
aside { width: 196px; background: #fff; border-right: 1px solid #e2ded8; padding: 8px 10px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
#props { border-right: 0; border-left: 1px solid #e2ded8; width: 210px; }
aside .sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #999; margin-top: 10px; }
aside .tool { display: flex; align-items: center; text-align: left; }
aside label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #444; }
aside label.chk { flex-direction: row; }
aside select, aside input[type=number] { font: inherit; padding: 4px; border: 1px solid #ccc8c2; border-radius: 5px; width: 100%; }
.row { display: flex; gap: 5px; }
.row button { flex: 1; }
#noSel, #armInfo, #saveState { color: #666; font-size: 12px; }
main { flex: 1; position: relative; display: flex; min-width: 0; }
#stage2d { position: relative; flex: 1 1 55%; min-width: 0; background: #e9e6e1; overflow: hidden; }
#stage3d { position: relative; flex: 1 1 45%; min-width: 0; background: #f4f2ef; }
#three { position: absolute; inset: 0; }
#divider { width: 6px; cursor: col-resize; background: #ddd8d1; flex-shrink: 0; }
main.v2d #stage3d, main.v2d #divider { display: none; }
main.v3d #stage2d, main.v3d #divider { display: none; }
#bar3d { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; background: rgba(255,255,255,.9); padding: 6px 8px; border-radius: 8px; border: 1px solid #e2ded8; }
#bar3d label { display: flex; gap: 5px; align-items: center; }
#bar3d input[type=range] { width: 90px; }
#dropHint { position: absolute; inset: 12px; border: 3px dashed #333; border-radius: 12px; display: none; align-items: center; justify-content: center; font-size: 22px; background: rgba(255,255,255,.6); pointer-events: none; }
#stage2d.drag #dropHint { display: flex; }
footer { position: absolute; bottom: 0; left: 0; right: 0; height: 26px; line-height: 26px; padding: 0 12px; background: #fff; border-top: 1px solid #e2ded8; color: #555; font-size: 12px; }
#help { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 10; }
#help[hidden] { display: none; }
#help .card { background: #fff; max-width: 560px; padding: 20px 24px; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
#help h2 { margin: 0 0 8px; font-size: 18px; }
#help p { margin: 8px 0; }
@media (max-width: 900px) {
  aside#props { display: none; }
  header .grp:not(.views) { display: none; }
  aside#tools { width: 150px; }
}

.pieces { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.pieces button { padding: 3px; height: 52px; display: flex; align-items: center; justify-content: center; background: #fff; }
.pieces img { max-width: 100%; max-height: 100%; }
.phrases { display: flex; flex-direction: column; gap: 4px; }
.phrases button { font-family: "Times New Roman", Georgia, serif; letter-spacing: .14em; font-size: 11px; }
#hebrew button { font-family: "Times New Roman", "Arial Hebrew", serif; letter-spacing: 0; font-size: 12px; }
#t777 { font-family: "Times New Roman", Georgia, serif; font-weight: 700; font-size: 15px; }
.pgroup { font-size: 10px; color: #999; margin: 6px 0 2px; }
