@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* —— Bowling night UI —— */
.bb-page { max-width: 1200px; margin: 0 auto; padding-bottom: 48px; }
.bb-page--night { padding-bottom: 72px; }

.bb-night-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 8px 0 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #dee2e6;
  backdrop-filter: blur(6px);
}
/* 8 night tabs: 2 rows × 4 */
.bb-night-nav--night {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.bb-night-nav--night .bb-night-tab {
  flex: none;
  min-width: 0;
  width: 100%;
  line-height: 1.15;
  white-space: normal;
}
.bb-night-tab {
  flex: 1 1 calc(14% - 6px);
  min-width: 4.2rem;
  min-height: 44px;
  padding: 10px 6px;
  border: 2px solid #212529;
  border-radius: 10px;
  background: #fff;
  color: #212529;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bb-night-tab.active {
  background: #212529;
  color: #fff;
}
.bb-night-more {
  position: relative;
  flex: 1 1 calc(18% - 6px);
  min-width: 4.2rem;
}
.bb-night-more-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.bb-night-more-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 50;
  min-width: 10rem;
  padding: 6px;
  background: #fff;
  border: 2px solid #212529;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bb-night-more-menu button {
  min-height: 44px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #212529;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.bb-night-more-menu button:hover,
.bb-night-more-menu button.active {
  background: #212529;
  color: #fff;
}
.bb-share-tab-panel {
  max-width: none;
  width: 100%;
}
.bb-share-tab-block {
  margin: 0 0 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #dee2e6;
}
.bb-share-tab-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.bb-share-tab-subhead {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}
.bb-opponent-game-block {
  margin: 0 0 32px;
}
.bb-opponent-game-block:last-of-type {
  margin-bottom: 12px;
}
.bb-opponent-summaries-head,
.bb-brackets-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 16px;
}
.bb-brackets-head {
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 12px;
}
.bb-opponent-summaries-head .bb-toolbar,
.bb-brackets-head .bb-toolbar {
  flex: 0 0 auto;
}
.bb-opponent-table {
  border-collapse: collapse;
  margin: 0;
}
.bb-opponent-table th,
.bb-opponent-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
  line-height: 1.25;
}
.bb-opponent-table thead th {
  border-bottom: 2px solid #ced4da;
}
.bb-opponent-table tbody tr:last-child td {
  border-bottom: none;
}
.bb-opponent-table td:first-child,
.bb-opponent-table th:first-child {
  white-space: nowrap;
  font-weight: 700;
}
.bb-night-heading {
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.bb-night-heading-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #555;
}
.bb-hint--tight { margin-bottom: 10px; }
.bb-night-panel { margin-top: 4px; }
.bb-share-section {
  margin: 0 0 10px;
  border: 1.5px solid #0d6efd;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.bb-share-section-h {
  background: #f5f9ff;
  border-bottom: none;
  padding: 8px 12px;
}
.bb-share-section-h.is-sharing {
  background: #e7f1ff;
}
.bb-share-section-h h2 {
  color: #0d6efd;
  font-size: 1.05rem;
}
.bb-share-section-h span {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0d6efd;
  line-height: 1;
}
.bb-share-panel {
  padding: 10px 12px 12px;
  background: #f5f9ff;
  border-top: 1px solid #cfe2ff;
}
.bb-share-msg {
  margin: 0 0 8px;
  line-height: 1.35;
  font-size: 0.95rem;
}
.bb-share-active {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 16px;
}
.bb-share-active-main {
  flex: 1 1 220px;
  min-width: 0;
}
.bb-share-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 6px;
}
.bb-share-code {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.bb-share-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.bb-share-actions .bb-status {
  margin: 0;
  padding: 6px 10px;
  font-size: 0.9rem;
  white-space: nowrap;
}
.bb-share-link {
  display: inline-block;
  word-break: break-all;
  font-size: 0.85rem;
  line-height: 1.3;
}
.bb-share-qr {
  flex: 0 0 auto;
  width: 148px;
  height: 148px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  background: #fff;
  align-self: flex-start;
}
.bb-share-hint {
  margin: 4px 0 0;
  color: #495057;
  font-size: 0.82rem;
  line-height: 1.35;
}
.bb-share-err { color: #b02a37; font-weight: 600; }
.bb-page--viewer .bb-title-row { display: none; }
.bb-viewer-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #212529;
  color: #fff;
}
.bb-viewer-banner-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}
.bb-viewer-banner-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em 0.65em;
  min-width: 0;
}
.bb-viewer-code {
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 1.15rem;
}
.bb-viewer-night-name {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  opacity: 0.95;
  max-width: min(420px, 55vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bb-viewer-managed {
  font-weight: 500;
  font-size: 0.95rem;
  opacity: 0.88;
  white-space: nowrap;
}
.bb-viewer-status { opacity: 0.85; font-size: 0.92rem; }
.bb-viewer-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.bb-viewer-updated { font-size: 0.85rem; opacity: 0.8; }
.bb-viewer-refresh-btn {
  min-width: 7.5rem;
}
.bb-btn-sm {
  padding: 8px 12px !important;
  min-height: 36px !important;
  font-size: 0.9rem !important;
}
.bb-viewer-enter {
  max-width: 420px;
  margin: 24px auto;
  text-align: center;
}
.bb-viewer-enter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.bb-viewer-code-input {
  width: 10rem;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 12px;
  border: 2px solid #212529;
  border-radius: 10px;
}
.score-scratch-readonly {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  height: 42px;
  padding: 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bb-ncba-progress {
  font-weight: 600;
  font-size: 1rem;
}
.bb-bulk-input {
  width: 100%;
  font-family: monospace;
  padding: 12px;
  font-size: 1rem;
  box-sizing: border-box;
}
.bb-touch-input {
  padding: 10px;
  font-size: 1.05rem;
  min-height: 44px;
  border: 1.5px solid #ced4da;
  border-radius: 8px;
}
.bb-avg-missing,
.bb-field-warn {
  background: #fff8db !important;
  border-color: #e0a800 !important;
  box-shadow: 0 0 0 1px #e0a800;
}
.score-scratch-input.bb-field-warn:focus,
.slot-scr-input.bb-field-warn:focus,
.bb-touch-input.bb-field-warn:focus {
  border-color: #e0a800;
  box-shadow: 0 0 0 3px rgba(224, 168, 0, 0.35);
}
.bb-avg-needed {
  color: #9a7b00;
  font-weight: 700;
}
.payout-person-table .payout-total-row td {
  border-top: 1px solid #ced4da;
  padding-top: 10px;
  font-weight: 800;
  background: #eef2f5;
}
.bb-touch-input--num {
  width: 88px;
  text-align: center;
}

.bb-roster-table td {
  vertical-align: middle;
}
.bb-roster-table .bb-roster-h {
  font-weight: 700;
  line-height: 1;
}

.bb-tabs--sticky {
  position: sticky;
  top: 62px;
  z-index: 30;
  background: rgba(255, 255, 255, 0.96);
  padding: 8px 0 10px;
  margin-top: 0;
  backdrop-filter: blur(6px);
}
/* Viewer: bracket pills left, Export PDF flush right on the same row */
.bb-viewer-brackets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  width: 100%;
  margin: 0 0 20px;
  box-sizing: border-box;
}
.bb-viewer-brackets-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bb-viewer-brackets-export {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.bb-title-block {
  margin-bottom: 10px;
}
.bb-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.bb-app-title {
  margin: 0;
  flex: 0 0 auto;
}
.bb-night-banner {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #212529;
  line-height: 1.3;
}
.bb-autosave-banner {
  margin: 6px 0 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: #6c757d;
  line-height: 1.35;
  max-width: 44rem;
}
.bb-title-account {
  position: relative;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.bb-title-row .bb-login-btn {
  align-self: center;
}
.bb-account-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 15rem;
  padding: 6px;
  background: #fff;
  border: 2px solid #212529;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.bb-account-email-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bb-account-field {
  display: block;
  margin: 0;
}
.bb-account-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background: #fff;
  color: #212529;
  font: inherit;
  font-size: 0.9rem;
}
.bb-account-input:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 1px;
  border-color: #0d6efd;
}
.bb-account-input:disabled {
  opacity: 0.6;
}
.bb-account-menu-divider {
  height: 1px;
  margin: 4px 6px;
  background: #dee2e6;
}
.bb-account-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #212529;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.bb-account-menu-item--primary {
  background: #0d6efd;
  color: #fff;
  text-align: center;
}
.bb-account-menu-item--primary:hover,
.bb-account-menu-item--primary:focus-visible {
  background: #0b5ed7;
  color: #fff;
}
.bb-account-menu-item--quiet {
  font-weight: 500;
  font-size: 0.85rem;
  color: #6c757d;
  text-align: center;
  padding-top: 6px;
  padding-bottom: 6px;
}
.bb-account-menu-item:hover,
.bb-account-menu-item:focus-visible {
  background: #e9ecef;
  outline: none;
}
.bb-account-menu-item:disabled {
  opacity: 0.6;
  cursor: wait;
}
.bb-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.bb-account-menu-hint {
  margin: 0;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #6c757d;
  line-height: 1.35;
}
.bb-account-menu-status {
  margin: 4px 6px 2px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #d4edda;
  color: #155724;
  font-size: 0.8rem;
}
.bb-account-menu-status.err {
  background: #f8d7da;
  color: #721c24;
}
.bb-admin-link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.85rem;
  color: #6c757d;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.bb-admin-link:hover {
  color: #495057;
}
.bb-account-form,
.bb-account-named {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
}
.bb-account-form label,
.bb-account-named label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #495057;
  min-width: 140px;
  flex: 1 1 160px;
}
.bb-account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.bb-account-named select.bb-touch-input {
  min-height: 42px;
}
/* Must beat .player-picker { margin: 0 0 16px } (declared later) or Open sits low. */
.player-picker.bb-open-night-picker {
  margin: 0;
  width: 100%;
}
.bb-open-night-label {
  flex: 1 1 160px;
  min-width: 140px;
}
.bb-saved-nights-toolbar {
  justify-content: flex-start;
}
.bb-saved-nights-wrap {
  width: 100%;
  overflow-x: auto;
}
.bb-saved-nights-table {
  width: 100%;
  min-width: 780px;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.95rem;
}
.bb-saved-nights-table th,
.bb-saved-nights-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
  vertical-align: middle;
}
.bb-saved-nights-table thead th {
  font-size: 0.82rem;
  color: #495057;
  font-weight: 700;
  white-space: nowrap;
  background: #fff;
}
.bb-saved-nights-check-col {
  width: 44px;
  text-align: center !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}
.bb-saved-night-check {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  accent-color: #0d6efd;
  vertical-align: middle;
}
.bb-saved-nights-table th:nth-child(2),
.bb-saved-nights-table td:nth-child(2) {
  width: 30%;
}
.bb-saved-nights-table th:nth-child(3),
.bb-saved-nights-table td:nth-child(3),
.bb-saved-nights-table th:nth-child(4),
.bb-saved-nights-table td:nth-child(4) {
  width: 20%;
}
.bb-sort-th {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.bb-sort-th:hover {
  color: #0d6efd;
}
.bb-saved-night-name {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.bb-saved-night-time {
  white-space: nowrap;
  color: #495057;
  font-variant-numeric: tabular-nums;
}
.bb-saved-nights-actions-col {
  width: 22%;
  white-space: nowrap;
}
/* Flex lives on an inner div — never on <td> (breaks table background paint). */
.bb-saved-nights-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  line-height: 1;
}
.bb-saved-nights-actions .bb-btn {
  margin: 0;
  flex: 0 0 auto;
}
/* Active night: same background on every cell so the wash is one flat band. */
.bb-saved-nights-table tbody tr.is-active-night > td {
  background-color: #e8f1ff;
}
.bb-saved-nights-table tbody tr.is-active-night .bb-saved-night-name {
  background-color: #e8f1ff;
  border-color: #b6d0f7;
}
.bb-hint { color: #555; margin: 0 0 16px; }
.bb-bye-fill-hint {
  color: #1a1a1a;
  font-weight: 600;
}
.bb-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0 28px; }
.bb-btn { padding: 12px 18px; border: none; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; color: #fff; }
.bb-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.bb-btn-green { background: #28a745; }
.bb-btn-blue { background: #0d6efd; }
.bb-btn-red { background: #dc3545; }
.bb-btn-gray { background: #6c757d; }
.bb-btn-dark { background: #212529; }
.bb-btn.bb-ncba-fetch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bb-ncba-fetch__sizer {
  visibility: hidden;
  white-space: nowrap;
  pointer-events: none;
}
.bb-ncba-fetch__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: inherit;
}
.bb-page-toast {
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: 6px;
  background: #d4edda;
  color: #155724;
  font-size: 0.95rem;
}
.bb-generate-toolbar {
  align-items: center;
}
.bb-generate-toolbar .bb-status {
  margin: 0;
  flex: 1 1 auto;
  min-width: 12rem;
}
.bb-status { padding: 8px 14px; border-radius: 6px; background: #d4edda; color: #155724; font-size: 0.95rem; }
.bb-status.warn { background: #fff3cd; color: #856404; }
.bb-status.err {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c2c7;
}
.bb-bulk-error {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 12px 14px;
}

.bb-section { margin-bottom: 28px; border: 1px solid #dee2e6; border-radius: 10px; overflow: hidden; background: #fff; }
.bb-section-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #f8f9fa; cursor: pointer; user-select: none; }
.bb-section-h h2 { margin: 0; font-size: 1.25rem; }
.bb-section-b { padding: 16px; }
.bb-sort-th {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.bb-sort-th:hover { color: #0d6efd; }
.bb-sort-th.active { color: #0d6efd; }
.bb-sort-mark {
  font-size: 0.85em;
  opacity: 0.55;
  min-width: 1em;
}
.bb-sort-th.active .bb-sort-mark { opacity: 1; }

.bb-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.bb-tab { padding: 10px 16px; border-radius: 999px; border: 2px solid #0d6efd; background: #fff; color: #0d6efd; font-weight: 600; cursor: pointer; }
.bb-tab.active { background: #0d6efd; color: #fff; }
.game-with-h {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #555;
  white-space: nowrap;
}

.live-bracket-title { margin: 0; }
.live-bracket-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 16px;
}

/* —— Sideways pyramid (desktop / tablet landscape) ——
   Three equal columns so Game 3 does not soak up leftover width alone. */
.bracket-tree--wide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 14px;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  padding: 4px 0 12px;
}
.bracket-tree--wide .round-1 .match-card,
.bracket-tree--wide .round-2 .match-card,
.bracket-tree--wide .round-3 .match-card {
  width: 100%;
  min-width: 0;
}
/* Wrap long names rather than ellipsis when a column is still wide enough. */
.bracket-tree--wide .slot-name .slot-write {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.bracket-tree--skinny {
  display: none;
}
.bracket-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.round-1 {
  justify-content: space-between;
  gap: 10px;
}
.round-2 {
  justify-content: space-around;
  gap: 24px;
  padding: 8% 0;
}
.round-3 {
  justify-content: center;
}
.match-slot {
  position: relative;
  min-width: 0;
}

/* Connector stubs (sideways) — simple rails into the next round */
.round-1 .match-slot::after,
.round-2 .match-slot::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  width: 14px;
  height: 2px;
  background: #ced4da;
  transform: translateY(-50%);
  pointer-events: none;
}
.round-1 .match-slot:nth-child(odd)::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  width: 2px;
  height: calc(100% + 10px);
  background: #ced4da;
  pointer-events: none;
}
.round-2 .match-slot:first-child::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  width: 2px;
  height: 40%;
  background: #ced4da;
  pointer-events: none;
}
.round-2 .match-slot:last-child::before {
  content: "";
  position: absolute;
  bottom: 50%;
  right: -14px;
  width: 2px;
  height: 40%;
  background: #ced4da;
  pointer-events: none;
}

.bracket-legend {
  margin: -8px 0 12px;
  font-size: 0.78rem;
  color: #6c757d;
}

.match-card {
  background: #fff;
  border: 1.5px solid #ced4da;
  border-radius: 8px;
  padding: 8px 10px 10px;
  box-shadow: none;
  width: 100%;
  box-sizing: border-box;
}
.match-card.ready { border-color: #0d6efd; }
.match-card.done { border-color: #28a745; background: #f7fcf8; }
.match-card.tied { border-color: #0d6efd; background: #f5f9ff; }
.match-card.waiting { opacity: 0.75; border-style: dashed; }
.match-card .round-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6c757d;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tie-info {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 1.5px solid #0d6efd;
  background: #fff;
  color: #0d6efd;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: help;
  line-height: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tie-info:focus,
.tie-info:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}
.tie-info-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: max-content;
  max-width: min(280px, 72vw);
  padding: 8px 10px;
  border-radius: 8px;
  background: #212529;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.bb-title-row .tie-info-bubble {
  left: auto;
  right: 0;
  transform: none;
}
.tie-info:hover .tie-info-bubble,
.tie-info:focus .tie-info-bubble,
.tie-info:focus-visible .tie-info-bubble {
  opacity: 1;
  visibility: visible;
}

/* Shared column tracks for header + every player row inside a card. */
.match-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.15rem 2.35rem;
  column-gap: 4px;
  row-gap: 4px;
  align-items: end;
  width: 100%;
  box-sizing: border-box;
}
.match-card-body.with-h {
  grid-template-columns: minmax(0, 1fr) 1.55rem 2.15rem 2.35rem;
}
.match-card-body.with-series {
  grid-template-columns: minmax(0, 1fr) 2.15rem 2.35rem 2.5rem;
}
.match-card-body.with-h.with-series {
  grid-template-columns: minmax(0, 1fr) 1.55rem 2.15rem 2.35rem 2.5rem;
}
.slot-head,
.player-slot {
  display: contents;
}
.slot-head > .slot-h-name,
.slot-head > .slot-h-h,
.slot-head > .slot-h-scr,
.slot-head > .slot-h-tot,
.slot-head > .slot-h-series {
  font-size: 0.58rem;
  font-weight: 600;
  color: #8a9199;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.2;
}
.slot-h-name { min-width: 0; }
.slot-h-h,
.slot-h-scr,
.slot-h-tot,
.slot-h-series {
  white-space: nowrap;
  text-align: center;
  justify-self: stretch;
  width: 100%;
  box-sizing: border-box;
}

.player-slot > .slot-name,
.player-slot > .slot-h,
.player-slot > .slot-scr,
.player-slot > .slot-tot,
.player-slot > .slot-series {
  font-weight: 700;
  font-size: 0.82rem;
  color: #212529;
}
.player-slot.winner > .slot-name,
.player-slot.winner > .slot-h,
.player-slot.winner > .slot-scr,
.player-slot.winner > .slot-tot,
.player-slot.winner > .slot-series { color: #198754; }
.player-slot.tied > .slot-name,
.player-slot.tied > .slot-h,
.player-slot.tied > .slot-scr,
.player-slot.tied > .slot-tot,
.player-slot.tied > .slot-series { color: #0d6efd; }
.player-slot.loser > .slot-name,
.player-slot.loser > .slot-h,
.player-slot.loser > .slot-scr,
.player-slot.loser > .slot-tot,
.player-slot.loser > .slot-series { color: #dc3545; }
.player-slot.tbd > .slot-name,
.player-slot.tbd > .slot-h,
.player-slot.tbd > .slot-scr,
.player-slot.tbd > .slot-tot,
.player-slot.tbd > .slot-series {
  color: #495057;
  font-weight: 600;
}

.slot-name {
  min-width: 0;
}
.slot-h,
.slot-scr,
.slot-tot,
.slot-series {
  justify-self: stretch;
  width: 100%;
  min-width: 0;
}

.slot-write {
  display: block;
  min-height: 1.15em;
  padding: 0 1px 1px;
  border-bottom: 1.5px solid #343a40;
  white-space: nowrap;
  line-height: 1.25;
}
.slot-name .slot-write {
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-slot.waiting .slot-write,
.match-card.waiting .slot-write {
  border-bottom-color: #adb5bd;
}
.slot-h .slot-write,
.slot-scr .slot-write,
.slot-tot .slot-write,
.slot-series .slot-write {
  overflow: visible;
  text-overflow: clip;
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 100%;
  box-sizing: border-box;
  padding: 0 1px 1px;
}
.slot-scr-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 1.35em;
  padding: 0 1px 1px;
  border: none;
  border-bottom: 1.5px solid #0d6efd;
  background: #f0f7ff;
  text-align: center;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: inherit;
  -moz-appearance: textfield;
}
.slot-scr-input::-webkit-outer-spin-button,
.slot-scr-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* legacy class kept for any leftover markup */
.match-card .player-line {
  font-weight: 700;
  font-size: 0.98rem;
  padding: 4px 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.match-card .player-line.winner { color: #198754; }
.match-card .player-line.tied { color: #0d6efd; }
.match-card .player-line.loser { color: #dc3545; }
.match-card .player-line.tbd { color: #212529; }

.champ-banner.split {
  background: linear-gradient(90deg, #e7f1ff, #d4edda);
  border-color: #0d6efd;
}

/* —— Players tab —— */
.player-panel { max-width: 640px; }
.player-picker-label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 6px;
}
.player-picker {
  position: relative;
  margin: 0 0 16px;
}
.player-picker-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid #212529;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
}
.player-picker-input.has-clear {
  padding-right: 52px;
}
.player-picker-input:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}
.player-picker-clear {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #495057;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.player-picker-clear:hover,
.player-picker-clear:focus-visible {
  background: #e9ecef;
  color: #212529;
  outline: none;
}
.player-picker-clear:focus-visible {
  box-shadow: 0 0 0 2px #0d6efd;
}
.player-picker-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 6px 0;
  list-style: none;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 2px solid #212529;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.player-picker-empty {
  padding: 12px 14px;
  color: #6c757d;
  font-size: 0.95rem;
}
.player-picker-option {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 12px 14px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  color: #212529;
}
.player-picker-option:hover,
.player-picker-option:focus {
  background: #e9ecef;
  outline: none;
}
.player-picker-option.is-selected {
  background: #212529;
  color: #fff;
}
.player-panel-hint {
  margin: 8px 0 0;
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.4;
}
.player-overview {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1.5px solid #dee2e6;
  border-radius: 10px;
  background: #f8f9fa;
}
.player-overview-name {
  margin: 0 0 4px;
  font-size: 1.35rem;
}
.player-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.player-night-scores {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid #dee2e6;
}
.player-night-scores-h {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
  margin-bottom: 4px;
}
.player-night-scores-hint {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.35;
}
.player-night-scores-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.player-night-score-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #495057;
  min-width: 5.5rem;
}
.player-night-score-input {
  width: 5.5rem !important;
  min-height: 44px;
}
.player-night-score-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #212529;
  line-height: 1.3;
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
  min-height: 0;
}
.player-night-scores.is-readonly .player-night-scores-row {
  gap: 16px 28px;
}
.player-night-scores.is-readonly .player-night-score-field {
  min-width: 0;
}
.player-match-scores-edit {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.player-match-score-input {
  width: 4.5rem !important;
  min-height: 40px;
  padding: 6px 8px !important;
}
.player-payouts {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #dee2e6;
}
.player-payouts-h {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
  margin-bottom: 6px;
}
.player-payouts-empty {
  margin: 0;
  font-size: 0.9rem;
  color: #6c757d;
}
.player-payouts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.player-payouts-list li,
.player-payouts-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 3px 0;
}
.player-payouts-total {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #dee2e6;
  font-weight: 800;
}
.player-payouts-amt {
  font-variant-numeric: tabular-nums;
}
.player-bracket-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.player-bracket-card {
  border: 1.5px solid #ced4da;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
}
.player-bracket-card.status-champion,
.player-bracket-card.status-split {
  border-color: #28a745;
  background: #f4fff6;
}
.player-bracket-card.status-2nd-place {
  border-color: #e0a800;
  background: #fffbeb;
}
.player-bracket-card.status-eliminated {
  border-color: #dc3545;
  background: #fff8f8;
}
.player-bracket-card.status-playing {
  border-color: #0d6efd;
}
.player-bracket-card-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.player-bracket-num {
  font-weight: 800;
  font-size: 1.05rem;
}
.player-bracket-status {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c757d;
}
.player-bracket-card.status-champion .player-bracket-status,
.player-bracket-card.status-split .player-bracket-status { color: #198754; }
.player-bracket-card.status-2nd-place .player-bracket-status { color: #b8860b; }
.player-bracket-card.status-eliminated .player-bracket-status { color: #b02a37; }
.player-bracket-card.status-playing .player-bracket-status { color: #0d6efd; }
.player-bracket-summary {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.4;
}
.player-bracket-opps {
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.35;
}
.player-match-scores {
  list-style: none;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #dee2e6;
}
.player-bracket-card.status-eliminated .player-match-scores {
  border-color: #f1aeb5;
}
.player-match-scores li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 4px 0;
  font-size: 0.92rem;
  line-height: 1.35;
}
.player-match-scores li + li {
  border-top: 1px solid #e9ecef;
}
.player-bracket-card.status-eliminated .player-match-scores li + li {
  border-top-color: #f8d7da;
}
.player-match-scores-name {
  font-weight: 700;
}
.player-bracket-card.status-eliminated .player-match-scores li.is-you .player-match-scores-name {
  color: #842029;
}
.player-match-scores-vals {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.player-match-scores-h {
  color: #6c757d;
  font-weight: 600;
}
.player-match-scores-vals.muted {
  color: #adb5bd;
}
.player-tip {
  margin: 0 0 6px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.4;
  background: #f1f3f5;
}
.player-tip:last-child { margin-bottom: 0; }
.player-tip.you-need {
  background: #e7f1ff;
  border-left: 3px solid #0d6efd;
}
.player-tip.opp-need {
  background: #fff3cd;
  border-left: 3px solid #e0a800;
}
.player-tip.standing {
  background: #f8f9fa;
  border-left: 3px solid #adb5bd;
}

.payouts-panel { max-width: 980px; }
/* Skinny: rules → people → brackets. Wide: rules + people on top row; brackets under rules. */
.payouts-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.payouts-rules {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.45;
}
.payouts-beside {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.payouts-below {
  display: grid;
  gap: 12px 24px;
  grid-template-columns: 1fr;
}
.payouts-col-h {
  margin: 0 0 10px;
}
.payouts-col-body {
  overflow-x: auto;
}
.payouts-people-block .payout-person-table {
  width: 100%;
}
.payout-person-table thead th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6c757d;
  background: #f1f3f5;
  border-bottom: 2px solid #adb5bd;
  padding: 8px 10px;
  vertical-align: bottom;
}
.payout-person-table thead th:nth-child(2),
.payout-person-table thead th:last-child {
  text-align: right;
}
.payout-person-table tbody td {
  padding: 8px 10px;
  border-top: 1px solid #e9ecef;
}
.payout-person-table { min-width: 300px; }
@media (min-width: 760px) {
  .payouts-layout {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
    grid-template-areas:
      "rules people"
      "beside people"
      "below below";
    gap: 16px 24px;
    align-items: start;
  }
  .payouts-rules-block { grid-area: rules; }
  .payouts-people-block { grid-area: people; }
  .payouts-beside { grid-area: beside; }
  .payouts-below {
    grid-area: below;
    grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  }
}
.payout-bracket {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 0;
  background: #fff;
}
.payout-bracket-h { font-weight: 700; margin-bottom: 8px; }
.payout-bracket-table { font-size: 0.95rem; }
.payout-bracket-table th { font-size: 0.8rem; color: #6c757d; }
.payout-paid-check {
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
}
.payout-paid-check:disabled {
  cursor: default;
  opacity: 0.45;
}
.payout-write-line {
  display: inline-block;
  width: 100%;
  max-width: 160px;
  border-bottom: 1px solid #adb5bd;
  height: 1.1em;
  vertical-align: bottom;
}
.payout-write-line-short {
  width: 72px;
  max-width: 72px;
  min-width: 72px;
}
.payout-blank-name { width: 160px; max-width: 160px; }
.payout-person-table { max-width: 360px; }

.score-sheet {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 10px 12px;
}
.score-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.score-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  background: #fff;
  table-layout: fixed;
}
.score-table th,
.score-table td {
  border: 1px solid #ced4da;
  vertical-align: middle;
  background: #fff;
}
.score-table thead th {
  background: #212529;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px 8px;
  text-align: center;
}
.score-th-name {
  width: 28%;
  text-align: center !important;
}
.score-th-game {
  width: 24%;
}
.score-td-name {
  text-align: center;
  padding: 8px 10px;
}
.score-name-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.score-row-name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  text-align: center;
}
.score-row-sub {
  color: #6c757d;
  font-size: 0.8rem;
  text-align: center;
}
.score-td-scratch {
  text-align: center;
  padding: 6px 4px;
  height: 52px;
}
.score-scratch-input {
  border: 2px solid #adb5bd;
  border-radius: 6px;
  width: 100%;
  max-width: 88px;
  height: 42px;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
}
.score-scratch-input:focus {
  outline: none;
  border-color: #495057;
  box-shadow: 0 0 0 3px rgba(73, 80, 87, 0.2);
}
.score-td-scratch.is-idle,
.score-td-hcp.is-idle {
  opacity: 0.45;
}
.score-td-scratch.is-not-required,
.score-td-hcp.is-not-required {
  background: #f1f3f5;
}
.score-td-scratch.is-not-required .score-scratch-input {
  border-color: #ced4da;
  border-style: dashed;
  background: #e9ecef;
  color: #868e96;
}
.score-td-scratch.is-not-required .score-scratch-input:focus {
  border-color: #adb5bd;
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(173, 181, 189, 0.35);
}
.score-td-hcp.is-not-required .score-hcp-value {
  color: #adb5bd;
}
.score-td-hcp {
  text-align: center;
  padding: 6px 4px;
  height: 40px;
  font-variant-numeric: tabular-nums;
}
.score-hcp-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #212529;
}
.score-hcp-empty {
  color: #adb5bd;
  font-weight: 600;
}
.score-idle-mark {
  display: inline-block;
  min-width: 48px;
  text-align: center;
  color: #adb5bd;
  font-size: 1.15rem;
  font-weight: 600;
}
/* Separate bowlers visually */
.score-hcp-row + .score-scratch-row td {
  border-top: 2px solid #868e96;
}
.score-hcp-row + .score-scratch-row .score-td-name {
  border-top: 2px solid #868e96;
}

/* Confirm dialog */
.bb-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.bb-confirm {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  padding: 18px 16px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.bb-confirm-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
}
.bb-confirm-msg {
  margin: 0 0 16px;
  color: #495057;
  font-size: 1rem;
  line-height: 1.4;
}
.bb-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
/* Keep handicap note as normal inline text (flex+gap used to lift <code> and space the period). */
.bb-handicap-line {
  display: block;
}
.bb-hint code {
  font-size: 0.95em;
  padding: 0;
  margin: 0;
  line-height: inherit;
  vertical-align: baseline;
}
.bb-handicap-params-btn {
  padding: 6px 12px;
  font-size: 0.9rem;
  min-height: 36px;
}
.bb-handicap-dialog {
  max-width: 420px;
}
.bb-payout-dialog {
  max-width: 480px;
}
.bb-name-prompt-dialog {
  max-width: 420px;
}
.bb-name-prompt-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: #212529;
}
.bb-name-prompt-input {
  width: 100%;
  box-sizing: border-box;
}
.bb-payout-table-wrap {
  overflow-x: auto;
}
.bb-payout-amounts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.bb-payout-amounts-table th,
.bb-payout-amounts-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e9ecef;
  text-align: left;
  vertical-align: middle;
}
.bb-payout-amounts-table thead th {
  font-size: 0.82rem;
  color: #495057;
  font-weight: 700;
  white-space: nowrap;
}
.bb-payout-money {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}
.bb-payout-num {
  width: 88px;
  text-align: right;
  padding: 6px 8px;
  min-height: 40px;
  font-size: 1.05rem;
  font-weight: 700;
}
.bb-handicap-formula-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #212529;
}
.bb-handicap-num {
  width: 88px;
  text-align: center;
  padding: 6px 8px;
  min-height: 40px;
  font-size: 1.05rem;
  font-weight: 700;
}
.bb-confirm-actions .bb-btn {
  min-height: 48px;
  width: 100%;
}
@media (min-width: 520px) {
  .bb-confirm-backdrop {
    align-items: center;
  }
}

.champ-banner {
  margin: 0;
  padding: 8px 14px;
  background: linear-gradient(90deg, #fff3cd, #d4edda);
  border: 2px solid #28a745;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}

/* —— Downward pyramid when screen is too skinny —— */
@media (max-width: 720px) {
  .bb-page { padding-left: 8px; padding-right: 8px; }
  .bb-title-row h1 { font-size: 1.35rem; }
  .bb-night-tab { font-size: 0.8rem; padding: 10px 4px; min-height: 48px; min-width: 3.6rem; }
  .bb-tabs--sticky { top: 66px; }
  .bb-tab { padding: 12px 14px; font-size: 0.95rem; min-height: 44px; }
  .bb-btn { padding: 14px 16px; font-size: 1.05rem; min-height: 48px; }
  .score-sheet { padding: 8px; }
  .score-table { min-width: 420px; }
  .score-table thead th { font-size: 0.82rem; padding: 8px 4px; }
  .score-row-name { font-size: 0.95rem; }
  .score-scratch-input {
    max-width: 72px;
    height: 40px;
    font-size: 1.15rem;
  }
  .score-hcp-value { font-size: 1.05rem; }
  .game-with-h { font-size: 0.68rem; }

  .bracket-tree--wide {
    display: none !important;
  }
  .bracket-tree--skinny {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
    width: 100%;
  }

  /* Hide desktop sideways connectors */
  .round-1 .match-slot::before,
  .round-1 .match-slot::after,
  .round-2 .match-slot::before,
  .round-2 .match-slot::after {
    display: none !important;
  }

  .bracket-col.round-1,
  .bracket-col.round-2,
  .bracket-col.round-3 {
    display: grid;
    width: 100%;
    padding: 0;
    gap: 10px;
    margin: 0;
    box-sizing: border-box;
  }

  /* Game 1: two pairs side by side (full width) */
  .bracket-col.round-1 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .round-1 .match-slot:nth-child(1) { grid-column: 1; grid-row: 1; }
  .round-1 .match-slot:nth-child(2) { grid-column: 1; grid-row: 2; }
  .round-1 .match-slot:nth-child(3) { grid-column: 2; grid-row: 1; }
  .round-1 .match-slot:nth-child(4) { grid-column: 2; grid-row: 2; }

  /* Drops centered on each Game 1 column → into Game 2 */
  .bracket-connect.connect-12 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: 18px;
    flex-shrink: 0;
  }
  .bracket-connect.connect-12::before,
  .bracket-connect.connect-12::after {
    content: "";
    justify-self: center;
    width: 2px;
    height: 100%;
    background: #ced4da;
  }

  /* Game 2: same 2 columns as Game 1; cards narrower & centered in each column */
  .bracket-col.round-2 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .bracket-col.round-2 .match-slot {
    display: flex;
    justify-content: center;
  }
  .bracket-col.round-2 .match-card {
    width: 86%;
  }

  /* Game 3 on top: stem down from final to bar above semis */
  .bracket-connect.connect-23 {
    display: block;
    position: relative;
    width: 100%;
    height: 28px;
    flex-shrink: 0;
  }
  .bracket-connect.connect-23::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 2px;
    background: #ced4da;
  }
  .bracket-connect.connect-23::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #ced4da;
    transform: translateX(-50%);
  }

  /* Game 3: centered at top of stack */
  .bracket-col.round-3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }
  .bracket-col.round-3 .match-slot {
    width: 43%;
    max-width: 280px;
    margin: 0 auto;
  }

  .match-card {
    padding: 4px 6px 6px 6px;
  }
  .match-card .round-tag { font-size: 0.65rem; margin-bottom: 2px; }
  .match-card-body { column-gap: 2px; row-gap: 2px; }
  .match-card-body.with-h {
    grid-template-columns: minmax(0, 1fr) 1.4rem 1.95rem 2.15rem;
  }
  .match-card-body.with-series {
    grid-template-columns: minmax(0, 1fr) 1.95rem 2.15rem 2.3rem;
  }
  .match-card-body.with-h.with-series {
    grid-template-columns: minmax(0, 1fr) 1.4rem 1.95rem 2.15rem 2.3rem;
  }
  .slot-head > .slot-h-name,
  .slot-head > .slot-h-h,
  .slot-head > .slot-h-scr,
  .slot-head > .slot-h-tot,
  .slot-head > .slot-h-series { font-size: 0.52rem; }
  .player-slot > .slot-name,
  .player-slot > .slot-h,
  .player-slot > .slot-scr,
  .player-slot > .slot-tot,
  .player-slot > .slot-series { font-size: 0.72rem; }
  .match-card .player-line { font-size: 0.72rem; padding: 2px 0; }

  .champ-banner { font-size: 1.05rem; padding: 12px; }
}

@media (max-width: 420px) {
  .bracket-col.round-1 {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    gap: 10px;
  }
  .round-1 .match-slot:nth-child(1),
  .round-1 .match-slot:nth-child(2),
  .round-1 .match-slot:nth-child(3),
  .round-1 .match-slot:nth-child(4) {
    grid-column: 1;
    grid-row: auto;
  }

  .bracket-connect.connect-12 {
    display: block;
    width: 2px;
    height: 14px;
    margin: 0 auto;
    background: #ced4da;
  }
  .bracket-connect.connect-12::before,
  .bracket-connect.connect-12::after {
    display: none;
  }

  .bracket-col.round-2 {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
  }
  .bracket-col.round-2 .match-slot {
    width: 90%;
  }
  .bracket-col.round-2 .match-card {
    width: 100%;
  }

  .bracket-connect.connect-23 {
    width: 2px;
    height: 18px;
    margin: 0 auto;
    background: #ced4da;
  }
  .bracket-connect.connect-23::before,
  .bracket-connect.connect-23::after {
    display: none;
  }

  .bracket-col.round-3 .match-slot {
    width: 78%;
    max-width: none;
  }
}

/* Desktop: sideways connectors unused on the wide tree */
@media (min-width: 721px) {
  .bracket-tree--wide .bracket-connect { display: none; }
}

@media print {
  .bb-toolbar, .bb-section-h { break-inside: avoid; }
  .bb-btn, .no-print { display: none !important; }
}

/* —— NCBA OCR average import review —— */
.ncba-review {
  border: 1.5px solid #ced4da;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 0 0 16px;
  background: #f8f9fa;
}
.ncba-review-table th {
  font-size: 0.85rem;
  white-space: nowrap;
}
.ncba-review-table td {
  vertical-align: middle;
  font-size: 0.92rem;
}
.ncba-row-matched { background: #f4fff7; }
.ncba-row-ambiguous { background: #fff8e6; }
.ncba-row-notfound { background: #fff; color: #6c757d; }
