/* Quadro tático: telemóvel = campo + folhas (Peças · Traços · Vista · Passos); tablet e computador = painéis fixos à volta do campo. */
.board { display: flex; flex-direction: column; height: 100dvh; background: var(--bg); position: relative; overflow: hidden; }
.b-head { grid-area: head; flex: none; display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.b-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; }
.b-title:focus { outline: 2px solid var(--p-200); background: var(--surface-2); }
.b-save { flex: none; }
.b-court { grid-area: court; flex: none; height: 42dvh; background: var(--court-out); position: relative; touch-action: none; }
.b-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.b-anim { grid-area: anim; flex: none; display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.arow { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; overflow-x: auto; }
.arow .ibtn { width: 40px; height: 40px; } .arow .btn.play { min-height: 40px; padding: 0 12px; }
.scrub { flex: 1; min-width: 80px; accent-color: var(--p-600); }
.b-stepn { flex: none; min-width: 90px; text-align: right; }
.chips-s { display: flex; gap: 6px; flex-wrap: wrap; }
.chip.s { min-height: 32px; padding: 0 10px; font-size: 13px; }
.b-sheets { flex: none; display: flex; background: var(--surface); border-bottom: 1px solid var(--border); }
.sheet-btn { flex: 1; min-height: 46px; border: 0; background: transparent; font-weight: 700; font-size: 13px; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 6px; border-bottom: 3px solid transparent; cursor: pointer; }
.sheet-btn.on { color: var(--p-600); border-bottom-color: var(--p-600); }
.panel { display: none; flex: 1; min-height: 0; overflow: auto; padding: 12px; background: var(--surface); flex-direction: column; gap: 10px; }
.board[data-sheet="vi"] .p-vi, .board[data-sheet="pe"] .p-pe, .board[data-sheet="tr"] .p-tr, .board[data-sheet="st"] .p-st { display: flex; }
.lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.hint { font-size: 12px; color: var(--text-2); line-height: 1.35; }
.seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; align-self: flex-start; }
.seg button { min-height: 36px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--p-600); color: #fff; }
.chip.big { min-height: 44px; } .chip.on .ic { color: inherit; }
label.sel { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; } label.sel select { width: auto; min-height: 40px; }
.pgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.pc { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); font-weight: 700; font-size: 14px; cursor: pointer; flex: none; }
.pc.def { background: #fff; color: #374151; border: 3px solid #374151; box-shadow: none; font-size: 12px; }
.pc.off { opacity: .35; } .pc.sel { outline: 3px solid var(--p-200); outline-offset: 2px; } .pc:disabled { opacity: .25; cursor: default; }
.trow { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; }
.steplist { display: flex; flex-direction: column; gap: 4px; }
.stepb { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 40px; padding: 4px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.stepb.on { border-color: var(--p-600); background: var(--p-50); }
.stepb .n { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex: none; }
.stepb.on .n { background: var(--p-600); color: #fff; } .stepb .tt { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow { display: flex; gap: 6px; flex-wrap: wrap; }
.srow .ibtn { width: 40px; height: 40px; }
.acard { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-color: var(--p-200); }
label.chk { display: flex; align-items: center; gap: 10px; font-size: 13px; } label.chk input { width: 20px; height: 20px; accent-color: var(--p-600); }
ul.issues { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; } ul.issues.err { color: var(--alert-text); } ul.issues.warn { color: var(--warn-text); }
.pop { position: fixed; z-index: 60; min-width: 170px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-2); padding: 6px; display: flex; flex-direction: column; }
.pop-t { font-size: 12px; font-weight: 700; color: var(--text-2); padding: 6px 10px; }
.pop-i { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border: 0; background: transparent; border-radius: 10px; font-weight: 600; cursor: pointer; text-align: left; } .pop-i:hover { background: var(--surface-2); }
.stack.g8 > .field { margin: 0; }

@media (min-width: 768px) {
  .board { display: grid; grid-template-columns: 104px minmax(0, 1fr) 280px; grid-template-rows: auto auto minmax(0, 1fr) auto auto; grid-template-areas: "head head head" "bar bar bar" "pieces court side" "tools tools tools" "anim anim anim"; }
  .b-court { height: auto; min-height: 0; }
  .b-sheets { display: none; }
  .panel { display: flex !important; flex: none; overflow: auto; }
  .b-bar { grid-area: bar; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
  .b-pieces { grid-area: pieces; border-right: 1px solid var(--border); padding: 10px 8px; }
  .b-pieces .pgrid { gap: 6px; } .b-pieces .hint { font-size: 11px; }
  .b-side { grid-area: side; border-left: 1px solid var(--border); }
  .b-tools { grid-area: tools; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); }
  .b-tools .hint { flex: 1; min-width: 200px; }
  .b-anim { flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; border-bottom: 0; border-top: 1px solid var(--border); padding: 6px 12px; }
  .b-anim .arow:last-child { flex: 1; } .b-anim .arow:first-child { overflow: visible; }
}
@media (min-width: 1280px) { .board { grid-template-columns: 116px minmax(0, 1fr) 340px; } }
@media (max-width: 767px) { .b-bar { align-items: flex-start; } .board .pc { width: 44px; height: 44px; } }
.arow .chips-s { flex-wrap: nowrap; }
.b-save { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 767px) { .b-save { max-width: 84px; font-size: 11px; padding: 0 8px; } .b-title { min-width: 70px; } .b-stepn { min-width: 70px; } }
