/* Table and lawn games scoreboard (kind "table"): cornhole, shuffleboard, pool. */
[data-table] .table-status { margin: 0; text-align: center; font-weight: 600; color: var(--body); font-variant-numeric: tabular-nums; }
[data-table] .table-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
[data-table] .table-side { min-width: 0; background: var(--canvas); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
[data-table] .table-top { display: flex; align-items: center; gap: 4px; }
[data-table] .table-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-table] .table-colour:hover { background: var(--pressed); }
[data-table] .table-colour .dot { width: 20px; height: 20px; margin: 0; }
[data-table] .table-name { flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; font-weight: 700; font-size: clamp(18px, 3.2vw, 28px); padding: 6px; border-radius: var(--input); }
[data-table] .table-name:focus { background: var(--soft); outline: none; }
[data-table] .table-score { border: 0; background: var(--softer); border-radius: 10px; min-height: clamp(120px, 24vh, 260px); display: flex; align-items: center; justify-content: center; padding: 8px 4px; overflow: hidden; color: var(--ink); width: 100%; }
[data-table] button.table-score { cursor: pointer; }
[data-table] button.table-score:active { background: var(--pressed); }
[data-table] .table-score:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[data-table] .table-score .big { font-size: clamp(80px, 20vw, 220px); }
[data-table] .table-score .big[data-len="3"] { font-size: clamp(60px, 14vw, 170px); }
[data-table] .table-score .big[data-len="4"], [data-table] .table-score .big[data-len="5"] { font-size: clamp(44px, 10vw, 130px); }
[data-table] .table-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-table] .table-info b { color: var(--ink); font-variant-numeric: tabular-nums; }
[data-table] .table-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-table] .table-tag.table-win { background: var(--signal); color: #fff; }
[data-table] .table-entryside { display: flex; flex-direction: column; gap: 8px; }
[data-table] .table-step { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; }
[data-table] .table-steplab { font-weight: 600; font-size: 15px; }
[data-table] .table-steplab small { display: block; font-weight: 400; color: var(--body); font-size: 13px; }
[data-table] .table-stepbtns { display: inline-flex; align-items: center; gap: 6px; }
[data-table] .table-stepbtns .pill { width: 52px; height: 52px; min-height: 52px; padding: 0; font-size: 26px; font-weight: 600; }
[data-table] .table-stepbtns .pill:not(.pill-ink) { background: var(--soft); }
[data-table] .table-stepn { min-width: 1.4ch; text-align: center; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
[data-table] .table-sum { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--body); font-size: 15px; }
[data-table] .table-sum b { color: var(--ink); font-size: 20px; }
[data-table] .table-bags { display: inline-flex; gap: 4px; }
[data-table] .table-bags i { width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--mute); }
[data-table] .table-bags i.is-board { background: var(--mute); }
[data-table] .table-bags i.is-hole { background: var(--ink); border-color: var(--ink); }
[data-table] .table-rackbtns .pill { width: 100%; padding: 8px; }
[data-table] .table-rackbtns .pill:not(.pill-ink) { background: var(--soft); }
[data-table] .table-entry { display: flex; flex-direction: column; gap: 10px; background: var(--canvas); border-radius: 12px; padding: 10px; }
[data-table] .table-entry:empty { display: none; }
[data-table] .table-segrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
[data-table] .table-seglab { font-weight: 600; font-size: 15px; }
[data-table] .table-segrow .seg { background: var(--soft); }
[data-table] .table-go { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
[data-table] .table-preview { margin-right: auto; font-weight: 700; font-size: 18px; }
[data-table] .table-go .pill:not(.pill-ink) { background: var(--soft); }
[data-table] .table-gobtn { min-width: 160px; font-size: 17px; font-weight: 700; }
[data-table] .table-zones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
[data-table] .table-zones .pill { min-height: 64px; padding: 4px; font-size: 20px; font-weight: 700; }
[data-table] .table-zones .pill:not(.pill-ink) { background: var(--soft); }
[data-table] .table-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 40px; align-items: center; }
[data-table] .table-chip { border: 2px solid var(--ink); background: transparent; color: var(--ink); border-radius: var(--pill); min-height: 40px; min-width: 48px; padding: 4px 12px; font-weight: 700; cursor: pointer; }
[data-table] .table-chip:hover { background: var(--pressed); }
[data-table] .table-chip::after { content: " \00d7"; font-weight: 400; color: var(--body); }
[data-table] .table-ball { border: 0; border-radius: 12px; background: var(--ink); color: var(--on-ink); min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-weight: 600; }
[data-table] .table-ball .big { font-size: 64px; }
[data-table] .table-ball:disabled { opacity: .4; cursor: default; }
[data-table] .table-ball:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[data-table] .table-over { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
[data-table] .table-log:empty { display: none; }
[data-table] .table-loglist { margin: 0; padding: 0 0 0 28px; font-size: 14px; color: var(--body); font-variant-numeric: tabular-nums; }
[data-table] .table-chartnote { font-size: 13px; margin: 6px 0 0; }
[data-table] .settings select { border: 0; border-radius: var(--input); padding: 12px; font-size: 16px; background: var(--canvas); color: var(--ink); }
[data-table] .settings input:disabled, [data-table] .settings select:disabled { opacity: .45; }
body.is-focus [data-table] .table-tools .pill { display: inline-flex; }
[data-table] .table-tools .pill[hidden] { display: none !important; }
body.is-focus [data-table] .table-score .big { font-size: min(22vw, 30vh); }

@media (max-width: 520px) {
  [data-table] .table-sides { gap: 6px; }
  [data-table] .table-side { padding: 6px; }
  [data-table] .table-info { font-size: 13px; gap: 2px 8px; }
  [data-table] .table-stepbtns .pill { width: 48px; height: 48px; min-height: 48px; }
  [data-table] .table-stepbtns { gap: 4px; }
  [data-table] .table-steplab { font-size: 14px; }
  [data-table] .table-zones .pill { font-size: 17px; }
  [data-table] .table-rackbtns .pill { font-size: 15px; }
  [data-table] .table-gobtn { flex: 1 1 100%; }
}

/* display window (?display=1): black board that fills the window */
body.table-display { background: #000; overflow: hidden; }
body.table-display > :not(.table-dsp) { display: none !important; }
.table-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; }
.table-dsp.is-idle { cursor: none; }
.table-dsp-status { text-align: center; color: var(--d-mute); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: min(3vw, 4.5vh); }
.table-dsp-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 2vw; align-items: stretch; }
.table-dsp-side { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1vh; }
.table-dsp-bar { width: 100%; height: max(10px, 2.2vh); border-radius: 999px; background: var(--tc); }
.table-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; }
.table-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); }
.table-dsp-score[data-len="3"] { font-size: min(19vw, 40vh); }
.table-dsp-score[data-len="4"], .table-dsp-score[data-len="5"] { font-size: min(14vw, 34vh); }
.table-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; }
.table-dsp-stats b { color: var(--d-ink); font-weight: 800; font-size: 1.3em; margin-left: .3em; }
.table-dsp-tag { background: var(--d-ink); color: #000; border-radius: 999px; padding: .15em .7em; font-weight: 800; }
.table-dsp-tag.table-dsp-win { background: #04844a; color: #fff; }
.table-dsp-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; min-width: 12vw; }
.table-dsp-plabel { color: var(--d-mute); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; font-size: min(3vw, 4.5vh); }
.table-dsp-pnum { font-weight: 800; line-height: 1; font-size: min(11vw, 16vh); letter-spacing: -0.03em; white-space: nowrap; }
.table-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); }
.table-dsp.is-idle .table-dsp-ui { opacity: 0; pointer-events: none; }
.table-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; }
.table-dsp-btn:hover { background: #2e2e2e; }
.table-dsp-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-aspect-ratio: 1/1) {
  .table-dsp-main { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; }
  .table-dsp-mid { grid-column: 1 / -1; grid-row: 1; flex-direction: row; gap: 3vw; }
  .table-dsp-score { font-size: min(34vw, 40vh); }
}
