/* ---- 판 화면 틀 (web/next.js, 2026-11-26): head, board, standing line, one bar, a box of a fixed height.
   Every row keeps its height whatever is in it, so the board and the buttons never move. ---- */
.bf { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "board" "side"; }
.bf [hidden] { display: none !important; }
.bf-head { grid-area: head; height: 40px; display: flex; align-items: center; gap: 8px; }
.bf-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.bf-head .btn { width: 42px; height: 34px; padding: 0; flex: none; }
.bf-board { grid-area: board; justify-self: center; width: min(100%, calc(100dvh - var(--hdr) - 286px)); }
.bf-board svg { display: block; width: 100%; height: auto; }
.bf-side { grid-area: side; min-width: 0; }
.bf-status { height: 38px; display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.bf-status > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bf-gap { flex: 1; }
.bf-chip { flex: none; height: 28px; padding: 0 10px; border: 1px solid var(--bad); background: var(--bad-soft); color: var(--bad); border-radius: 999px;
  font: inherit; font-size: 13px; cursor: pointer; }
.bf-seg { display: flex; width: 100%; }
.bf-seg button { flex: 1; min-width: 0; padding: 0 6px; height: 30px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-bar { height: 50px; display: flex; align-items: center; gap: 6px; padding: 0 6px; border-radius: 12px; background: var(--hover); }
.bf-bar .btn { height: 38px; min-width: 48px; padding: 0 10px; flex: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.bf-mid { flex: 1; min-width: 0; height: 38px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.bf-mid:disabled { cursor: default; opacity: 1; color: inherit; }
.bf-bar .bf-act { min-width: 96px; background: var(--ours); border-color: var(--ours); color: #fff; font-weight: 700; }
.bf-bar .bf-act:disabled { opacity: .45; }
/* inside a line: the bar goes dark (the same row, the same buttons) */
.bf-bar.in { background: #1e293b; color: #f1f5f9; }
.bf-bar.in .btn { background: transparent; border-color: #64748b; color: #f1f5f9; font-weight: 600; }
.bf-bar.in .bf-mid { color: #f1f5f9; }
.bf-extra { height: 104px; overflow: hidden; padding-top: 8px; }
.bf-extra .aibkids { margin: 0; }
.bf-extra p { margin: 4px 2px 8px; }
.bf-note { height: 42px; overflow: hidden; font-size: 14px; line-height: 1.5; }
.bf-play { width: 100%; height: 40px; }
.bf-sheet { max-height: 86dvh; display: flex; flex-direction: column; }
.bf-sheet .traplist, .bf-sheet .aibcards { min-height: 0; }
.bf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.bf-themes, .bf-forks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bf-themes .chip { padding: 6px 14px; cursor: pointer; font: inherit; color: var(--ink); }
.bf-themes .chip.on { background: var(--ours); border-color: var(--ours); color: #fff; font-weight: 700; }
.bf-forks { margin-top: 0; }

/* a phone held upright: the site's header and tab bar give their room to the board (the ← in the head goes back) */
@media (max-width: 720px) and (orientation: portrait) {
  body.bfp .top, body.bfp .tabbar, body.bfp .foot { display: none; }
  body.bfp main { padding: 4px 12px 8px; }
  .bf-board { width: min(100%, calc(100dvh - 250px)); }
}
/* wide and low (a laptop, a tablet on its side): the board on the left as tall as the screen allows, the rows in the
   same order beside it; the box grows to what is left */
@media (min-width: 900px) and (orientation: landscape) and (min-height: 561px) {
  body.bfp .foot { display: none; }
  .bf { grid-template-columns: minmax(0, auto) minmax(320px, 400px); grid-template-areas: "head head" "board side"; column-gap: 24px; justify-content: center; }
  .bf-board { width: min(calc(100vw - 500px), calc(100dvh - var(--hdr) - 124px)); }
  .bf-extra { height: auto; min-height: 104px; overflow: visible; }
  .bf-extra .aibkids { height: auto; }
}
