/* Baseball / softball line score (kind "baseball") */
[data-baseball] .dot { display: inline-block; vertical-align: middle; }
[data-baseball] .bb-names { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
[data-baseball] .bb-team { display: flex; align-items: center; gap: 4px; background: var(--canvas); border-radius: 12px; padding: 4px; min-width: 0; }
[data-baseball] .bb-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-baseball] .bb-colour:hover { background: var(--pressed); }
[data-baseball] .bb-colour .dot { width: 20px; height: 20px; margin: 0; }
[data-baseball] .bb-name { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font-weight: 700; font-size: 18px; padding: 8px 6px; border-radius: var(--input); }
[data-baseball] .bb-name:focus { background: var(--soft); outline: none; }
[data-baseball] .bb-name::placeholder { color: var(--mute); }

[data-baseball] .bb-score { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
[data-baseball] .bb-side { background: var(--canvas); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
[data-baseball] .bb-sname { font-weight: 600; color: var(--body); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-baseball] .bb-sname .dot { margin-right: 6px; }
[data-baseball] .bb-runs { font-size: clamp(64px, 18vw, 150px); line-height: 1; }
[data-baseball] .bb-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-baseball] .bb-tag.bb-win { background: var(--signal); color: #fff; }

[data-baseball] .bb-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 20px; }
[data-baseball] .bb-inning { background: var(--canvas); border-radius: var(--pill); padding: 8px 18px; font-weight: 600; font-size: 18px; }
[data-baseball] .bb-inning b { font-size: 26px; font-variant-numeric: tabular-nums; }
[data-baseball] .bb-count { display: flex; flex-direction: column; gap: 6px; background: var(--canvas); border-radius: 12px; padding: 8px 14px; }
[data-baseball] .bb-lights { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
[data-baseball] .bb-lights i { font-style: normal; font-weight: 700; width: 18px; }
[data-baseball] .bb-lights b { margin-left: 4px; min-width: 1ch; }
[data-baseball] .bb-light { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
[data-baseball] .bb-light.on { background: var(--ink); }
[data-baseball] .bb-diamond { position: relative; width: 150px; height: 124px; flex: none; }
[data-baseball] .bb-base { position: absolute; width: 52px; height: 52px; border: 0; background: none; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
[data-baseball] .bb-base span { width: 30px; height: 30px; transform: rotate(45deg); border: 3px solid var(--ink); background: var(--canvas); border-radius: 3px; }
[data-baseball] .bb-base.on span { background: var(--ink); }
[data-baseball] .bb-base:hover span { background: var(--pressed); }
[data-baseball] .bb-base.on:hover span { background: var(--ink); opacity: .8; }
[data-baseball] .bb-base:focus-visible { outline: 3px solid var(--ink); }
[data-baseball] .bb-b2 { left: 49px; top: 0; }
[data-baseball] .bb-b3 { left: 4px; top: 40px; }
[data-baseball] .bb-b1 { right: 4px; top: 40px; }
[data-baseball] .bb-plate { position: absolute; left: 64px; bottom: 2px; width: 22px; height: 22px; transform: rotate(45deg); background: var(--mute); border-radius: 2px; }

[data-baseball] .bb-linebox { background: var(--canvas); border-radius: 12px; padding: 4px 6px; }
[data-baseball] .bb-line th, [data-baseball] .bb-line td { padding: 8px 5px; min-width: 26px; }
[data-baseball] .bb-line tbody th { text-align: left; font-weight: 700; color: var(--ink); font-size: 15px; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
[data-baseball] .bb-line tbody th .dot { margin-right: 6px; }
[data-baseball] .bb-line .bb-tot { border-left: 2px solid var(--hairline); }
[data-baseball] .bb-line td.bb-now { background: var(--ink); color: var(--on-ink); font-weight: 700; border-radius: 6px; }

[data-baseball] .bb-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
[data-baseball] .bb-pad .pill { padding: 0 4px; min-width: 0; font-size: 16px; font-weight: 600; min-height: 56px; }
[data-baseball] .bb-pad .pill:not(.pill-ink) { background: var(--canvas); }
[data-baseball] .bb-pad .pill:not(.pill-ink):hover { background: var(--pressed); }
[data-baseball] .bb-pad .bb-wide { grid-column: span 2; }
[data-baseball] .bb-off { opacity: .45; }
[data-baseball] .bb-note { font-size: 13px; margin: 6px 0 0; }
body.is-focus [data-baseball] .bb-tools .pill { display: inline-flex; }
[data-baseball] .bb-tools .pill[hidden] { display: none !important; }
body.is-focus [data-baseball] .bb-stage { overflow-y: auto; }
body.is-focus [data-baseball] .bb-runs { font-size: min(16vw, 20vh); }

@media (max-width: 520px) {
  [data-baseball] .bb-pad .pill { font-size: 14px; }
  [data-baseball] .bb-state { gap: 8px 12px; }
  [data-baseball] .bb-inning { font-size: 16px; padding: 6px 14px; }
  [data-baseball] .bb-line th, [data-baseball] .bb-line td { padding: 6px 3px; min-width: 20px; font-size: 14px; }
  [data-baseball] .bb-line tbody th { max-width: 84px; }
}

/* display window (?display=1): a black stadium board, in both themes */
body.bb-display { background: #000; overflow: hidden; }
body.bb-display > :not(.bb-dsp) { display: none !important; }
.bb-dsp { position: fixed; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; justify-content: center; gap: 4vh; padding: 3vh 3vw; font-variant-numeric: tabular-nums; }
.bb-dsp.is-idle { cursor: none; }
.bb-dsp-board { display: flex; flex-direction: column; gap: 1.2vh; --cols: 9; }
.bb-dsp-row { display: grid; grid-template-columns: minmax(0, 3.2fr) repeat(var(--cols), minmax(0, 1fr)) repeat(3, minmax(0, 1.2fr)); gap: .5vw; align-items: center; font-weight: 800; font-size: min(calc(60vw / (var(--cols) + 8)), 11vh); line-height: 1.15; }
.bb-dsp-row > span { text-align: center; background: #141414; border-radius: .15em; padding: .08em 0; min-height: 1.3em; }
.bb-dsp-row > span:first-child { background: none; text-align: left; }
.bb-dsp-head > span { background: none; color: #9a9a9a; font-size: .55em; }
.bb-dsp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: .02em; font-size: .7em; border-left: .18em solid var(--tc); padding-left: .3em !important; }
.bb-dsp-name em { font-style: normal; color: #ffc043; font-size: .7em; vertical-align: middle; }
.bb-dsp-name em.bb-dsp-win { color: #fff; background: var(--signal, #04844a); border-radius: 999px; padding: 0 .4em; }
.bb-dsp-row .bb-dsp-r { background: #1c1c1c; color: #ffc043; }
.bb-dsp-head .bb-dsp-r { background: none; color: #9a9a9a; }
.bb-dsp-row .bb-dsp-now { background: #fff; color: #000; }
.bb-dsp-foot { display: flex; align-items: center; justify-content: center; gap: 6vw; flex-wrap: wrap; }
.bb-dsp-inn { font-weight: 800; font-size: min(7vw, 10vh); letter-spacing: -0.02em; }
.bb-dsp-counts { display: flex; flex-direction: column; gap: 1.2vh; }
.bb-dsp-cnt { display: flex; align-items: center; gap: 1vw; font-weight: 800; font-size: min(4vw, 6vh); }
.bb-dsp-cnt span { width: 1.3em; color: #9a9a9a; }
.bb-dsp-cnt i { width: .8em; height: .8em; border-radius: 50%; border: .12em solid #555; }
.bb-dsp-cnt i.on { background: #ffc043; border-color: #ffc043; }
.bb-dsp-dia { position: relative; width: min(18vw, 24vh); height: min(14vw, 19vh); }
.bb-dsp-dia i { position: absolute; width: 32%; aspect-ratio: 1; transform: rotate(45deg); border: .35vh solid #fff; border-radius: 3px; }
.bb-dsp-dia i.on { background: #ffc043; border-color: #ffc043; }
.bb-dsp-dia .b2 { left: 34%; top: 4%; }
.bb-dsp-dia .b3 { left: 4%; top: 40%; }
.bb-dsp-dia .b1 { right: 4%; top: 40%; }
.bb-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: #9a9a9a; }
.bb-dsp.is-idle .bb-dsp-ui { opacity: 0; pointer-events: none; }
.bb-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; }
.bb-dsp-btn:hover { background: #2e2e2e; }
.bb-dsp-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
