/* The scoreboard (public/anzeigetafel.js), in the app and on the website: both define the colours used here
   (--card, --field, --line, --ink, --muted, --brand). Each field is filled with its team's colour (--team) and its
   text in --on-team, dark or white, whichever stands out more. */
.sb { display: grid; gap: 14px; }
.sb p, .sb h3 { margin: 0; }
.sb-clock { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px; }
.sb-time { font-size: clamp(2.8rem, 13vw, 5rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.sb-time.over { color: #c62828; }
.sb-clock-btns, .sb-btns, .sb-tools, .sb-modes, .sb-live-btns { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.sb-badge { padding: 4px 12px; border-radius: 99px; background: var(--field); border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.sb-badge[data-status="offline"], .sb-badge[data-status="missing"] { border-color: #c62828; color: #c62828; }

/* the fields: two side by side, or four as 2 × 2 */
.sb-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sb-field { display: grid; gap: 8px; justify-items: center; align-content: start; min-width: 0; padding: 12px; border-radius: 16px;
  background: var(--team, var(--brand)); color: var(--on-team, #fff); box-shadow: inset 0 0 0 1px rgba(128, 128, 128, .45); } /* the ring: a white field shows on white */
.sb-field[hidden] { display: none; }
.sb .sb-name { width: 100%; box-sizing: border-box; min-height: 0; padding: 6px; border: 1px solid transparent; border-radius: 10px; background: transparent;
  color: inherit; font: inherit; font-size: 1.2rem; font-weight: 700; text-align: center; }
.sb .sb-name:hover, .sb .sb-name:focus { border-color: currentColor; }
.sb .sb-score { width: 100%; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none; color: inherit; cursor: pointer;
  font: inherit; font-size: clamp(5rem, 26vw, 10rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.sb-four .sb-score { font-size: clamp(3.6rem, 17vw, 7rem); }
.sb .sb-btns .btn { min-width: 48px; min-height: 40px; padding: 6px 12px; }
.sb-color::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 50%; background: var(--team); box-shadow: 0 0 0 1px rgba(128, 128, 128, .7); vertical-align: -1px; }
/* the colours to choose from, under the field's buttons */
.sb-swatches { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px; border-radius: 12px; background: var(--card); }
.sb-swatches[hidden] { display: none; }
.sb .sb-swatch { width: 36px; height: 36px; min-height: 0; padding: 0; border: 2px solid var(--line); border-radius: 50%; cursor: pointer; }
.sb .sb-swatch.on { outline: 3px solid var(--brand); outline-offset: 2px; }

/* the settings: 2 or 4 fields, the match time, live */
.sb-mode.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.sb-mode-icon { display: inline-grid; grid-template-columns: repeat(2, 7px); gap: 2px; margin-right: 6px; vertical-align: middle; }
.sb-mode-icon i { display: block; width: 7px; height: 7px; border-radius: 2px; background: currentColor; }
.sb-mode-2 i { height: 16px; }
.sb-time-set { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .95rem; }
.sb-time-set input { width: 64px; min-height: 40px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; text-align: center; }
[data-act="live"].on { border-color: var(--brand); color: var(--brand); }
.sb-live { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 16px; border-radius: 16px; background: var(--field); border: 1px solid var(--line); }
.sb-live[hidden] { display: none; }
.sb-live-code { font-size: 1.6rem; font-weight: 800; letter-spacing: .06em; }
.sb-live-status { font-weight: 600; }
.sb-live-status[data-status="offline"], .sb-live-status[data-status="missing"] { color: #c62828; }
.sb-live-link code { word-break: break-all; font-size: .9rem; }
.sb-live-hint, .sb-live-note { color: var(--muted); font-size: .92rem; max-width: 46ch; }
.sb-join { display: flex; flex-wrap: wrap; align-items: end; justify-content: center; gap: 8px; }
.sb-join label { display: grid; gap: 4px; color: var(--muted); font-size: .92rem; }
.sb-join input { min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
  font: inherit; font-size: 1.2rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-align: center; width: 10ch; }

/* "Groß anzeigen": the clock and the fields fill the screen; the settings stay out, the live code stays in view */
.sb:is(:fullscreen, .big-view) { display: flex; flex-direction: column; gap: 2vh; padding: 24px; border-radius: 0; margin: 0; overflow: auto; background: var(--card); }
.sb:is(:fullscreen, .big-view) :is(.sb-tools, .sb-live, .sb-swatches) { display: none; }
.sb:is(:fullscreen, .big-view) .sb-fields { flex: 1 1 auto; min-height: 0; }
.sb:is(:fullscreen, .big-view) .sb-field { align-content: center; }
.sb:is(:fullscreen, .big-view) .sb-time { font-size: min(14vh, 22vw); }
.sb:is(:fullscreen, .big-view) .sb-name { font-size: 4vh; }
.sb:is(:fullscreen, .big-view) .sb-score { font-size: min(40vh, 34vw); }
.sb-four:is(:fullscreen, .big-view) .sb-time { font-size: min(10vh, 16vw); }
.sb-four:is(:fullscreen, .big-view) .sb-name { font-size: 3vh; }
.sb-four:is(:fullscreen, .big-view) .sb-score { font-size: min(18vh, 17vw); }
.sb-four:is(:fullscreen, .big-view) .sb-field { padding: 8px; gap: 4px; }

@media (max-width: 380px) {
  .sb-field { padding: 8px; }
  .sb-color { font-size: 0; }
  .sb-color::before { margin: 0; }
}
@media print { .sb { display: none; } }
