/* The chat's board (round 3, package C6: docs/CHAT_ROUND3_SPEC.md 5.10). A film's scenes as
   tiles in a 96 px band, a reel's own strip in a 108 px band; one sideways scroller each, never
   a vertical one. No new colour and no new font: the Simple layout's tokens. */

/* the board itself never scrolls: its one row does (a film's .desk-board-in, a reel's #chReel) */
#deskBoard { overflow: hidden; position: relative; }
#deskBoard[hidden] { display: none; }
#deskBoard.desk-board-film { height: 96px; border-bottom: 1px solid var(--line, rgba(127,127,127,.25)); }
#deskBoard.desk-board-reel { height: 108px; background: #08090b; border-bottom: 1px solid var(--line, rgba(127,127,127,.25)); }

/* ---------------------------------------------------------------- a film: 120 by 88 tiles */
#deskBoard .desk-board-in { display: flex; gap: 8px; height: 96px; box-sizing: border-box; padding: 4px 12px;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  scroll-padding-inline: 12px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
#deskBoard .desk-board-in::-webkit-scrollbar { display: none; }
#deskBoard .desk-tile { flex: none; position: relative; width: 120px; min-width: 120px; height: 88px; min-height: 88px; margin: 0; padding: 0;
  display: block; overflow: hidden; border: 0; border-radius: 10px; cursor: pointer; scroll-snap-align: start;
  background: var(--raised, #1f2227); color: var(--ink, #f3ece1); box-shadow: inset 0 0 0 1px var(--line, rgba(127,127,127,.25));
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: pan-x; text-align: left; font: inherit; }
#deskBoard .desk-tile:focus-visible { outline: 3px solid var(--primary, #3167ed); outline-offset: -3px; }
#deskBoard .desk-tile.needs { box-shadow: inset 0 0 0 2px var(--primary, #3167ed); }
#deskBoard .desk-tile-pic { position: absolute; inset: 0; display: grid; place-items: center; }
#deskBoard .desk-tile-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#deskBoard .desk-tile-num { font: 700 34px/1 var(--font, inherit); color: var(--muted, #9a948b); font-variant-numeric: tabular-nums; margin-top: -18px; }
/* the words sit on a shade at the tile's foot, so they read on any picture in both themes */
#deskBoard .desk-tile-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 0;
  padding: 14px 8px 6px; background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.5) 60%, transparent); color: #fff; }
#deskBoard .desk-tile-cap b, #deskBoard .desk-tile-cap span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#deskBoard .desk-tile-cap b { font-size: 13px; line-height: 16px; font-weight: 650; }
#deskBoard .desk-tile-cap span { font-size: 12px; line-height: 15px; color: rgba(255,255,255,.88); }
#deskBoard .desk-tile-ring { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); }
#deskBoard .desk-tile-ring circle { fill: none; stroke-width: 3; }
#deskBoard .desk-tile-ring .trk { stroke: rgba(255,255,255,.28); }
#deskBoard .desk-tile-ring .val { stroke: var(--primary, #3167ed); stroke-linecap: round; }
#deskBoard .desk-tile.st-signed .desk-tile-ring .val, #deskBoard .desk-tile.st-in-the-cut .desk-tile-ring .val { stroke: var(--ok, #2fa86b); }
#deskBoard .desk-tile-dot { position: absolute; top: 9px; left: 8px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary, #3167ed); box-shadow: 0 0 0 2px rgba(0,0,0,.55); }
/* the scene being made: a thin bar that moves on its own along the top */
#deskBoard .desk-tile-bar { position: absolute; left: 0; right: 0; top: 0; height: 3px; overflow: hidden; background: rgba(255,255,255,.18); }
#deskBoard .desk-tile-bar::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--primary, #3167ed);
  animation: desk-board-run 1.6s linear infinite; }
@keyframes desk-board-run { from { left: -40%; } to { left: 100%; } }

/* a scene's newest line in the thread, shown once after a tap on its tile */
#deskItems .desk-board-flash { animation: desk-board-flash 1.2s ease-out 1; border-radius: 12px; }
@keyframes desk-board-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--primary, #3167ed); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* ---------------------------------------------------------------- a reel: its own strip, 108 px
   12 (padding) + 64 (the tile) + 4 (gap) + 16 (the caption) + 12 (padding) = 108; the padding equals
   the gap between tiles, as the strip's tests read it on #chReel */
#deskBoard .ch-reel { --h: 64px; padding: 12px; gap: 12px; height: 108px; box-sizing: border-box; align-items: flex-start;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-padding-inline: 12px 112px;
  scrollbar-width: none; background-position: 4px 1px, 4px calc(100% - 1px); }
#deskBoard .ch-reel::-webkit-scrollbar { display: none; }
/* lane RS: a block lifted by a thumb holds the strip still under it */
#deskBoard #chReel.ch-touchdrag { overflow-x: hidden; }
#deskBoard .ch-frame { gap: 4px; }
#deskBoard .ch-pic { height: 64px; width: calc(64px * var(--ar)); min-width: 64px; max-width: 160px; container-type: inline-size; }
#deskBoard .ch-pbtn { width: 28px; height: 28px; }
#deskBoard .ch-spin { width: 22px; height: 22px; }
#deskBoard .ch-state { left: 4px; top: 4px; max-width: calc(100% - 8px); }
/* a narrow tile (a 9:16 reel) keeps its word inside: a smaller word, no dot */
@container (max-width: 80px) {
  #deskBoard .ch-state { font-size: 9.5px; padding: 1px 4px; gap: 0; }
  #deskBoard .ch-state > i { display: none; }
}
/* a tile is as wide as its picture: the caption takes no width of its own and is cut inside it */
#deskBoard .ch-cap { height: 16px; line-height: 16px; font-size: 12px; overflow: hidden; white-space: nowrap; width: 0; min-width: 100%; box-sizing: border-box; }
#deskBoard .ch-cap b { height: 16px; min-width: 16px; font-size: 11px; line-height: 16px; border-radius: 5px; }
#deskBoard .ch-cap.ch-cap3 { display: flex; align-items: center; gap: 4px; }
#deskBoard .ch-cap.ch-cap3 > b { flex: none; margin-left: 0; }
#deskBoard .ch-cap.ch-cap3 > span:empty { display: none; }
/* a word that does not fit drops whole to a hidden second line: never cut inside a word (5.10) */
#deskBoard .ch-cap .ch-mid { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; column-gap: 4px; row-gap: 0;
  flex: 1 1 auto; min-width: 0; height: 16px; overflow: hidden; white-space: nowrap; }
#deskBoard .ch-cap .ch-mid > span { flex: none; display: inline-block; line-height: 16px; }
#deskBoard .ch-cap .ch-res { line-height: 14px; padding: 0 5px; }
/* the 1080p clock of an accepted draft sits on the tile's foot, inside the band */
#deskBoard .ch-frame > .ch-exp { position: absolute; left: 4px; bottom: 22px; max-width: calc(100% - 8px); box-sizing: border-box;
  white-space: normal; overflow-wrap: normal; word-break: keep-all; text-overflow: clip;
  padding: 1px 5px; border-radius: 6px; font-size: 10px; line-height: 12px; background: rgba(0,0,0,.66); }
/* + Block: 44 px tall, always in view, beside the strip and never over a tile (Z4): the strip ends
   where the button begins, and the button stands in that room on the band's right */
#deskBoard .ch-frame.ch-addbtn { align-self: center; }
#deskBoard.desk-board-reel > #chReel { position: static; margin: 0 var(--board-add-w, 108px) 0 0; scroll-padding-inline: 12px; }
#deskBoard.desk-board-reel .ch-frame.ch-addbtn { position: absolute; top: 22px; right: 12px; margin: 0; width: auto; max-width: calc(var(--board-add-w, 108px) - 16px);
  box-shadow: none; }
/* D621: on a phone the + is a 44 px square, so the strip gives it less room than the word needed */
@media (max-width: 899px) {
  #deskBoard.desk-board-reel { --board-add-w: 68px; }
  /* the Move state's Cancel needs its word: while a move is on the button gets the room it needs */
  #deskBoard.desk-board-reel:has(.ch-movecancel) { --board-add-w: 116px; }
  #deskBoard.desk-board-reel .ch-frame.ch-addbtn:not(.ch-movecancel) { width: 44px; height: 44px; padding: 0; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  #deskBoard .desk-tile-bar::after { animation: none; left: 0; width: 100%; opacity: .6; }
  #deskItems .desk-board-flash { animation: none; box-shadow: 0 0 0 3px var(--primary, #3167ed); }
}
