/* ============================================================================
   JUNK BOTTOM SHEET
   Additive UI layer. To remove: delete this entire block and js/junk-sheet.js.
   ============================================================================ */

/* When active, hide the per-cell <details> dropdown and make rows tappable */
body.junk-sheet-active #junkBody .junk-dd { display: none !important; }
body.junk-sheet-active #junkBody tr { cursor: pointer; }
body.junk-sheet-active #junkBody tr:hover td { background: var(--hi-thin); }
/* Header row visibility — both rows live inside a single <thead>; show/hide
   at the <tr> level so sticky positioning is inherited correctly. */
.junk-table-desktop-header {
  display: table-row;
}

.junk-table-tablet-header {
  display: none;
}

/* Phone/narrow (<1024px): Show simplified "Results" header */
@media (max-width: 1023px) {
  .junk-table-desktop-header {
    display: none;
  }

  .junk-table-tablet-header {
    display: table-row;
  }

  /* Keep only the tablet header cells visible and sticky in narrow layouts.
     Hiding desktop-row cells directly avoids duplicate/ghost sticky headers. */
  #junkTable thead tr.junk-table-desktop-header th {
    display: none !important;
  }

  #junkTable thead tr.junk-table-tablet-header th {
    display: table-cell !important;
    position: sticky;
    top: 0 !important;
    z-index: var(--z-sticky-header);
    background: var(--panel-alt);
  }

  #junkTable thead tr.junk-table-tablet-header th:first-child {
    z-index: var(--z-sticky-corner);
    background: var(--panel);
  }
}

/* Junk standings table uses a compact 3-column layout (Player, Dots, vs Field)
   and explicit vertical dividers so borders remain visible on narrow phones. */
.junk-standings-table {
  width: 100%;
  table-layout: fixed;
}

.junk-standings-table col.junk-col-player {
  width: 50%;
}

.junk-standings-table col.junk-col-dots,
.junk-standings-table col.junk-col-net {
  width: 25%;
}

.junk-standings-table .live-results-label {
  position: static;
  left: auto;
  width: auto;
  min-width: 0;
  max-width: none;
  box-shadow: none;
  padding-left: 8px;
  padding-right: 8px;
}

.junk-standings-table tr > :first-child {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.junk-standings-table tr > :nth-child(2),
.junk-standings-table tr > :nth-child(3) {
  font-variant-numeric: tabular-nums;
}

.junk-standings-table td + td,
.junk-standings-table th + th {
  border-left: 2px solid var(--line);
}

@media (max-width: 640px) {
  .junk-standings-table th,
  .junk-standings-table td {
    white-space: normal;
  }
}

/* Collapse cell layout to just the dot + active achievement labels */
body.junk-sheet-active .junk-cell { gap: 2px; }

/* Mobile 2-column layout: Hole | summary of all players' points for that hole.
   Driven by `.junk-mobile-summary-active` (toggled via media query in JS). */
body.junk-mobile-summary-active #junkBody tr > td:not(:first-child):not(.junk-mobile-summary-cell),
body.junk-mobile-summary-active #junkTable tfoot tr > td:not(:first-child) {
  display: none !important;
}

/* In summary mode, keep only the first sticky header cell visible and render
   the "Results" label there. This avoids colspan/column-width mismatch. */
body.junk-mobile-summary-active #junkTable thead tr th:not(:first-child) {
  display: none !important;
}
/* Shrink the Hole label column hard so the summary cell gets the rest. */
body.junk-mobile-summary-active #junkTable {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 0 !important;
}
body.junk-mobile-summary-active #junkTable th:first-child,
body.junk-mobile-summary-active #junkTable td:first-child {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  padding: 4px 6px !important;
  text-align: center !important;
  font-size: var(--text-sm) !important;
  font-weight: 700 !important;
}

/* Keep the Hole header pinned with the first column in Junk mobile summary mode. */
body.junk-mobile-summary-active #junkTable thead th:first-child,
body.junk-mobile-summary-active #junkTable tbody td:first-child {
  position: sticky !important;
  left: 0 !important;
}

body.junk-mobile-summary-active #junkTable thead th:first-child {
  top: 0 !important;
  z-index: var(--z-sticky-corner) !important;
  background: var(--panel) !important;
  border-right: 2px solid var(--line);
}
body.junk-mobile-summary-active #junkBody td.junk-mobile-summary-cell {
  display: table-cell !important;
  width: calc(100% - 64px) !important;
  max-width: none !important;
}
body.junk-mobile-summary-active #junkTable thead tr th:first-child::after {
  content: 'Results';
  display: inline-block;
  margin-left: 12px;
  font-weight: 700;
  color: var(--muted);
  font-size: var(--text-sm);
}
body.junk-mobile-summary-active #junkTable tfoot { display: none; }

.junk-mobile-summary-cell {
  display: block !important;
  padding: 6px 8px !important;
  text-align: left !important;
  vertical-align: middle !important;
}
.junk-mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  padding: 2px 4px;
  border-bottom: 1px solid var(--line);
  font-size: calc(12px + var(--font-size-step));
  line-height: 1.3;
}
.junk-mini-row:last-child { border-bottom: 0; }
.junk-mini-row.is-empty { color: var(--muted); }
.junk-mini-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.junk-mini-right {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.junk-mini-emojis {
  font-size: calc(11px + var(--font-size-step));
  letter-spacing: 1px;
  line-height: 1;
}
.junk-mini-dot {
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 20px;
  text-align: right;
}
.junk-mini-empty {
  color: var(--muted);
  font-style: italic;
  font-size: calc(12px + var(--font-size-step));
}

/* Backdrop */
.junk-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.002);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 9000;
}
.junk-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
/* Sheet panel */
.junk-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(90dvh, 90svh);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  color: var(--ink);
  border-top: 2px solid var(--line);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  box-shadow: none;
  transform: translateY(100%);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 9001;
}
.junk-sheet.is-open {
  transform: translateY(0);
  box-shadow: 0 -12px 32px rgba(0,0,0,0.4);
}
@media (min-width: 720px) {
  .junk-sheet {
    left: 50%;
    right: auto;
    bottom: 24px;
    transform: translate(-50%, 120%);
    width: min(680px, calc(100vw - 32px));
    border-radius: var(--radius-lg);
    border: 2px solid var(--line);
  }
  .junk-sheet.is-open { transform: translate(-50%, 0); }
}

.junk-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
  background: var(--panel-alt);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}
.junk-sheet-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.junk-sheet-title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 700;
}

.junk-sheet-navbtn {
  background: transparent;
  border: 2px solid var(--line);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: calc(16px + var(--font-size-step));
  line-height: 1;
  cursor: pointer;
}

.junk-sheet-navbtn:disabled {
  opacity: 0.45;
  cursor: default;
}
.junk-sheet-navbtn:hover:not(:disabled) { background: var(--hi-faint); }
.junk-sheet-close {
  background: transparent;
  border: 2px solid var(--line);
  color: var(--ink);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: calc(16px + var(--font-size-step));
  cursor: pointer;
}.junk-sheet-close:hover { background: var(--hi-faint); }
.junk-sheet-body {
  padding: 12px 16px 4px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

.junk-sheet-player {
  padding: 10px 0 14px;
  border-bottom: 2px solid var(--line);
}
.junk-sheet-player:last-child { border-bottom: none; }

.junk-sheet-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.junk-sheet-player-name {
  font-weight: 700;
  font-size: var(--text-lg);
}
.junk-sheet-player-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.junk-sheet-chip-meta {
  font-size: var(--text-sm);
  color: var(--muted);
  padding: 2px 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--panel-alt);
}

.junk-sheet-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.junk-sheet-chip {
  appearance: none;
  -webkit-appearance: none;
  background: var(--panel-alt);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 6px;
  min-height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 80ms ease;
  text-align: center;
}.junk-sheet-chip:hover:not(:disabled) { border-color: var(--accent); }
.junk-sheet-chip:active:not(:disabled) { transform: scale(0.97); }
.junk-sheet-chip[data-active="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.junk-sheet-chip[data-active="true"] .junk-sheet-chip-pts { color: rgba(255,255,255,0.85); }
.junk-sheet-chip.is-auto {
  opacity: 0.75;
  cursor: not-allowed;
}
.junk-sheet-chip-emoji { font-size: calc(20px + var(--font-size-step)); line-height: 1; }
.junk-sheet-chip-label { font-weight: 600; font-size: var(--text-sm); line-height: 1.1; }
.junk-sheet-chip-pts { font-size: var(--text-xs); color: var(--muted); line-height: 1; }

.junk-sheet-footer {
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid var(--line);
  background: var(--panel-alt);
  display: flex;
  justify-content: stretch;
}.junk-sheet-done {
  width: 100%;
  min-width: 0;
  background: rgba(220, 53, 69, 0.85);
  border-color: rgba(220, 53, 69, 0.9);
  color: #fff;
  font-weight: 800;
}
.junk-sheet-done:hover {
  background: rgba(220, 53, 69, 1);
  border-color: rgba(220, 53, 69, 1);
  filter: brightness(1.04);
}
/* Prevent background scroll while sheet is open */
body.junk-sheet-open { overflow: hidden; }

.junk-team-stroke-info {
  font-size: calc(var(--text-sm) + var(--font-descriptive-adjust));
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
}

/* =========================
   Junk (Dots) — Table + Dropdown
   Appended from main.css
   ========================= */

/* =========================
   Junk (Dots) — Table + Dropdown
   ========================= */
#junkTable {
  width: 100%;
  table-layout: auto;
}

#junkTable th:first-child,
#junkTable td:first-child {
  width: 40px;
  min-width: 40px;
  padding: 4px;
  position: sticky;
  left: 0;
  background-color: var(--panel);
  z-index: var(--z-sticky-col);
  border-right: 3px solid var(--line);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

#junkTable th:not(:first-child),
#junkTable td:not(:first-child) {
  padding: 4px !important;
  border-right: 2px solid var(--hi-faint);
}

#junkTable tbody td {
  padding: 4px !important;
  vertical-align: middle;
  height: auto;
}
.junk-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  min-height: 0;
}

.junk-ach-labels {
  font-size: calc(9px + var(--font-size-step));
  color: var(--muted);
  text-align: center;
  line-height: 1.1;
  max-width: 90px;
  min-height: 20px;
  word-wrap: break-word;
  margin: 0;
  padding: 0;
}

.junk-text-labels {
  font-size: calc(9px + var(--font-size-step));
  color: var(--muted);
  line-height: 1.2;
}

.junk-ach-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  justify-content: center;
  align-items: center;
  margin-top: 1px;
}

.junk-ach-badge {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  font-size: calc(9px + var(--font-size-step));
  white-space: nowrap;
}

.junk-ach-emoji {
  font-size: calc(11px + var(--font-size-step));
  line-height: 1;
  flex-shrink: 0;
}

.junk-ach-label-small {
  font-size: calc(8px + var(--font-size-step));
  font-weight: 600;
  color: var(--ink);
}

.junk-dot {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  margin: 0;
  padding: 0;
  line-height: 1;
  font-size: calc(14px + var(--font-size-step));
  font-weight: 600;
}

.junk-dd {
  display: inline-block;
  position: relative;
}

.junk-dd > summary {
  list-style: none;
  cursor: pointer;
  border: 2px solid var(--line);
  background: var(--hi-soft);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: calc(11px + var(--font-size-step));

.scorecard-help-notes {
  margin: 6px var(--space-lg) 0;
}

.scorecard-options-panel .scorecard-help-notes {
  margin: 10px 0 0;
}

.scorecard-help-notes .small {
  margin: 4px 0;
}
  font-weight: 500;
  line-height: 1;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  -webkit-tap-highlight-color: rgba(104, 211, 145, 0.1);
  margin-top: 2px;
  transition: background 0.15s ease;
}

.junk-dd > summary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.junk-dd[open] > summary {
  filter: brightness(1.08);
}

.junk-dd .menu {
  position: absolute;
  z-index: var(--z-dropdown);
  margin-top: var(--space-xs);
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-sm);
  min-width: 160px;
  border: 2px solid var(--line);
  background: var(--panel-alt);
  border-radius: var(--radius-lg);
  max-height: calc(3 * var(--touch-min) + 2 * var(--space-xs) + 2 * var(--space-sm));
  overflow-y: auto;
  overflow-x: hidden;
}

.junk-dd .menu label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--text-md) var(--space-lg);
  border-radius: var(--radius-lg);
  cursor: pointer;
  border: 2px solid transparent;
  user-select: none;
  color: var(--ink);
  min-height: var(--touch-min);
  font-size: var(--text-lg);
}

.junk-dd .menu label input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.junk-dd .menu label:has(input:checked) {
  background: #14202a;
  border-color: #224;
}

.junk-dd .menu label:has(input:checked)::after {
  content: "✓";
  margin-left: auto;
  font-weight: 700;
}

.junk-ach-auto-badge {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: calc(10px + var(--font-size-step));
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Density tweaks for game tables */
#junkTable tbody td,
#junkTable tbody th,
#vegasTable tbody td,
#vegasTable tbody th {
  padding-top: var(--space-xs);
  padding-bottom: var(--space-xs);
}

/* Touch target sizing */
.gamesbar .game-toggle {
  min-height: var(--footer-action-h);
}

input[type="number"],
input[type="text"] {
  padding: 10px var(--space-md);
  min-height: var(--touch-min);
  font-size: calc(var(--text-xl) + var(--font-data-adjust));
}

/* Keep score-entry cells at the larger data size while Par/HCP use their
   dedicated anti-clipping sizing above. */
#scorecard .score-input {
  font-size: calc(var(--text-xl) + var(--font-data-adjust));
}

/* Header rows are denser than score-entry rows; cap Par/HCP sizing to avoid
   clipping two-digit values in sticky mode. Vertical padding mirrors the
   Hole label row (`#scorecard thead th` uses var(--space-xs)) so all three
   sticky bands sit on the same rhythm. NOTE: this rule loads AFTER
   responsive-layout.css, so any media-query overrides over there need to
   use a more specific selector or the same specificity (#scorecard .par-row).
   See [stylesheet/responsive-layout.css `@media (max-width: 768px)`]. */
#scorecard .par-row input,
#scorecard .hcp-row input {
  font-size: clamp(14px, calc(var(--text-base) + var(--font-data-adjust)), 22px);
  line-height: 1.05;
  padding: var(--space-xs) 2px;
}

/* Add Player row — small top gap without large inline margin */
.header-addplayer-row {
  margin-top: 0;
  margin-bottom: 0;
}

.header-title-row {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
}

.header-title-row h1 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Round-name title is tappable to open the rename dialog.
   Neutral ink-toned styling (matches the rest of the chrome — Sign In chip,
   +Player button, Game Totals bar) — no accent-green so it doesn't read
   as a primary action. */
.header-title-row h1.header-round-title {
  cursor: pointer;
  border-radius: 8px;
  padding: 2px 8px;
  margin: -2px -8px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent);
}

.header-title-row h1.header-round-title .header-round-title-text {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-title-row h1.header-round-title .header-round-title-edit {
  flex: 0 0 auto;
  opacity: 0.55;
  color: var(--muted);
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.header-title-row h1.header-round-title:hover,
.header-title-row h1.header-round-title:focus-visible {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-color: color-mix(in srgb, var(--ink) 50%, transparent);
  outline: none;
}

.header-title-row h1.header-round-title:hover .header-round-title-edit,
.header-title-row h1.header-round-title:focus-visible .header-round-title-edit {
  opacity: 1;
  color: var(--ink);
  transform: rotate(-8deg);
}

.header-title-row h1.header-round-title:active {
  background: color-mix(in srgb, var(--ink) 14%, transparent);
}.header-course-control {
  flex: 1 1 100%;
  min-width: 0;
}

.scorecard-options-controls .header-course-control {
  margin-bottom: 2px;
}

.header-course-control input {
  width: 100%;
  height: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  box-sizing: border-box;
}

.course-picker {
  position: relative;
}

.course-picker-wrap {
  margin-top: 6px;
}

.course-source-control {
  margin-bottom: 2px;
}

.course-source-control .hcp-mode-btn-group {
  width: 100%;
}

.course-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(24, 120, 206, 0.35);
  border-radius: 999px;
  background: rgba(24, 120, 206, 0.14);
  color: var(--ink);
  font-weight: 700;
}

.course-source-badge[hidden] {
  display: none !important;
}

.course-picker-input-wrap {
  position: relative;
}

.course-picker-input-wrap .course-picker-search {
  padding-right: 44px;
}

.course-picker-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 34px;
  min-width: 34px;
  height: calc(var(--touch-min) - 8px);
  min-height: calc(var(--touch-min) - 8px);
  padding: 0;
  border-radius: var(--radius-sm);
}

.course-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
  z-index: 85;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.course-options {
  max-height: min(46vh, 280px);
  overflow-y: auto;
}

.course-option {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(168, 179, 191, 0.22);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
}

.course-option:last-child {
  border-bottom: none;
}

.course-option:hover,
.course-option:focus-visible,
.course-option.is-selected {
  background: rgba(74, 158, 255, 0.2);
}

.course-no-results {
  padding: 10px 12px;
  color: var(--muted);
}
.course-picker-attribution {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.3;
}

.course-picker-attribution a,
.data-sources-block a {
  color: inherit;
  text-decoration: underline;
}

.data-sources-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line-cool);
}.header-cloud-row {
  margin-top: 2px;
}

.header-options-panel {
  margin-top: 2px;
  padding: var(--space-sm) var(--space-sm) var(--space-md);
  border: 2px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel-alt);
}

.header-options-panel.footer-mounted-options {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 16px);
  margin: 0;
  padding: var(--space-sm) 12px 24px;
  border-left: 2px solid var(--line);
  border-right: 2px solid var(--line);
  border-top: 2px solid rgba(168, 179, 191, 0.2);
  border-bottom: 2px solid var(--line);
  border-radius: var(--radius-xl);
  background: #132639;
  z-index: 36;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.2);
}
.header-options-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}
.scorecard-options-panel {
  margin: 0;
  padding: var(--space-sm) 12px 10px;
  border: none;
  border-top: 2px solid rgba(168, 179, 191, 0.2);
  border-radius: 0;
  background: #132639;
  max-height: calc(50dvh - 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.header-options-panel.footer-mounted-options .control,
.header-options-panel.footer-mounted-options .utilities-section,
.header-options-panel.footer-mounted-options .cloud-control {
  background: #173149;
}
/* Scorecard gear menu must stay opaque for readability. */
body.mode-score #scorecardOptionsPanel.game-options-panel {
  background: #132639 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.mode-score #scorecardOptionsPanel.game-options-panel .control,
body.mode-score #scorecardOptionsPanel.game-options-panel .utilities-section,
body.mode-score #scorecardOptionsPanel.game-options-panel .cloud-control,
body.mode-score #scorecardOptionsPanel.game-options-panel .control-box,
body.mode-score #scorecardOptionsPanel.game-options-panel .team-box,
body.mode-score #scorecardOptionsPanel.game-options-panel .opts-box {
  background: #173149 !important;
}
.scorecard-options-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

/* par badge tighter below header */
#parBadge {
  margin: 0 var(--space-lg) 2px;
}

/* =========================================================================
   Light theme overrides — moved from light-theme-overrides.css. Includes
   options-panel light rules because the base .header-options-panel /
   .scorecard-options-panel styles also live in this file (lines ~848/872).
   ========================================================================= */

:root[data-theme="light"] body.junk-sheet-active #junkBody tr:hover td { background: rgba(0,0,0,0.03); }

:root[data-theme="light"] .junk-sheet-backdrop {
  background: rgba(255, 255, 255, 0.006);
}

:root[data-theme="light"] .junk-sheet {
  border-top-color: rgba(21, 32, 43, 0.18);
}

:root[data-theme="light"] .junk-sheet.is-open {
  box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.14);
}

:root[data-theme="light"] .junk-sheet-header {
  background: #f8fafc;
}

:root[data-theme="light"] .junk-sheet-navbtn {
  background: #ffffff;
  border-color: var(--shadow-navy);
  color: #0f172a;
}

:root[data-theme="light"] .junk-sheet-navbtn:hover:not(:disabled) { background: rgba(0,0,0,0.05); }

:root[data-theme="light"] .junk-sheet-close {
  background: #ffffff;
  border-color: var(--shadow-navy);
  color: #0f172a;
}

:root[data-theme="light"] .junk-sheet-close:hover { background: rgba(0,0,0,0.05); }

:root[data-theme="light"] .junk-sheet-chip {
  background: #ffffff;
  border-color: var(--shadow-navy);
}

/* Light-theme override: the global `:root[data-theme="light"] button` rule wins
   by specificity, so re-assert the active chip styling here. */
:root[data-theme="light"] .junk-sheet-chip[data-active="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

:root[data-theme="light"] .junk-sheet-chip[data-active="true"]:hover {
  background: var(--accent);
  border-color: var(--accent);
}

:root[data-theme="light"] .junk-sheet-chip[data-active="true"] .junk-sheet-chip-pts {
  color: rgba(255,255,255,0.85);
}

:root[data-theme="light"] .junk-sheet-footer {
  background: rgba(248, 250, 252, 0.94);
}

:root[data-theme="light"] .junk-sheet-done {
  background: rgba(200, 40, 56, 0.9);
  border-color: rgba(190, 35, 50, 0.9);
  color: #fff;
}

/* Light theme Junk table borders */
:root[data-theme="light"] #junkTable th:first-child,
:root[data-theme="light"] #junkTable td:first-child {
  border-right: 3px solid rgba(0, 0, 0, 0.15);
}

:root[data-theme="light"] #junkTable th:not(:first-child),
:root[data-theme="light"] #junkTable td:not(:first-child) {
  border-right: 2px solid rgba(0, 0, 0, 0.05);
}

/* Options-panel light rules — base styles live in this file too */
:root[data-theme="light"] .header-options-panel.footer-mounted-options {
  background: #f2f8ff;
}

:root[data-theme="light"] .scorecard-options-panel {
  background: #f2f8ff;
}

:root[data-theme="light"] .header-options-panel.footer-mounted-options .control,
:root[data-theme="light"] .header-options-panel.footer-mounted-options .utilities-section,
:root[data-theme="light"] .header-options-panel.footer-mounted-options .cloud-control {
  background: #ffffff;
}

:root[data-theme="light"] body.mode-score #scorecardOptionsPanel.game-options-panel {
  background: #f2f8ff !important;
}

:root[data-theme="light"] body.mode-score #scorecardOptionsPanel.game-options-panel .control,
:root[data-theme="light"] body.mode-score #scorecardOptionsPanel.game-options-panel .utilities-section,
:root[data-theme="light"] body.mode-score #scorecardOptionsPanel.game-options-panel .cloud-control,
:root[data-theme="light"] body.mode-score #scorecardOptionsPanel.game-options-panel .control-box,
:root[data-theme="light"] body.mode-score #scorecardOptionsPanel.game-options-panel .team-box,
:root[data-theme="light"] body.mode-score #scorecardOptionsPanel.game-options-panel .opts-box {
  background: #ffffff !important;
}

/* Junk dropdown menu (.junk-dd) light styling */
:root[data-theme="light"] .junk-dd > summary {
  background: #ffffff;
  border-color: #d3d7dc;
  color: #1a1c1f;
}

:root[data-theme="light"] .junk-dd .menu {
  background: #ffffff;
  border-color: #d3d7dc;
}

:root[data-theme="light"] .junk-dd .menu label {
  color: #1a1c1f;
}

:root[data-theme="light"] .junk-dd .menu label:has(input:checked) {
  background: #e0f2ff;
  border-color: #0090e0;
}

/* Junk "Dots" button cell */
:root[data-theme="light"] .junk-cell summary,
:root[data-theme="light"] .junk-cell button {
  background: #d4dee8;
  border: 2px solid #aebac7;
  color: #1a1c1f;
}
