/* DG Board (dg-board.js): the board games inside the Dataslate. Everything is scoped to .bd, the element the
   Dataslate mounts the board into; the board colours come from the viewer's own choice (set on .bd by dg-board.js). */
.bd { --card: #0f172a; --card2: #111c33; --line: #1e293b; --line2: #334155; --text: #e2e8f0; --muted: #94a3b8; --accent: #4f46e5; --accent-ink: #fff; --ok: #6ee7b7; --warn: #fcd34d;
  --p1: #a5b4fc; --p2: #fb7185;
  color: var(--text); font-size: 14px; line-height: 1.45; user-select: none; -webkit-user-select: none; }
/* the same three columns as the Warhammer screen: player 1, the board, player 2 (one column on narrower screens) */
.bd-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 6fr) minmax(0, 3fr); gap: 16px; padding: 16px; max-width: 1700px; margin: 0 auto; width: 100%; box-sizing: border-box; align-items: start; }
@media (max-width: 1023px) { .bd-grid { grid-template-columns: minmax(0, 1fr); } }
.bd-panel, .bd-main { background: rgba(15, 23, 42, .8); border: 1px solid rgba(30, 41, 59, .8); border-radius: 16px; padding: 20px; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .25); box-sizing: border-box; }
.bd-main { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bd-panel.active { border-color: rgba(99, 102, 241, .7); }
.bd-ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #1e293b; }
.bd-pt { font-weight: 900; text-transform: uppercase; letter-spacing: .05em; font-size: .875rem; }
.bd-panel.p1 .bd-pt, .bd-panel.p1 .bd-pn { color: var(--p1); } .bd-panel.p2 .bd-pt, .bd-panel.p2 .bd-pn { color: var(--p2); }
.bd-pn { font-weight: 700; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-you { color: var(--muted); font-weight: 600; font-size: .8rem; }
.bd-badge { font-size: 9px; font-weight: 900; text-transform: uppercase; color: #a5b4fc; background: #312e81; padding: 2px 6px; border-radius: 4px; }
.bd-cap { margin-top: 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.bd-panel .tray { display: flex; flex-wrap: wrap; gap: 2px; min-height: 34px; align-items: center; cursor: pointer; border: 1px dashed #334155; border-radius: 10px; padding: 6px; margin-top: 6px; }
.bd-panel .tray svg { width: 30px; height: 30px; }
.bd-panel .tray .sel { outline: 2px solid var(--accent); border-radius: 4px; }
.bd-panel .tray .count { color: var(--text); font-weight: 700; }
.bd-panel .tray .pa { color: var(--pa); --ln: var(--pa-ln); } .bd-panel .tray .pb { color: var(--pb); --ln: var(--pb-ln); }
.bd-wrap { position: relative; width: min(100%, calc(100vh - 300px), 780px); width: min(100%, calc(100dvh - 300px), 780px); min-width: 260px; aspect-ratio: 1; }
#bdNotice { width: 100%; }
#bdNotice:empty { display: none; }
.bd-actions, .bd-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bd-actions { justify-content: center; }
.bd-row.end { justify-content: flex-end; margin-top: 12px; }
.bd-row.between { justify-content: space-between; }
/* buttons look like the Dataslate's own */
.bd-btn { background: #1e293b; color: #e2e8f0; border: 1px solid #334155; border-radius: 6px; padding: 6px 10px; font: inherit; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; cursor: pointer; }
.bd-btn:hover { background: #334155; }
.bd-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.bd-btn.primary:hover { background: #6366f1; }
.bd-btn.small { padding: 3px 8px; font-size: 10px; }
.bd-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bd-btn:disabled { opacity: .45; cursor: default; }
.bd-card { width: 100%; box-sizing: border-box; background: #020617; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.bd-card h2 { margin: 0 0 6px; font-size: .8rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: #fbbf24; }
.bd-movestab { display: none; }
.bd-dlg { background: #0f172a; color: var(--text); border: 1px solid #334155; border-radius: 16px; padding: 18px 20px; width: min(460px, 94vw); user-select: text; -webkit-user-select: text; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .6); }
.bd-dlg.wide { width: min(640px, 96vw); }
.bd-dlg::backdrop { background: rgba(2, 6, 23, .75); }
.bd-dlg h2 { font-size: .95rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: #fbbf24; }
/* face to face: both panels with the board, the far player's turned round to face them */
.bd-grid.f2f { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.bd-grid.f2f .bd-panel.far { order: 0; transform: rotate(180deg); }
.bd-grid.f2f .bd-main { order: 1; } .bd-grid.f2f .bd-panel.near { order: 2; }
/* phone: the Dataslate's bottom tabs pick what shows (my panel, the board, the moves, the opponent's panel) */
.bd[data-phone="1"] .bd-grid { display: flex; flex-direction: column; align-items: stretch; padding: 8px; gap: 8px; }
.bd[data-phone="1"] .bd-main, .bd[data-phone="1"] .bd-panel { padding: 12px; border-radius: 14px; }
.bd[data-phone="1"] .bd-panel { display: none; }
.bd[data-phone="1"][data-tab="me"] .bd-panel.me, .bd[data-phone="1"][data-tab="opp"] .bd-panel.opp { display: block; }
.bd[data-phone="1"][data-tab="board"] .bd-grid.f2f .bd-panel { display: block; }
.bd[data-phone="1"][data-tab="me"] .bd-main, .bd[data-phone="1"][data-tab="opp"] .bd-main { display: none; }
.bd[data-phone="1"][data-tab="moves"] .bd-main > :not(.bd-movestab) { display: none; }
.bd[data-phone="1"][data-tab="moves"] .bd-movestab { display: block; }
.bd[data-phone="1"] .bd-wrap { width: 100%; min-width: 0; }
.bd[data-phone="1"] .bd-btn { padding: 10px 12px; font-size: 12px; }
.bd-row.end { justify-content: flex-end; margin-top: 12px; }
.bd-row.between { justify-content: space-between; }
#bdBoard { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 6px; box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
.bd-clock { font: 700 1.35rem/1 ui-monospace, Consolas, monospace; background: #020617; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 92px; text-align: center; cursor: pointer; }
.bd-clock.run { border-color: var(--ok); color: var(--ok); }
.bd-clock.low { color: #fda4af; border-color: #fda4af; }
.bd-clock .byo { display: block; font-size: .65rem; color: var(--muted); margin-top: 2px; }
.bd-moves { margin: 0; padding-left: 24px; max-height: 320px; overflow: auto; font: .9rem/1.6 ui-monospace, Consolas, monospace; }
.bd-moves li span { display: inline-block; min-width: 7.5em; }
.bd-moves li .by { color: var(--muted); font-size: .8em; min-width: 0; }
.bd-moves li.cur { background: #312e81; border-radius: 4px; }
.bd-moves li[data-mv] { cursor: default; }
.bd-rules { margin: 0 0 6px; }
.bd-small { color: var(--muted); font-size: .82rem; margin: 4px 0; }
.bd-note { border-radius: 10px; padding: 10px 12px; background: #2a2212; border: 1px solid #78591f; margin-bottom: 4px; }
.bd-note.ok { background: #12271f; border-color: #2c6b52; }
.bd-note .bd-row { margin-top: 8px; }
.bd-dlg h3 { margin: 12px 0 4px; font-size: .95rem; }
.bd-dlg h2 { margin: 0 0 10px; }
.bd-dlg label { display: flex; flex-direction: column; gap: 3px; margin: 8px 0; font-size: .9rem; color: var(--muted); flex: 1; }
.bd-dlg label.bd-check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.bd-dlg input, .bd-dlg select, .bd input, .bd select { font: inherit; background: #020617; color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
.bd-dlg input[type=color] { padding: 2px; height: 36px; width: 100%; }
.bd-dlg [hidden] { display: none !important; }
.bd-qr { width: 200px; background: #fff; padding: 8px; border-radius: 10px; margin: 8px 0; }
.bd-qr svg { display: block; width: 100%; height: auto; }
.bd-code { font: 800 1.8rem/1 ui-monospace, Consolas, monospace; letter-spacing: .15em; }
.bd-promo-pc { width: 64px; height: 64px; padding: 4px; background: #e8dcc6; border-radius: 10px; cursor: pointer; border: 2px solid transparent; }
.bd-promo-pc:hover { border-color: var(--accent); }
/* the board itself: colours are set on the svg by board.js */
#bdBoard .sq-l { fill: var(--sq-l); } #bdBoard .sq-d { fill: var(--sq-d); }
#bdBoard .gobg { fill: var(--go-bg); } #bdBoard .goln { stroke: var(--go-line); stroke-width: .035; }
#bdBoard .star { fill: var(--go-line); }
#bdBoard .last { fill: var(--last); }
#bdBoard .selsq { fill: none; stroke: var(--sel); stroke-width: .07; }
#bdBoard .coord { font: 600 .2px system-ui, sans-serif; fill: var(--coord); pointer-events: none; }
#bdBoard .pa { color: var(--pa); --ln: var(--pa-ln); } #bdBoard .pb { color: var(--pb); --ln: var(--pb-ln); }
#bdBoard .dead { opacity: .4; }
#bdBoard .own-a { fill: var(--pa); opacity: .55; } #bdBoard .own-b { fill: var(--pb); opacity: .55; }
#bdBoard .ghost { pointer-events: none; opacity: .85; }

.bd-seek { flex: 1; min-width: 120px; accent-color: var(--accent); }
.bd-speed { padding: 4px 6px; border-radius: 7px; border: 1px solid var(--line); color: var(--text); }
/* the replay's Speed and Style dropdowns carry a visible name, so two "Normal"s are never side by side */
.bd-lab { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.bd-lab .bd-speed { text-transform: none; letter-spacing: 0; font-size: .9rem; }
.bd-games { width: 100%; border-collapse: collapse; font-size: .88rem; }
.bd-games td { padding: 5px 6px; border-top: 1px solid var(--line); }
.bd-games td:last-child { text-align: right; }
.bd-promo-pc .pa { color: var(--pa); --ln: var(--pa-ln); } .bd-promo-pc .pb { color: var(--pb); --ln: var(--pb-ln); }
.bd [hidden] { display: none !important; }
/* the venue display's small board (dg-board-draw.js) */
.dgb-mini { display: block; width: 100%; height: auto; border-radius: 6px; }
/* Battle replays (dg-board-battle.js): the figures stand on a canvas over the board, reaching a little above its top edge */
.bd-battle { position: absolute; left: 0; pointer-events: none; z-index: 1; }
.bd-callout { text-align: center; font-size: 1.15rem; border-color: #f59e0b; background: rgba(120, 53, 15, .55); animation: bd-pop .35s ease-out; }
.bd-callout.mate { border-color: #ef4444; background: rgba(127, 29, 29, .6); font-size: 1.3rem; }
@keyframes bd-pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bd-callout { animation: none; } }

/* for screen readers only (the move just made, read out) */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
