.omb-mode-corner {
  position: relative;
  z-index: 2100;
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  height: 25px;
  padding: 2px 7px 0;
  pointer-events: none;
}

.omb-mode-corner button {
  min-height: 21px;
  padding: 2px 7px;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  background: rgba(255, 255, 255, .92);
  color: #475569;
  font: 700 10px/1 system-ui, sans-serif;
  cursor: pointer;
  opacity: .82;
  pointer-events: auto;
}

.omb-mode-corner button:hover,
.omb-mode-corner button[aria-pressed="true"] {
  border-color: #1e3a8a;
  background: #1e3a8a;
  color: #fff;
  opacity: 1;
}

.omb-song-toggle {
  min-width: 54px;
  min-height: 18px;
  padding: 2px 5px;
  border: 1px solid #64748b;
  border-radius: 4px;
  background: #e2e8f0;
  color: #334155;
  font: 800 8px/1 system-ui, sans-serif;
  cursor: pointer;
  vertical-align: middle;
}

.omb-song-toggle-cell {
  padding: 1px !important;
  white-space: nowrap;
}

.omb-song-toggle[aria-pressed="true"] {
  border-color: #166534;
  background: #dcfce7;
  color: #166534;
}

.omb-intro-hidden .match-book-table .intro-cell {
  display: none !important;
}

/* Keep the sticky scoring bar and table header joined as one solid surface. */
#draggable {
  z-index: 30 !important;
  box-sizing: border-box;
  background: var(--sticky-bg, #fff);
  border: 1px solid color-mix(in srgb, var(--grid, #124de9) 32%, transparent);
  border-radius: 10px;
  box-shadow: 0 7px 18px rgba(15, 23, 42, .13);
  background-clip: padding-box;
}

.match-book-table > thead.sticky {
  top: var(--omb-sticky-header-top, 143px) !important;
  z-index: 29 !important;
  background: var(--sticky-bg, #fff);
  box-shadow: 0 7px 16px rgba(15, 23, 42, .12);
}

.match-book-table > thead.sticky th {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--blue-1, #c9d4ff) 78%, #fff 22%) 0%,
    var(--blue-3, #9cb1f9) 100%
  );
  background-clip: padding-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .42);
}

.match-book-table > thead.sticky tr:first-child th:first-child {
  border-top-left-radius: 9px;
}

.match-book-table > thead.sticky tr:first-child th:last-child,
.omb-intro-hidden .match-book-table > thead.sticky tr:first-child th:nth-last-child(2) {
  border-top-right-radius: 9px;
}

#draggable .btn,
#draggable #saveMatchBook,
#draggable #undoButton {
  border-radius: 8px !important;
}

#draggable #total-home-score {
  border-radius: 9px 0 0 9px;
}

#draggable #total-away-score {
  border-radius: 0 9px 9px 0;
}

#draggable .btn:focus-visible,
#draggable #saveMatchBook:focus-visible,
#draggable #undoButton:focus-visible,
.omb-mode-corner button:focus-visible,
.omb-song-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus, #7aa7ff) 72%, #fff 28%);
  outline-offset: 2px;
}

#draggable .omb-dyn-action-cell {
  display: none;
  padding: 1px 2px;
  border: 0;
  background: var(--sticky-bg, #fff);
  vertical-align: middle;
}

#draggable.omb-dynamic-mode .tBtn {
  display: none !important;
}

#draggable.omb-dynamic-mode .omb-dyn-action-cell {
  display: table-cell;
}

.omb-dyn-split-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  padding: 1px;
  box-sizing: border-box;
}

.omb-dyn-button-bank {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: stretch;
  min-width: 0;
}

.omb-dyn-action-cell .btn {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 13px;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .12s ease, filter .16s ease;
}

.omb-dyn-action-cell .btn:hover {
  filter: saturate(1.04) brightness(1.025);
}

#draggable.omb-dynamic-mode .omb-dyn-button-bank.home .btn {
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--home-fill, #d4edda) 55%, #fff 45%) 0%,
    var(--home-fill, #d4edda) 55%,
    color-mix(in srgb, var(--home-fill, #d4edda) 75%, #000 0%) 100%
  );
}

#draggable.omb-dynamic-mode .omb-dyn-button-bank.away .btn {
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--away-fill, #f8d7da) 55%, #fff 45%) 0%,
    var(--away-fill, #f8d7da) 55%,
    color-mix(in srgb, var(--away-fill, #f8d7da) 75%, #000 0%) 100%
  );
}

html[data-theme="dark"] .omb-mode-corner button {
  background: #151922;
  color: #e6e6e6;
}

html[data-theme="dark"] .omb-mode-corner button[aria-pressed="true"] {
  background: #2f44a6;
}

html[data-theme="dark"] #draggable,
html[data-theme="dark"] .match-book-table > thead.sticky {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .34);
}

@media (max-width: 850px) {
  .omb-dyn-split-row {
    gap: 3px;
  }

  .omb-dyn-button-bank {
    gap: 2px;
  }

  .omb-dyn-action-cell .btn {
    min-height: 29px;
    padding: 3px 2px;
    font-size: 10px;
  }
}
