/* Echo Hub strategy board (board.html, with assets/js/board.js). The arena itself is always dark, like a
   game map; the controls around it follow the page's light or dark theme. */

.bd-section { padding-top: 8px; }
.bd-shell { background: var(--bg); }
.bd-shell:fullscreen { padding: 14px 18px; overflow: auto; }
.bd-shell:fullscreen .board-svg { max-height: calc(100vh - 230px); }

/* Tools and view controls, above the board. */
.bd-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
}
/* Two lines: the tools on the left and the view controls on the right, then the colour, width and line of
   what you draw. (#bd-tools holds the tools and the styles; it steps aside so both sit in the bar's lines.) */
.bd-tools { display: contents; }
.bd-toolset { order: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; }
.bd-sep { width: 1px; height: 22px; margin: 0 6px; background: var(--line); flex: none; }
.bd-tool, .bd-icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0;
  background: transparent; color: var(--text); border: 1px solid transparent; cursor: pointer;
}
.bd-icon-btn { border-color: var(--line); }
.bd-icon-btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--hover); }
.bd-icon-btn:disabled { opacity: .35; cursor: default; }
.bd-viewgroup { flex-wrap: nowrap; gap: 4px; }
.bd-tool:hover { border-color: var(--line); background: var(--hover); }
.bd-tool[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #0b0d12; }
.bd-ico { flex: none; }
.bd-styles {
  order: 3; flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin: 0 -10px -8px; padding: 7px 10px; border-top: 1px solid var(--line); background: var(--bg);
}
.bd-swatches { display: flex; align-items: center; gap: 4px; }
.bd-swatch {
  width: 22px; height: 22px; padding: 0; border: 2px solid var(--surface); outline: 1px solid var(--line-strong);
  cursor: pointer;
}
.bd-swatch[aria-pressed="true"] { outline: 2px solid var(--text); }
.bd-color {
  width: 34px; height: 28px; padding: 0 2px; border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; vertical-align: middle;
}
.bd-seg { display: inline-flex; }
.bd-seg > * + * { margin-left: -1px; }
.bd-segbtn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; min-height: 34px;
  padding: 4px 9px; background: transparent; color: var(--text); border: 1px solid var(--line-strong);
  font: 600 12px/1 var(--f-body); cursor: pointer;
}
.bd-segbtn[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); position: relative; }
.bd-viewbar { order: 2; display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bd-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.bd-group .check { font-size: 13px; white-space: nowrap; }
.bd-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.bd-inline select { padding: 5px 8px; }

/* The View menu (area names, ghosts, paths, snap). */
.bd-menu { position: relative; }
.bd-menu > summary { list-style: none; cursor: pointer; }
.bd-menu > summary::-webkit-details-marker { display: none; }
.bd-menu-list {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 6; min-width: 230px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.bd-menu-list .check { font-size: 14px; white-space: nowrap; }
.bd-menu:not([open]) .bd-menu-list { display: none; }

/* The board. */
/* The play's name as a title above the arena, as on a play diagram; type in it to rename the play. */
.bd-titlebar { background: #0b0d12; border: 1px solid var(--line); border-bottom: 0; padding: 10px 14px 2px; text-align: center; }
.bd-title {
  width: 100%; max-width: 900px; padding: 2px 8px; background: transparent; border: 1px solid transparent; color: #f5e04a;
  text-align: center; font: 700 clamp(22px, 3.2vw, 36px)/1.15 var(--f-display); letter-spacing: .02em;
}
.bd-title::placeholder { color: rgba(245, 224, 74, .4); }
.bd-title:hover { border-color: #2a3242; }
.bd-title:focus { outline: none; border-color: #f5e04a; }
.board-wrap { position: relative; background: #0b0d12; border: 1px solid var(--line); touch-action: none; }
.board-svg { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
/* A phone held upright: the arena stands up and fills the screen's height. */
.board-wrap[data-rot] .board-svg { height: min(calc(100vh - 170px), 262vw); }
.board-wrap .bd-hit { cursor: grab; }
.board-wrap .bd-hit:focus { outline: none; }
.board-wrap .bd-hit:focus-visible { outline: 2px solid #ffe08a; }
.board-wrap[data-tool="pen"] .board-svg, .board-wrap[data-tool="arrow"] .board-svg,
.board-wrap[data-tool="circle"] .board-svg, .board-wrap[data-tool="rect"] .board-svg,
.board-wrap[data-tool="measure"] .board-svg, .board-wrap[data-tool="stamp"] .board-svg { cursor: crosshair; }
.board-wrap[data-tool="text"] .board-svg { cursor: text; }
.board-wrap[data-tool="pan"] .board-svg { cursor: move; }
.board-wrap[data-tool="erase"] .board-svg { cursor: cell; }
.board-wrap:not([data-tool="select"]) .bd-hit { cursor: inherit; }
.board-wrap[data-tool="erase"] [data-kind="shape"]:hover, .board-wrap[data-tool="erase"] [data-kind="label"]:hover { opacity: .45; }
.bd-tip {
  position: absolute; left: 10px; bottom: 8px; margin: 0; max-width: calc(100% - 20px); pointer-events: none;
  font: 500 13px/1.4 var(--f-body); color: #e8edf5; text-shadow: 0 1px 2px #000, 0 0 6px #000;
}
.bd-tip:empty { display: none; }
.bd-textbox {
  position: absolute; z-index: 2; width: 220px; padding: 6px 8px; transform: translateX(-50%);
  background: #0b0d12; color: #fff; border: 1px solid #ffe08a; font: 600 15px/1.2 var(--f-body);
}

/* The legend under the arena: each player's name in their color over a bar for their speed, as on a play
   diagram. Orange's players on the left, blue's on the right. */
.bd-legend {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 10px 16px 12px;
  background: #0b0d12; border: 1px solid var(--line); border-top: 0;
}
.bd-leg-team { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.bd-leg { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; }
.bd-leg-name { font: 700 14px/1.1 var(--f-display); letter-spacing: .02em; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-leg-bar { position: relative; display: block; width: 76px; height: 12px; border: 1.5px solid rgba(255, 255, 255, .85); }
.bd-leg-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
/* The tray: every player; the ones not on the board are solid and can be dragged or tapped in. */
.bd-tray {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--line); border-top: 0;
}
.bd-tray-team { display: flex; gap: 6px; }
.bd-chip {
  width: 36px; height: 36px; padding: 0; display: grid; place-items: center; overflow: hidden; cursor: grab;
  border-radius: 50%; border: 2px solid #ffffff; background: var(--chip); color: #0b0d12;
  font: 700 14px/1 var(--f-display); touch-action: none;
}
.bd-chip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd-chip[data-on] { opacity: .32; border-color: var(--line-strong); }
.bd-chip:active { cursor: grabbing; }
.bd-chip[aria-pressed="true"] { outline: 2px solid #ffe08a; outline-offset: 2px; opacity: 1; }
.bd-chip-ghost { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -50%); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.bd-tray-note { flex: 1 1 220px; margin: 0; font-size: 13px; color: var(--muted); }
.bd-tray-start { margin-left: auto; }
/* The cast moment a play was drawn from: a plain link beside Start in the tunnels. */
.bd-vod { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.bd-vod:hover { text-decoration: underline; }
.bd-vod .bd-ico { color: var(--orange); }
.bd-vod-time { font: 600 12px/1 var(--f-mono); color: var(--muted); }
.bd-menu-pick select { padding: 4px 6px; }

/* Steps and the selected thing, under the board. */
.bd-below {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; border: 1px solid var(--line); border-top: 0;
  background: var(--surface);
}
.bd-timeline, .bd-inspect { padding: 12px 14px 14px; min-width: 0; }
.bd-inspect { border-left: 1px solid var(--line); }
.bd-panel-title {
  margin: 0 0 8px; font: 700 12px/1 var(--f-display); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.bd-frames { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; align-items: stretch; }
.bd-frame {
  position: relative; flex: none; padding: 3px; background: var(--bg); border: 1px solid var(--line);
  cursor: pointer; line-height: 0;
}
.bd-frame svg { width: 112px; height: 48px; }
.bd-frame:hover { border-color: var(--line-strong); }
.bd-frame[aria-pressed="true"] { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.bd-frame-n {
  position: absolute; left: 3px; top: 3px; padding: 3px 5px; background: #0b0d12; color: #fff;
  font: 700 11px/1 var(--f-display);
}
.bd-frame[aria-pressed="true"] .bd-frame-n { background: var(--orange); color: #fff; }
/* The hidden "Play name" label still gets read for contrast; keep it light on the dark title bar. */
.bd-titlebar .visually-hidden { color: #e8ecf2; }
.bd-add { flex: none; align-self: center; white-space: nowrap; }
/* Forks: after a step the play can split into options. Between the steps, each fork's options (the one the
   play goes on with is pressed); under the steps, the fork on show, to name, add or delete an option. */
.bd-fork-pick {
  flex: none; align-self: center; display: inline-flex; align-items: center;
  padding: 3px 4px 3px 6px; background: var(--bg); border: 1px dashed var(--orange);
}
.bd-fork-pick > .bd-ico { color: var(--orange); margin-right: 6px; }
.bd-fork-pick .bd-segbtn { min-height: 30px; padding: 4px 10px; white-space: nowrap; }
.bd-fork-pick .bd-segbtn + .bd-segbtn { margin-left: -1px; }
.bd-fork-btn { display: inline-flex; align-items: center; gap: 6px; }
.bd-fork-btn .bd-ico, .bd-fork-title .bd-ico { color: var(--orange); }
.bd-fork {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 10px 12px;
  background: var(--bg); border: 1px dashed var(--orange);
}
.bd-fork p { margin: 0; }
.bd-fork-title {
  display: flex; align-items: center; gap: 6px; font: 700 12px/1.2 var(--f-display); letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.bd-fork-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bd-fork-row label { font-size: 13px; color: var(--muted); }
.bd-fork-row input { flex: 1 1 160px; min-width: 0; max-width: 260px; padding: 6px 8px; }
.bd-timeline-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-top: 8px; }
.bd-note-box { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.bd-note-box label { font-size: 13px; color: var(--muted); }
.bd-note-box textarea { width: 100%; resize: vertical; min-height: 44px; font: inherit; padding: 6px 8px; }
.bd-step-tools { flex: 0 1 auto; }
.bd-empty { margin: 0; color: var(--muted); font-size: 14px; }
.bd-insp { display: flex; flex-direction: column; gap: 6px; }
.bd-insp label, .bd-label-text { font-size: 13px; color: var(--muted); margin-top: 2px; }
.bd-insp input[type="text"], .bd-insp select { width: 100%; padding: 6px 8px; }
.bd-insp .check { color: var(--text); }
.bd-insp > .btn { align-self: flex-start; margin-top: 4px; }
.bd-insp-title { margin: 0; font: 700 17px/1.2 var(--f-display); }
.bd-small { font-size: 13px; margin: 0; }

/* Panels under the board. */
/* Block names in the labels panel, and the names a teammate shared, offered above the board. */
.bd-blocknames { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.bd-blocknames p { margin: 0 0 8px; }
.bd-small-head { margin: 0 0 6px; font: 700 13px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bd-names-offer { margin: 0 0 10px; padding: 12px 14px; background: var(--surface); border: 1px dashed var(--orange); }
.bd-names-offer p { margin: 0 0 6px; overflow-wrap: anywhere; }
/* Default plays: examples everyone sees, above the panels; a card each, with a small picture of the play. */
.bd-defaults { margin-top: 20px; }
.bd-defaults .sub-head { margin: 0 0 4px; }
.bd-defaults-intro { margin: 0 0 12px; }
.bd-defaults-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.bd-def { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--line); }
.bd-def > svg { display: block; width: 100%; height: auto; background: #0b0d12; border: 1px solid var(--line); }
.bd-def-text strong { display: block; font: 700 18px/1.2 var(--f-display); }
.bd-def-text p { margin: 4px 0 2px; }
.bd-def .bd-group { margin-top: auto; }
.bd-def-owner { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; padding: 12px; border: 1px dashed var(--line-strong); }
.bd-def-owner p { margin: 0; }
.bd-def-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bd-def-row input { flex: 1 1 240px; min-width: 0; padding: 6px 8px; }
.bd-panels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 20px; }
.bd-panels .sub-head { margin-top: 0; }
.bd-team { border: 0; padding: 0; margin: 0 0 12px; }
.bd-team legend { display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 8px; font: 700 15px/1 var(--f-display); }
.bd-team-pick { width: 100%; margin-bottom: 8px; padding: 5px 8px; }
.bd-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.bd-name-row input { flex: 1; min-width: 0; padding: 6px 8px; }
.bd-dot {
  flex: none; width: 24px; height: 24px; display: grid; place-items: center; color: #0b0d12;
  font: 700 12px/1 var(--f-display); border: 2px solid #fff;
}
/* The player's square in Teams: their number or picture; it opens their settings. */
button.bd-dot { padding: 0; cursor: pointer; overflow: hidden; }
.bd-dot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bd-clear { margin-left: 6px; }
.bd-share { display: flex; flex-direction: column; gap: 10px; }
.bd-share > label { font-size: 13px; color: var(--muted); }
.bd-share input[type="text"], .bd-share input[type="url"] { width: 100%; padding: 6px 8px; }
.bd-vod-row { display: flex; align-items: center; gap: 8px; margin-top: -4px; }
.bd-vod-row input[type="url"] { flex: 1; min-width: 0; }
.bd-vod-row input[type="text"] { flex: none; width: 5.5em; }
.bd-gif-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bd-gif-out { margin-top: 16px; max-width: 980px; }
.bd-gif-result { display: flex; flex-direction: column; gap: 8px; }
.bd-gif-result img { width: 100%; height: auto; border: 1px solid var(--line); }
.bd-plays { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bd-plays li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.bd-lib-note { margin: 10px 0 0; }
.bd-only-here { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--line); }
.bd-play-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-keys { margin-top: 16px; }
.bd-keys summary { cursor: pointer; font: 700 15px/1.3 var(--f-display); }
/* The shortcuts: keys, then mouse and touch, side by side when there is room. Each row is its keys (or what
   to do) and what it does, in two even columns; on a phone the two stack. */
.bd-keylist { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px 40px; margin: 14px 0 0; }
.bd-keygroup h3 { margin: 0 0 8px; font: 700 14px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bd-keygroup h4 { margin: 16px 0 8px; font: 700 13px/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bd-keygroup dl { margin: 0; }
.bd-keyrow { display: grid; grid-template-columns: minmax(8.5rem, 38%) 1fr; gap: 4px 14px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line-soft); }
.bd-keyrow:first-child { border-top: 0; }
.bd-keyrow dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.bd-keyrow dd { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.bd-key-words { font-weight: 600; font-size: 14px; color: var(--text); }
.bd-key-or { font-size: 12px; color: var(--muted); }
.bd-keys kbd {
  display: inline-block; min-width: 1.9em; padding: 2px 6px; text-align: center; font: 600 12px/1.4 var(--f-mono);
  color: var(--text); background: var(--surface-2, var(--hover)); border: 1px solid var(--line-strong); border-bottom-width: 2px;
}
.bd-keytools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px 12px; }
.bd-keytools li { font-size: 14px; color: var(--muted); white-space: nowrap; }
@media (max-width: 520px) {
  .bd-keyrow { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (max-width: 1300px) {
  .bd-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .bd-below { grid-template-columns: minmax(0, 1fr); }
  .bd-inspect { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .bd-panels { grid-template-columns: minmax(0, 1fr); }
  /* One scrolling row each for tools and styles, with finger-sized buttons; the board runs edge to edge. */
  .bd-shell { margin-inline: calc(-1 * var(--gutter)); }
  .bd-bar { border-inline: 0; position: relative; }
  .board-wrap, .bd-below, .bd-titlebar, .bd-legend { border-inline: 0; }
  .bd-legend { padding-inline: 12px; gap: 8px 14px; }
  .bd-leg-team { gap: 8px 12px; }
  .bd-leg { min-width: 64px; }
  .bd-leg-bar { width: 64px; }
  .bd-toolset, .bd-styles { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .bd-toolset::-webkit-scrollbar, .bd-styles::-webkit-scrollbar { display: none; }
  .bd-toolset { flex: 1 1 100%; }
  .bd-styles { margin-inline: -8px; margin-bottom: -8px; padding-inline: 8px; }
  .bd-tool { flex: none; width: 44px; height: 44px; }
  .bd-icon-btn { flex: none; width: 40px; height: 40px; }
  .bd-swatch { flex: none; width: 32px; height: 32px; }
  .bd-segbtn { min-height: 40px; }
  .bd-styles > * { flex: none; }
  .bd-viewbar { width: 100%; flex-direction: row; align-items: center; overflow-x: auto; scrollbar-width: none; }
  .bd-viewbar::-webkit-scrollbar { display: none; }
  .bd-viewbar .bd-group { flex-wrap: nowrap; flex: none; }
  .bd-viewbar .btn-small { min-height: 40px; flex: none; }
  /* The View menu opens as a panel along the bottom of the screen. */
  .bd-menu-list { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; min-width: 0; z-index: 30; padding: 14px 16px; gap: 12px; }
  .bd-menu-list .check { font-size: 15px; }
  .bd-frame svg { width: 76px; height: 32px; }
  .bd-fork-pick .bd-segbtn { min-height: 36px; }
  .bd-fork-row input { flex-basis: 100%; max-width: none; }
  .bd-bar { padding: 8px; }
  .bd-tip { position: static; max-width: none; padding: 6px 8px; text-shadow: none; color: #c9d2e0; }
}
