/* =========================
   Scorecard (Single-Table Layout)
   Extracted from main.css
   ========================= */

/* =========================
   Scorecard (Single-Table Layout)
   ========================= */
.scorecard-container {
  display: block;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  overflow: hidden;
  margin: var(--space-md) 0 0;
  border-bottom: none;
}

.scorecard-card-footer {
  background: var(--panel-alt);
  border: none;
  border-top: 2px solid rgba(168, 179, 191, 0.15);
  border-radius: 0;
  margin: 0;
  padding: 6px 10px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-height: 58px;
  justify-content: flex-start;
}

.scorecard-footer-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}

/* Pin footer button heights so font-size changes don't grow them. */
.scorecard-footer-controls > .btn,
.scorecard-footer-controls > .scorecard-theme-toggle,
.scorecard-footer-controls > .scorecard-main-options-icon,
.scorecard-footer-controls > .scorecard-clear-actions-toggle {
  min-height: var(--footer-action-h) !important;
  height: var(--footer-action-h) !important;
  font-weight: 600 !important;
}

.scorecard-footer-controls > .scorecard-theme-toggle,
.scorecard-footer-controls > .scorecard-main-options-icon,
.scorecard-footer-controls > .scorecard-clear-actions-toggle {
  min-width: var(--footer-action-h) !important;
  width: var(--footer-action-h) !important;
  font-size: 28px !important;
}

#scorecardOptionsToggle {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scorecard-theme-toggle {
  min-width: 40px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.scorecard-footer-controls .scorecard-theme-toggle {
  min-width: 40px;
  width: 40px;
  height: auto;
  min-height: 0;
  align-self: stretch;
  padding: 0;
}

/* Score-footer icon buttons (theme, clear, main-options).
   Each has the .btn class which picks up responsive-layout.css's
   `padding: 6px 12px` rule for footer buttons. That extra padding shrinks
   the icon inside a 44px square and makes the 3 icons look visually
   uneven (each SVG sits at its own size — 20px for theme/gear, 16px for
   clear). Raise specificity to scope the icon-only rules to the footer
   container so they win the cascade. */
.scorecard-card-footer .scorecard-theme-toggle svg,
.scorecard-card-footer .scorecard-main-options-icon svg,
.scorecard-card-footer .scorecard-clear-actions-toggle svg {
  /* Normalize icon size — the clear-actions SVG ships at 16px in HTML
     while the other two ship at 20px. Forcing all three to 20px lines
     them up as a uniform icon row. */
  width: 20px;
  height: 20px;
}

.scorecard-card-footer .scorecard-main-options-icon,
.scorecard-card-footer .scorecard-clear-actions-toggle {
  margin-left: 0;
  min-width: 40px;
  width: 40px;
  height: auto;
  min-height: 0;
  align-self: stretch;
  padding: 0 !important;
  gap: 0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.scorecard-footer-controls[hidden] {
  display: none !important;
}
.scorecard-card-footer.is-compact {
  padding: 4px 8px;
  min-height: 36px;
  gap: 0;
}

.scorecard-clear-panel {
  margin: 0;
  padding: 8px 10px;
  border: none;
  border-top: 2px solid rgba(168, 179, 191, 0.2);
  border-radius: 0;
  background: var(--panel-alt);
  min-height: 63px;
  display: flex;
  align-items: center;
}

.scorecard-clear-panel[hidden] {
  display: none !important;
}

.final-round-report-panel {
  position: fixed;
  inset: 0;
  margin: 0;
  padding:
    max(10px, calc(env(safe-area-inset-top, 0px) + 10px), calc(var(--safe-top-inset, 0px) + 10px))
    8px
    max(8px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(255, 255, 255, 0.006);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10041;
}

.final-round-report-sheet {
  width: min(100%, 820px);
  max-width: min(820px, calc(100vw - 16px));
  max-height: calc(
    100dvh -
    max(16px, calc(env(safe-area-inset-top, 0px) + 10px), calc(var(--safe-top-inset, 0px) + 10px)) -
    max(16px, calc(env(safe-area-inset-bottom, 0px) + 8px))
  );
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-top: 2px solid rgba(168, 179, 191, 0.2);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 26px 56px -34px color-mix(in srgb, #000 44%, transparent);
}

.final-round-report-panel[hidden] {
  display: none !important;
}

.final-round-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: -12px -12px 10px;
  padding: 12px;
  background: inherit;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

.final-round-report-header h3 {
  margin: 0;
  font-size: var(--text-lg);
  letter-spacing: 0.01em;
}

.final-round-report-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.final-round-report-subtitle {
  color: var(--muted);
  font-size: var(--text-sm, 13px);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.final-round-report-subtitle:empty {
  display: none;
}

.final-round-report-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.final-round-report-section {
  margin-top: 10px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 4px 12px color-mix(in srgb, #000 8%, transparent);
}

.final-round-report-section:first-of-type {
  margin-top: 0;
  padding-top: 10px;
}

.final-round-report-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
}

.final-round-game-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.final-round-game-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  background: var(--panel-alt);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  padding: 6px 13px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.final-round-game-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  transform: translateY(-1px);
}

.final-round-game-chip.is-static {
  cursor: default;
}

.final-round-game-chip.is-static:hover {
  transform: none;
}
.final-round-game-chip:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 22%, transparent);
}

.final-round-game-chip.is-active,
.final-round-game-chip[aria-pressed="true"],
.final-round-game-chip[data-active="true"] {
  background: rgba(74, 158, 255, 0.18);
  border-color: rgba(74, 158, 255, 0.7);
  color: #4a9eff;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 2px rgba(74, 158, 255, 0.18);
}
#finalRoundSummary {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

.final-round-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  table-layout: fixed;
  box-sizing: border-box;
  border-collapse: collapse;
  font-size: var(--text-sm);
  border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 10px;
  overflow: hidden;
}

.final-round-table th,
.final-round-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 9px;
  text-align: right;
  white-space: nowrap;
}

.final-round-table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.85;
  background: color-mix(in srgb, var(--panel-alt) 95%, transparent);
}

.final-round-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--panel) 97%, transparent);
}

.final-round-table tbody tr:hover {
  background: color-mix(in srgb, var(--panel-alt) 90%, transparent);
}

.final-round-table th:first-child,
.final-round-table td:first-child,
.final-round-name {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.final-round-table tfoot td {
  font-weight: 700;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}/* Individual player cards */
.final-round-player-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.final-round-player-card {
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 5px 14px color-mix(in srgb, #000 10%, transparent);
}

.final-round-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel-alt) 96%, transparent),
    color-mix(in srgb, var(--panel-alt) 90%, transparent)
  );
  border-bottom: 1px solid var(--line);
}

.final-round-card-name {
  font-weight: 700;
  font-size: var(--text-md, 0.96rem);
  color: var(--ink);
}

.final-round-card-scores {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.final-round-score-badge {
  font-size: 0.74rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  opacity: 0.82;
  white-space: nowrap;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
}

.final-round-game-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.final-round-game-row:nth-child(odd) {
  background: color-mix(in srgb, var(--panel) 98%, transparent);
}

.final-round-game-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  opacity: 0.86;
}

.final-round-game-amount-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.final-round-player-amount {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.final-round-team-amount {
  font-size: 0.73rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  opacity: 0.9;
  background: color-mix(in srgb, var(--panel-alt) 92%, transparent);
}

.final-round-card-net {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 0.92rem;
  background: color-mix(in srgb, var(--panel-alt) 88%, transparent);
}

.final-round-player-amount.is-positive,
.final-round-card-net .is-positive { color: var(--accent); }

.final-round-player-amount.is-negative,
.final-round-card-net .is-negative { color: var(--danger); }

.final-round-player-amount.is-zero,
.final-round-card-net .is-zero {
  color: color-mix(in srgb, var(--ink) 55%, transparent);
}

.final-round-team-amount.is-positive { color: var(--accent); }
.final-round-team-amount.is-negative { color: var(--danger); }
.final-round-team-amount.is-zero {
  color: color-mix(in srgb, var(--ink) 52%, transparent);
}

@media (max-width: 760px) {
  .final-round-player-cards {
    grid-template-columns: 1fr;
  }}

.scorecard-clear-buttons {
  display: flex;
  gap: 6px;
  padding: 0;
  background: transparent;
  border-top: none;
  margin: 0;
  justify-content: flex-start;
  min-width: 0;
  box-sizing: border-box;
  flex-wrap: nowrap;
  width: 100%;
  align-items: stretch;
}

.scorecard-clear-buttons .btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--footer-action-h) !important;
  height: var(--footer-action-h) !important;
  font-size: var(--text-md) !important;
  font-weight: 600 !important;
  background: var(--danger);
  border-color: var(--danger);
  max-height: var(--footer-action-h); /* Added max-height */
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.scorecard-footer-controls .scorecard-clear-actions-toggle::after,
.scorecard-footer-controls .scorecard-main-options-icon::after {
}

.scorecard-controls-shell {
  background: var(--panel-alt);
  border-top: 2px solid var(--line);
  border-left: none;
  border-right: none;
  border-radius: 0;
  overflow: hidden;
  margin: 0;
  padding-bottom: 0;
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--footer-bottom-offset, 0px);
  z-index: 35;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Game Totals is positioned upward above the score footer shell.
   Keep overflow visible in score mode so it cannot be clipped off-screen
   on browsers where :has() / media-conditional overrides don't apply. */
body.mode-score .scorecard-controls-shell {
  overflow: visible;
}

.scorecard-controls-shell.has-main-options-open {
  z-index: 120;
  overflow: visible;
}

#scoreEntryPanel {
  padding-bottom: 0;
}

.scorecard-add-player-btn {
  background: rgba(74, 158, 255, 0.12);
  border-color: rgba(74, 158, 255, 0.35);
  color: #a8d4ff;
  min-width: calc(var(--footer-action-h) * 1.378125) !important;
  width: calc(var(--footer-action-h) * 1.378125) !important;
  white-space: nowrap;
  padding: 0 !important;
}

.scorecard-add-player-btn:hover {
  background: rgba(74, 158, 255, 0.22);
  border-color: rgba(74, 158, 255, 0.55);
}
.entry-panel[hidden] {
  display: none !important;
}

/* Panel crossfade — touch devices only (class added by JS).
   Note: do NOT animate transform on the panel — fixed-position footer
   shells inside become positioned relative to a transformed ancestor and
   visibly slide during the animation. Opacity only avoids that bounce. */
@keyframes entryPanelFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.entry-panel.panel-entering {
  animation: entryPanelFadeIn 160ms ease forwards;
}

#scoreEntryPanel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
  background: var(--bg);
}

#scoreEntryPanel > #main-scorecard {
  order: 1;
}

#scoreEntryPanel > .scorecard-help-notes {
  order: 2;
  max-height: 22vh;
  overflow: auto;
}

#scoreEntryPanel > .scorecard-controls-shell {
  order: 3;
  margin-top: auto;
  margin-bottom: 0;
}

#gamesEntryPanel {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-top: 0;
  padding-bottom: calc(var(--safe-bottom-inset, env(safe-area-inset-bottom, 0px)) + 130px);
  background: var(--bg);
}

/* Games mode: keep launcher/header area attached to the sticky primary tabs
   so no dark strip appears between the switcher and game content. */
body.mode-games #gamesEntryPanel {
  padding-top: 0;
}

body.mode-games #gamesEntryPanel > p.note {
  display: none;
}

.entry-switcher {
  position: relative;
  z-index: auto;
  display: flex;
  gap: 8px;
  margin: var(--space-sm) var(--space-lg) 10px;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: var(--radius-3xl);
  background: var(--panel);
}

/* Score mode: keep sticky bar attached with no visual gap underneath */
body.mode-score .entry-switcher {
  margin-bottom: 0;
}

/* Games mode: same no-gap treatment under sticky switcher */
body.mode-games .entry-switcher {
  margin-bottom: 0;
}

/* Switcher row inside a fixed footer shell — tighter margins, separated from game row */
.footer-entry-switcher {
  margin: 0 0 0;
  border-top: 2px solid var(--line);
  padding: 2px 8px var(--footer-row-bottom-clearance);
  box-shadow: none;
  background: var(--panel-alt);
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
}

.entry-switcher-btn {
  flex: 1 1 0;
  cursor: pointer;
  border: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-3xl);
  padding: 10px 14px;
  min-height: var(--footer-action-h);
  font-size: 19px;
  font-weight: 600;
}

.entry-switcher-btn.active {
  color: #d8ecff;
  background: rgba(74, 158, 255, 0.2);
  border-color: #4a9eff;
  box-shadow: none;
}

.entry-switcher-btn.active:hover {
  color: #d8ecff;
  background: rgba(74, 158, 255, 0.28);
}

/* Utility class — force left alignment where needed */
.align-left {
  text-align: left !important;
}

body.mode-score #main-scorecard {
  flex: 1 1 auto;
  min-height: 180px;
  height: auto;
  max-height: none;
  margin-top: 0;
}

.scorecard-container {
  position: relative;
  width: 100%;
  height: min(62vh, 560px);
  max-height: min(62vh, 560px);
  overflow: auto;
  overscroll-behavior: none;
  overscroll-behavior-y: none;
  scroll-behavior: auto;
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: auto;
  touch-action: pan-x pan-y;
}

/* iOS: keep scroll contained inside scorecard to minimize rubberbanding. */
@supports (-webkit-touch-callout: none) {
  #scoreEntryPanel,
  .scorecard-container {
    overscroll-behavior: none;
    overscroll-behavior-x: none;
    overscroll-behavior-y: none;
  }

  #scoreEntryPanel {
    overflow: hidden;
  }

  .scorecard-container {
    -webkit-overflow-scrolling: auto;
  }
}

/* Scrollbar styling */
.scorecard-container::-webkit-scrollbar {
  height: 2px;
  width: 2px;
}

.scorecard-header-debug-readout {
  margin: 0 0 6px;
  padding: 6px 8px;
  border: 1px dashed rgba(0, 229, 255, 0.75);
  border-radius: 8px;
  background: rgba(7, 14, 20, 0.7);
  color: #d9f7ff;
  font: 11px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.scorecard-header-debug-title {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #8de8ff;
}
.scorecard-container::-webkit-scrollbar-track {
  background: var(--panel-alt);
}

.scorecard-container::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 2px;
}

.scorecard-container::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
}

#scorecard {
  min-width: 1040px;
}

#scorecard thead th {
  position: sticky;
  top: var(--score-sticky-head-top, 0px);
  background: var(--panel-alt);
  z-index: 60;
}

#scorecard thead th {
  padding-top: calc(var(--space-xs) * var(--score-header-height-scale, 1));
  padding-bottom: calc(var(--space-xs) * var(--score-header-height-scale, 1));
}

#scorecard #parRow td,
#scorecard #parRow th {
  position: sticky;
  top: var(--score-sticky-par-top, 44px);
  z-index: 50;
  background: var(--panel-alt);
}

#scorecard #hcpRow td,
#scorecard #hcpRow th {
  position: sticky;
  top: var(--score-sticky-hcp-top, 88px);
  z-index: 40;
  background: var(--panel-alt);
}

/* Let touch drags started on sticky header/par/hcp rows scroll the pane on iOS. */
#scorecard thead th,
#scorecard #parRow td,
#scorecard #parRow th,
#scorecard #hcpRow td,
#scorecard #hcpRow th {
  pointer-events: none;
}

th,
td {
  border-bottom: 2px solid var(--line);
  text-align: center;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  padding: var(--space-xs) 3px;
  white-space: nowrap;
}

/* Sticky left columns (Player + CH) */
#scorecard th:first-child,
#scorecard td:first-child {
  text-align: left;
  padding: var(--space-xs) 6px;
  min-width: 120px;
  max-width: 120px;
  width: 120px;
  position: sticky;
  left: 0;
  background-color: var(--panel);
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: var(--z-sticky-col);
}

#scorecard th:nth-child(2),
#scorecard td:nth-child(2) {
  min-width: 55px;
  max-width: 55px;
  width: 55px;
  padding: var(--space-xs) 3px;
  position: sticky;
  left: 120px;
  background-color: var(--panel);
  border-left: 1px solid rgba(168, 179, 191, 0.16);
  border-right: 2px solid rgba(168, 179, 191, 0.4);
  z-index: var(--z-sticky-col);
}

.scorecard-ch-header-mobile {
  display: none;
}

.scorecard-mobile-handicap-chip {
  display: none;
}

.scorecard-mobile-to-par {
  display: none;
}

/* Name cell container with delete button */
.name-cell-container {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.player-delete-btn {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  margin: 0;
  border: 2px solid var(--danger) !important;
  background: var(--danger) !important;
  color: white !important;
  border-radius: var(--radius-sm);
  font-size: calc(16px + var(--font-size-step));
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.player-delete-btn:hover {
  background: #c0392b !important;
  color: white !important;
  border-color: #c0392b !important;
  transform: scale(1.1);
}

.player-delete-btn:active {
  transform: scale(0.95);
}

/* Hide delete button on touch screens */
@media (pointer: coarse) {
  .player-delete-btn {
  }
}

/* Input styling for first columns */
#scorecard .name-edit {
  flex: 1;
  min-width: 0;
  max-width: none;
  font-size: var(--scorecard-name-font-size) !important;
  line-height: 1.2;
  padding: 6px 3px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-weight: 500;
}

/* Make player names look editable on touch devices */
@media (pointer: coarse) {
  #scorecard .name-edit {
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    padding: 6px 8px;
  }}

#scorecard .ch-input {
  width: var(--table-input-width);
  min-width: var(--table-input-width);
  height: var(--table-input-width);
  min-height: var(--table-input-width);
  aspect-ratio: 1 / 1;
  font-size: var(--scorecard-data-font-size);
  padding: 0;
  text-align: center;
  line-height: 1;
}

@media (max-width: 1024px) {
  #scorecard th:nth-child(2),
  #scorecard td:nth-child(2) {
    min-width: 52px;
    max-width: 52px;
    width: 52px;
  }

  .scorecard-ch-header-desktop {
    display: none;
  }

  .scorecard-ch-header-mobile {
    display: none;
  }

  #scorecard .scorecard-ch-col .ch-input {
    display: none;
  }

  #scorecard .scorecard-ch-col {
    text-align: center;
  }

  .scorecard-mobile-to-par {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-variant-numeric: tabular-nums;
    font-size: var(--scorecard-data-font-size);
    font-weight: 700;
    padding-left: 2px;
    padding-right: 2px;
  }

  .scorecard-mobile-to-par[data-sign="+"] {
    color: #000;
  }

  .scorecard-mobile-to-par[data-sign="-"] {
    color: var(--danger);
  }

  .scorecard-mobile-to-par[data-sign="0"] {
    color: #000;
  }

  .name-cell-container {
    position: relative;
  }

  .scorecard-mobile-handicap-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
    padding: 0;
    width: 24px;
    min-width: 24px;
    max-width: 24px;
    height: 24px;
    border: 2px solid var(--line);
    border-radius: 50%;
    font-size: var(--text-xs);
    color: var(--muted);
    background: var(--panel-alt);
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    z-index: 1;
  }

  #scorecard .name-edit {
    padding-right: 40px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  #scorecard .name-edit {
    padding-right: 34px;
  }
}

#scorecard thead th:first-child {
  background-color: var(--panel-alt);
  z-index: 72;
}

#scorecard thead th:nth-child(2) {
  background-color: var(--panel-alt);
  z-index: 71;
}
:root:not([data-theme="light"]) #scorecard th:first-child,
:root:not([data-theme="light"]) #scorecard td:first-child,
:root:not([data-theme="light"]) #scorecard th:nth-child(2),
:root:not([data-theme="light"]) #scorecard td:nth-child(2) {
  background-color: color-mix(in srgb, var(--panel) 74%, black 26%);
}

tr:last-child td {
  border-bottom: none;
}

#scorecard tr.player-row:last-child td,
#scorecard tr.player-row:last-child th,
#scorecard tr.player-row:last-child th {
  border-bottom: 2px solid var(--line);
}

/* Keep sticky corners and left cells above other sticky rows. */
#scorecard #parRow td:first-child,
#scorecard #parRow td:nth-child(2),
#scorecard #hcpRow td:first-child,
#scorecard #hcpRow td:nth-child(2) {
  z-index: 55;
}

/* Divider between front 9 and back 9 (after hole 9, before hole 10) */
#scorecard th:nth-child(12),
#scorecard td:nth-child(12) {
  border-left: 3px solid rgba(168, 179, 191, 0.4) !important;
}

/* Divider between CH and Hole 1 */
#scorecard th:nth-child(3),
#scorecard td:nth-child(3) {
  border-left: 3px solid rgba(168, 179, 191, 0.4) !important;
}

.subtle {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Emphasize Par and Handicap rows */
.par-row th,
.par-row td {
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  border-right: none;
  border-top: 2px solid rgba(255, 255, 255, 0.3);
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
}

.hcp-row th,
.hcp-row td {
  border-left: 2px solid rgba(255, 255, 255, 0.15);
  border-right: none;
  border-top: 2px solid rgba(255, 255, 255, 0.3);
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.par-row input,
.hcp-row input {
  width: var(--table-input-width);
  text-align: center;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  /* Match the Hole label row's vertical rhythm. The par/hcp inputs are
     read-only (tabIndex=-1) so the iOS touch-target min-height that score
     inputs need would just waste vertical space. */
  padding: var(--space-xs) 2px;
  -moz-appearance: textfield;
  appearance: textfield;
  font-size: clamp(14px, calc(var(--text-base) + var(--font-data-adjust)), 22px);
  line-height: 1.05;
  cursor: pointer;
  opacity: 0.75;
}

.par-row input:hover,
.hcp-row input:hover {
  opacity: 1;
}

.par-row input:focus,
.hcp-row input:focus {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  pointer-events: none;
  touch-action: manipulation;
}

.score-input,
.ch-input {
  width: var(--table-input-width);
  text-align: center;
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  background: #000000;
  color: var(--ink);
  padding: 10px var(--space-xs);
  -moz-appearance: textfield;
  appearance: textfield;
  min-height: var(--touch-min);
  font-size: var(--scorecard-data-font-size);
  touch-action: manipulation;
}

/* Divider between hole 18 and Out — matches the front/back 9 divider weight */
#scorecard th:nth-child(21),
#scorecard td:nth-child(21) {
  border-left: 3px solid rgba(168, 179, 191, 0.4) !important;
}

/* Thin dividers between summary columns (Out | In | Total | To Par | Net) */
#scorecard th:nth-child(22),
#scorecard td:nth-child(22),
#scorecard th:nth-child(23),
#scorecard td:nth-child(23),
#scorecard th:nth-child(24),
#scorecard td:nth-child(24),
#scorecard th:nth-child(25),
#scorecard td:nth-child(25) {
  border-left: 1px solid rgba(168, 179, 191, 0.3) !important;
}

/* Keep summary columns stable even when values change from "—" to numbers */
#scorecard th:nth-child(21),
#scorecard td:nth-child(21),
#scorecard th:nth-child(22),
#scorecard td:nth-child(22),
#scorecard th:nth-child(23),
#scorecard td:nth-child(23),
#scorecard th:nth-child(25),
#scorecard td:nth-child(25) {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
}

#scorecard th:nth-child(24),
#scorecard td:nth-child(24) {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
}

/* Remove spinner buttons globally from all numeric fields */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.ch-input {
  width: var(--table-input-width);
  min-width: var(--table-input-width);
  height: var(--table-input-width);
  min-height: var(--table-input-width);
  aspect-ratio: 1 / 1;
  padding: 0;
  line-height: 1;
}

.score-input.invalid {
  border-color: var(--danger);
}

/* Optional stroke symbols shown in top-right of each hole cell */
#scorecard .player-row td:nth-child(n+3) {
  position: relative;
}

#scorecard .player-row td:nth-child(n+3)[data-stroke-symbol]::after {
  content: '';
  position: absolute;
  top: calc(50% - (var(--table-input-width) / 2) + 4px);
  right: calc(50% - (var(--table-input-width) / 2) + 4px);
  z-index: 12;
  color: var(--hi-strong);
  pointer-events: none;
  display: block;
}

#scorecard .player-row td:nth-child(n+3)[data-stroke-symbol="dot"]::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

#scorecard .player-row td:nth-child(n+3)[data-stroke-symbol="dot"][data-stroke-dots="2"]::after {
  width: 18px;
  height: 8px;
  border-radius: 0;
  background:
    radial-gradient(circle at 4px 4px, currentColor 3.5px, transparent 3.6px),
    radial-gradient(circle at 14px 4px, currentColor 3.5px, transparent 3.6px);
  box-shadow: none;
}

#scorecard .player-row td:nth-child(n+3)[data-stroke-symbol="dot"][data-stroke-dots="3"]::after {
  width: 28px;
  height: 8px;
  border-radius: 0;
  background:
    radial-gradient(circle at 4px 4px, currentColor 3.5px, transparent 3.6px),
    radial-gradient(circle at 14px 4px, currentColor 3.5px, transparent 3.6px),
    radial-gradient(circle at 24px 4px, currentColor 3.5px, transparent 3.6px);
  box-shadow: none;
}

#scorecard .player-row td:nth-child(n+3)[data-stroke-symbol="dot"][data-stroke-dots="4"]::after {
  width: 38px;
  height: 8px;
  border-radius: 0;
  background:
    radial-gradient(circle at 4px 4px, currentColor 3.5px, transparent 3.6px),
    radial-gradient(circle at 14px 4px, currentColor 3.5px, transparent 3.6px),
    radial-gradient(circle at 24px 4px, currentColor 3.5px, transparent 3.6px),
    radial-gradient(circle at 34px 4px, currentColor 3.5px, transparent 3.6px);
  box-shadow: none;
}

#scorecard .player-row td:nth-child(n+3)[data-stroke-symbol="plus"]::after {
  width: 10px;
  height: 10px;
  background:
    linear-gradient(currentColor 0 0) center / 2px 10px no-repeat,
    linear-gradient(currentColor 0 0) center / 10px 2px no-repeat;
}
/* Stroke highlighting with progressive rings */
.score-input.receives-stroke {
  border: 2px solid var(--accent) !important;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 1px var(--accent) !important;
}

.score-input.receives-stroke[data-strokes="2"] {
  border: 2px solid var(--accent) !important;
  z-index: 3;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent) !important;
}

.score-input.receives-stroke[data-strokes="3"] {
  border: 2px solid var(--accent) !important;
  z-index: 4;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--accent), 0 0 0 8px var(--bg), 0 0 0 10px var(--accent) !important;
}

/* Plus Handicap - Gives Strokes (Red) */
.score-input.gives-stroke {
  border: 2px solid var(--danger) !important;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 0 1px var(--danger) !important;
}

.score-input.gives-stroke[data-strokes="2"] {
  border: 2px solid var(--danger) !important;
  z-index: 3;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--danger) !important;
}

.score-input.gives-stroke[data-strokes="3"] {
  border: 2px solid var(--danger) !important;
  z-index: 4;
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--danger), 0 0 0 8px var(--bg), 0 0 0 10px var(--danger) !important;
}

/* Hi-Lo Game Highlighting */
.score-input.hilo-low {
  background-color: rgba(15, 122, 73, 0.12) !important;
  border-color: rgba(15, 122, 73, 0.35) !important;
  color: #0f7a49 !important;
  font-weight: 600;
}

.score-input.hilo-high {
  background-color: rgba(255, 107, 107, 0.12) !important;
  border-color: rgba(255, 107, 107, 0.35) !important;
  color: #ff6b6b !important;
  font-weight: 600;
}

.total,
.to-par,
.split,
.net {
  font-weight: 600;
}

.to-par[data-sign="+"] {
  color: #000;
}

.to-par[data-sign="-"] {
  color: var(--danger);
}

.to-par[data-sign="0"] {
  color: #000;
}

tfoot td {
  background: var(--panel-alt);
  font-weight: 600;
}

.note {
  margin: var(--space-sm) var(--space-md) var(--space-md);
  color: var(--muted);
  font-size: var(--text-sm);
}

.small {
  font-size: var(--text-xs);
  color: var(--muted);
  margin: 0 var(--space-md);
}

.name-edit {
  background: transparent;
  border: none;
  color: var(--ink);
  font-weight: 600;
  font-size: calc(var(--text-md) + var(--font-data-adjust));
  width: 100%;
  padding: var(--space-xs) 10px;
  display: block;
}

.name-edit:focus {
  outline: 2px dashed var(--accent);
  border-radius: var(--radius-sm);
}

/* =========================================================================
   Light theme overrides — moved from light-theme-overrides.css
   ========================================================================= */

:root[data-theme="light"] .final-round-game-chip {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

:root[data-theme="light"] .final-round-game-chip.is-active,
:root[data-theme="light"] .final-round-game-chip[aria-pressed="true"],
:root[data-theme="light"] .final-round-game-chip[data-active="true"] {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.6);
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 2px rgba(37, 99, 235, 0.16);
}

:root[data-theme="light"] .scorecard-add-player-btn {
  background: rgba(37, 99, 235, 0.07);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

:root[data-theme="light"] .scorecard-add-player-btn:hover {
  background: rgba(37, 99, 235, 0.14);
}

:root[data-theme="light"] .scorecard-header-debug-readout {
  border-color: rgba(0, 120, 168, 0.55);
  background: rgba(223, 246, 255, 0.88);
  color: #0f2633;
}

:root[data-theme="light"] #scorecard th:first-child,
:root[data-theme="light"] #scorecard td:first-child,
:root[data-theme="light"] #scorecard th:nth-child(2),
:root[data-theme="light"] #scorecard td:nth-child(2) {
  background-color: #f1f5f9;
}

:root[data-theme="light"] #scorecard thead th:first-child,
:root[data-theme="light"] #scorecard thead th:nth-child(2) {
  background-color: var(--panel-alt);
}

:root[data-theme="light"] #scorecard .player-row td:nth-child(n+3)[data-stroke-symbol]::after {
  color: rgba(8, 12, 17, 0.92);
}

@media (pointer: coarse) {
  :root[data-theme="light"] #scorecard .name-edit {
    background: #ffffff;
    border-color: #bcc7d2;
  }
}

/* =========================================================================
   More light-theme overrides — par/hcp rows, scorecard column dividers,
   score-input stroke indicators, name/handicap inputs, scorecard footer
   icons (.scorecard-main-options-icon.is-open etc.), Clear-buttons,
   .player-delete-btn. Moved from light-theme-overrides.css.
   ========================================================================= */

/* Par / HCP row borders */
:root[data-theme="light"] .par-row th,
:root[data-theme="light"] .par-row td {
  border-left: 2px solid #bcc7d2;
  border-top: none;
  border-bottom: 2px solid #bcc7d2;
}

:root[data-theme="light"] .hcp-row th,
:root[data-theme="light"] .hcp-row td {
  border-left: 2px solid #bcc7d2;
  border-top: none;
  border-bottom: 2px solid #bcc7d2;
}

/* Light theme: divider between CH and Hole 1 */
:root[data-theme="light"] #scorecard th:nth-child(3),
:root[data-theme="light"] #scorecard td:nth-child(3) {
  border-left: 3px solid rgba(0, 0, 0, 0.35) !important;
}

/* Light theme: heavy divider between hole 18 and Out */
:root[data-theme="light"] #scorecard th:nth-child(21),
:root[data-theme="light"] #scorecard td:nth-child(21) {
  border-left: 3px solid rgba(0, 0, 0, 0.35) !important;
}

/* Light theme: thin dividers between summary columns */
:root[data-theme="light"] #scorecard th:nth-child(22),
:root[data-theme="light"] #scorecard td:nth-child(22),
:root[data-theme="light"] #scorecard th:nth-child(23),
:root[data-theme="light"] #scorecard td:nth-child(23),
:root[data-theme="light"] #scorecard th:nth-child(24),
:root[data-theme="light"] #scorecard td:nth-child(24),
:root[data-theme="light"] #scorecard th:nth-child(25),
:root[data-theme="light"] #scorecard td:nth-child(25) {
  border-left: 1px solid rgba(0, 0, 0, 0.2) !important;
}

/* Stroke highlighting */
:root[data-theme="light"] .score-input.receives-stroke {
  border: 2px solid #28a745;
  box-shadow: 0 0 0 1px #28a745;
}

:root[data-theme="light"] .score-input.receives-stroke[data-strokes="2"] {
  border: 2px solid #28a745;
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px #28a745;
}

:root[data-theme="light"] .score-input.receives-stroke[data-strokes="3"] {
  border: 2px solid #28a745;
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px #28a745, 0 0 0 8px #ffffff, 0 0 0 10px #28a745;
}

/* Plus-handicap (gives stroke) */
:root[data-theme="light"] .score-input.gives-stroke {
  border: 2px solid #dc3545;
  box-shadow: 0 0 0 1px #dc3545;
}

:root[data-theme="light"] .score-input.gives-stroke[data-strokes="2"] {
  border: 2px solid #dc3545;
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px #dc3545;
}

:root[data-theme="light"] .score-input.gives-stroke[data-strokes="3"] {
  border: 2px solid #dc3545;
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 6px #dc3545, 0 0 0 8px #ffffff, 0 0 0 10px #dc3545;
}

/* Light theme Hi-Lo highlighting */
:root[data-theme="light"] .score-input.hilo-low {
  background-color: rgba(40, 167, 69, 0.1) !important;
  border-color: rgba(40, 167, 69, 0.3) !important;
  color: #28a745 !important;
  font-weight: 600;
}

:root[data-theme="light"] .score-input.hilo-high {
  background-color: rgba(220, 53, 69, 0.1) !important;
  border-color: rgba(220, 53, 69, 0.3) !important;
  color: #dc3545 !important;
  font-weight: 600;
}

/* Mobile: enforce the same stroke-ring visuals used on desktop */
@media (max-width: 768px) {
  #scorecard .player-row td:nth-child(n+3) {
    overflow: visible;
    position: relative;
  }

  #scorecard .player-row td:first-child,
  #scorecard .player-row td:nth-child(2) {
    overflow: hidden;
  }

  #scorecard .score-input.receives-stroke {
    border: 2px solid var(--accent) !important;
    z-index: 5;
    -webkit-box-shadow: 0 0 0 2px var(--accent) !important;
    box-shadow: 0 0 0 2px var(--accent) !important;
  }

  #scorecard .score-input.receives-stroke[data-strokes="2"] {
    z-index: 6;
    -webkit-box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--bg), 0 0 0 6px var(--accent) !important;
    box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--bg), 0 0 0 6px var(--accent) !important;
  }

  #scorecard .score-input.receives-stroke[data-strokes="3"] {
    z-index: 7;
    -webkit-box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--bg), 0 0 0 6px var(--accent), 0 0 0 8px var(--bg), 0 0 0 10px var(--accent) !important;
    box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--bg), 0 0 0 6px var(--accent), 0 0 0 8px var(--bg), 0 0 0 10px var(--accent) !important;
  }

  #scorecard .score-input.gives-stroke {
    border: 2px solid var(--danger) !important;
    z-index: 5;
    -webkit-box-shadow: 0 0 0 2px var(--danger) !important;
    box-shadow: 0 0 0 2px var(--danger) !important;
  }

  #scorecard .score-input.gives-stroke[data-strokes="2"] {
    z-index: 6;
    -webkit-box-shadow: 0 0 0 2px var(--danger), 0 0 0 4px var(--bg), 0 0 0 6px var(--danger) !important;
    box-shadow: 0 0 0 2px var(--danger), 0 0 0 4px var(--bg), 0 0 0 6px var(--danger) !important;
  }

  #scorecard .score-input.gives-stroke[data-strokes="3"] {
    z-index: 7;
    -webkit-box-shadow: 0 0 0 2px var(--danger), 0 0 0 4px var(--bg), 0 0 0 6px var(--danger), 0 0 0 8px var(--bg), 0 0 0 10px var(--danger) !important;
    box-shadow: 0 0 0 2px var(--danger), 0 0 0 4px var(--bg), 0 0 0 6px var(--danger), 0 0 0 8px var(--bg), 0 0 0 10px var(--danger) !important;
  }

  :root[data-theme="light"] #scorecard .score-input.receives-stroke {
    border: 2px solid #28a745 !important;
    -webkit-box-shadow: 0 0 0 2px #28a745 !important;
    box-shadow: 0 0 0 2px #28a745 !important;
  }

  :root[data-theme="light"] #scorecard .score-input.receives-stroke[data-strokes="2"] {
    -webkit-box-shadow: 0 0 0 2px #28a745, 0 0 0 4px #ffffff, 0 0 0 6px #28a745 !important;
    box-shadow: 0 0 0 2px #28a745, 0 0 0 4px #ffffff, 0 0 0 6px #28a745 !important;
  }

  :root[data-theme="light"] #scorecard .score-input.receives-stroke[data-strokes="3"] {
    -webkit-box-shadow: 0 0 0 2px #28a745, 0 0 0 4px #ffffff, 0 0 0 6px #28a745, 0 0 0 8px #ffffff, 0 0 0 10px #28a745 !important;
    box-shadow: 0 0 0 2px #28a745, 0 0 0 4px #ffffff, 0 0 0 6px #28a745, 0 0 0 8px #ffffff, 0 0 0 10px #28a745 !important;
  }

  :root[data-theme="light"] #scorecard .score-input.gives-stroke {
    border: 2px solid #dc3545 !important;
    -webkit-box-shadow: 0 0 0 2px #dc3545 !important;
    box-shadow: 0 0 0 2px #dc3545 !important;
  }

  :root[data-theme="light"] #scorecard .score-input.gives-stroke[data-strokes="2"] {
    -webkit-box-shadow: 0 0 0 2px #dc3545, 0 0 0 4px #ffffff, 0 0 0 6px #dc3545 !important;
    box-shadow: 0 0 0 2px #dc3545, 0 0 0 4px #ffffff, 0 0 0 6px #dc3545 !important;
  }

  :root[data-theme="light"] #scorecard .score-input.gives-stroke[data-strokes="3"] {
    -webkit-box-shadow: 0 0 0 2px #dc3545, 0 0 0 4px #ffffff, 0 0 0 6px #dc3545, 0 0 0 8px #ffffff, 0 0 0 10px #dc3545 !important;
    box-shadow: 0 0 0 2px #dc3545, 0 0 0 4px #ffffff, 0 0 0 6px #dc3545, 0 0 0 8px #ffffff, 0 0 0 10px #dc3545 !important;
  }
}

/* Light theme input fixes */
:root[data-theme="light"] .score-input,
:root[data-theme="light"] .ch-input {
  background: #ffffff;
  color: #1a1c1f;
  border: 2px solid #bcc7d2;
}

:root[data-theme="light"] .score-input:focus,
:root[data-theme="light"] .ch-input:focus {
  border-color: #0090e0;
  outline: none;
}

/* Scorecard footer icon toggles (open state) */
:root[data-theme="light"] .scorecard-main-options-icon.is-open,
:root[data-theme="light"] .scorecard-clear-actions-toggle.is-open {
  background: #0b74d1;
  border-color: #095ba3;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px var(--hi-medium);
}

:root[data-theme="light"] .scorecard-main-options-icon.is-open:hover,
:root[data-theme="light"] .scorecard-clear-actions-toggle.is-open:hover {
  background: #0b74d1;
  border-color: #095ba3;
  color: #ffffff;
}

/* Clear buttons */
:root[data-theme="light"] .scorecard-clear-buttons .btn,
:root[data-theme="light"] .scorecard-clear-buttons button {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

:root[data-theme="light"] .scorecard-clear-buttons .btn:hover,
:root[data-theme="light"] .scorecard-clear-buttons button:hover {
  background: color-mix(in srgb, var(--danger) 78%, black 22%);
  border-color: color-mix(in srgb, var(--danger) 78%, black 22%);
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.22), 0 6px 16px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

/* Keep Par/HCP header values as plain table cells in light theme (no inner input box). */
:root[data-theme="light"] #scorecard .par-row input,
:root[data-theme="light"] #scorecard .hcp-row input {
  background: transparent;
  border: none;
}

/* Delete-player button */
:root[data-theme="light"] .player-delete-btn {
  background: #dc3545 !important;
  border-color: #dc3545 !important;
  color: white !important;
}

:root[data-theme="light"] .player-delete-btn:hover {
  background: #bb2d3b !important;
  color: white !important;
  border-color: #bb2d3b !important;
}
