/* ============================================================================
 * OVERRIDE DARK THEME FROM PARENT CONTAINERS (e.g., scoremgmt jumbotron)
 * The jumbotron in scoremgmt.html has inline styles: color: #f4dbaa; background-color: #3d3d3d;
 * This ONLY applies to supported game types: singles_standard_gameplay and teams_standard_gameplay
 * Legacy game types are NOT affected by these overrides
 * ============================================================================ */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"],
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] {
  background-color: transparent !important;
  color: #212529 !important;
}

/* Player view (spectator role=player): glowing green border on "my" game rows */
.csd-my-game {
  box-shadow: 0 0 14px 4px rgba(34, 197, 94, 0.7), 0 0 6px 1px rgba(34, 197, 94, 0.5) !important;
  border: 2px solid rgba(22, 163, 74, 0.95) !important;
  border-radius: 4px !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 2 !important;
}

/* Sheet header - pale blue theme for all game types */

#scoresheet-designer .csd-sheet-bar {
  background: #90caf9 !important;
  border: 1px solid #42a5f5 !important;
  padding: 8px 12px !important;
  border-radius: 4px 4px 0 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  color: #0d47a1 !important;
  font-weight: 600 !important;
}

/* Keep all content inside #scoresheet-designer - no page-level horizontal scroll; inner .csd-round-scroll handles overflow */

/* Live Preview panel: permanently hide horizontal scrollbars - clip overflow instead of scrolling */
#csd-preview-container,
#csd-preview-body,
#csd-preview-root,
#csd-preview-container .csd-round-scroll,
#csd-preview-container [id^="csd-round-"],
#csd-preview-container .csd-two,
#csd-preview-container .csd-col,
#csd-preview-container .csd-scoresheet-wrapper,
#csd-preview-body .csd-round-scroll,
#csd-preview-body [id^="csd-round-"],
#csd-preview-body .csd-two,
#csd-preview-body .csd-col,
#csd-preview-body .csd-scoresheet-wrapper,
#scoresheet-designer .csd-round-scroll,
#scoresheet-designer [id^="csd-round-"],
#scoresheet-designer .csd-two,
#scoresheet-designer .csd-round-scroll .csd-col,
#scoresheet-designer .csd-round-scroll .csd-scoresheet-wrapper {
  overflow-x: hidden !important;
}

/* Center content with max total width 1400px (team headers + round grids combination) */

#scoresheet-designer {
  width: 100% !important;
  max-width: 1400px !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  box-sizing: border-box !important;
}

/* Teams scoresheet: max 1200px and always stay inside #scoresheet-designer; scale content to fit on smaller screens */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] {
  max-width: 1200px !important;
  container-type: inline-size !important;
  container-name: csd-teams !important;
}

/* Teams: allow round grid and card columns to shrink so content fits inside container */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
  min-width: 0 !important;
}

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-two .csd-col[id^="csd-s"][id$="-home-card"],
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-two .csd-col[id^="csd-s"][id$="-away-card"] {
  min-width: 0 !important;
}

/* Teams: base grid – Player column smaller but flexible (1fr); other cells max 50px. Prevents Score/overall cutoff. */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
  grid-template-columns: 40px minmax(60px, 1fr) 50px 60px 50px 50px 50px 60px !important;
  width: 100% !important;
}

/* Teams: right-side padding so Score column and Round Totals "overall" are not cut off */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-scoresheet-wrapper {
  padding-right: 0px !important;
  box-sizing: border-box !important;
}

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell.csd-totals.csd-round-totals-text {
  padding-right: 5px !important;
}

/* Scale round grid columns and font/padding so content fits inside #scoresheet-designer as container shrinks (others stay ≤50px) */

@container csd-teams (max-width: 1200px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
    grid-template-columns: 40px minmax(60px, 1fr) 50px 60px 50px 50px 50px 60px !important;
    font-size: 0.98em !important;
  }
}

@container csd-teams (max-width: 1200px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-header,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-rowcell {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

@container csd-teams (max-width: 1100px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
    grid-template-columns: 36px minmax(60px, 1fr) 48px 56px 48px 48px 48px 56px !important;
    font-size: 0.94em !important;
  }
}

@container csd-teams (max-width: 1100px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-header,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-rowcell {
    padding-left: 5px !important;
    padding-right: 5px !important;
  }
}

@container csd-teams (max-width: 1000px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
    grid-template-columns: 32px minmax(60px, 1fr) 44px 52px 44px 44px 44px 52px !important;
    font-size: 0.9em !important;
  }
}

@container csd-teams (max-width: 1000px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-header,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-rowcell {
    padding-left: 4px !important;
    padding-right: 4px !important;
  }
}

/* Large Screens: Keep standard side-by-side totals layout (perfect for desktop) */

@container csd-teams (min-width: 1251px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-totals-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    gap: 1.5rem !important;
  }
}

@container csd-teams (max-width: 900px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
    grid-template-columns: 28px minmax(60px, 1fr) 40px 48px 40px 40px 40px 48px !important;
    font-size: 0.85em !important;
  }
}

@container csd-teams (max-width: 800px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
    grid-template-columns: 24px minmax(50px, 1fr) 36px 44px 36px 36px 36px 44px !important;
    font-size: 0.8em !important;
  }
}

/* Very narrow viewports (e.g. Galaxy S21 ~360px): smaller columns + font to reduce right-edge cutoff */

@container csd-teams (max-width: 420px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
    grid-template-columns: 18px minmax(36px, 1fr) 28px 32px 28px 28px 28px 32px !important;
    font-size: 0.72em !important;
  }
}

@container csd-teams (max-width: 420px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-header,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-rowcell {
    padding-left: 1px !important;
    padding-right: 1px !important;
  }
}

@container csd-teams (max-width: 420px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text {
    gap: 0.2rem 0.1rem !important;
    font-size: 0.82em !important;
  }
}

@container csd-teams (max-width: 800px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-header,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-rowcell {
    padding-left: 2px !important;
    padding-right: 2px !important;
  }
}

/* Tighten spacing for totals row items on narrow screens */

@container csd-teams (max-width: 800px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text {
    gap: 0.25rem 0.15rem !important;
    font-size: 0.9em !important;
  }
}

/* Ensure preview containers have proper background - ONLY for supported game types */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-wrap,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-preview,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-preview-container,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-preview-body,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-preview-root,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-wrap,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-preview,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-preview-container,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-preview-body,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-preview-root {
  background-color: transparent !important;
  color: #212529 !important;
}

/* Ensure grids have white backgrounds - ONLY for supported game types */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-grid,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-grid {
  background-color: #ffffff !important;
  color: #212529 !important;
}

/* Ensure cards have white backgrounds - ONLY for supported game types */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-card,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-card {
  background-color: #ffffff !important;
  color: #212529 !important;
}

/* Ensure columns and wrappers have white backgrounds - ONLY for supported game types */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-col .csd-scoresheet-wrapper,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col .csd-scoresheet-wrapper {
  background-color: #ffffff !important;
}

/* Ensure cells have proper text color - ONLY for supported game types */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-rowcell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-header,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell {
  color: #212529 !important;
}

/* Ensure header bar has proper styling - ONLY for supported game types */

/* Match the original good styling that singles has (dark background, white text, rounded corners) */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-bar,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-bar {
  background-color: #495057 !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0.375rem !important;
  padding: 8px 12px !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06) !important;
  margin-bottom: 1rem !important;
  position: relative !important;
  z-index: 1050 !important;
  overflow: visible !important;
}

/* Ensure header bar text elements have proper color - white text on dark background */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-bar .csd-bar-title,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-bar .csd-bar-meta,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-bar span,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-bar .csd-bar-title,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-bar .csd-bar-meta,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-bar span {
  color: #ffffff !important;
}

/* Make the "Scoresheet" title bold */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-bar .csd-bar-title,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-bar .csd-bar-title {
  font-weight: bold !important;
  font-size: 1.1em !important;
  margin-bottom: 0.5rem !important;
}

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-bar .csd-bar-title:empty,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-bar .csd-bar-title:empty {
  display: none !important;
}

.csd-bar-row {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 0.5rem !important;
  width: 100% !important;
}

.csd-bar-meta {
  font-size: 0.9em !important;
  opacity: 0.95 !important;
}

.csd-bar-status {
  margin-top: 0.25rem !important;
  padding-top: 0.25rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  font-size: 0.8em !important;
  color: rgba(255, 255, 255, 0.85) !important;
  font-style: italic !important;
  min-height: 1.25rem !important;
}

.csd-bar-status:empty {
  display: none !important;
}

/* Captain tournament: stylized Flip Home vs Away button */
.csd-flip-homeaway-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  padding: 0.35rem 0.65rem !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: #fff !important;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  border-radius: 0.35rem !important;
  cursor: pointer !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
  white-space: nowrap !important;
}
.csd-flip-homeaway-btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(245,158,11,0.4) !important;
}
.csd-flip-homeaway-btn i.fa-exchange {
  font-size: 0.9em !important;
}

/* Ensure borders are visible - ONLY for supported game types */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-grid,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-card,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-grid,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-card,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell {
  border: 1px solid #dee2e6 !important;
}

/* Ensure headers and row cells also have borders */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-rowcell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-header,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell {
  border: 1px solid #dee2e6 !important;
}

/* Header rows - slightly grey background to match divmgmt */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-header {
  background-color: #e9ecef !important;
}

/* Make grid headers bold and slightly smaller */

#scoresheet-designer .csd-grid .csd-header.csd-cell {
  font-weight: 700 !important;
  font-size: 0.85em !important;
  text-transform: none !important;
}

/* Totals row (Round scores/handicap/totals) - slightly grey background to match divmgmt */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-totals,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-totals {
  background-color: #e9ecef !important;
}

/* Gap between Home and Away grids - desktop view */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-two,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-two {
  gap: 1rem !important;
}

/* Narrow screens: minimal gap between home/away grid cols; no margin on outer edges */
@media (max-width: 767px) {
  #scoresheet-designer .csd-round-scroll .csd-two {
    gap: 1px !important;
  }
  #scoresheet-designer .csd-round-scroll .csd-two .csd-col:first-child,
  #scoresheet-designer .csd-round-scroll .csd-two .csd-col:last-child {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Teams: also tighten gap when container is narrow (e.g. portrait mobile) */
@container csd-teams (max-width: 900px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-two {
    gap: 1px !important;
  }
}

/* Match scores summary: same two-column card layout as player headers and round grids */
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-matchscores-summary {
  width: 100% !important;
}

/* Truncate content that doesn't fit - prevent overflow */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-rowcell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Exclude totals row from truncation - allow wrapping */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-totals,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-totals {
  white-space: normal !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

/* Round totals text row - single cell: "Round Totals" left, team hcp / round score / overall right, one row */

/* Fallback rule for when data-csd-game-type attribute is not set (divmgmt) */

.csd-round-totals-text {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.3rem 0.4rem !important;
  font-family: inherit !important;
  font-size: 0.85em !important;
  white-space: nowrap !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  cursor: help !important;
  position: relative !important;
  gap: 0.4rem 0.6rem !important;
  min-width: 0 !important;
}

/* Specific rule for when data-csd-game-type attribute is set (scoremgmt) */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.3rem 0.4rem !important;
  font-family: inherit !important;
  font-size: 0.85em !important;
  white-space: nowrap !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  cursor: help !important;
  position: relative !important;
  gap: 0.4rem 0.6rem !important;
  min-width: 0 !important;
}

/* Round Totals cell: do not clip so "overall" is always visible (override .csd-totals overflow) */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell.csd-totals.csd-round-totals-text,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell.csd-totals.csd-round-totals-text {
  overflow: visible !important;
}

/* Mobile: Long press for tooltip + fluid scale for Round score summaries (HCP/SCORE/OVERALL) - no cutoff */

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text {
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    font-size: clamp(9px, 2vw, 12px) !important;
    padding: 0.2rem 0.2rem !important;
    gap: 0.15rem 0.2rem !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell.csd-totals.csd-round-totals-text {
    padding-right: 6px !important;
  }
}

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .round-totals-title,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text .round-totals-title {
    font-size: clamp(11px, 2.5vw, 14px) !important;
  }
}

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .totals-item,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text .totals-item {
    gap: 0.08rem !important;
    min-width: 0 !important;
  }
}

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text strong,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text strong {
    font-size: clamp(11px, 2.5vw, 14px) !important;
  }
}

/* "Round Totals" title - left only; team hcp / round score / overall grouped on the right via margin-right: auto */

.csd-round-totals-text .round-totals-title {
  font-size: 1.1em !important;
  font-weight: bold !important;
  color: #212529 !important;
  margin-right: auto !important;
  flex-shrink: 0 !important;
  text-align: left !important;
}

/* "Round Totals" title - larger and left justified - Specific */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text .round-totals-title,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .round-totals-title {
  font-size: 1.1em !important;
  font-weight: bold !important;
  color: #212529 !important;
  margin-right: auto !important;
  flex-shrink: 0 !important;
  text-align: left !important;
}

/* Labels (team hcp, round handicap, round score, overall) - make bold */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text .label,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .label {
  font-weight: bold !important;
  color: #212529 !important;
}

/* Values - keep normal weight */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text .value,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .value {
  font-weight: normal !important;
  color: #212529 !important;
}

/* Item wrapper for label+value pairs - right justified with spacing - Fallback */

.csd-round-totals-text .totals-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

/* Item wrapper for label+value pairs - right justified with spacing - Specific */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text .totals-item,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .totals-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

/* Legacy support for old structure */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-totals-text strong,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text strong {
  font-weight: bold !important;
  color: #212529 !important;
  font-size: 1.1em !important;
  flex-shrink: 0 !important;
}

/* Center-align all grid content horizontally EXCEPT Player column */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-rowcell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell {
  text-align: center !important;
  touch-action: manipulation !important;
}

/* Ensure checkboxes are clickable and not blocked by overlays */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-rowcell input[type="checkbox"],
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell input[type="checkbox"] {
  z-index: 100 !important;
  position: relative !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  width: 24px !important;
  height: 24px !important;
  margin: 0 !important;
  touch-action: manipulation !important;
}

/* Ensure grid itself handles touches properly */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-grid,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-grid {
  touch-action: manipulation !important;
  pointer-events: auto !important;
}

/* Ensure the scroll container allows clicks through to children */

#scoresheet-designer .csd-round-scroll {
  touch-action: pan-x pan-y !important;
  pointer-events: auto !important;
}

/* Make the cell itself a larger touch target if possible */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-rowcell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell {
  position: relative !important;
}

/* Player column - keep left-aligned */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-teams-player-cell,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-teams-player-header,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-player-cell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-player-header {
  text-align: left !important;
}

/* Points dropdown container - relative positioning for absolute children, full height and clickable */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-points-container,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-points-container {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 2rem !important;
  cursor: pointer !important;
}

/* Ensure cells containing points containers fill properly */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-rowcell:has(.csd-points-container),
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell:has(.csd-points-container) {
  display: flex !important;
  align-items: stretch !important;
  padding: 0 !important;
}

/* Points display - visible by default, hidden when dropdown is shown, vertically centered */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-points-display,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-points-display {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  min-height: 2rem !important;
  cursor: pointer !important;
  padding: 0.25rem 0.5rem !important;
  position: relative !important;
  z-index: 1 !important;
  pointer-events: auto !important;
}

/* hcp column values - vertically centered; force light background (override dark theme) */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-teams-hcp-cell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-hcp-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #ffffff !important;
  color: #212529 !important;
}

/* Add player modal: differentiate labels (headings) from values/inputs below */

.csd-addplayer-modal .csd-addplayer-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #6c757d;
  letter-spacing: 0.02em;
  margin-bottom: 0.375rem;
  text-transform: none;
}

.csd-addplayer-modal .csd-addplayer-field .csd-addplayer-input-wrap,
.csd-addplayer-modal .csd-addplayer-field .csd-addplayer-hcp-text-wrap,
.csd-addplayer-modal .csd-addplayer-trs {
  font-size: 1rem;
  color: #212529;
  font-weight: normal;
}

/* Handicap dropdown in Add player modal - force light background (page may have dark theme) */

.csd-addplayer-modal #csd-addplayer-hcp-wrap,
.csd-addplayer-modal #csd-addplayer-hcp-wrap select,
.csd-addplayer-modal #csd-addplayer-hcp-select {
  background-color: #ffffff !important;
  color: #212529 !important;
}

/* TRS league: handicap is text only – "Handicap: —" until player picked */

.csd-addplayer-modal .csd-addplayer-hcp-text-only {
  padding: 0.25rem 0;
}

.csd-addplayer-modal .csd-addplayer-hcp-text-wrap {
  display: inline-block;
}

.csd-addplayer-modal .csd-addplayer-label-inline {
  font-size: 1rem;
  font-weight: 500;
  color: #212529;
  margin-right: 0.25rem;
}

.csd-addplayer-modal .csd-addplayer-hcp-value {
  font-weight: normal;
  color: #212529;
}

/* Non-TRS: obvious border so handicap is clearly a picker */

.csd-addplayer-modal .csd-addplayer-hcp-picker,
.csd-addplayer-modal #csd-addplayer-hcp-wrap:not(.csd-addplayer-hcp-text-only) select {
  border: 2px solid #0d6efd !important;
  border-radius: 0.25rem !important;
  min-height: 2.25rem !important;
  padding: 0.25rem 0.5rem !important;
}

/* score column values - vertically centered */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-teams-score-cell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-score-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Points dropdown select - absolutely positioned to overlay display, preventing row height increase */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-points-dropdown,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-points-dropdown {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 10 !important;
}

/* Ensure sheet bar has proper styling - ONLY for supported game types */

/* White background with dark text, flexbox layout for left/right alignment */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-sheet-bar,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-sheet-bar {
  background-color: #90caf9 !important;
  border: 1px solid #42a5f5 !important;
  color: #212529 !important;
  border-radius: 0.375rem !important;
  padding: 8px 12px !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

/* Sheet bar text elements - dark text */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-sheet-bar .csd-sheet-main,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-sheet-bar .csd-sheet-match-id,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-sheet-bar .csd-sheet-sub,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-sheet-bar .csd-sheet-main,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-sheet-bar .csd-sheet-match-id,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-sheet-bar .csd-sheet-sub {
  color: #212529 !important;
}

/* Sheet main (Sheet 1 of x) - left aligned, bold */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-sheet-bar .csd-sheet-main,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-sheet-bar .csd-sheet-main {
  text-align: left !important;
  font-weight: bold !important;
  flex-shrink: 0 !important;
}

/* Sheet sub (Match ID and Home/Away info) - right aligned, normal weight */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-sheet-bar .csd-sheet-sub,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-sheet-bar .csd-sheet-sub {
  text-align: right !important;
  font-weight: normal !important;
  margin-left: auto !important;
}

/* Round title - make text bold and remove excessive margin */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-title .csd-bar,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-title .csd-bar {
  font-weight: bold !important;
  margin-bottom: 0 !important;
}

/* Reduce spacing between round header and grids - override mb-2 class */

#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-title.mb-2,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-title.mb-2 {
  margin-bottom: 0.25rem !important;
}

/* Ensure TRS/HCP details are hidden for teams mode; preserve Games Won / Rounds Won / Match Won stats */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-dyn-hcp,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-mini.text-muted,
.csd-card .csd-mini.text-muted {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* Singles: show per-game handicap when it has content (override above hide rule) - desktop only; on mobile it's in View Details modal */
@media (min-width: 768px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-card .csd-mini.csd-pergame-hcp:not(:empty) {
    display: block !important;
    visibility: visible !important;
    height: auto !important;
    margin: 0.25rem 0 0 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
}

/* Player header cards: normalize height so both home/away match the taller side */
#scoresheet-designer .csd-sheet > .csd-two .csd-col {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}
#scoresheet-designer .csd-sheet > .csd-two .csd-col .csd-card {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

/* Ensure player cards match singles styling EXACTLY in teams mode */

/* Apply ALL the same styling that singles cards have */

/* Card container (.csd-col) - remove any inline styles, match singles exactly */

/* Teams card cols: same width behavior as singles so headers align with round grids below; cap at half minus gap */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col[id^="csd-s"][id$="-home-card"],
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col[id^="csd-s"][id$="-away-card"] {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  max-width: calc(50% - 0.5rem) !important;
  box-sizing: border-box !important;
}

/* Card element (.csd-card) - match singles exactly */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-card[id^="csd-s"][id$="-home-card"],
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-card[id^="csd-s"][id$="-away-card"] {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 0% !important;
  flex-basis: 0% !important;
  flex-grow: 1 !important;
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03) !important;
}

/* Headline - ensure flex display like singles with exact properties */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-headline {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

/* Player title - ensure bold (Home Team/Away Team) - match singles exactly */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-player-title {
  font-weight: 700 !important;
  font-size: 16px !important;
  color: rgb(17, 24, 39) !important;
}

/* Player name - ensure semibold like singles */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-player-name {
  font-weight: 600 !important;
}

/* Chips wrap - match singles exactly (display: block, not flex!) */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-chips-wrap {
  display: block !important;
  flex-direction: row !important;
}

/* Chips row container - ensure proper flex layout */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .mt-2.d-flex.align-items-center.justify-content-between {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
}

/* Chips - match singles exactly */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-chip {
  display: inline-flex !important;
  align-items: center !important;
  background-color: rgb(249, 250, 251) !important;
  border: 1.11111px solid rgb(229, 231, 235) !important;
  border-radius: 999px !important;
  padding: 2.4px 8px !important;
  font-size: 12.48px !important;
  color: rgb(33, 37, 41) !important;
}

/* Chip key (8W, 8BB, etc.) - ensure bold like singles */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-chip .csd-chip-k {
  font-weight: 600 !important;
}

/* Score - match singles exactly */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-score {
  font-weight: 700 !important;
  font-size: 15px !important;
  text-align: right !important;
  margin: 0 0 0 auto !important;
  flex-shrink: 0 !important;
}

/* Override mobile media queries for score font size in teams mode - fluid scale to fit portrait mobile */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-score {
    font-size: clamp(12px, 3.5vw, 15px) !important;
  }
}

/* Score value - bold like singles */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-score span {
  font-weight: 700 !important;
}

/* Mini stats - match singles exactly */

/* Mini stats - match singles exactly - DESKTOP ONLY */

@media (min-width: 768px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-mini.mt-1:not(:empty) {
    display: block !important;
    font-size: 12.8px !important;
    color: rgb(17, 24, 39) !important;
    margin-top: 4px !important;
    font-weight: 400 !important;
  }
}

/* ============================================================================
  * PHASE 1: MOBILE RESPONSIVE - CORE FUNCTIONALITY
  * Mobile-first horizontal scrolling and touch-friendly sizing
  * All mobile styles wrapped in @media (max-width: 767px) - desktop unchanged
  * ============================================================================ */

/* ----------------------------------------------------------------------------
  * 1.1 Horizontal Scrolling Container
  * ---------------------------------------------------------------------------- */

/* Mobile-first: NO horizontal scroll - scale to fit instead */

.csd-scoresheet-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  box-sizing: border-box !important;
}

/* Ensure grid scales to fit wrapper */

.csd-grid {
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
}

/* Ensure round container and columns don't overflow */

.csd-round-title,
.csd-sheet-0,
.csd-sheet-1 {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

/* ----------------------------------------------------------------------------
  * Per-round horizontal scroll: when headers/grid don't fit, scroll per round
  * .csd-round-scroll wraps the game grid only; round title stays fixed.
  * Headers and cells do not wrap; content drives width, then scroll.
  * ---------------------------------------------------------------------------- */

/* Round block: constrain width so overflow happens inside .csd-round-scroll only.
    Exclude [id*="score"] so the round-score span (e.g. csd-round-score-0-0-away) is NOT forced to width:100%. */

#scoresheet-designer [id^="csd-round-"]:not([id*="score"]) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  box-sizing: border-box !important;
}

/* Scroll container = one per round, wraps only the game grid (.csd-two) - no horizontal scrollbars in Live Preview */

#scoresheet-designer .csd-round-scroll {
  overflow-x: hidden !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  width: 100% !important;
  max-width: 100% !important;
}

/* Singles small screen: gray background behind grids (round area only) */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-round-scroll {
    background-color: #e9ecef !important;
  }
}

/* Round grid .csd-two must match cards row width at all viewports (alignment with #csd-s*-home-card / #csd-s*-away-card) */

#scoresheet-designer .csd-round-scroll .csd-two {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  box-sizing: border-box !important;
}

/* Round cols use same flex/min-width as cards row via .csd-two .csd-col - only ensure no min-content override */

#scoresheet-designer .csd-round-scroll .csd-col {
  overflow-x: visible !important;
  overflow-y: visible !important;
  box-sizing: border-box !important;
}

#scoresheet-designer .csd-round-scroll .csd-scoresheet-wrapper {
  overflow-x: visible !important;
  overflow-y: visible !important;
  max-width: none !important;
  width: 100% !important;
}

/* Teams: grid constrained to column width (#csd-home-0-0 etc.) so Round Totals cell = column width */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-col {
  overflow-x: hidden !important;
  overflow-y: visible !important;
  min-width: 0 !important;
}

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-scoresheet-wrapper {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

/* Teams: MOBILE - no scrollbars; content must fit via narrower columns + abbreviated headers (Score→scr) */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-scoresheet-wrapper {
    overflow-x: hidden !important;
  }
}

/* Teams: on narrow screens, abbreviate "Score" header to "scr" to prevent right-edge cutoff */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-score-header .csd-score-abbr {
  display: none !important;
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-score-header .csd-score-full {
    display: none !important;
  }
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-score-header .csd-score-abbr {
    display: inline !important;
  }
}

/* Teams: on sufficiently wide viewport, no horizontal scrollbar so Round Totals row fits like the reference layout */

@media (min-width: 1280px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll {
    overflow-x: hidden !important;
  }
}

@media (min-width: 1280px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-col {
    overflow-x: hidden !important;
  }
}

@media (min-width: 1280px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-scoresheet-wrapper {
    overflow-x: hidden !important;
  }
}

#scoresheet-designer .csd-round-scroll .csd-grid {
  min-width: min-content !important;
  max-width: none !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

/* Header row (# pts/W BB RO TRO) and totals row (Round scores hcp — 0): same grey at all widths */

#scoresheet-designer .csd-round-scroll .csd-grid .csd-header,
#scoresheet-designer .csd-round-scroll .csd-grid .csd-cell.csd-totals,
.csd-round-scroll .csd-grid .csd-header,
.csd-round-scroll .csd-grid .csd-cell.csd-totals {
  background-color: #e9ecef !important;
  background: #e9ecef !important;
}

/* Round Totals cell: allow shrinking so it doesn't force horizontal scroll */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell.csd-totals.csd-round-totals-text {
  min-width: 0 !important;
}

#scoresheet-designer .csd-round-scroll .csd-header,
#scoresheet-designer .csd-round-scroll .csd-cell,
#scoresheet-designer .csd-round-scroll .csd-rowcell {
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

/* Totals row label: allow "Round scores" to wrap (no truncation) in narrow format */

#scoresheet-designer .csd-round-scroll .csd-totals-label {
  white-space: normal !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  line-height: 1.25 !important;
  min-width: 0 !important;
}

/* Large screens: round grid must match team header width and align (no narrow fit-content) */

/* Desktop: round grid same width as cards row (redundant with global .csd-round-scroll .csd-two above) */

@media (min-width: 768px) {
  #scoresheet-designer .csd-round-scroll .csd-two {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* Round .csd-col: do NOT override flex/min-width so .csd-two .csd-col (same as cards) applies at all breakpoints */

/* Desktop: No horizontal scroll, auto width */

@media (min-width: 768px) {
  .csd-scoresheet-wrapper {
    overflow-x: hidden !important;
    overflow-y: hidden !important;
  }
}

@media (min-width: 768px) {
  .csd-grid {
    overflow-x: hidden !important;
    overflow-y: hidden !important;
  }
}

/* Desktop: Show full sheet header - show both Sheet X of Y and full sub text */

@media (min-width: 768px) {
  .csd-sheet-sub {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .csd-sheet-main {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .csd-sheet-match-id {
    display: none !important;
  }
}

/* Handicap label - show "handicap" on desktop, "hcp" on mobile, right-justified */

.csd-handicap-label {
  text-align: right !important;
  justify-content: flex-end !important;
}

@media (max-width: 767px) {
  .csd-handicap-text-desktop {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .csd-handicap-text-mobile {
    display: inline !important;
    font-size: .75rem !important;
  }
}

@media (min-width: 768px) {
  .csd-handicap-text-desktop {
    display: inline !important;
  }
}

@media (min-width: 768px) {
  .csd-handicap-text-mobile {
    display: none !important;
  }
}

/* ----------------------------------------------------------------------------
  * 1.2 Touch-Friendly Game Cells
  * ---------------------------------------------------------------------------- */

/* Mobile: Touch targets (iOS/Android minimum 44px) - optimized for compact layout */

@media (max-width: 767px) {
  .csd-cell {
    min-height: 44px;
  }
}

@media (max-width: 767px) {
  .csd-rowcell {
    min-height: 44px;
  }
}

/* Checkboxes - size optimized in compact layout section */

@media (max-width: 767px) {
  .csd-rowcell input[type="checkbox"] {
    cursor: pointer;
  }
}

/* Score inputs - sizing optimized in compact layout section */

@media (max-width: 767px) {

  .csd-rowcell input[type="number"],
  .csd-rowcell select {
    min-height: 44px;
  }
}

/* Headers - sizing optimized in compact layout section (same breakpoint as reduced W/BB/RO/TRO text) */

@media (max-width: 767px) {
  .csd-header {
    min-height: 44px;
  }
}

/* Round grid header row (# pts/W BB RO TRO) and Round scores totals row: same grey */

@media (max-width: 767px) {

  #scoresheet-designer .csd-round-scroll .csd-grid .csd-header,
  #scoresheet-designer .csd-round-scroll .csd-grid .csd-cell.csd-totals,
  .csd-round-scroll .csd-grid .csd-header,
  .csd-round-scroll .csd-grid .csd-cell.csd-totals {
    background-color: #e9ecef !important;
    background: #e9ecef !important;
  }
}

/* ----------------------------------------------------------------------------
  * 1.3 Mobile-Optimized Compact Layout
  * Creative space-saving optimizations for narrow screens
  * Reduces cell widths while maintaining touch targets and readability
  * ---------------------------------------------------------------------------- */

/* Grid columns - use flexible units so grids match card widths exactly */

/* Row # column is fixed, feat columns expand to fill available space */

@media (max-width: 767px) {
  .csd-grid {
    grid-template-columns: 24px 1fr 1fr 1fr 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 0;
    box-sizing: border-box !important;
  }
}

/* Singles only: one line per col on small screens - hide full text, show abbrev only (pts/W, BB, RO, TRO) */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:first-child {
    min-height: 2rem !important;
  }
}

/* Keep cell visible so header row background/border paints; hide only the text (::before shows W/BB/RO/TRO) */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:not(:first-child) {
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    position: relative !important;
    min-height: 2rem !important;
    padding: .35rem .2rem !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(2)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(3)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(4)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(5)::before {
    visibility: visible !important;
    font-size: clamp(9px, 2vw, 11px) !important;
    color: #374151 !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: center !important;
  }
}

/* Column 2: "W" or "pts" (injected CSS overrides for points vs wins mode) */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(2)::before {
    content: "W" !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(3)::before {
    content: "BB" !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(4)::before {
    content: "RO" !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(5)::before {
    content: "TRO" !important;
  }
}

/* Reduce row number column width - fluid font for narrow viewports */

@media (max-width: 767px) {

  .csd-grid>.csd-cell:first-child,
  .csd-grid>.csd-rownum {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    padding: .4rem .15rem !important;
    font-size: clamp(9px, 2vw, 12px) !important;
  }
}

/* Compact cell padding - maintain touch target but reduce horizontal space
   Fluid font: clamp scales with viewport - no cutoff on narrow portrait mobile */

@media (max-width: 767px) {
  .csd-cell {
    padding: .4rem .2rem !important;
    font-size: clamp(10px, 2.2vw, 13px) !important;
  }
}

/* Thinner borders to save space */

@media (max-width: 767px) {
  .csd-cell {
    border-width: 0.5px !important;
  }
}

/* Compact checkboxes - size handled in prettier checkmarks section below */

/* Compact inputs - full height but narrower, fluid font */

@media (max-width: 767px) {

  .csd-rowcell input[type="number"],
  .csd-rowcell select {
    padding: .35rem .2rem !important;
    font-size: clamp(10px, 2.2vw, 13px) !important;
    min-width: 0;
  }
}

/* Compact totals row - fluid font (slightly larger, less padding) */

@media (max-width: 767px) {
  .csd-totals {
    padding: .25rem .15rem !important;
    font-size: clamp(11px, 2.5vw, 14px) !important;
    position: relative !important;
    overflow: visible !important;
  }
}

/* Round scores label - allow wrapping on mobile */

@media (max-width: 767px) {
  .csd-totals-label {
    white-space: normal !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
  }
}

/* Reduce spacing in row cells - fluid font */

@media (max-width: 767px) {
  .csd-rowcell {
    padding: .35rem .2rem !important;
    font-size: clamp(10px, 2.2vw, 13px) !important;
  }
}

/* Very small screens - even more compact */

@media (max-width: 375px) {
  .csd-grid {
    grid-template-columns: 22px 1fr 1fr 1fr 1fr !important;
  }
}

@media (max-width: 375px) {

  .csd-grid>.csd-cell:first-child,
  .csd-grid>.csd-rownum {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    padding: .35rem .1rem !important;
    font-size: clamp(8px, 1.8vw, 10px) !important;
  }
}

@media (max-width: 375px) {
  .csd-cell {
    padding: .35rem .15rem !important;
    font-size: clamp(9px, 2vw, 11px) !important;
  }
}

/* Headers on very small screens - same text replacement, no vertical rotation */

@media (max-width: 375px) {
  .csd-header:not(:first-child) {
    font-size: 0 !important;
    color: transparent !important;
    padding: .3rem .15rem !important;
  }
}

@media (max-width: 375px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(2)::before {
    content: "W" !important;
    font-size: .65rem !important;
    color: #374151 !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: center !important;
  }
}

@media (max-width: 375px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(3)::before {
    content: "BB" !important;
    font-size: .65rem !important;
    color: #374151 !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: center !important;
  }
}

@media (max-width: 375px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(4)::before {
    content: "RO" !important;
    font-size: .65rem !important;
    color: #374151 !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: center !important;
  }
}

@media (max-width: 375px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(5)::before {
    content: "TRO" !important;
    font-size: .65rem !important;
    color: #374151 !important;
    font-weight: 600 !important;
    display: block !important;
    text-align: center !important;
  }
}

/* Even smaller checkmarks on very small screens */

@media (max-width: 375px) {
  .csd-rowcell input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
  }
}

@media (max-width: 375px) {
  .csd-rowcell input[type="checkbox"]:checked::after {
    font-size: 12px !important;
  }
}

/* ----------------------------------------------------------------------------
  * 1.4 Compact Player Headers for Mobile
  * Hide most info so both home/away headers fit on narrow screens
  * ---------------------------------------------------------------------------- */

/* Player cards - remove excess space, ensure equal heights */

/* Override any min-height from injected CSS (which sets min-height: 180px) */

.csd-card {
  min-height: auto !important;
  height: auto !important;
  max-height: none !important;
}

/* Desktop: Keep original behavior - grids match card widths */

@media (min-width: 768px) {
  .csd-two .csd-col {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

@media (min-width: 768px) {
  .csd-two .csd-col .csd-card {
    width: 100% !important;
  }
}

@media (min-width: 768px) {
  .csd-two .csd-col>.csd-scoresheet-wrapper {
    width: 100% !important;
    max-width: 100% !important;
  }
}

@media (min-width: 768px) {
  .csd-two .csd-col>.csd-scoresheet-wrapper>.csd-grid {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Mobile: Grids must match player card widths exactly */

/* Singles only: Mobile grids must match player card widths exactly */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-two .csd-col {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-two .csd-col .csd-card {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  /* Player header cards: keep equal height on mobile (override above for .csd-sheet > .csd-two only) */
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-sheet > .csd-two .csd-col .csd-card {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-two .csd-col>.csd-scoresheet-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-two .csd-col>.csd-scoresheet-wrapper>.csd-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Remove excess margins/padding from card children */

.csd-card>*:last-child {
  margin-bottom: 0 !important;
}

/* Remove any empty space at bottom of cards */

.csd-card::after {
  display: none !important;
}

/* Compact player cards - ensure positioning context for absolute dropdown */

@media (max-width: 767px) {
  .csd-card {
    padding: 2px 3px !important;
    padding-bottom: 3px !important;
    position: relative !important;
    overflow: visible !important;
    z-index: 1 !important;
  }
}

/* Hide or minimize player title - fluid font (slightly larger) */

@media (max-width: 767px) {
  .csd-player-title {
    font-size: clamp(10px, 2.2vw, 13px) !important;
    margin-bottom: 2px !important;
    font-weight: 600;
  }
}

/* Compact player name - ensure full names visible, fluid font (slightly larger) */

@media (max-width: 767px) {
  .csd-player-name {
    font-size: clamp(11px, 2.5vw, 14px) !important;
    line-height: 1.1 !important;
    word-break: break-word;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: 100% !important;
    margin-bottom: 0 !important;
  }
}

/* Ensure headline container allows wrapping */

@media (max-width: 767px) {
  .csd-headline {
    flex-wrap: nowrap !important;
    min-width: 0 !important;
  }
}

/* Hide chips on mobile (8BB, 8RO, etc.) */

@media (max-width: 767px) {
  .csd-chips-wrap {
    display: none !important;
  }
}

/* Compact score display */

@media (max-width: 767px) {
  .csd-score {
    font-size: .85rem !important;
    margin-top: .25rem !important;
  }
}

/* Hide mini stats (Games won, Rounds won, Match won) */

@media (max-width: 767px) {
  .csd-mini {
    display: none !important;
  }
}

/* Compact handicap controls */

@media (max-width: 767px) {
  .csd-dyn-hcp {
    font-size: .65rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
}

/* Make HCP control elements smaller and prevent wrapping */

@media (max-width: 767px) {

  .csd-dyn-hcp .key,
  .csd-dyn-hcp .val,
  .csd-dyn-hcp .sep {
    font-size: .65rem !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 767px) {
  .csd-dyn-hcp select.form-select-sm {
    font-size: .65rem !important;
    padding: .15rem .3rem !important;
    height: auto !important;
    min-height: 1.5rem !important;
    line-height: 1.2 !important;
    width: auto !important;
    min-width: 3rem !important;
    max-width: 4rem !important;
  }
}

/* Sheet header - pale blue theme for all game types */

#scoresheet-designer .csd-sheet-bar {
  background: #90caf9 !important;
  border: 1px solid #42a5f5 !important;
  padding: 8px 12px !important;
  border-radius: 4px 4px 0 0 !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  color: #0d47a1 !important;
  font-weight: 600 !important;
}

@media (max-width: 767px) {
  .csd-sheet-bar {
    font-size: .75rem !important;
    padding: 6px 10px !important;
  }
}

/* 3-Row Mobile Totals: restricted to mobile only */

@media (max-width: 767px) {
  #scoresheet-designer .csd-totals-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    width: 100% !important;
    padding: 0.1rem 0 !important;
    min-width: 0 !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer .csd-total-item {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    min-width: 0 !important;
    align-items: baseline !important;
    width: 100% !important;
    gap: 3px !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer .csd-total-label {
    font-size: clamp(10px, 2.2vw, 13px) !important;
    font-weight: 600 !important;
    color: #6c757d !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer .csd-total-value {
    font-size: clamp(11px, 2.5vw, 14px) !important;
    font-weight: bold !important;
    color: #212529 !important;
    text-align: right !important;
  }
}

/* Teams narrow: Round scores row (HCP, SCORE, OVERALL) - same size, weight, alignment */
@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .csd-total-label,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .csd-total-value {
    font-size: clamp(10px, 2.5vw, 13px) !important;
    font-weight: normal !important;
    text-align: left !important;
  }
}

@container csd-teams (max-width: 900px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .csd-total-label,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-totals-text .csd-total-value {
    font-size: clamp(10px, 2.5vw, 13px) !important;
    font-weight: normal !important;
    text-align: left !important;
  }
}

/* Teams: multi-cell totals row (Round scores | hcp | values) - same size/weight/alignment */
@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-totals-label,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-handicap-label,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell.csd-totals {
    font-size: clamp(10px, 2.5vw, 13px) !important;
    font-weight: normal !important;
    text-align: left !important;
  }
}

@media (max-width: 767px) {
  .csd-sheet-sub {
    display: none !important;
  }
}

@media (max-width: 767px) {

  .csd-sheet-main,
  .csd-sheet-match-id {
    display: block !important;
    font-size: .75rem !important;
  }
}

@media (max-width: 767px) {
  .csd-sheet-match-id {
    margin-top: .25rem !important;
  }
}

/* Compact headline */

@media (max-width: 767px) {
  .csd-headline {
    margin-top: .25rem !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: .5rem !important;
  }
}

@media (max-width: 767px) {
  .csd-headline-ctl {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
}

/* Reduce spacing between elements */

@media (max-width: 767px) {
  .csd-card>* {
    margin-bottom: 1px !important;
  }
}

/* Remove bottom margin from last element to eliminate excess space */

@media (max-width: 767px) {
  .csd-card>*:last-child {
    margin-bottom: 0 !important;
  }
}

/* ----------------------------------------------------------------------------
  * Mobile Layout Optimization (New Request)
  * Hide #, BB, RO, TRO columns on small screens
  * ---------------------------------------------------------------------------- */

/* Hide specific headers and cells by child index or class if available */

/* Grid cols: # (1), Player (2), hcp (3), Score (4), BB (5), RO (6), TRO (7) */

/* Hide #, HCP, BB, RO, TRO columns on mobile using robust classes */

/* Hide #, HCP, BB, RO, TRO columns on mobile using robust classes */

/* Hide chips on mobile */

@media (max-width: 767px) {
  .csd-chips-wrap {
    display: none !important;
  }
}

/* Ensure our new action buttons ARE visible */

@media (max-width: 767px) {
  .csd-card-actions {
    display: flex !important;
    z-index: 20 !important;
  }
}

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-num,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-hcp,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-bb,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-ro,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-tro {
    display: none !important;
  }
}

/* Define 3-column grid for mobile: Player | Pts | Score
   Fluid column widths - scale to fit narrow viewports, no horizontal scroll */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
    grid-template-columns: minmax(40px, 1fr) minmax(32px, 1fr) minmax(36px, 1fr) !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* Enable scrolling */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll {
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 5px !important;
    display: block !important;
    width: 100% !important;
  }
}

/* Prevent wrapping */

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-header,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-cell,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-rowcell {
    white-space: nowrap !important;
    overflow: hidden !important;
  }
}

/* -----------------------------------------------------------
      HIDING COLUMNS (Mobile) - ROBUST STRATEGY (Class-Based)
      Classes injected by tagColumnCells() in JS
      ----------------------------------------------------------- */

/* Hide specific columns on mobile using robust classes */

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-num,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-hcp,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-bb,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-ro,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-col-tro {
    display: none !important;
  }
}

/* -----------------------------------------------------------
      Visual Alignment & Scroll
      ----------------------------------------------------------- */

/* Ensure the totals label spans the correct amount */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid .csd-totals-label {
    grid-column: span 1 !important;
    width: auto !important;
  }
}

/* Ensure Totals Row is visible */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-totals {
    display: flex !important;
  }
}

/* If Totals row elements are: Label, Hcp, Pts, Score. (4 elements) */

/* We need to hide Hcp. */

/* Try to hide 2nd child of totals row? */

/* #scoresheet-designer[...] .csd-totals:nth-of-type(2) ? No, they are siblings in grid. */

/* Robust approach: just let them flow for now, user requested totals row to APPEAR. 
      If alignment is off, we can tune later. */

/* We need to identify BB, RO, TRO cells. 
      If they don't have specific classes, we might need JS to add them or use attribute selectors.
      Looking at previous `view_file`, game cells have `data-rack`.
      But specific columns?
      Ah, `createHcpCell` adds `.csd-teams-hcp-cell`.
      Maybe we can target inputs? */

/* Very small screens - even more compact */

@media (max-width: 375px) {
  .csd-card {
    padding: .4rem !important;
  }
}

@media (max-width: 375px) {
  .csd-player-title {
    font-size: clamp(10px, 2.2vw, 12px) !important;
  }
}

@media (max-width: 375px) {
  .csd-player-name {
    font-size: clamp(11px, 2.5vw, 14px) !important;
  }
}

@media (max-width: 375px) {
  .csd-score {
    font-size: .8rem !important;
  }
}

/* ----------------------------------------------------------------------------
  * 1.5 Compact Two-Column Layout for Mobile
  * Make both sides of a round fit on narrow screens side-by-side
  * ---------------------------------------------------------------------------- */

/* CRITICAL: Round-sides must NEVER wrap - always stay side-by-side */

.csd-two {
  flex-wrap: nowrap !important;
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  /* No horizontal scrollbars in Live Preview */
  overflow-y: visible !important;
}

/* ONE scrollbar per round: only .csd-round-scroll scrolls; inner .csd-two must not */

#scoresheet-designer .csd-round-scroll .csd-two {
  overflow-x: visible !important;
  overflow-y: visible !important;
}

/* Slightly narrowed to 1024px: flexible columns so NO horizontal scrollbar when there is plenty of space for grid content */

@media (max-width: 1024px) {
  .csd-two {
    flex-direction: row !important;
    gap: .5rem !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }
}

@media (max-width: 1024px) {
  .csd-two .csd-col {
    flex: 1 1 calc(50% - .25rem) !important;
    min-width: 0 !important;
    max-width: calc(50% - .25rem) !important;
    width: calc(50% - .25rem) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    position: relative !important;
  }
}

/* Teams: card columns must shrink like singles so content stays inside #scoresheet-designer */

@media (max-width: 1024px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-two .csd-col[id^="csd-s"][id$="-home-card"],
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-two .csd-col[id^="csd-s"][id$="-away-card"] {
    flex: 1 1 calc(50% - .25rem) !important;
    min-width: 0 !important;
    max-width: calc(50% - .25rem) !important;
    width: calc(50% - .25rem) !important;
    box-sizing: border-box !important;
  }
}

/* Keep side-by-side but scale to fit - NO horizontal scroll (mobile) */

@media (max-width: 767px) {
  .csd-two {
    flex-direction: row !important;
    gap: 4px !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }
}

@media (max-width: 767px) {
  .csd-two .csd-col {
    flex: 1 1 calc(50% - 2px) !important;
    min-width: 0 !important;
    max-width: calc(50% - 2px) !important;
    width: calc(50% - 2px) !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    position: relative !important;
  }
}

/* Teams: card columns same as above so layout fits inside #scoresheet-designer */

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-two .csd-col[id^="csd-s"][id$="-home-card"],
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-two .csd-col[id^="csd-s"][id$="-away-card"] {
    flex: 1 1 calc(50% - 2px) !important;
    min-width: 0 !important;
    max-width: calc(50% - 2px) !important;
    width: calc(50% - 2px) !important;
    box-sizing: border-box !important;
  }
}

/* Grids must match card width exactly - no centering, full width */

@media (max-width: 767px) {
  .csd-two .csd-col>.csd-scoresheet-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 767px) {
  .csd-two .csd-col>.csd-scoresheet-wrapper>.csd-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Progressive scaling: Scale down as screen gets narrower */

/* Medium-small screens (480px - 600px) */

@media (max-width: 600px) {
  .csd-grid {
    grid-template-columns: 22px 1fr 1fr 1fr 1fr !important;
  }
}

@media (max-width: 600px) {

  .csd-grid>.csd-cell:first-child,
  .csd-grid>.csd-rownum {
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    padding: .35rem .12rem !important;
    font-size: clamp(9px, 2vw, 11px) !important;
  }
}

@media (max-width: 600px) {
  .csd-cell {
    padding: .35rem .18rem !important;
    font-size: clamp(9px, 2.2vw, 12px) !important;
  }
}

@media (max-width: 600px) {
  .csd-header:not(:first-child) {
    padding: .3rem .18rem !important;
    font-size: .65rem !important;
  }
}

@media (max-width: 600px) {

  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(2)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(3)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(4)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(5)::before {
    font-size: .65rem !important;
  }
}

/* Small screens (400px - 480px) */

@media (max-width: 480px) {
  .csd-two {
    gap: .4rem !important;
  }
}

@media (max-width: 480px) {
  .csd-two .csd-col {
    flex: 1 1 calc(50% - .2rem) !important;
    max-width: calc(50% - .2rem) !important;
    width: calc(50% - .2rem) !important;
  }
}

@media (max-width: 480px) {
  .csd-grid {
    grid-template-columns: 20px 1fr 1fr 1fr 1fr !important;
  }
}

@media (max-width: 480px) {

  .csd-grid>.csd-cell:first-child,
  .csd-grid>.csd-rownum {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    padding: .32rem .1rem !important;
    font-size: clamp(8px, 1.9vw, 10px) !important;
  }
}

@media (max-width: 480px) {
  .csd-cell {
    padding: .32rem .16rem !important;
    font-size: clamp(9px, 2vw, 11px) !important;
  }
}

@media (max-width: 480px) {
  .csd-header:not(:first-child) {
    padding: .28rem .16rem !important;
    font-size: .63rem !important;
  }
}

@media (max-width: 480px) {

  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(2)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(3)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(4)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(5)::before {
    font-size: .63rem !important;
  }
}

/* Singles only: Scale down grid columns proportionally on very small screens */

@media (max-width: 360px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-two {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: .3rem !important;
  }
}

@media (max-width: 360px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-two .csd-col {
    flex: 1 1 calc(50% - .15rem) !important;
    min-width: 0 !important;
    max-width: calc(50% - .15rem) !important;
    width: calc(50% - .15rem) !important;
  }
}

@media (max-width: 360px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-grid {
    grid-template-columns: 20px 1fr 1fr 1fr 1fr !important;
  }
}

@media (max-width: 360px) {

  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-grid>.csd-cell:first-child,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-grid>.csd-rownum {
    width: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    padding: .3rem .1rem !important;
    font-size: .65rem !important;
  }
}

@media (max-width: 360px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell {
    padding: .3rem .15rem !important;
    font-size: .7rem !important;
  }
}

/* Keep original text hidden; only padding (do not restore font-size) */

@media (max-width: 360px) {
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:not(:first-child) {
    padding: .3rem .15rem !important;
  }
}

@media (max-width: 360px) {

  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(2)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(3)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(4)::before,
  #scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-header:nth-child(5)::before {
    font-size: .65rem !important;
  }
}

/* ----------------------------------------------------------------------------
  * 1.6 Prettier Checkmarks for ALL Screens
  * Replace standard checkboxes with styled checkmarks/icons
  * ---------------------------------------------------------------------------- */

/* Center checkboxes in their cells - only apply flex to cells with checkboxes */

.csd-rowcell:has(input[type="checkbox"]) {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Hide default checkbox - prettier checkmarks for all screens */

.csd-rowcell input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 22px !important;
  height: 22px !important;
  border: 2px solid #6b7280 !important;
  border-radius: 4px !important;
  background: #fff !important;
  cursor: pointer !important;
  position: relative !important;
  transition: all 0.2s ease !important;
  margin: 0 auto !important;
  flex-shrink: 0 !important;
  display: block !important;
}

/* Checked state - green with checkmark */

.csd-rowcell input[type="checkbox"]:checked {
  background: #10b981 !important;
  border-color: #10b981 !important;
}

/* Checkmark icon using CSS */

.csd-rowcell input[type="checkbox"]:checked::after {
  content: "✓" !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: bold !important;
  line-height: 1 !important;
}

/* Hover state */

.csd-rowcell input[type="checkbox"]:hover:not(:checked) {
  border-color: #10b981 !important;
  background: #f0fdf4 !important;
}

/* Active/pressed state */

.csd-rowcell input[type="checkbox"]:active {
  transform: scale(0.95) !important;
}

/* Focus state for accessibility */

.csd-rowcell input[type="checkbox"]:focus {
  outline: 2px solid #10b981 !important;
  outline-offset: 2px !important;
}

/* Disabled state - scoped to CSD scoresheets only */

.csd-grid .csd-rowcell input[type="checkbox"]:disabled,
.csd-scoresheet-wrapper .csd-rowcell input[type="checkbox"]:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  background: #f3f4f6 !important;
}

/* Disabled but checked - keep green color and full opacity - scoped to CSD scoresheets only */

.csd-grid .csd-rowcell input[type="checkbox"]:disabled:checked,
.csd-scoresheet-wrapper .csd-rowcell input[type="checkbox"]:disabled:checked {
  opacity: 1 !important;
  background: #10b981 !important;
  border-color: #10b981 !important;
  cursor: not-allowed !important;
}

/* Ensure checkmark is visible on disabled checked checkboxes - scoped to CSD scoresheets only */

.csd-grid .csd-rowcell input[type="checkbox"]:disabled:checked::after,
.csd-scoresheet-wrapper .csd-rowcell input[type="checkbox"]:disabled:checked::after {
  content: "✓" !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: bold !important;
  line-height: 1 !important;
}

/* Mobile: Smaller checkmarks to match compact layout */

@media (max-width: 767px) {
  .csd-rowcell input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    border: 1.5px solid #6b7280 !important;
    border-radius: 3px !important;
  }
}

@media (max-width: 767px) {
  .csd-rowcell input[type="checkbox"]:checked::after {
    font-size: 14px !important;
  }
}

/* ----------------------------------------------------------------------------
  * 1.7 Player Details Modal for Mobile
  * Show hidden feat counts and stats in a modal popup
  * ---------------------------------------------------------------------------- */

/* Desktop: Hide the modal button */

/* Mobile: Show modal trigger button */

/* Hide desktop chips and mini stats on mobile */

@media (max-width: 767px) {
  .csd-chips-wrap {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .csd-mini {
    display: none !important;
  }
}

/* Modal trigger button - very subtle and compact */

@media (max-width: 767px) {
  .csd-player-details-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: .3rem !important;
    cursor: pointer !important;
    user-select: none !important;
    padding: .15rem 0 !important;
    margin-top: .2rem !important;
    background: transparent !important;
    border: none !important;
    font-size: .65rem !important;
    font-weight: 400 !important;
    color: #9ca3af !important;
    transition: all 0.2s ease !important;
    line-height: 1.1 !important;
    width: 100% !important;
    text-align: left !important;
  }
}

/* Hover state - very subtle */

@media (max-width: 767px) {
  .csd-player-details-btn:hover {
    color: #6b7280 !important;
  }
}

@media (max-width: 767px) {
  .csd-player-details-btn:hover .csd-player-details-text {
    text-decoration: underline !important;
    text-decoration-thickness: 0.5px !important;
    text-underline-offset: 1px !important;
  }
}

/* Active/pressed state */

@media (max-width: 767px) {
  .csd-player-details-btn:active {
    opacity: 0.7 !important;
  }
}

/* Icon styling */

@media (max-width: 767px) {
  .csd-player-details-icon {
    font-size: .8rem !important;
    color: #9ca3af !important;
    flex-shrink: 0 !important;
  }
}

/* Text styling */

@media (max-width: 767px) {
  .csd-player-details-text {
    flex: 1 !important;
    text-align: left !important;
  }
}

/* Desktop: Hide modal button */

@media (min-width: 768px) {
  .csd-player-details-btn {
    display: none !important;
  }
}

/* Modal Styles */

.csd-modal {
  display: none !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 10000 !important;
  pointer-events: none !important;
}

.csd-modal.csd-modal-open {
  display: block !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

.csd-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.csd-modal.csd-modal-open .csd-modal-overlay {
  opacity: 1;
}

.csd-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: .5rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 90vw;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.csd-modal.csd-modal-open .csd-modal-content {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.csd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.csd-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

.csd-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .25rem;
  transition: all 0.2s ease;
}

.csd-modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.csd-modal-body {
  padding: 1.25rem;
}

.csd-modal-score {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #374151;
}

.csd-modal-score strong {
  color: #111827;
}

.csd-modal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1rem;
}

.csd-modal-chips .csd-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: .25rem .75rem;
  font-size: .875rem;
  background: #f9fafb;
  color: #374151;
}

.csd-modal-chips .csd-chip .csd-chip-k {
  font-weight: 600;
  letter-spacing: .02em;
}

.csd-modal-stats {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .875rem;
  color: #374151;
}

.csd-modal-stats div {
  padding: .5rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.csd-modal-stats div:last-child {
  border-bottom: none;
}

/* FIX: Explicit mobile grid override for teams */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll .csd-grid {
    grid-template-columns: minmax(60px, 1fr) 45px 45px !important;
    grid-auto-rows: minmax(32px, auto) !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* Override global mobile min-heights (44px) for teams portrait */

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-header {
    min-height: 32px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
  }
}

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell select,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell input {
    min-height: 30px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-player-subtext {
    margin-top: -2px !important;
    line-height: 1 !important;
    font-size: 0.6rem !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-player-cell {
    justify-content: flex-start !important;
    padding-top: 2px !important;
    white-space: normal !important;
    overflow: visible !important;
  }
}

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-score-cell {
    font-weight: normal !important;
    font-size: 14px !important;
  }
}

/* Ensure strict hiding of columns (including row number #) */

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-num,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-hcp,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-bb,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-ro,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-tro {
    display: none !important;
  }
}

/* -----------------------------------------------------------
      MOBILE CELL DISPLAY (Clean)
      ----------------------------------------------------------- */

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-player,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-pts,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-score {
    display: flex !important;
    align-items: center !important;
    background: transparent !important;
  }
}

/* Player cell: Left align */

@media (max-width: 767px) {
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-player {
    justify-content: flex-start !important;
  }
}

/* Pts/Score: Center align */

@media (max-width: 767px) {

  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-pts,
  #scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-col-score {
    justify-content: center !important;
  }
}

/* -----------------------------------------------------------
      ROUND TOTALS LAYOUT (Structured)
      ----------------------------------------------------------- */

.csd-totals-container {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 15px;
  width: 100%;
}

/* Desktop: Add "Round Totals" label on left, push data to right */

@media (min-width: 768px) {
  .csd-totals-container::before {
    content: "Round Totals";
    font-weight: bold;
    color: #444;
    font-size: 1rem;
    margin-right: auto;
    padding-left: 10px;
  }
}

.csd-total-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
}

.csd-total-label {
  font-weight: bold;
  color: #444;
}

.csd-total-value {
  font-weight: bold;
}

/* Mobile: Headers above Values */

@media (max-width: 767px) {
  .csd-totals-container {
    justify-content: space-between;
    gap: 2px;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  .csd-total-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: right;
    min-width: 0;
    line-height: 1.1;
  }
}

@media (max-width: 767px) {
  .csd-total-label {
    font-size: clamp(10px, 2.2vw, 13px);
    text-transform: uppercase;
    color: #888;
    margin-bottom: 1px;
  }
}

@media (max-width: 767px) {
  .csd-total-value {
    font-size: clamp(11px, 2.5vw, 14px);
  }
}

/* ============================================================================
    FONT SCALING & PADDING REFACTOR (User Request)
    ============================================================================ */

/* 1. Scale font size slightly up for all game row cells */

/* Applied to scroll container to scale children relative to base */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-round-scroll {
  font-size: 1.1em !important;
}

/* 2. Reduce padding to compensate (take the diff back) */

/* Force tighter padding on all cells (2px matches tightest mobile setting) */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-rowcell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-header {
  padding-left: 2px !important;
  padding-right: 2px !important;
}

/* 3. Make Player Name column bold */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-player-cell,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-player-cell select,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-teams-player-dropdown {
  font-weight: normal !important;
  color: #212529 !important;
}

/* 4. Animated 8-Ball Icon for Feats (BB, RO, TRO) - NUCLEAR OPTION */

/* Card Actions container for relocated buttons */

.csd-card {
  position: relative !important;
}

.csd-card-actions {
  position: absolute !important;
  top: 0.5rem;
  right: 0.5rem;
  display: flex !important;
  gap: 0.4rem;
  z-index: 20;
}

.csd-player-title {
  font-size: 0.75rem !important;
  opacity: 0.8 !important;
  margin-bottom: 0px !important;
  line-height: 1 !important;
}

.csd-card-actions button {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.csd-card-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

@media (max-width: 767px) {
  .csd-card-actions {
    top: 0.25rem;
    right: 0.25rem;
  }
}

/* Target checkboxes inside cells identified by data-csd-field="brk", "ero", "tro" */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"],
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"],
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"],
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"],
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"],
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 1.5em !important;
  height: 1.5em !important;
  border: 1px solid #dee2e6 !important;
  border-radius: 50% !important;
  background-color: #fff !important;
  cursor: pointer !important;
  display: inline-block !important;
  vertical-align: middle !important;
  position: relative !important;
  margin: 0 !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  content: none !important;
}

/* Feat cell highlight: Light gold background and glow when checked */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="brk"]:has(input:checked),
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="ero"]:has(input:checked),
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="tro"]:has(input:checked),
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="brk"]:has(input:checked),
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="ero"]:has(input:checked),
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="tro"]:has(input:checked) {
  background-color: #f5f7ff !important;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.04) !important;
  transition: background-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Hide pseudo-elements (standard checkmarks often use ::before/::after) */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]::before,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]::after,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]::before,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]::after,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]::before,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]::after,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]::before,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]::after,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]::before,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]::after,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]::before,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]::after {
  content: none !important;
  display: none !important;
  background: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}

/* Ensure no checks/background image when unchecked */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:not(:checked),
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:not(:checked),
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:not(:checked),
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:not(:checked),
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:not(:checked),
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:not(:checked) {
  background-image: none !important;
}

/* Checked state: Default to 8-Ball (Black Solid) if no specific round type */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:checked,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:checked,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:checked,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:checked,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:checked,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:checked {
  background-color: #000 !important;
  border-color: #000 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='black'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='35' text-anchor='middle' fill='black'%3E8%3C/text%3E%3C/svg%3E") !important;
  background-size: 100% !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
  animation: spin-in 0.85s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* 9-Ball overrides: Yellow Stripe */

/* Use attribute selector on parent round container to target 9b games */

/* Note: The checkboxes are nested deep inside .csd-sheet-... ID csd-round-... data-csd-round-game-type="9b" */

/* We need to target based on the round container's attribute */

/* Assuming round container wraps the grid? Yes, we added it to .csd-sheet-... */

/* Selector: .csd-sheet-[data-csd-round-game-type="9b"] ... input:checked (but exact structure is complex) */

/* The input is inside .csd-cell inside .csd-grid inside .csd-col inside .csd-two inside .csd-round-scroll inside .csd-sheet-... */

/* 9-Ball overrides: Yellow Stripe */

#scoresheet-designer div[data-csd-round-game-type="9b"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:checked,
#scoresheet-designer div[data-csd-round-game-type="9b"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:checked,
#scoresheet-designer div[data-csd-round-game-type="9b"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:checked {
  background-color: #fff !important;
  border-color: #ffc107 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='white'/%3E%3Crect x='0' y='20' width='100' height='60' fill='%23ffc107'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='35' text-anchor='middle' fill='black'%3E9%3C/text%3E%3C/svg%3E") !important;
}

/* 10-Ball overrides: Blue Stripe */

#scoresheet-designer div[data-csd-round-game-type="10b"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:checked,
#scoresheet-designer div[data-csd-round-game-type="10b"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:checked,
#scoresheet-designer div[data-csd-round-game-type="10b"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:checked {
  background-color: #fff !important;
  border-color: #0d6efd !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='white'/%3E%3Crect x='0' y='20' width='100' height='60' fill='%230d6efd'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='30' text-anchor='middle' fill='black'%3E10%3C/text%3E%3C/svg%3E") !important;
}

@keyframes spin-in {
  0% {
    transform: scale(0) rotate(-1440deg);
    opacity: 0;
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Disabled state */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:disabled,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:disabled,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:disabled,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:disabled,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:disabled,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:disabled {
  background-color: #e9ecef !important;
  border-color: #dee2e6 !important;
  border-radius: 0.25em !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  filter: grayscale(1) !important;
  background-image: none !important;
}

/* If disabled AND checked (e.g. handicap wins), show 8-ball but greyed out - DEFAULT */

#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:disabled:checked,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:disabled:checked,
#scoresheet-designer[data-csd-game-type="teams_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:disabled:checked,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="brk"] input[type="checkbox"]:disabled:checked,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="ero"] input[type="checkbox"]:disabled:checked,
#scoresheet-designer[data-csd-game-type="singles_standard_gameplay"] .csd-cell[data-csd-field="tro"] input[type="checkbox"]:disabled:checked {
  background-color: #555 !important;
  border-color: #555 !important;
  border-radius: 50% !important;
  opacity: 0.7 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='black'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='35' text-anchor='middle' fill='black'%3E8%3C/text%3E%3C/svg%3E") !important;
}

/* Checkbox wrapper to increase touch target */

.csd-checkbox-wrapper {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent;
}

/* Ensure input inside wrapper behaves correctly */

.csd-checkbox-wrapper input[type="checkbox"] {
  margin: 0 !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
  width: 24px;
  height: 24px;
}

/* Scenario 1: Row error styling - glowing background with normal borders */

.csd-rowcell.csd-row-error {
  background-color: #fca5a5 !important;
  box-shadow: 0 0 10px 3px rgba(220, 38, 38, 0.6) !important;
  position: relative !important;
  z-index: 5 !important;
}

/* Mobile Feats Modal Trigger (inside Score cell) */

.csd-teams-score-cell {
  position: relative !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.csd-score-value {
  z-index: 1;
}

.csd-mobile-feat-trigger {
  display: none;
  position: absolute !important;
  top: 1px !important;
  right: -1px !important;
  font-size: 11px !important;
  color: #9ca3af !important;
  pointer-events: none !important;
  line-height: 1 !important;
  z-index: 5 !important;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
  transition: all 0.2s ease;
}

.csd-mobile-feat-trigger.has-feats {
  color: #fbbf24 !important;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.8), 0 0 4px rgba(251, 191, 36, 0.4);
}

@media (max-width: 767px) {
  .csd-mobile-feat-trigger {
    display: inline-block !important;
  }
}

/* Feats Modal Styling */

.csd-feats-modal .modal-content {
  border-radius: 16px;
  border: none;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.csd-feats-modal .modal-header {
  border-bottom: 1px solid #eee;
  background: #fcfcfc;
  border-radius: 16px 16px 0 0;
}

.csd-feats-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.csd-feat-row {
  background: #fff;
  transition: all 0.2s ease;
  border: 1px solid #eee !important;
}

.csd-feat-row:active {
  background: #f8f9fa;
}

.csd-feat-label {
  font-weight: 700 !important;
  color: #333 !important;
  letter-spacing: 0.5px;
}

/* Modal Checkbox Styling (Targeting the actual ball animations) */

.csd-feat-checkbox {
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 32px !important;
  height: 32px !important;
  border: 2px solid #dee2e6 !important;
  border-radius: 50% !important;
  background-color: #fff !important;
  cursor: pointer !important;
  position: relative !important;
  margin: 0 !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* Rotation Animation Keyframes */

@keyframes csdSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.csd-feat-checkbox:checked {
  animation: csdSpin 0.3s ease-in-out;
  transform: rotate(360deg);
}

/* Ensure consistent vertical alignment */

.csd-feat-row {
  align-items: center !important;
}

.csd-feat-label {
  line-height: 1.2;
  display: flex;
  align-items: center;
}

/* --- HIGH SPECIFICITY BALL ICON OVERRIDES (Grid & Modal) --- */

/* 8-Ball Default (Solid Black) - High Specificity - EXCLUDING WIN COLUMN */

#scoresheet-designer div[data-csd-round-game-type="8b"] .csd-cell[data-csd-field]:not([data-csd-field="win"]) input[type="checkbox"]:checked,
#scoresheet-designer div[data-csd-round-game-type="8b"] .csd-cell[data-csd-field]:not([data-csd-field="win"]) input[type="checkbox"]:disabled:checked,
.csd-feats-modal[data-csd-round-game-type="8b"] .csd-feat-checkbox:checked {
  background-color: #000 !important;
  border-color: #000 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='black'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='35' text-anchor='middle' fill='black'%3E8%3C/text%3E%3C/svg%3E") !important;
  background-size: cover !important;
  filter: none !important;
  opacity: 1 !important;
}

/* 9-Ball (Yellow Stripe) - EXCLUDING WIN COLUMN */

#scoresheet-designer div[data-csd-round-game-type="9b"] .csd-cell[data-csd-field]:not([data-csd-field="win"]) input[type="checkbox"]:checked,
#scoresheet-designer div[data-csd-round-game-type="9b"] .csd-cell[data-csd-field]:not([data-csd-field="win"]) input[type="checkbox"]:disabled:checked,
.csd-feats-modal[data-csd-round-game-type="9b"] .csd-feat-checkbox:checked {
  background-color: #fff !important;
  border-color: #ffc107 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='white'/%3E%3Crect x='0' y='20' width='100' height='60' fill='%23ffc107'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='35' text-anchor='middle' fill='black'%3E9%3C/text%3E%3C/svg%3E") !important;
  background-size: cover !important;
  filter: none !important;
  opacity: 1 !important;
}

/* 10-Ball (Blue Stripe) - EXCLUDING WIN COLUMN */

#scoresheet-designer div[data-csd-round-game-type="10b"] .csd-cell[data-csd-field]:not([data-csd-field="win"]) input[type="checkbox"]:checked,
#scoresheet-designer div[data-csd-round-game-type="10b"] .csd-cell[data-csd-field]:not([data-csd-field="win"]) input[type="checkbox"]:disabled:checked,
.csd-feats-modal[data-csd-round-game-type="10b"] .csd-feat-checkbox:checked {
  background-color: #fff !important;
  border-color: #0d6efd !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='white'/%3E%3Crect x='0' y='20' width='100' height='60' fill='%230d6efd'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='30' text-anchor='middle' fill='black'%3E10%3C/text%3E%3C/svg%3E") !important;
  background-size: cover !important;
  filter: none !important;
  opacity: 1 !important;
}

/* --- LOADING STATE / SPINNER (REVISED) --- */

/* Custom morphing ball loader with opaque overlay */

/* Hide legacy controls in CSD modes (Teams/Singles) */

body.is-csd-game #syncsheets_checkbox,
body.is-csd-game #syncsheets_checkbox+label,
body.is-csd-game #winnerscircles_checkbox,
body.is-csd-game #winnerscircles_checkbox+label,
body.is-csd-game #precalc_hcp_checkbox,
body.is-csd-game #precalc_hcp_checkbox+label,
body.is-csd-game #new_livescorescol,
body.is-csd-game #moreinfo_button {
  display: none !important;
}

/* Also hide the parent form-check if needed, but the IDs above should cover the essentials */

body.is-csd-game .form-check:has(#syncsheets_checkbox),
body.is-csd-game .form-check:has(#winnerscircles_checkbox),
body.is-csd-game .form-check:has(#precalc_hcp_checkbox) {
  display: none !important;
}

.csd-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  /*Optional: blur content behind;*/
}

.csd-loader-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.csd-loader-text {
  margin-top: 30px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: #333;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

/* Spinner & Logo Branding Wrapper */

.csd-loader-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  background: rgba(0, 0, 0, 0.85);
  padding: 35px 50px;
  border-radius: 25px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.csd-loader-logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.csd-loader-logo {
  max-width: 160px;
  max-height: 60px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Spinner Wrapper (Rotates continuously) */

.csd-ball-spinner-wrapper {
  width: 80px;
  height: 80px;
  position: relative;
  animation: csdSpin 2s linear infinite;
}

/* Individual Ball Layer */

.csd-spinner-ball {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 50%;
  opacity: 0;
  animation: csdBallFade 6s ease-in-out infinite;
}

/* Specific Ball Images (pasted from inline SVGs above for consistency) */

.csd-spinner-ball.ball-9 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='white'/%3E%3Crect x='0' y='20' width='100' height='60' fill='%23ffc107'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='35' text-anchor='middle' fill='black'%3E9%3C/text%3E%3C/svg%3E");
  animation-delay: 0s;
}

.csd-spinner-ball.ball-10 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='white'/%3E%3Crect x='0' y='20' width='100' height='60' fill='%230d6efd'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='30' text-anchor='middle' fill='black'%3E10%3C/text%3E%3C/svg%3E");
  animation-delay: 2s;
}

.csd-spinner-ball.ball-8 {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='black'/%3E%3Ccircle cx='50' cy='50' r='25' fill='white'/%3E%3Ctext x='50' y='63' font-family='Arial' font-weight='bold' font-size='35' text-anchor='middle' fill='black'%3E8%3C/text%3E%3C/svg%3E");
  animation-delay: 4s;
}

/* Keyframes for smooth cross-fading */

@keyframes csdBallFade {
  0% {
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  28% {
    opacity: 1;
  }

  33% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

/* =========================================================================
    Dropdown Indicators
    - Small grey down arrows for select-based fields (Points, Players)
    ========================================================================= */

.csd-dropdown-indicator {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid #ccc;
  pointer-events: none;
}


/* Ensure points container has padding for the arrow */

.csd-points-container .csd-points-display {
  padding-right: 12px !important;
}

/* Ensure player cells have padding for the arrow */

.csd-teams-player-cell {
  position: relative !important;
}

.csd-teams-player-cell .csd-dropdown-indicator {
  right: 2px;
  bottom: 2px;
  top: auto;
  border-top-color: #bbb;
}

/* Desktop points dropdown adjustments */

@media (min-width: 992px) {
  .csd-points-container .csd-dropdown-indicator {
    right: 2px;
    bottom: 2px;
    top: auto;
    border-top-width: 3px;
    border-left-width: 3.5px;
    border-right-width: 3.5px;
  }
}

/* Player/Watcher role banner on scoresheet page (read-only spectator view) */

.csd-spectator-role-banner {
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 4px;
  font-size: 13px;
}

.csd-role-player {
  background: rgba(40, 167, 69, 0.15);
  border: 1px solid rgba(40, 167, 69, 0.6);
  color: #28a745;
  font-weight: 600;
  animation: csd-player-banner-sparkle 15s ease-in-out 1;
  animation-fill-mode: forwards;
}

@keyframes csd-player-banner-sparkle {

  0%,
  100% {
    box-shadow: none;
    border-color: rgba(40, 167, 69, 0.6);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    box-shadow: 0 0 12px rgba(40, 167, 69, 0.8), 0 0 20px rgba(40, 167, 69, 0.3);
    border-color: rgba(40, 167, 69, 1);
  }

  20%,
  40%,
  60%,
  80% {
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.5);
    border-color: rgba(40, 167, 69, 0.85);
  }
}

.csd-role-spectator {
  background: rgba(0, 123, 255, 0.15);
  border: 1px solid rgba(0, 123, 255, 0.6);
  color: #007bff;
  font-weight: 600;
}

.csd-role-official {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.7);
  color: #ffc107;
  font-weight: 600;
}

.csd-official-emphasis {
  font-weight: 800;
}

/* Responsive spectator banner: left=text+timestamp, right=share */
.csd-spectator-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: clamp(12px, 2.5vw, 14px);
}
.csd-spectator-banner-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.csd-spectator-banner-inner .csd-spectator-banner-timestamp {
  font-weight: 500;
  font-size: 0.9em;
}
.csd-spectator-banner-inner .csd-spectator-share-link {
  color: #fff;
  text-decoration: underline;
  flex-shrink: 0;
}
.csd-spectator-banner-inner .csd-spectator-share-link:hover {
  color: #fff;
  opacity: 0.9;
}
@media (max-width: 480px) {
  .csd-spectator-banner-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .csd-spectator-banner-inner .csd-spectator-share-link {
    align-self: flex-end;
  }
}

/* CSD spectator live bar (inside .csd-bar, scoresheet page) */

.csd-spectator-share-wrap {
  font-size: 12px;
}

.csd-spectator-share-wrap a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.csd-spectator-share-wrap a:hover {
  text-decoration: underline;
}

/* Spectator live bar: left=Live+Home/Away+lastupdate, right=Share */
.csd-spectator-live-bar {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  /* Align to the left now */
  gap: 0.25rem !important;
  margin-left: 0 !important;
  /* Remove auto margin */
  padding-left: 0 !important;
  border-left: none !important;
  /* Remove border divider */
}

.csd-spectator-live-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  /* Align to the left */
  gap: 0.75rem !important;
}

.csd-spectator-share-link {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  white-space: nowrap;
  display: inline-block;
  font-size: 13px;
  font-weight: inherit;
  padding: 0.15em 0;
  min-width: 11em;
  text-align: right;
  /* Hover: visual-only so layout doesn't shift (no font-size/weight change) */
}

.csd-spectator-share-link:hover {
  color: #fff;
  text-decoration: underline;
  font-size: 13px;
  font-weight: inherit;
}

.csd-spectator-homeaway-wrap .btn-group-toggle .btn {
  font-size: 12px;
  padding: 0.25rem 0.5rem;
}

.csd-spectator-update-wrap {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
  color: #fff;
}

.csd-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.csd-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.5);
  animation: csd-live-pulse 2s ease-in-out infinite;
}

.csd-not-live-badge {
  background: rgba(108, 117, 125, 0.2) !important;
  color: #6c757d !important;
  border: 1px solid rgba(108, 117, 125, 0.5) !important;
  animation: none !important;
}

.csd-not-live-badge::before {
  background: #6c757d !important;
  animation: none !important;
}

@keyframes csd-live-pulse {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
  }

  50% {
    opacity: 0.95;
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0);
  }
}

.csd-live-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: csd-live-dot 1.5s ease-in-out infinite;
}

@keyframes csd-live-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.85);
  }
}

.csd-update-recent {
  color: #28a745 !important;
}

.csd-update-stale {
  color: #495057 !important;
}

.csd-update-inactivity {
  color: #d97706 !important;
  /* Amber 600 - legible warning yellow */
  font-weight: 500;
}

.csd-update-pending {
  color: #ffc107 !important;
}

/* ============================================================================
   STICKY BOTTOM SCORE BAR (Spectator + Captain scoresheet)
   Always visible overlay - Home vs Away summary. Mobile + large screen optimized.
   ============================================================================ */

#csd-sticky-score-bar {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1050 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 6px 36px 6px 48px !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.97) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35) !important;
  border-top: 1px solid rgba(148, 163, 184, 0.2) !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  transition: transform 0.2s ease, opacity 0.2s ease !important;
}

#csd-sticky-score-bar.csd-sticky-dismissed {
  transform: translateY(100%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

#csd-sticky-score-bar .csd-sticky-close {
  position: absolute !important;
  top: 4px !important;
  right: 6px !important;
  width: 22px !important;
  height: 22px !important;
  padding: 0 !important;
  border: none !important;
  background: rgba(148, 163, 184, 0.2) !important;
  color: rgba(248, 250, 252, 0.8) !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.15s, color 0.15s !important;
}

#csd-sticky-score-bar .csd-sticky-close:hover {
  background: rgba(248, 250, 252, 0.15) !important;
  color: #fff !important;
}



#csd-sticky-score-bar .csd-sticky-inner {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#csd-sticky-score-bar .csd-sticky-table {
  margin: 0 auto !important;
  width: auto !important;
  max-width: 420px !important;
  border-collapse: collapse !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #f8fafc !important;
}

#csd-sticky-score-bar .csd-sticky-table th,
#csd-sticky-score-bar .csd-sticky-table td {
  padding: 2px 8px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

#csd-sticky-score-bar .csd-sticky-header-row th {
  font-size: 10px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding-bottom: 0 !important;
}

#csd-sticky-score-bar .csd-sticky-th-home {
  color: #93c5fd !important;
}

#csd-sticky-score-bar .csd-sticky-th-away {
  color: #fcd34d !important;
}

#csd-sticky-score-bar .csd-sticky-subheader-row th {
  font-size: 9px !important;
  font-weight: 600 !important;
  color: rgba(248, 250, 252, 0.6) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  padding: 1px 8px 3px !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25) !important;
}

#csd-sticky-score-bar .csd-sticky-th-sheet {
  text-align: left !important;
  min-width: 36px !important;
}

#csd-sticky-score-bar .csd-sticky-th-rounds,
#csd-sticky-score-bar .csd-sticky-td-rounds {
  min-width: 44px !important;
}

#csd-sticky-score-bar .csd-sticky-th-score,
#csd-sticky-score-bar .csd-sticky-td-score {
  min-width: 40px !important;
}

#csd-sticky-score-bar .csd-sticky-td-sheet {
  font-size: 9px !important;
  font-weight: 600 !important;
  color: rgba(248, 250, 252, 0.6) !important;
  text-align: left !important;
  padding: 2px 8px !important;
}

#csd-sticky-score-bar .csd-sticky-row td {
  padding: 2px 8px !important;
}

/* Elegant Home/Away Separation in Sticky Bar */
#csd-sticky-score-bar .csd-sticky-th-away {
  border-left: 1px solid rgba(148, 163, 184, 0.3) !important;
}

#csd-sticky-score-bar .csd-sticky-subheader-row th:nth-child(4),
#csd-sticky-score-bar .csd-sticky-row td:nth-child(4) {
  border-left: 1px solid rgba(148, 163, 184, 0.3) !important;
}

/* Colorize the scores slightly to match header colors, pop out from rounds */
#csd-sticky-score-bar .csd-sticky-row td:nth-child(3) {
  color: #bae6fd !important;
  /* Soft light blue for Home Score */
  font-weight: 700 !important;
}

#csd-sticky-score-bar .csd-sticky-row td:nth-child(5) {
  color: #fde68a !important;
  /* Soft yellow for Away Score */
  font-weight: 700 !important;
}

#csd-sticky-score-bar .csd-sticky-row td:nth-child(2),
#csd-sticky-score-bar .csd-sticky-row td:nth-child(4) {
  color: rgba(248, 250, 252, 0.8) !important;
  /* Slightly dim rounds to emphasize score */
}

/* Large screens: slightly more room */
@media (min-width: 992px) {
  #csd-sticky-score-bar {
    padding: 8px 40px 8px 48px !important;
  }

  #csd-sticky-score-bar .csd-sticky-inner {
    gap: 10px !important;
    max-width: 800px !important;
  }

  #csd-sticky-score-bar .csd-sticky-table {
    font-size: 13px !important;
    max-width: 460px !important;
  }

  #csd-sticky-score-bar .csd-sticky-header-row th {
    font-size: 11px !important;
  }

  #csd-sticky-score-bar .csd-sticky-subheader-row th {
    font-size: 10px !important;
    padding: 2px 10px 4px !important;
  }

  #csd-sticky-score-bar .csd-sticky-table th,
  #csd-sticky-score-bar .csd-sticky-table td {
    padding: 3px 10px !important;
  }

  #csd-sticky-score-bar .csd-sticky-th-rounds,
  #csd-sticky-score-bar .csd-sticky-td-rounds {
    min-width: 48px !important;
  }
}

/* Tablet: balanced */
@media (max-width: 767px) {
  #csd-sticky-score-bar {
    padding: 5px 28px 5px 44px !important;
  }

  #csd-sticky-score-bar .csd-sticky-inner {
    gap: 6px !important;
  }

  #csd-sticky-score-bar .csd-sticky-table {
    font-size: 12px !important;
    max-width: 380px !important;
  }

  #csd-sticky-score-bar .csd-sticky-table th,
  #csd-sticky-score-bar .csd-sticky-table td {
    padding: 2px 6px !important;
  }

  #csd-sticky-score-bar .csd-sticky-header-row th {
    font-size: 11px !important;
  }

  #csd-sticky-score-bar .csd-sticky-subheader-row th {
    font-size: 9px !important;
    padding: 2px 8px 5px !important;
  }

  #csd-sticky-score-bar .csd-sticky-td-sheet {
    font-size: 9px !important;
  }

  #csd-sticky-score-bar .csd-sticky-th-rounds,
  #csd-sticky-score-bar .csd-sticky-td-rounds {
    min-width: 38px !important;
  }

  #csd-sticky-score-bar .csd-sticky-th-score,
  #csd-sticky-score-bar .csd-sticky-td-score {
    min-width: 34px !important;
  }
}

/* Mobile: compact */
@media (max-width: 480px) {
  #csd-sticky-score-bar {
    padding: 4px 26px 4px 40px !important;
  }

  #csd-sticky-score-bar .csd-sticky-inner {
    gap: 6px !important;
  }

  #csd-sticky-score-bar .csd-sticky-table {
    font-size: 12px !important;
    max-width: 320px !important;
  }

  #csd-sticky-score-bar .csd-sticky-table th,
  #csd-sticky-score-bar .csd-sticky-table td {
    padding: 2px 6px !important;
  }

  #csd-sticky-score-bar .csd-sticky-header-row th {
    font-size: 10px !important;
  }

  #csd-sticky-score-bar .csd-sticky-subheader-row th {
    font-size: 8px !important;
    padding: 2px 6px 4px !important;
  }

  #csd-sticky-score-bar .csd-sticky-td-sheet {
    font-size: 8px !important;
  }

  #csd-sticky-score-bar .csd-sticky-th-rounds,
  #csd-sticky-score-bar .csd-sticky-td-rounds {
    min-width: 32px !important;
  }

  #csd-sticky-score-bar .csd-sticky-th-score,
  #csd-sticky-score-bar .csd-sticky-td-score {
    min-width: 28px !important;
  }
}

/* Interactive game numbers for custom numbering */
.csd-rownum.csd-interactive-num {
  cursor: pointer !important;
  transition: background-color 0.2s, color 0.2s;
  position: relative;
  z-index: 10;
}

.csd-rownum.csd-interactive-num:hover {
  background-color: #bbdefb !important;
  color: #0d47a1 !important;
  font-weight: bold !important;
  box-shadow: inset 0 0 0 1px #42a5f5;
}

.csd-rownum.csd-interactive-num:active {
  background-color: #90caf9 !important;
}

/* Edit icon for interactive game numbers */
.csd-edit-icon {
  font-size: 0.75em !important;
  color: #42a5f5 !important;
  margin-right: 4px !important;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.csd-interactive-num:hover .csd-edit-icon {
  opacity: 1;
  color: #0d47a1 !important;
}


/* Fix for division picker dropdown getting hidden behind CSD elements with high z-index */
#divpicker_dropdown {
  position: relative;
  z-index: 10005 !important;
}

#divpicker_dropdown .dropdown-menu {
  z-index: 10005 !important;
}

/* --- MOBILE GAME NUMBER OVERLAY (User Request) --- */
/* Small light-grey number in top left of player name cell - only visible on narrow displays */
.csd-mobile-game-number {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 10px;
  color: #999;
  font-weight: 500;
  pointer-events: none;
  display: none;
  /* Hidden by default */
  user-select: none;
}


/* Only show on narrow screens where the # column is hidden */
@media (max-width: 767px) {
  .csd-mobile-game-number {
    display: block;
    top: 1px !important;
    left: 2px !important;
    font-size: 8px !important;
    /* slightly smaller so it doesn't compete with name */
  }
}

/* --- MOBILE PLAYER CELL TIGHTENING (User Request) --- */
/* Optimized spacing for Player Name + HCP/CPR subtext */

/* Mobile Screens (Narrow / Landscape) */
@media (max-width: 767px) {
  .csd-teams-player-cell {
    min-height: 26px !important;
    padding-top: 0 !important;
    justify-content: center !important;
    /* vertically center name+subtext */
  }

  .csd-teams-player-dropdown,
  .csd-readonly-player-name {
    height: 16px !important;
    max-height: 16px !important;
    line-height: 1.1 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 12px !important;
  }

  .csd-player-subtext {
    margin-top: -2px !important;
    font-size: 9px !important;
    height: 10px !important;
    line-height: 1 !important;
  }
}

/* Extra Tight for Portrait Mobile (Very Narrow, < 480px) */
@media (max-width: 480px) {
  .csd-teams-player-cell {
    padding-top: 1px !important;
  }

  .csd-teams-player-dropdown,
  .csd-readonly-player-name {
    height: 15px !important;
    max-height: 15px !important;
    font-size: 12px !important;
  }

  .csd-player-subtext {
    margin-top: -3px !important;
  }
}

/* CPR value: slightly smaller to fit in tight spaces (player subtext, add-player modal, info list) */
.csd-cpr-value {
  font-size: 0.9em !important;
}

/* CPR under player name on singles cards (when Run TRS as CPR is enabled) */
.csd-singles-cpr-subtext {
  font-size: 0.75rem !important;
  color: #6b7280 !important;
  margin-top: 0.125rem !important;
  line-height: 1.2 !important;
}

/* Break Indicator badge — upper right corner of the # cell (Singles) or player name cell (Teams) */
.csd-rownum {
  position: relative !important;
  overflow: visible !important;
}

.csd-teams-player-cell {
  position: relative !important;
  overflow: visible !important;
}

.csd-break-indicator {
  position: absolute;
  top: -2px;
  right: -6px;
  left: auto !important;
  transform: none !important;
  width: 16px;
  height: 16px;
  object-fit: contain;
  pointer-events: none;
  z-index: 50;
  background: white;
  border-radius: 50%;
  padding: 1px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
  opacity: 0.9;
}

/* Teams badge class — same positioning, just confirms upper-right */
.csd-break-indicator-teams {
  top: -2px !important;
  right: -6px !important;
  left: auto !important;
  transform: none !important;
  width: 16px !important;
  height: 16px !important;
}

/* Mobile: slightly smaller */
@media (max-width: 767px) {

  .csd-break-indicator,
  .csd-break-indicator-teams {
    width: 13px !important;
    height: 13px !important;
    top: -1px !important;
    right: -4px !important;
  }
}

/* Round header break badge */
.csd-round-break-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  vertical-align: middle;
  gap: 3px;
  opacity: 0.9;
}

.csd-round-break-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: middle;
}