/* Two-team scoreboard (kind "board"). Made to be shown on a TV or projector in full screen. */
[data-board] .board-mid { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; }
[data-board] .board-period, [data-board] .board-clock { display: flex; align-items: center; gap: 8px; background: var(--canvas); border-radius: var(--pill); padding: 4px 4px 4px 16px; }
[data-board] .board-plabel { font-weight: 600; color: var(--body); }
[data-board] .board-pnum { font-size: 36px; min-width: 1ch; text-align: center; }
[data-board] .board-time { border: 0; background: transparent; cursor: pointer; font-size: clamp(40px, 11vw, 88px); padding: 0 6px; border-radius: 12px; color: var(--ink); min-width: 4ch; }
[data-board] .board-time:focus-visible { outline: 3px solid var(--ink); }
[data-board] .board-ss { min-width: 92px; }
[data-board] .board-poss { background: var(--canvas); font-weight: 600; }
[data-board] .board-timeform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
[data-board] .board-timeform .field { width: 110px; }
[data-board] .board-timeform .field input { background: var(--soft); }

[data-board] .board-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
[data-board] .board-team { min-width: 0; background: var(--canvas); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
[data-board] .board-top { display: flex; align-items: center; gap: 4px; }
[data-board] .board-colour { border: 0; background: none; width: 40px; height: 40px; border-radius: var(--pill); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; flex: none; }
[data-board] .board-colour:hover { background: var(--pressed); }
[data-board] .board-colour .dot { width: 20px; height: 20px; margin: 0; }
[data-board] .board-name { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font-weight: 700; font-size: clamp(18px, 3.2vw, 30px); padding: 6px; border-radius: var(--input); }
[data-board] .board-name:focus { background: var(--soft); outline: none; }
[data-board] .board-info { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; min-height: 26px; font-size: 15px; color: var(--body); padding: 0 6px; }
[data-board] .board-info b { color: var(--ink); font-variant-numeric: tabular-nums; }
[data-board] .board-tag { background: var(--ink); color: var(--on-ink); border-radius: var(--pill); padding: 2px 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
[data-board] .board-tag.board-win { background: var(--signal); color: #fff; }
[data-board] .board-score { border: 0; background: var(--softer); border-radius: 10px; min-height: clamp(170px, 36vh, 400px); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 8px 4px; overflow: hidden; }
[data-board] .board-score:active { background: var(--pressed); }
[data-board] .board-score:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[data-board] .board-score .big { font-size: clamp(96px, 26vw, 280px); }
[data-board] .board-score .big[data-len="3"] { font-size: clamp(64px, 16vw, 200px); }
[data-board] .board-score .big[data-len="4"] { font-size: clamp(48px, 12vw, 150px); }
[data-board] .board-btns { display: grid; gap: 6px; grid-template-columns: 1fr 1fr; }
[data-board] .board-btns-basketball, [data-board] .board-btns-volleyball { grid-template-columns: repeat(3, 1fr); }
[data-board] .board-btns .pill { padding: 0 4px; min-width: 0; font-size: 17px; font-weight: 600; }
[data-board] .board-btns .pill:not(.pill-ink) { background: var(--soft); }
[data-board] .board-btns .pill:not(.pill-ink):hover { background: var(--pressed); }
[data-board] .board-sets ul { list-style: none; margin: 0; padding: 0 4px; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-variant-numeric: tabular-nums; }
[data-board] .board-off { opacity: .45; }
[data-board] .settings select { border: 0; border-radius: var(--input); padding: 12px; font-size: 16px; background: var(--canvas); color: var(--ink); }

/* keep the tool buttons (Undo, Swap...) visible in full screen */
body.is-focus [data-board] .board-tools .pill { display: inline-flex; }
[data-board] .board-tools .pill[hidden] { display: none !important; }
body.is-focus [data-board] .board-teams { flex: 1; min-height: 0; }
body.is-focus [data-board] .board-team { min-height: 0; }
body.is-focus [data-board] .board-score { flex: 1; min-height: 0; }
body.is-focus [data-board] .board-score .big { font-size: min(30vw, 50vh); }
body.is-focus [data-board] .board-score .big[data-len="3"] { font-size: min(19vw, 42vh); }
body.is-focus [data-board] .board-score .big[data-len="4"] { font-size: min(14vw, 36vh); }
body.is-focus [data-board] .board-time { font-size: min(10vw, 13vh); }
body.is-focus [data-board] .board-name { font-size: min(4vw, 6vh); }

@media (max-width: 520px) {
  [data-board] .board-teams { gap: 6px; }
  [data-board] .board-team { padding: 6px; }
  [data-board] .board-btns .pill { font-size: 15px; }
  [data-board] .board-btns-basketball .pill { font-size: 14px; }
  [data-board] .board-info { font-size: 13px; gap: 2px 8px; }
  [data-board] .board-period, [data-board] .board-clock { padding-left: 12px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  body.is-focus [data-board] .board-info, body.is-focus [data-board] .board-sets { display: none; }
}
[data-board] .board-chart-note { font-size: 13px; margin: 6px 0 0; }

/* display window (?display=1): a black scoreboard that fills the whole window, in both themes */
body.board-display { background: #000; overflow: hidden; }
body.board-display > :not(.board-dsp) { display: none !important; }
.board-dsp { --d-ink: #fff; --d-mute: #9a9a9a; position: fixed; inset: 0; background: #000; color: var(--d-ink); display: flex; flex-direction: column; padding: 2vh 2vw; gap: 1vh; font-variant-numeric: tabular-nums; }
.board-dsp.is-idle { cursor: none; }
.board-dsp-clock { text-align: center; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-size: min(17vw, 22vh); padding-top: 1vh; }
.board-dsp-clock.is-zero { color: #e11900; }
.board-dsp-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 2vw; align-items: stretch; }
.board-dsp-team { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1vh; }
.board-dsp-bar { width: 100%; height: max(10px, 2.2vh); border-radius: 999px; background: var(--tc); }
.board-dsp-name { max-width: 100%; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: min(5.5vw, 8vh); line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-dsp-score { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; letter-spacing: -0.04em; line-height: 1; font-size: min(28vw, 50vh); }
.board-dsp.has-clock .board-dsp-score { font-size: min(28vw, 40vh); }
.board-dsp-score[data-len="3"] { font-size: min(19vw, 40vh) !important; }
.board-dsp-score[data-len="4"] { font-size: min(14vw, 34vh) !important; }
.board-dsp-stats { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .6vh 2.5vw; min-height: 6vh; font-size: min(3vw, 4.5vh); color: var(--d-mute); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.board-dsp-stats b { color: var(--d-ink); font-weight: 800; font-size: 1.4em; margin-left: .3em; }
.board-dsp-tag { background: var(--d-ink); color: #000; border-radius: 999px; padding: .15em .7em; font-weight: 800; }
.board-dsp-tag.board-dsp-win { background: var(--signal, #04844a); color: #fff; }
.board-dsp-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; min-width: 12vw; }
.board-dsp-plabel { color: var(--d-mute); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: min(3vw, 4.5vh); }
.board-dsp-pnum { font-weight: 800; line-height: 1; font-size: min(11vw, 16vh); letter-spacing: -0.03em; white-space: nowrap; }
.board-dsp-poss { font-weight: 700; text-transform: uppercase; letter-spacing: .05em; font-size: min(2.8vw, 4vh); border: 2px solid var(--d-ink); border-radius: 999px; padding: .2em .8em; white-space: nowrap; }
.board-dsp-sets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: .4vh; font-weight: 700; font-size: min(3vw, 4.5vh); color: var(--d-mute); }
.board-dsp-ui { position: fixed; right: 16px; bottom: 16px; left: 16px; display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; transition: opacity .4s; font-size: 14px; color: var(--d-mute); }
.board-dsp.is-idle .board-dsp-ui { opacity: 0; pointer-events: none; }
.board-dsp-btn { border: 0; border-radius: 999px; background: #1c1c1c; color: #fff; font: inherit; font-size: 16px; font-weight: 600; min-height: 48px; padding: 10px 20px; cursor: pointer; }
.board-dsp-btn:hover { background: #2e2e2e; }
.board-dsp-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-aspect-ratio: 1/1) {
  .board-dsp-main { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; }
  .board-dsp-mid { grid-column: 1 / -1; grid-row: 1; flex-direction: row; gap: 3vw; }
  .board-dsp-score { font-size: min(34vw, 40vh); }
}
