
/* ===== Variables & Theme Defaults ===== */
:root {
    --color-text-muted: #6b7280;
    --color-text: #111827;
    --bg-elev: #ffffff;
    --bg-elev-alt: #f3f4f6;
    --color-border: #e5e7eb;
}

:root[data-theme="dark"] {
    --color-text-muted: #9ca3af;
    --color-text: #f9fafb;
    --bg-elev: #1f2937;
    --bg-elev-alt: #374151;
    --color-border: #4b5563;
}

/* Ensure global text color inheritance for the wrapper */
.epgm-wrapper {
    color: var(--color-text);
    width: 100%;
    box-sizing: border-box;
    position: relative; /* Contain absolute children */
    overflow-x: hidden; /* Prevent balloons/tooltips from widening the page on mobile */
}

/* Fix floating/scrolling page issues caused by modal or off-canvas elements */
body.epgm-modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

/* Constrain table containers */
.epgm-table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 10px;
}

/* ===== Sticky Columns for Rabbit / Other Tables ===== */
.epgm-table-container.has-sticky-cols {
    overflow-x: auto;
    overscroll-behavior-x: none;
    /* Ensure z-index context */
    position: relative;
}

.epgm-table-container.has-sticky-cols table {
    border-collapse: separate !important; /* Critical for sticky cols and borders */
    border-spacing: 0;
    table-layout: fixed; /* Force column widths to respect CSS */
    width: auto;
    min-width: 100%;
}

/* Sticky Hole Column (1st) */
.epgm-sticky-col-1 {
    position: sticky;
    left: 0 !important;
    z-index: 25 !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    padding: 4px 2px !important;
    box-sizing: border-box !important;
    background: inherit;
    background-color: var(--bg-elev, #ffffff) !important;
    background-clip: padding-box !important; /* Prevent border overlap */
    border-right: 1px solid #e5e7eb;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

/* Sticky Status Column (2nd) */
.epgm-sticky-col-2 {
    position: sticky;
    /* left: 44px !important; REMOVED per user request to fix alignment */
    z-index: 25 !important;
    box-sizing: border-box !important;
    background-color: var(--bg-elev, #ffffff) !important;
    background-clip: padding-box !important;
    border-right: 1px solid #e5e7eb;
    min-width: 140px !important;
    width: 140px !important;
    max-width: 140px !important;
    padding: 4px 8px !important;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Force Header Match */
.epgm-table-container.has-sticky-cols thead th.epgm-sticky-col-1 {
    z-index: 50 !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    box-sizing: border-box !important;
}

.epgm-table-container.has-sticky-cols thead th.epgm-sticky-col-2 {
    z-index: 50 !important;
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    /* left: 44px !important; REMOVED */
    box-sizing: border-box !important;
}

/* Sticky Header Row (Generic & Match Play) */
.epgm-table-container.has-sticky-cols thead th,
.epgm-game-table.sticky-head thead th {
    position: sticky;
    top: 0;
    z-index: 30 !important; /* Above cols */
    background-color: var(--bg-elev-alt, #f9fafb) !important; /* Match header bg */
    background-clip: border-box !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    color: var(--color-text);
}

/* Dark mode adjustments for sticky bg */
:root[data-theme="dark"] .epgm-sticky-col-1,
:root[data-theme="dark"] .epgm-sticky-col-2,
:root[data-theme="dark"] .epgm-game-table.sticky-head thead th,
:root[data-theme="dark"] .epgm-table-container.has-sticky-cols thead th {
    background-color: #374151 !important;
    border-right-color: #374151;
}
.epgm-table-scroll {
    display: block;
    width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: none;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* Intersection of Sticky Header + Sticky Col (Top Left Corner) */
.epgm-table-container.has-sticky-cols thead th.epgm-sticky-col-1,
.epgm-table-container.has-sticky-cols thead th.epgm-sticky-col-2 {
    z-index: 50; /* Topmost */
}

/* Dark mode adjustments for sticky bg */
:root[data-theme="dark"] .epgm-sticky-col-1,
:root[data-theme="dark"] .epgm-sticky-col-2 {
    background-color: #1f2937;
    border-right-color: #374151;
}
:root[data-theme="dark"] .epgm-table-container.has-sticky-cols thead th {
    background-color: #374151;
}

/* ===== 6-6-6 / Match Play Running Columns ===== */
.epgm-run-col {
    width: 32px;
    text-align: center;
    font-weight: 700;
    font-size: 0.9em;
    color: #0891b2; /* Cyan-600: Light blueish-green for font */
    padding: 4px 2px !important;
    vertical-align: middle;
}
td.epgm-game-table thead th.epgm-hole-col,
td.epgm-game-table thead th.epgm-press-col,
td.epgm-game-table thead th.epgm-props-col {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
    text-align: center;
    vertical-align: middle;
    padding: 2px 0px !important;
    height: 60px; /* Ensure enough height for rotated labels */
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}
td.epgm-game-table thead th.epgm-hole-col,
td.epgm-game-table thead th.epgm-press-col {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
}
td.epgm-game-table thead th.epgm-props-col {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
}
.epgm-game-table thead th {
    vertical-align: middle;
}

.epgm-hole-col {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    text-align: center;
    padding: 4px 0 !important;
    vertical-align: middle !important;
}
.epgm-press-col {
    width: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    text-align: center;
    padding: 4px 0 !important;
    vertical-align: middle !important;
}
.epgm-hole-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #3b82f6; /* Blue-500 */
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    margin: 0 auto;
}
:root[data-theme="dark"] .epgm-hole-chip {
    background-color: #2563eb; /* Blue-600 */
}
.epgm-press-col--flex {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    height: 100% !important;
    min-height: 28px;
    margin: 0 auto;
}
td.epgm-press-col {
    vertical-align: middle !important;
}
.epgm-game-table.epgm-666-seg {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}
.epgm-game-table.epgm-666-seg .epgm-hole-col {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
}
.epgm-game-table.epgm-666-seg .epgm-press-col {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    padding: 6px 4px !important;
}
.epgm-game-table.epgm-666-seg .epgm-run-col {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
}
.epgm-game-table.epgm-666-seg .epgm-press-col--flex {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 40px;
    padding: 2px 0;
}
.epgm-game-table.epgm-666-seg .epgm-666-press-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
}
.epgm-game-table.epgm-666-seg .epgm-press-col .epgm-press-badge {
    margin: 0 !important;
    flex: 0 0 auto;
}
.epgm-game-table.epgm-666-seg .epgm-press-col .epgm-press-start-btn {
    min-width: 24px;
    padding: 0 8px;
    margin: 0;
}
.epgm-game-table.epgm-666-seg .epgm-666-status-col {
    white-space: nowrap;
}
.epgm-game-table.epgm-666-seg .epgm-666-status-col .epgm-run-val,
.epgm-game-table.epgm-666-seg .epgm-666-status-col .epgm-run-as,
.epgm-game-table.epgm-666-seg .epgm-666-status-col .epgm-run-arrow {
    display: inline-block;
    vertical-align: middle;
}
.epgm-game-table.epgm-666-seg th,
.epgm-game-table.epgm-666-seg td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.epgm-game-table.epgm-666-seg thead th:not(.epgm-hole-col):not(.epgm-press-col):not(.epgm-props-col):not(.epgm-run-col),
.epgm-game-table.epgm-666-seg tbody td:not(.epgm-hole-col):not(.epgm-press-col):not(.epgm-props-col):not(.epgm-run-col) {
    min-width: 0;
}
.epgm-game-table.epgm-team-match-grid {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
}
.epgm-game-table.epgm-team-match-grid .epgm-hole-col {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
}
.epgm-game-table.epgm-team-match-grid .epgm-press-col {
    width: 68px !important;
    min-width: 68px !important;
    max-width: 68px !important;
    padding: 6px 4px !important;
}
.epgm-game-table.epgm-team-match-grid .epgm-props-col {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    padding: 6px 6px !important;
}
.epgm-game-table.epgm-team-match-grid .epgm-run-col {
    width: 46px;
    min-width: 46px;
    max-width: 46px;
}
.epgm-game-table.epgm-team-match-grid .epgm-press-col--flex {
    display: table-cell !important;
    min-height: 0;
    height: auto !important;
    padding: 6px 2px !important;
    margin: 0;
    text-align: center !important;
    vertical-align: middle;
}
.epgm-game-table.epgm-team-match-grid .epgm-team-match-press-badges {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    line-height: 1;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.epgm-game-table.epgm-team-match-grid .epgm-press-col .epgm-press-badge {
    margin: 0 !important;
    flex: 0 0 auto;
}
.epgm-game-table.epgm-team-match-grid .epgm-press-col--flex:empty {
    padding: 2px !important;
    background: transparent !important;
    box-shadow: none !important;
}
.epgm-game-table.epgm-team-match-grid .epgm-press-col--flex.is-empty {
    padding: 2px !important;
    background: transparent !important;
    box-shadow: none !important;
}
.epgm-game-table.epgm-team-match-grid .epgm-press-col--flex:empty::before {
    content: none !important;
}
.epgm-game-table.epgm-team-match-grid .epgm-press-col--flex.is-empty::before {
    content: none !important;
}
.epgm-game-table.epgm-team-match-grid tbody td.epgm-press-col.epgm-press-col--flex:empty,
.epgm-game-table.epgm-team-match-grid tfoot td.epgm-press-col.epgm-press-col--flex:empty {
    background: transparent !important;
    box-shadow: none !important;
}
.epgm-game-table.epgm-team-match-grid tbody td.epgm-press-col.epgm-press-col--flex.is-empty,
.epgm-game-table.epgm-team-match-grid tfoot td.epgm-press-col.epgm-press-col--flex.is-empty,
.epgm-game-table.epgm-nassau-match-grid tbody td.epgm-press-col.epgm-press-col--flex.is-empty,
.epgm-game-table.epgm-nassau-match-grid tfoot td.epgm-press-col.epgm-press-col--flex.is-empty {
    background: transparent !important;
    box-shadow: none !important;
}
.epgm-game-table.epgm-team-match-grid tbody td.epgm-press-col:empty,
.epgm-game-table.epgm-team-match-grid tfoot td.epgm-press-col:empty,
.epgm-game-table.epgm-nassau-match-grid tbody td.epgm-press-col:empty,
.epgm-game-table.epgm-nassau-match-grid tfoot td.epgm-press-col:empty {
    background: transparent !important;
    box-shadow: none !important;
}
.epgm-game-table.epgm-team-match-grid td.epgm-press-col:has(.epgm-press-col--flex:empty) {
    /* keep default padding to maintain column width */
}
.epgm-game-table.epgm-team-match-grid td.epgm-press-col.is-empty,
.epgm-game-table.epgm-nassau-match-grid td.epgm-press-col.is-empty {
    /* keep default padding to maintain column width */
    background: transparent !important;
    box-shadow: none !important;
}
.epgm-game-table.epgm-team-match-grid td.epgm-press-col:has(.epgm-press-col--flex:empty) .epgm-team-match-press-badges,
.epgm-game-table.epgm-team-match-grid td.epgm-press-col:has(.epgm-press-col--flex:empty) .epgm-press-badge,
.epgm-game-table.epgm-team-match-grid td.epgm-press-col:has(.epgm-press-col--flex:empty) .epgm-press-start-btn {
    display: none !important;
}
.epgm-game-table.epgm-team-match-grid td.epgm-press-col.is-empty .epgm-team-match-press-badges,
.epgm-game-table.epgm-team-match-grid td.epgm-press-col.is-empty .epgm-press-badge,
.epgm-game-table.epgm-team-match-grid td.epgm-press-col.is-empty .epgm-press-start-btn,
.epgm-game-table.epgm-nassau-match-grid td.epgm-press-col.is-empty .epgm-team-match-press-badges,
.epgm-game-table.epgm-nassau-match-grid td.epgm-press-col.is-empty .epgm-press-badge,
.epgm-game-table.epgm-nassau-match-grid td.epgm-press-col.is-empty .epgm-press-start-btn {
    display: none !important;
}
.epgm-game-table.epgm-team-match-grid td.epgm-press-col:has(.epgm-press-col--flex:empty) .epgm-press-col--flex {
    visibility: hidden;
    height: 0;
    overflow: hidden;
}
.epgm-game-table.epgm-team-match-grid td.epgm-press-col.is-empty.epgm-press-col--flex,
.epgm-game-table.epgm-nassau-match-grid td.epgm-press-col.is-empty.epgm-press-col--flex {
    /* Keep cell visible for table layout; just hide content */
    color: transparent;
    background: transparent !important;
    box-shadow: none !important;
}
.epgm-game-table.epgm-nassau-match-grid tbody td.epgm-press-col.epgm-press-col--flex:empty,
.epgm-game-table.epgm-nassau-match-grid tfoot td.epgm-press-col.epgm-press-col--flex:empty {
    background: transparent !important;
    box-shadow: none !important;
}
.epgm-game-table.epgm-team-match-grid .epgm-press-col .epgm-press-start-btn {
    display: block;
    margin: 4px auto 0;
}
.epgm-game-table.epgm-team-match-grid th,
.epgm-game-table.epgm-team-match-grid td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.epgm-game-table.epgm-team-match-grid thead th:not(.epgm-hole-col):not(.epgm-press-col):not(.epgm-props-col):not(.epgm-run-col),
.epgm-game-table.epgm-team-match-grid tbody td:not(.epgm-hole-col):not(.epgm-press-col):not(.epgm-props-col):not(.epgm-run-col) {
    min-width: 0;
}
.epgm-game-table.epgm-team-match-grid .epgm-run-col {
    white-space: nowrap;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-press-col {
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-hole-col {
    width: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col {
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    padding: 6px 4px !important;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-running-cell {
    white-space: nowrap;
}
.epgm-game-table.epgm-nassau-match-grid td.epgm-running-cell,
.epgm-game-table.epgm-nassau-match-grid th:last-child {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
}
.epgm-game-table.epgm-nassau-match-grid th,
.epgm-game-table.epgm-nassau-match-grid td {
    overflow: hidden;
}
.epgm-game-table.epgm-nassau-match-grid thead th:nth-last-child(2),
.epgm-game-table.epgm-nassau-match-grid tbody td:nth-last-child(2),
.epgm-game-table.epgm-nassau-match-grid tfoot td:nth-last-child(2),
.epgm-game-table.epgm-nassau-match-grid thead th:last-child,
.epgm-game-table.epgm-nassau-match-grid tbody td:last-child,
.epgm-game-table.epgm-nassau-match-grid tfoot td:last-child {
    min-width: 0;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-cell {
    overflow-wrap: break-word;
    word-break: break-word;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-press-col.epgm-press-col--flex {
    display: table-cell !important;
    min-height: 0;
    height: auto !important;
    padding: 4px 2px !important;
    margin: 0;
    text-align: center !important;
    vertical-align: middle;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-team-match-press-badges {
    gap: 2px;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col .epgm-prop-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    white-space: nowrap;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col .epgm-prop-entry:last-child {
    margin-bottom: 0;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col .epgm-prop-initials {
    flex: 0 0 auto;
}
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col .epgm-prop-badges {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    flex-wrap: nowrap;
}
.epgm-game-table.epgm-team-nassau-medal-grid .epgm-props-col {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
}
.epgm-game-table.epgm-team-nassau-medal-grid .epgm-props-col {
    padding: 6px 3px !important;
}
.epgm-game-table.epgm-team-nassau-medal-grid .epgm-props-col .epgm-prop-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
}
.epgm-game-table.epgm-team-nassau-medal-grid .epgm-props-col .epgm-prop-entry:last-child {
    margin-bottom: 0;
}
.epgm-game-table.epgm-team-nassau-medal-grid .epgm-props-col .epgm-prop-initials {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    flex: 0 0 auto;
}
.epgm-game-table.epgm-team-nassau-medal-grid .epgm-props-col .epgm-prop-badges {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    flex-wrap: nowrap;
}
.epgm-game-table.epgm-team-match-grid .epgm-props-col .epgm-prop-entry,
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col .epgm-prop-entry {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    margin-bottom: 2px;
    white-space: nowrap;
    min-width: 0;
}
.epgm-game-table.epgm-team-match-grid .epgm-props-col .epgm-prop-entry:last-child,
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col .epgm-prop-entry:last-child {
    margin-bottom: 0;
}
.epgm-game-table.epgm-team-match-grid .epgm-props-col .epgm-prop-initials,
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col .epgm-prop-initials {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    flex: 0 0 auto;
}
.epgm-game-table.epgm-team-match-grid .epgm-props-col .epgm-prop-badges,
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col .epgm-prop-badges {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
}
.epgm-game-table.epgm-team-match-grid .epgm-props-col,
.epgm-game-table.epgm-nassau-match-grid .epgm-props-col {
    text-align: center;
}
.epgm-props-col {
    width: 26px !important;
    min-width: 26px !important;
    max-width: 26px !important;
    text-align: center;
}
.epgm-props-summary {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9em;
    background-color: #f9f9f9;
    border: 1px solid #eeeeee;
    color: #444444;
}

:root[data-theme="dark"] .epgm-props-summary {
    background-color: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

.epgm-props-summary strong {
    color: inherit;
}
:root[data-theme="dark"] .epgm-run-col {
    color: #22d3ee; /* Cyan-400: Light blueish-green for font in dark mode */
}
:root[data-theme="dark"] .epgm-run-arrow {
    color: #22d3ee !important;
}
.epgm-run-arrow {
    display: inline-block;
    margin-left: 2px;
    color: #0891b2; /* Cyan-600 */
}
:root[data-theme="dark"] .epgm-run-as {
    color: #9ca3af !important; /* Lighter gray for AS in Dark Mode */
    opacity: 0.8 !important;
}
/* If leading opponent, maybe red? No, stick to standard. */
/* Some themes apply dark surfaces globally; ensure our setup stays light in light mode. */
:root[data-theme="light"] .epgm-setup-wrapper .epgm-add-game-panel,
html.theme-light .epgm-setup-wrapper .epgm-add-game-panel,
body.theme-light .epgm-setup-wrapper .epgm-add-game-panel {
    background: var(--bg-elev, #ffffff) !important;
    border-color: var(--color-border, #e5e7eb) !important;
    color: var(--color-text, #111827) !important;
}

:root[data-theme="light"] .epgm-setup-wrapper .epgm-add-game-btn,
:root[data-theme="light"] .epgm-setup-wrapper .epgm-save-game-btn,
:root[data-theme="light"] .epgm-setup-wrapper .epgm-cancel-game-btn,
:root[data-theme="light"] .epgm-setup-wrapper .epgm-delete-game-btn,
html.theme-light .epgm-setup-wrapper .epgm-add-game-btn,
html.theme-light .epgm-setup-wrapper .epgm-save-game-btn,
html.theme-light .epgm-setup-wrapper .epgm-cancel-game-btn,
html.theme-light .epgm-setup-wrapper .epgm-delete-game-btn,
body.theme-light .epgm-setup-wrapper .epgm-add-game-btn,
body.theme-light .epgm-setup-wrapper .epgm-save-game-btn,
body.theme-light .epgm-setup-wrapper .epgm-cancel-game-btn,
body.theme-light .epgm-setup-wrapper .epgm-delete-game-btn {
    background: var(--bg-elev-alt, #f3f4f6) !important;
    color: var(--color-text, #111827) !important;
    border-color: var(--color-border, #e5e7eb) !important;
    margin-bottom: 10px;
    margin-top: 10px;
}

:root[data-theme="light"] .epgm-setup-wrapper input[type="number"],
:root[data-theme="light"] .epgm-setup-wrapper select,
html.theme-light .epgm-setup-wrapper input[type="number"],
html.theme-light .epgm-setup-wrapper select,
body.theme-light .epgm-setup-wrapper input[type="number"],
body.theme-light .epgm-setup-wrapper select {
    background: var(--bg-elev, #ffffff) !important;
    color: var(--color-text, #111827) !important;
    border-color: var(--color-border, #d1d5db) !important;
}

:root[data-theme="light"] .epgm-setup-wrapper .epgm-player-pool,
:root[data-theme="light"] .epgm-setup-wrapper .epgm-player-dropzone,
html.theme-light .epgm-setup-wrapper .epgm-player-pool,
html.theme-light .epgm-setup-wrapper .epgm-player-dropzone,
body.theme-light .epgm-setup-wrapper .epgm-player-pool,
body.theme-light .epgm-setup-wrapper .epgm-player-dropzone {
    background: var(--bg-elev, #ffffff) !important;
}
/* Ensure team selectors remain light in light theme */
:root[data-theme="light"] .epgm-setup-wrapper .epgm-team-col,
html.theme-light .epgm-setup-wrapper .epgm-team-col,
body.theme-light .epgm-setup-wrapper .epgm-team-col {
    background: var(--bg-elev, #ffffff) !important;
    border-color: var(--color-border, #e5e7eb) !important;
}
:root[data-theme="light"] .epgm-setup-wrapper .epgm-team-dropzone,
html.theme-light .epgm-setup-wrapper .epgm-team-dropzone,
body.theme-light .epgm-setup-wrapper .epgm-team-dropzone {
    background: var(--bg-elev, #ffffff) !important;
    border-color: var(--color-border, #d1d5db) !important;
}

/* ===== Small Games Setup: Hard guards for Team vs Individual UI ===== */
/* Hide Team A/B container unless the wrapper explicitly sets team mode. */
.epgm-setup-wrapper:not([data-team-mode="1"]) .epgm-team-section {
    display: none !important;
}
/* When team mode is active, hide the single Selected Players list to avoid confusion. */
.epgm-setup-wrapper[data-team-mode="1"] .epgm-selected-players[data-mode="individual"] {
    display: none !important;
}

:root[data-theme="light"] .epgm-setup-wrapper .epgm-player,
html.theme-light .epgm-setup-wrapper .epgm-player,
body.theme-light .epgm-setup-wrapper .epgm-player {
    background: var(--bg-elev-alt, #f9fafb) !important;
    color: var(--color-text, #111827) !important;
    border-color: var(--color-border, #e5e7eb) !important;
}

/* ===== Live results (games-display) cards ===== */
.epgm-wrapper .epgm-game-card {
    border: 1px solid var(--color-border, #e5e7eb);
    background: var(--bg-elev, #ffffff);
    border-radius: 10px;
    margin-bottom: 12px;
}
.epgm-wrapper .epgm-game-header {
    background: var(--bg-elev-alt, #f9fafb);
    color: var(--color-text, #111827);
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.epgm-wrapper .epgm-game-name {
    font-size: 1.1rem; /* Reduced from default h4 size per user request */
}
/* Header inline actions layout */
.epgm-wrapper .epgm-game-header .epgm-go-scores-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    margin-left: 8px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
}
.epgm-wrapper .epgm-game-header .epgm-go-scores-btn:hover,
.epgm-wrapper .epgm-game-header .epgm-go-scores-btn:focus {
    border-color: #b6beca;
    background: #f3f4f6;
    outline: none;
}
.epgm-wrapper .epgm-game-body { background: var(--bg-elev, #ffffff); color: var(--color-text, #111827); }
.epgm-wrapper .epgm-game-body { padding-left: 8px; padding-right: 8px; }
.epgm-wrapper .epgm-raw-toggle-btn {
    background: var(--bg-elev-alt, #f3f4f6);
    color: var(--color-text, #111827);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 6px;
    padding: 6px 10px;
}
/* Ensure the hole-by-hole area uses light surfaces in light mode */
.epgm-wrapper .epgm-raw-inner { background: var(--bg-elev, #ffffff); padding-left: 8px; padding-right: 8px; }
.epgm-wrapper .epgm-game-table th,
.epgm-wrapper .epgm-game-table td {
    background: transparent;
    text-align: center; /* Center results in all cells/headers */
    padding: 6px 8px; /* subtle horizontal padding per request */
}
/* Ensure explicit center on score cells and totals */
.epgm-wrapper .epgm-game-table td.epgm-cell,
.epgm-wrapper .epgm-game-table td.epgm-total-cell {
    text-align: center;
}

/* Explicit light theme enforcement to avoid dark bleed on some themes */
:root[data-theme="light"] .epgm-wrapper .epgm-game-card,
html.theme-light .epgm-wrapper .epgm-game-card,
body.theme-light .epgm-wrapper .epgm-game-card { background: var(--bg-elev, #ffffff) !important; border-color: var(--color-border, #e5e7eb) !important; }

:root[data-theme="light"] .epgm-wrapper .epgm-game-header,
html.theme-light .epgm-wrapper .epgm-game-header,
body.theme-light .epgm-wrapper .epgm-game-header {
    background: var(--bg-elev-alt, #f5f6f8) !important;
    color: var(--color-text, #171923) !important;
    border-color: var(--color-border, rgba(0,0,0,0.1)) !important;
}

/* Ensure the expanded game body is light in light theme */
:root[data-theme="light"] .epgm-wrapper .epgm-game-body,
html.theme-light .epgm-wrapper .epgm-game-body,
body.theme-light .epgm-wrapper .epgm-game-body {
    background: var(--bg-elev, #ffffff) !important;
    color: var(--color-text, #111827) !important;
}

/* Light mode explicit: force raw inner + table cells to be light */
:root[data-theme="light"] .epgm-wrapper .epgm-raw-inner,
html.theme-light .epgm-wrapper .epgm-raw-inner,
body.theme-light .epgm-wrapper .epgm-raw-inner { background: var(--bg-elev, #ffffff) !important; }

:root[data-theme="light"] .epgm-wrapper .epgm-game-table th,
:root[data-theme="light"] .epgm-wrapper .epgm-game-table td,
html.theme-light .epgm-wrapper .epgm-game-table th,
html.theme-light .epgm-wrapper .epgm-game-table td,
body.theme-light .epgm-wrapper .epgm-game-table th,
body.theme-light .epgm-wrapper .epgm-game-table td {
    background: var(--bg-elev, #ffffff) !important;
    color: var(--color-text, #111827) !important;
    border-color: var(--color-border, #e5e7eb) !important;
    text-align: center; /* keep centered in light mode too */
    padding: 6px 8px;
}

:root[data-theme="light"] .epgm-sg-card,
html.theme-light .epgm-sg-card,
body.theme-light .epgm-sg-card { background: var(--bg-elev, #ffffff) !important; border-color: var(--color-border, #e5e7eb) !important; }

:root[data-theme="light"] .epgm-sg-header,
html.theme-light .epgm-sg-header,
body.theme-light .epgm-sg-header { background: var(--bg-elev-alt, #f5f6f8) !important; color: var(--color-text, #171923) !important; }

@media (prefers-color-scheme: dark) {
    .epgm-wrapper .epgm-game-card { border-color: #374151; background: #111827; }
    .epgm-wrapper .epgm-game-header { background: #1f2937; color: #e5e7eb; border-color: #374151; }
    .epgm-wrapper .epgm-game-body { background: #0b1220; color: #e5e7eb; padding-left: 8px; padding-right: 8px; }
    .epgm-wrapper .epgm-raw-toggle-btn { background: #1f2937; color: #e5e7eb; border-color: #374151; }
}

/* ===== Setup UI spacing and player cards ===== */
.epgm-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: var(--color-text, #111827);
}

.epgm-add-game {
    margin-bottom: 24px;
}

.epgm-setup-wrapper .epgm-add-game-panel { padding: 10px; border: 1px solid var(--color-border, #e5e7eb); border-radius: 10px; }
.epgm-setup-wrapper .epgm-field { margin: 8px 0; }
.epgm-setup-wrapper .epgm-field + .epgm-field { margin-top: 10px; }
.epgm-setup-wrapper .epgm-actions { margin-top: 12px; display: flex; gap: 8px; }

/* Spacing for Wager rows (e.g., "Wager per Point - $") */
.epgm-setup-wrapper .epgm-field.epgm-wagers .epgm-wager-row {
    margin: 8px 0 8px 0;
}

.epgm-setup-wrapper .epgm-player-pool,
.epgm-setup-wrapper .epgm-player-dropzone,
.epgm-setup-wrapper .epgm-team-dropzone {
    list-style: none;
    padding: 6px;
    margin: 6px 0;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    min-height: 52px;
}
.epgm-setup-wrapper .epgm-player {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    margin: 6px 0;
    cursor: grab;
    background-color: var(--bg-elev, #ffffff); /* Ensure background for drag ghost */
    touch-action: none; /* Improve mobile touch handling */
}
.epgm-setup-wrapper .epgm-player:active {
    cursor: grabbing;
    background-color: var(--bg-elev-alt, #f3f4f6);
    border: none; /* Removed border */
    /* Default (Light Mode) -> Dark Glow */
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
    transform: scale(0.98);
    z-index: 10;
}
/* Source element visual when dragging */
.epgm-dragging-source {
    opacity: 0.6;
    border: none !important; /* Removed border */
    /* Default (Light Mode) -> Dark Glow */
    box-shadow: 0 0 10px rgba(0,0,0,0.6) !important;
    background-color: var(--bg-elev, #ffffff) !important;
}

/* Helper to force the 'Glow' look immediately for the drag ghost */
.epgm-ghost-style {
    border: none !important;
    border-color: transparent !important;
    background-color: var(--bg-elev, #ffffff) !important; /* Match base */
    /* Light Mode Glow */
    box-shadow: 0 0 10px rgba(0,0,0,0.6) !important;
    opacity: 1 !important; /* Ghost should be opaque initially */
}

/* Dark Mode Glow Overrides */
:root[data-theme="dark"] .epgm-setup-wrapper .epgm-player {
    background-color: var(--bg-elev, #1f2937); /* Base background for dark mode */
}
:root[data-theme="dark"] .epgm-setup-wrapper .epgm-player:active,
:root[data-theme="dark"] .epgm-dragging-source {
    /* Dark Mode -> Light Glow */
    box-shadow: 0 0 12px rgba(255,255,255,0.5) !important;
    background-color: #374151 !important;
}

:root[data-theme="dark"] .epgm-ghost-style {
    box-shadow: 0 0 12px rgba(255,255,255,0.5) !important;
    background-color: #374151 !important;
}
.epgm-setup-wrapper .epgm-avatar-wrap {
    width: 28px; height: 28px; border-radius: 50%;
    background: #374151; /* Force Dark Grey */
    color: #ffffff; /* Force White Text */
    display: inline-flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex: 0 0 28px;
}
.epgm-setup-wrapper .epgm-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.epgm-setup-wrapper .epgm-avatar-initials { font-size: 12px; font-weight: 600; color: inherit; }
.epgm-setup-wrapper .epgm-player-name { font-size: 14px; }

/* Player Pool: Two Columns */
.epgm-setup-wrapper .epgm-player-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    align-content: flex-start;
    min-height: 120px; /* Increased height for easier drop */
    background-color: var(--bg-elev-alt, #f9fafb); 
    border: 3px dashed var(--color-border, #d1d5db); /* Clearer border */
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px; /* Spacing from next section */
    /* Ensure visibility */
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important; /* Force display */
}
/* Empty state for player pool - makes deselection target obvious */
.epgm-player-pool:empty {
    border-color: #ef4444; /* Red border when empty to highlight drop zone */
    background-color: rgba(239, 68, 68, 0.05);
}
.epgm-player-pool:empty::before {
    content: 'Drop players here to remove from game';
    color: #ef4444;
    font-weight: 700;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 60px;
    font-style: italic;
    pointer-events: none;
    background: rgba(0,0,0,0.02); /* Slight tint to show active area */
    border-radius: 4px;
}
.epgm-setup-wrapper .epgm-player-pool .epgm-player {
    width: auto;
    margin: 0;
    flex: 0 1 auto;
    min-width: 140px;
    max-width: 48%; /* Prevent full width single items */
}

/* Team columns */
.epgm-setup-wrapper .epgm-team-section { display: flex; gap: 12px; }
.epgm-setup-wrapper .epgm-team-col { flex: 1; padding: 6px; border: 1px solid var(--color-border, #e5e7eb); border-radius: 8px; }
.epgm-setup-wrapper .epgm-team-label { margin: 0 0 6px; font-size: 14px; }

/* Hard guard: when 6-6-6 is selected, hide manual Team A/B UI entirely */
.epgm-setup-wrapper[data-game-type="666"] .epgm-team-section { display: none !important; }
/* Also hide Team A/B for explicitly individual-only Medal Play */
.epgm-setup-wrapper[data-game-type="medal_play"] .epgm-team-section { display: none !important; }
/* Hide Team A/B for Stableford (individual format) */
.epgm-setup-wrapper[data-game-type="stableford"] .epgm-team-section { display: none !important; }

/* Stableford points index/edit table (two-column compact layout) */
.epgm-setup-wrapper .epgm-stb-table {
    width: 100%;
    border-collapse: collapse;
}
.epgm-setup-wrapper .epgm-stb-table td {
    padding: 4px 6px;
    vertical-align: middle;
}
.epgm-setup-wrapper .epgm-stb-table td:first-child {
    width: 60%;
}
.epgm-setup-wrapper .epgm-stb-table .epgm-stb-val {
    text-align: right;
    font-weight: 600;
}
.epgm-setup-wrapper .epgm-stb-pts {
    width: 80px;
}

/* Stableford points index half-width on desktop, full-width on mobile */
@media (min-width: 768px) {
    .epgm-setup-wrapper .epgm-wager-extra .epgm-stb-points {
        width: 50%;
        display: inline-block;
        vertical-align: top;
    }
}

/* Pills (Net/Gross and Presses) */
.epgm-pill-group { display: inline-flex; gap: 6px; }
.epgm-pill { background: var(--bg-elev-alt, #f3f4f6); border: 1px solid var(--color-border, #e5e7eb); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.epgm-pill.is-active { background: var(--color-accent, #2563eb); color: #fff; border-color: var(--color-accent, #2563eb); }

/* Presses row: slider + mode indicator */
.epgm-setup-wrapper .epgm-presses-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
}

/* Toggle switch */
.epgm-setup-wrapper .epgm-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.epgm-setup-wrapper .epgm-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
}
.epgm-setup-wrapper .epgm-switch-slider {
    width: 42px; height: 24px;
    background: var(--bg-elev-alt, #f3f4f6);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 999px;
    position: relative;
    transition: background-color .2s ease, border-color .2s ease;
}
.epgm-setup-wrapper .epgm-switch-slider::after {
    content: '';
    position: absolute; top: 50%; left: 2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; border: 1px solid var(--color-border, #e5e7eb);
    transform: translate(0, -50%);
    transition: transform .2s ease;
}
.epgm-setup-wrapper .epgm-switch input:checked + .epgm-switch-slider {
    background: var(--color-accent, #2563eb);
    border-color: var(--color-accent, #2563eb);
}
.epgm-setup-wrapper .epgm-switch input:checked + .epgm-switch-slider::after {
    transform: translate(18px, -50%);
    border-color: rgba(0,0,0,0.08);
}
.epgm-setup-wrapper .epgm-switch-label {
    font-size: 13px; color: var(--color-text, #111827);
    min-width: 28px;
}
.epgm-setup-wrapper .epgm-presses-mode-indicator {
    font-size: 12px; opacity: .8; color: var(--color-text, #111827);
}

/* Balloon notice for Presses amount */
.epgm-setup-wrapper .epgm-presses-balloon {
    margin-top: 8px;
    background: #111827;
    color: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    max-width: min(560px, calc(100vw - 24px));
    box-shadow: 0 6px 16px rgba(0,0,0,.25);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease;
}
.epgm-setup-wrapper .epgm-presses-balloon.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Press start badge "P" (active press) */
.epgm-press-badge {
    display: inline-flex !important; /* enforce visibility even if theme hides badges */
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #b71c1c; /* default to cardinal red for generic badge */
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    margin: 0 auto;
    opacity: 1 !important; /* prevent theme opacity reductions */
    visibility: visible !important; /* override any theme visibility rules */
    position: relative;
    z-index: 1;
    min-width: 16px;
    min-height: 16px;
    box-shadow: 0 0 0 1px rgba(0,0,0,.08); /* subtle ring so it remains visible even if bg overridden */
}

/* Slightly smaller badge on very tight cells */
td.epgm-running-cell .epgm-press-badge,
td.epgm-press-col .epgm-press-badge {
    width: 16px !important;
    height: 16px !important;
    font-size: 10px !important;
    margin: 0 auto !important;
    min-width: 16px !important;
    min-height: 16px !important;
}

    /* Distinguish auto vs manual badges */
    .epgm-wrapper .epgm-press-badge.epgm-press-badge--auto {
        background-color: #27ae60 !important;
        border: 1px solid #1f8f50 !important; /* ensure visibility on very light backgrounds */
        box-shadow: 0 0 0 1px rgba(31,143,80,0.25) !important;
        filter: none !important; /* neutralize any theme filters */
    }
    .epgm-wrapper .epgm-press-badge.epgm-press-badge--manual {
        background-color: #b71c1c !important; /* cardinal red */
        border: 1px solid #7f0f0f !important;
        box-shadow: 0 0 0 1px rgba(127,15,15,0.25) !important;
        filter: none !important;
    }

    /* Manual press trigger button (organizer)
       Default: white pill with dark "Press" label.
       Active:  red circular button with white "P". */
    /* Enforce site-green styling for the Press pill button.
       Some themes override button styles aggressively; increase specificity
       and use limited !important on color props to ensure consistency. */
    .epgm-wrapper .epgm-press-start-btn,
    button.epgm-press-start-btn {
        /* Use flex to perfectly center label vertically and horizontally */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 24px;
        padding: 0 10px;
        border-radius: 999px; /* pill */
        /* Site accent blue */
        border: 1px solid #335f92 !important; /* slightly darker than accent blue */
        background: #3B73B3 !important; /* site accent blue */
        color: #ffffff !important; /* white text */
        font-size: 12px;
        font-weight: 600;
        line-height: 1; /* avoid baseline drift; rely on flex centering */
        vertical-align: middle;
        white-space: nowrap;
        margin-left: 6px;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        text-decoration: none !important;
        transition: background-color .15s ease, color .15s ease, border-color .15s ease, width .15s ease, height .15s ease, border-radius .15s ease, padding .15s ease, box-shadow .15s ease;
    }
    .epgm-wrapper .epgm-press-start-btn:hover,
    .epgm-wrapper .epgm-press-start-btn:focus,
    button.epgm-press-start-btn:hover,
    button.epgm-press-start-btn:focus {
        outline: none;
        border-color: #2f5f97 !important;
        background: #345f90 !important; /* hover: a touch darker blue */
        color: #ffffff !important;
        box-shadow: 0 0 0 2px rgba(59,115,179,0.25);
        text-decoration: none !important;
    }
    .epgm-press-start-btn:disabled { opacity: .6; cursor: not-allowed; }

    /* Active/started look (used if we toggle the button state): cardinal red circle with white "P" */
    .epgm-wrapper .epgm-press-start-btn.is-active,
    button.epgm-press-start-btn.is-active {
        /* Slightly larger circular container for the "P" with a defined ring */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        height: 18px;
        padding: 0;
        border-radius: 50%;
        background: #b71c1c !important; /* cardinal red */
        color: #fff !important;
        border: 2px solid #7f0f0f !important; /* subtle darker ring around the P container */
        font-weight: 700;
        line-height: 1;
        margin: 0 auto;
    }
    /* Align the new press column cells */
    td.epgm-press-col {
        text-align: center;
        white-space: nowrap;
        overflow: visible; /* allow circular badges to show fully */
        min-width: 64px; /* prevent column from collapsing so badges remain visible */
    }
    .epgm-wrapper .epgm-press-start-btn.is-active:hover,
    .epgm-wrapper .epgm-press-start-btn.is-active:focus,
    button.epgm-press-start-btn.is-active:hover,
    button.epgm-press-start-btn.is-active:focus {
        box-shadow: 0 0 0 2px rgba(183,28,28,0.2);
    }

    /* Make manual press badges visibly interactive when user can remove them */
    .epgm-press-badge.epgm-press-badge--manual.is-removable { cursor: pointer; box-shadow: 0 0 0 2px rgba(183,28,28,0.15); }
    .epgm-press-badge.epgm-press-badge--manual.is-removable:hover { box-shadow: 0 0 0 3px rgba(183,28,28,0.25); }

    /* Slight upward nudge for the word "Press" inside the pill for optical centering */
    .epgm-wrapper .epgm-press-start-btn .epgm-press-label,
    button.epgm-press-start-btn .epgm-press-label {
        position: relative;
        top: -3px; /* lower the label slightly from previous (-5px) so it's less high */
    }

    /* Reset Presses button in totals row */
    .epgm-wrapper .epgm-press-reset-btn,
    button.epgm-press-reset-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 22px;
        padding: 0 10px;
        border-radius: 999px;
        border: 1px solid #9aa8bd;
        background: #f5f7fb;
        color: #223554;
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        vertical-align: middle;
        white-space: nowrap;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
        text-decoration: none !important;
    }
    .epgm-wrapper .epgm-press-reset-btn:hover,
    .epgm-wrapper .epgm-press-reset-btn:focus,
    button.epgm-press-reset-btn:hover,
    button.epgm-press-reset-btn:focus {
        outline: none;
        border-color: #335f92;
        background: #eaf0fb;
        color: #283e62;
        box-shadow: 0 0 0 2px rgba(59,115,179,0.20);
    }
    .epgm-press-reset-btn:disabled { opacity: .6; cursor: not-allowed; }
/* Press Badges */
.epgm-press-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #2563eb; /* Blue default */
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    margin: 0 auto;
    cursor: default;
    line-height: 1;
    vertical-align: middle;
}
.epgm-press-badge--auto {
    background-color: #16a34a; /* Green */
}
.epgm-press-badge--manual {
    background-color: #dc2626; /* Red */
}
.epgm-press-badge.is-removable {
    cursor: pointer;
}
.epgm-press-badge.is-removable:hover {
    opacity: 0.8;
}

/* Manual Press Start Button (in table) */
.epgm-press-start-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #dc2626;
    background: #fff;
    color: #dc2626;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    margin: 0 auto;
}
.epgm-press-start-btn:hover {
    background: #dc2626;
    color: #fff;
}
.epgm-press-reset-btn {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    border-radius: 50% !important;
    border: 1px solid #ef4444 !important; /* Red-500 */
    background: #fff !important;
    color: #ef4444 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    line-height: 1 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.epgm-press-reset-btn:hover {
    background: #fef2f2 !important;
}

/* Toast Notification */
.epgm-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: #1f2937; /* gray-800 */
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    text-align: center;
    max-width: 90vw;
}
.epgm-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}


/* ===== 3-way Toggle Switch (Segmented Control) ===== */
.epgm-setup-wrapper .epgm-switch-3,
.epgm-setup-wrapper .epgm-switch-2 {
    display: inline-flex;
    position: relative;
    background: var(--bg-elev-alt, #f3f4f6);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 999px;
    padding: 3px;
    width: 100%;
    max-width: 300px; /* Restrict width on large screens */
    box-sizing: border-box;
}
.epgm-setup-wrapper .epgm-switch-3 *,
.epgm-setup-wrapper .epgm-switch-2 * {
    box-sizing: border-box;
}
.epgm-setup-wrapper .epgm-switch-3 input[type="radio"],
.epgm-setup-wrapper .epgm-switch-2 input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}
.epgm-setup-wrapper .epgm-switch-3 label,
.epgm-setup-wrapper .epgm-switch-2 label {
    flex: 1;
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 6px 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text, #374151);
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
    white-space: nowrap;
}
.epgm-setup-wrapper .epgm-switch-3 input:checked + label,
.epgm-setup-wrapper .epgm-switch-2 input:checked + label {
    color: #ffffff;
}
.epgm-setup-wrapper .epgm-switch-3 .epgm-switch-slider,
.epgm-setup-wrapper .epgm-switch-2 .epgm-switch-slider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc((100% - 6px) / 3);
    background: var(--color-accent, #2563eb);
    border-radius: 999px;
    z-index: 1;
    transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
    border: none;
    height: auto;
    content: "";
}
.epgm-setup-wrapper .epgm-switch-3 input[value="auto"]:checked ~ .epgm-switch-slider {
    transform: translateX(0%);
}
.epgm-setup-wrapper .epgm-switch-3 input[value="manual"]:checked ~ .epgm-switch-slider {
    transform: translateX(100%);
}
.epgm-setup-wrapper .epgm-switch-3 input[value="both"]:checked ~ .epgm-switch-slider {
    transform: translateX(200%);
}
/* Switch 2 (Two Options) */
.epgm-setup-wrapper .epgm-switch-2 .epgm-switch-slider {
    width: calc((100% - 6px) / 2);
}
.epgm-setup-wrapper .epgm-switch-2 input:checked ~ .epgm-switch-slider {
    /* Base logic, overridden by specific value selectors if needed */
}
.epgm-setup-wrapper .epgm-switch-2 input:first-of-type:checked ~ .epgm-switch-slider {
    transform: translateX(0%);
}
.epgm-setup-wrapper .epgm-switch-2 input:nth-of-type(2):checked ~ .epgm-switch-slider {
    transform: translateX(100%);
}
.epgm-place-pct {
    width: 70px;
}
@media (min-width: 768px) {
    .epgm-place-pct {
        width: 110px; /* Wider on desktop per request */
    }
}

.epgm-666-match-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.epgm-666-row {
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: background-color 0.2s;
}
.epgm-666-row:hover {
    background-color: rgba(0,0,0,0.02);
}

/* 6-6-6 Box Styles (replaced inline styles) */
.epgm-666-box {
    min-height: 40px;
    border-radius: 4px;
    padding: 4px;
    font-size: 0.9em;
    border: 1px solid var(--color-border, #e5e7eb);
}
.epgm-team-dropzone.epgm-666-box {
    list-style: none;
    margin: 0;
}
.epgm-666-box-active {
    background: var(--bg-elev, #ffffff);
}
.epgm-666-box-readonly {
    background: var(--bg-elev-alt, #f3f4f6);
}

/* Readonly Players - Restored Size & "Locked" Look */
.epgm-readonly-container .epgm-player {
    pointer-events: none; /* Can't drag from read-only */
    opacity: 0.9;
    margin: 4px 0; /* Standard margin */
    padding: 6px 8px; /* Standard padding */
    background: #fff;
    border-radius: 6px;
    box-shadow: none; /* Flat to distinguish from draggable */
    border: 1px solid rgba(0,0,0,0.08); /* Subtle border */
    font-size: 1em; /* Standard text size */
    display: flex;
    align-items: center;
    gap: 8px;
}
/* Ensure Avatars are standard size (28px) */
.epgm-readonly-container .epgm-avatar-wrap {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

/* Dark Mode Overrides for 6-6-6 Boxes */
:root[data-theme="dark"] .epgm-666-box-active {
    background: #374151; /* Lighter dark surface for active */
    border-color: #4b5563;
}
:root[data-theme="dark"] .epgm-666-box-readonly {
    background: #1f2937; /* Darker/Standard surface for readonly */
    border-color: #374151;
}
:root[data-theme="dark"] .epgm-readonly-container .epgm-player {
    background: #374151; /* Match active box bg effectively 'raising' it slightly or blending? */
    /* Let's make player card slightly lighter than the readonly container (#1f2937) */
    background: #2d3748; 
    border-color: rgba(255,255,255,0.05);
    color: #e5e7eb;
}

/* ===== Sticky Headers & Columns for Results Tables ===== */
.epgm-raw-inner {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 80vh; /* Enable vertical scrolling for sticky header support */
    position: relative;
    max-width: 100%;
    /* Ensure scrollbar style matches theme if possible (optional) */
    scrollbar-width: thin;
}
.epgm-game-table {
    border-collapse: collapse !important;
}
/* Sticky Header Row */
.epgm-game-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: var(--bg-elev-alt, #f9fafb);
    box-shadow: 0 1px 0 var(--color-border, #e5e7eb); /* Simulate border */
}
/* Sticky First Column (Hole #) */
.epgm-game-table thead th:first-child,
.epgm-game-table tbody td:first-child,
.epgm-game-table tbody th:first-child,
.epgm-game-table tfoot th:first-child,
.epgm-game-table tfoot td:first-child {
    position: sticky;
    left: 0;
    z-index: 10;
    background-color: var(--bg-elev, #ffffff);
    border-right: 1px solid var(--color-border, #e5e7eb);
}
/* Top-left intersection cell needs highest z-index */
.epgm-game-table thead th:first-child {
    z-index: 30;
}
/* Intersection of Header & First Column (Top-Left) */
.epgm-game-table thead th:first-child {
    z-index: 30;
    background-color: var(--bg-elev-alt, #f9fafb);
}
/* Subtotal/Footer Row Headers */
.epgm-game-table tbody tr.epgm-table-subtotal th:first-child,
.epgm-game-table tfoot tr th:first-child,
.epgm-game-table tfoot tr.epgm-table-totals th:first-child {
    background-color: var(--bg-elev-alt, #f9fafb);
}
/* Winnings Row Header special background */
.epgm-game-table tfoot tr.epgm-winnings-row th:first-child {
    background-color: var(--bg-elev-alt, #f9fafb) !important;
}

/* Ensure Winnings Row respects theme */
.epgm-winnings-row {
    background-color: transparent;
    border-top: 2px solid var(--color-border, #e5e7eb);
}
.epgm-winnings-row th {
    color: var(--color-text, #111827);
    font-weight: 600;
}
:root[data-theme="dark"] .epgm-winnings-row th {
    color: #e5e7eb;
}

/* Drag and Drop Feedback */
.epgm-drag-over {
    background-color: rgba(37, 99, 235, 0.1) !important;
    border-color: #2563eb !important;
    box-shadow: inset 0 0 0 2px #2563eb !important;
    transition: all 0.2s ease;
}
/* =========================================================
   FIX: Light/Dark Mode Contrast Overrides
   Ensures text contrast matches the theme-aware backgrounds
   ========================================================= */
.epgm-666-grand-total,
.epgm-666-schedule-view,
.epgm-team-dropzone,
.epgm-readonly-container {
    color: var(--color-text, #111827) !important;
}

/* Ensure 6-6-6 Schedule View is scrollable if it gets too tall */
.epgm-666-schedule-view {
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px; /* Space for scrollbar */
}

/* Explicit Dark Mode Overrides (Safety) */
:root[data-theme="dark"] .epgm-666-grand-total,
:root[data-theme="dark"] .epgm-666-schedule-view,
:root[data-theme="dark"] .epgm-team-dropzone,
:root[data-theme="dark"] .epgm-readonly-container,
html.theme-dark .epgm-666-grand-total,
html.theme-dark .epgm-666-schedule-view,
html.theme-dark .epgm-team-dropzone,
html.theme-dark .epgm-readonly-container {
    color: #e5e7eb !important;
}

.epgm-placeholder {
    color: currentColor !important;
    opacity: 0.6;
}

/* =========================================================
   FIX: 6-6-6 Header & Sticky Table Backgrounds
   ========================================================= */

/* Setup View: Make "First 6" / "Middle 6" headers distinct rows */
.epgm-666-header {
    background-color: var(--bg-elev, #ffffff);
    padding: 8px 10px;
    border-radius: 6px;
    font-weight: 700;
    margin-bottom: 6px;
    border: 1px solid var(--color-border, #e5e7eb);
    /* Ensure opacity so it doesn't look transparent over other elements */
    position: relative;
    z-index: 2;
}
:root[data-theme="dark"] .epgm-666-header {
    background-color: #374151; /* Dark grey opaque */
    color: #e5e7eb;
    border-color: #4b5563;
}

/* =========================================================
   FIX: Mobile Edge-to-Edge & Sticky Reinforcement
   ========================================================= */
@media (max-width: 768px) {
    /* Expand cards to full width, removing borders/radius/padding */
    .epgm-wrapper .epgm-game-card,
    .epgm-setup-wrapper .epgm-add-game-panel {
        /* FIXED: Removed negative margins that caused overflow/negative-space on mobile */
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        /* Restore standard card appearance */
        border-radius: 6px !important;
        border: 1px solid var(--color-border, #e5e7eb) !important;
        padding: 10px 0 !important;
        background: var(--bg-elev, #ffffff);
    }
    
    /* Inside the setup panel, ensure content has breathing room */
    .epgm-setup-wrapper .epgm-field,
    .epgm-setup-wrapper .epgm-actions,
    .epgm-setup-wrapper .epgm-add-game,
    .epgm-setup-wrapper .epgm-title {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .epgm-title {
        font-size: 1.1rem;
    }

    /* 6-6-6 Schedule View specifically - remove gridwork */
    .epgm-666-schedule-view {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
    }
    .epgm-666-row {
        margin-bottom: 12px;
        border-bottom: 1px solid var(--color-border, #e5e7eb);
        padding-bottom: 12px;
    }
    
    /* Remove padding from body so table hits the edge */
    .epgm-game-body {
        padding: 0 !important;
    }
    
    /* Ensure scrolling containers match width */
    .epgm-table-container,
    .epgm-raw-inner,
    .epgm-666-grand-total {
        border-radius: 0 !important;
        border: none !important;
        width: 100% !important;
    }
    
    /* Adjust header/toggle padding to remain touchable but aligned */
    .epgm-game-toggle {
        border-radius: 0 !important;
        padding: 12px 16px !important;
    }

    /* Fix 6-6-6 Drag & Drop on Mobile: Stack Team Containers - REVERTED per user request */
    /* .epgm-666-match-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px;
    } */
    /* Ensure 2-column grid is maintained */
    .epgm-666-match-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }
    /* Ensure dropzones are full width */
    .epgm-assignment-block,
    .epgm-team-dropzone,
    .epgm-readonly-container {
        width: 100% !important;
    }

    /* Fix Padding for Text Elements (Sub-titles & Captions) */
    /* Compensates for the edge-to-edge negative margins on mobile */
    .epgm-setup-wrapper .epgm-field > label,
    .epgm-setup-wrapper .epgm-help,
    .epgm-assignment-block label,
    .epgm-666-header,
    .epgm-game-wagers {
        padding-left: 8px; 
        padding-right: 8px;
        /* Ensure they don't overflow if width is 100% */
        box-sizing: border-box; 
    }
    
    .epgm-666-header {
        font-size: 0.95rem;
    }
}

/* Reinforce Sticky Headers - Vertical & Horizontal */
.epgm-game-table,
.epgm-table-container table {
    border-collapse: separate; /* Essential for sticky */
    border-spacing: 0;
}

/* 1. Header Row (Top) */
.epgm-game-table thead th,
.epgm-table-container thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: var(--bg-elev-alt, #f9fafb);
    /* Add bottom border visual */
    box-shadow: 0 1px 0 var(--color-border, #e5e7eb);
}

/* 2. First Column (Left) - Player names */
.epgm-game-table th:first-child,
.epgm-game-table td:first-child,
.epgm-table-container th:first-child,
.epgm-table-container td:first-child {
    position: sticky;
    left: 0;
    z-index: 15; /* Above normal cells, below header intersection */
    background-color: var(--bg-elev, #ffffff);
    border-right: 1px solid var(--color-border, #e5e7eb);
}

/* 3. Intersection (Top-Left Corner) */
.epgm-game-table thead th:first-child,
.epgm-table-container thead th:first-child {
    z-index: 30; /* Topmost */
    background-color: var(--bg-elev-alt, #f9fafb); /* Match header row bg */
}

/* Dark Mode Sticky Backgrounds */
:root[data-theme="dark"] .epgm-game-table thead th,
:root[data-theme="dark"] .epgm-table-container thead th {
    background-color: #1f2937; /* Dark header bg */
    box-shadow: 0 1px 0 #374151;
}
:root[data-theme="dark"] .epgm-game-table th:first-child,
:root[data-theme="dark"] .epgm-game-table td:first-child,
:root[data-theme="dark"] .epgm-table-container th:first-child,
:root[data-theme="dark"] .epgm-table-container td:first-child {
    background-color: #111827; /* Dark body bg */
    border-right-color: #374151;
}
:root[data-theme="dark"] .epgm-game-table thead th:first-child,
:root[data-theme="dark"] .epgm-table-container thead th:first-child {
    background-color: #1f2937; /* Dark header bg */
}

/* Ensure Name Balloon pointer */
.epgm-short-name {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    text-decoration-color: rgba(0,0,0,0.3);
}
:root[data-theme="dark"] .epgm-short-name {
    text-decoration-color: rgba(255,255,255,0.3);
}

/* Fix Mobile Team Layout Stacking */
@media (max-width: 768px) {
    /* Previously column, now 2-column grid per request */
    .epgm-setup-wrapper .epgm-team-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .epgm-team-col {
        width: 100%;
    }
}

/* Toggle Explanation / Help Text Styling */
.epgm-help {
    display: block;
    font-size: 0.8em; /* Smaller font */
    font-weight: 400; /* Normal weight, less bold */
    opacity: 0.7;     /* Less important */
    margin-top: 4px;
    line-height: 1.3;
}
:root[data-theme="dark"] .epgm-help {
    opacity: 0.6; /* Slightly more fade in dark mode */
}


/* ===== Custom Game Type Dropdown ===== */
.epgm-custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}
.epgm-custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text, #111827);
    background: var(--bg-elev, #ffffff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
}
.epgm-custom-select-trigger:after {
    content: "▼";
    font-size: 10px;
    margin-left: 8px;
    opacity: 0.6;
}
.epgm-custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 999;
    background: var(--bg-elev, #ffffff);
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: none;
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 100%;
    width: max-content;
    max-width: 90vw;
}
.epgm-custom-select-options.open {
    display: block;
}
.epgm-custom-select-option {
    padding: 10px 12px;
    font-size: 14px;
    color: var(--color-text, #111827);
    cursor: pointer;
    border-bottom: 1px solid var(--color-border, #e5e7eb);
    white-space: nowrap;
}
.epgm-custom-select-option:last-child {
    border-bottom: none;
}
.epgm-custom-select-option:hover {
    background-color: var(--bg-elev-alt, #f3f4f6);
}
.epgm-custom-select-optgroup {
    padding: 6px 12px;
    font-weight: 700;
    color: var(--color-text-muted, #6b7280);
    background-color: var(--bg-elev-alt, #f3f4f6);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    pointer-events: none;
}

/* Dark Mode Overrides for Dropdown */
:root[data-theme="dark"] .epgm-custom-select-trigger {
    background-color: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}
:root[data-theme="dark"] .epgm-custom-select-options {
    background-color: #1f2937;
    border-color: #374151;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] .epgm-custom-select-option {
    color: #e5e7eb;
    border-bottom-color: #374151;
}
:root[data-theme="dark"] .epgm-custom-select-option:hover {
    background-color: #374151;
}
:root[data-theme="dark"] .epgm-custom-select-optgroup {
    background-color: #374151;
    color: #9ca3af;
}

/* Fix padding for 6-6-6 Winnings and Delete Button */
.epgm-666-winnings {
    padding-left: 15px;
}
.epgm-sg-delete {
    background: transparent;
    border: none;
    color: var(--color-error, #ef4444);
    border-radius: 6px;
    padding: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    max-width: none;
    text-align: center;
    transition: background 0.2s;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.epgm-sg-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* =========================================================
   START HOLE INDICATOR (Cross-plugin compatibility)
   Matches .eps-start-hole in scorecard-theme.css
========================================================= */
.eps-start-hole {
    border-left: 3px solid var(--eps-site-green, #27ae60) !important;
    background-color: color-mix(in srgb, var(--eps-site-green, #27ae60), transparent 90%) !important;
}
html.theme-dark .eps-start-hole {
    border-left: 3px solid var(--eps-site-green, #2ecc71) !important;
    background-color: color-mix(in srgb, var(--eps-site-green, #2ecc71), transparent 90%) !important;
}
/* Mobile constraint to prevent horizontal page scroll/spring on Small Games Live AND Core Games panels */
@media (max-width: 768px) {
    /* Prevent page-level bounce via class injection (robust fallback for :has) */
    html.epgm-body-locked,
    body.epgm-body-locked {
        overscroll-behavior-x: none !important;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        /* Kill horizontal gestures on the page root to stop bounce/swipe-nav */
        touch-action: pan-y !important;
    }

    /* Fallback using :has for modern browsers if script delayed */
    body:has(.epgm-small-games-live) {
        overscroll-behavior-x: none !important;
        touch-action: pan-y !important;
    }

    .epgm-small-games-live {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
        overscroll-behavior-x: none !important;
        /* Wrapper also strictly vertical to stop drag on headers/titles */
        touch-action: pan-y !important;
    }
    /* Apply globally to all EPGM scroll containers on mobile */
    .epgm-table-scroll,
    .epgm-table-container {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-x: none !important;
        /* Explicitly RE-ENABLE horizontal panning for the tables */
        touch-action: pan-x pan-y !important;
        -webkit-overflow-scrolling: touch;
    }
    .epgm-small-games-live .epgm-title {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* FIX: Reset negative margins for Live View cards (since wrapper has 0 padding) */
    .epgm-small-games-live .epgm-game-card {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        border-radius: 0 !important;
    }

    /* FIX: Ensure actions container has padding on mobile (since body padding is removed) */
    .epgm-game-body .epgm-sg-actions {
        padding-left: 12px;
        padding-right: 12px;
        padding-bottom: 12px;
    }
}

/* =========================================================
   FLEX HEADER FIX (Toggle + Delete Button Alignment)
   ========================================================= */
.epgm-game-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 10px;
}
.epgm-toggle-game {
    flex: 1 1 auto;
    min-width: 0; /* Allow text truncation */
    background: transparent;
    border: none;
    text-align: left;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: inherit;
}
.epgm-delete-game {
    flex: 0 0 auto;
    background: transparent;
    border: 1px solid var(--color-error, #ef4444);
    color: var(--color-error, #ef4444);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.epgm-delete-game:hover {
    background: var(--color-error, #ef4444);
    color: #fff;
}
/* Ensure toggle chevron stays on right of toggle button content */
.epgm-toggle-chevron { margin-left: auto; padding-left: 8px; }

/* =========================================================
   GAMES DRAWER MODAL (Left Side)
   ========================================================= */
#epgmGamesModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%); /* Start off-screen left */
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    background: var(--bg-elev, #ffffff);
    color: var(--color-text, #111111);
    z-index: 2147483647; /* Highest priority */
    box-shadow: 14px 0 40px rgba(0, 0, 0, 0.25);
}

@media (min-width: 769px) {
    #epgmGamesModal {
        width: 480px; /* Drawer width on desktop */
        border-right: 1px solid var(--color-border);
    }
}

#epgmGamesModal.active {
    transform: translateX(0);
}

/* Modal Header */
#epgmGamesModal .epgm-modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--bg-elev-alt);
}

/* Back to Scores Button */
#epgmGamesModal .epgm-back-btn {
    appearance: none;
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
#epgmGamesModal .epgm-back-btn:hover {
    background: var(--color-accent);
    color: #fff;
}

/* Close Button */
#epgmGamesModal .epgm-close-btn {
    appearance: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
}
#epgmGamesModal .epgm-close-btn:hover {
    color: var(--color-error);
}

/* Modal Content Area */
#epgmGamesModal .epgm-modal-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

/* Game Body inside Modal */
#epgmGamesModal .epgm-game-body {
    display: none; /* All hidden by default */
}
#epgmGamesModal .epgm-game-body.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Dark Mode Overrides */
[data-theme='dark'] #epgmGamesModal {
    background: var(--color-surface);
    color: var(--color-text);
    border-right-color: var(--color-border);
}
[data-theme='dark'] #epgmGamesModal .epgm-modal-header {
    background: #1f2937;
    border-bottom-color: var(--color-border);
}

/* Main List Adjustments */
.epgm-game-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.epgm-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
/* Hide the chevron arrow in the main list headers */
.epgm-toggle-chevron {
    display: none !important;
}
/* Ensure header looks clickable */
.epgm-game-header {
    cursor: pointer;
}


/* =========================================================
   GAMES DRAWER MODAL (Left Side)
   ========================================================= */
#epgmGamesModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%); /* Start off-screen left */
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    background: var(--bg-elev, #ffffff);
    color: var(--color-text, #111111);
    z-index: 2147483647; /* Highest priority */
    box-shadow: 14px 0 40px rgba(0, 0, 0, 0.25);
}

@media (min-width: 769px) {
    #epgmGamesModal {
        width: 480px; /* Drawer width on desktop */
        border-right: 1px solid var(--color-border);
    }
}

#epgmGamesModal.active {
    transform: translateX(0);
}

/* Modal Header */
#epgmGamesModal .epgm-modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--bg-elev-alt);
}

/* Back to Scores Button */
#epgmGamesModal .epgm-back-btn {
    appearance: none;
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
#epgmGamesModal .epgm-back-btn:hover {
    background: var(--color-accent);
    color: #fff;
}

/* Close Button */
#epgmGamesModal .epgm-close-btn {
    appearance: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
}
#epgmGamesModal .epgm-close-btn:hover {
    color: var(--color-error);
}

/* Modal Content Area */
#epgmGamesModal .epgm-modal-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

/* Game Body inside Modal */
#epgmGamesModal .epgm-game-body {
    display: none; /* All hidden by default */
}
#epgmGamesModal .epgm-game-body.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Dark Mode Overrides */
[data-theme='dark'] #epgmGamesModal {
    background: var(--color-surface);
    color: var(--color-text);
    border-right-color: var(--color-border);
}
[data-theme='dark'] #epgmGamesModal .epgm-modal-header {
    background: #1f2937;
    border-bottom-color: var(--color-border);
}

/* Main List Adjustments */
.epgm-game-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.epgm-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
/* Hide the chevron arrow in the main list headers */
.epgm-toggle-chevron {
    display: none !important;
}
/* Ensure header looks clickable */
.epgm-game-header {
    cursor: pointer;
}


/* ===== GRID LAYOUT FOR GAMES LIST ===== */
.epgm-game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

/* Square Card Style */
.epgm-game-grid .epgm-game-card {
    margin: 0 !important;
    width: auto !important;
    border-radius: 12px !important;
    border: 1px solid var(--color-border);
    background: var(--bg-elev);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
    min-height: 140px;
    position: relative; /* Context for absolute delete btn */
}
.epgm-game-grid .epgm-game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Header becomes the main content */
.epgm-game-grid .epgm-game-header {
    flex: 1;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding: 12px !important;
    gap: 8px;
    height: auto;
    background: transparent !important;
    border-bottom: none !important;
}

/* Title & Status */
.epgm-game-grid .epgm-game-name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 2px;
    color: var(--color-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.epgm-game-grid .epgm-card-status {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-bottom: auto; /* Push avatars down */
    line-height: 1.3;
}

/* 6-6-6 Avatar Rows (Header) */
.epgm-666-avatars {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    margin-top: 8px;
}
.epgm-666-match-row {
    display: flex;
    align-items: center;
    gap: 2px;
}
.epgm-666-match-vs {
    margin: 0 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
}
.epgm-666-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-right: 6px;
    min-width: 45px; /* Align "First 6", "Mid 6" */
}

/* Avatar Grid */
.epgm-card-avatars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
}
.epgm-card-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-elev-alt);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid var(--color-border);
    overflow: hidden;
    position: relative;
    cursor: help;
}
.epgm-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Delete Icon on Card (Top Right) */
.epgm-card-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 4px;
    color: var(--color-text-muted);
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    opacity: 1 !important; /* Always visible */
    transition: opacity 0.2s, color 0.2s;
    z-index: 5;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}
.epgm-card-delete:hover,
.epgm-card-delete:focus {
    color: var(--color-error);
    background: rgba(239, 68, 68, 0.1) !important; /* Subtle red bg on hover */
    opacity: 1;
}

/* Mobile Adjustments for Grid */
@media (max-width: 768px) {
    .epgm-game-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns */
        gap: 10px;
        margin-top: 10px;
    }
    .epgm-game-grid .epgm-game-card {
        min-height: 120px;
    }
    .epgm-card-delete {
        opacity: 1; /* Always visible on touch */
        background: transparent;
        border: none;
    }
    [data-theme="dark"] .epgm-card-delete {
        background: transparent;
    }
}

/* Dark Mode Contrast Enhancements */
html.theme-dark .epgm-run-col,
[data-theme='dark'] .epgm-run-col {
    color: #ffffff !important;
    font-weight: 700;
}
html.theme-dark .epgm-run-as,
[data-theme='dark'] .epgm-run-as {
    color: #e5e7eb !important;
    opacity: 1 !important;
}
html.theme-dark .epgm-card-status {
    color: #d1d5db;
}
/* Ensure Table Header Contrast */
.epgm-table-container.has-sticky-cols thead th {
    color: var(--color-text);
}
html.theme-dark .epgm-table-container.has-sticky-cols thead th,
[data-theme='dark'] .epgm-table-container.has-sticky-cols thead th {
    color: #f3f4f6; /* Slate-100 */
}

/* =========================================================
   FIXED MODAL STYLES (Matching PHP ID: #epgm-games-modal)
   ========================================================= */
#epgm-games-modal,
.epgm-games-modal-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    background: var(--bg-elev, #ffffff);
    color: var(--color-text, #111111);
    z-index: 2147483647;
    box-shadow: 14px 0 40px rgba(0, 0, 0, 0.25);
}

@media (min-width: 769px) {
    #epgm-games-modal,
    .epgm-games-modal-drawer {
        width: 480px;
        border-right: 1px solid var(--color-border);
    }
}

#epgm-games-modal.active,
.epgm-games-modal-drawer.active {
    transform: translateX(0);
}

#epgm-games-modal .epgm-modal-header,
.epgm-games-modal-drawer .epgm-modal-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    background: var(--bg-elev-alt);
}

#epgm-games-modal .epgm-back-btn,
.epgm-games-modal-drawer .epgm-back-btn {
    appearance: none;
    background: transparent;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
#epgm-games-modal .epgm-back-btn:hover,
.epgm-games-modal-drawer .epgm-back-btn:hover {
    background: var(--color-accent);
    color: #fff;
}

#epgm-games-modal .epgm-close-btn,
.epgm-games-modal-drawer .epgm-close-btn {
    appearance: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
}
#epgm-games-modal .epgm-close-btn:hover,
.epgm-games-modal-drawer .epgm-close-btn:hover {
    color: var(--color-error);
}

#epgm-games-modal .epgm-modal-content,
.epgm-games-modal-drawer .epgm-modal-content {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
}

#epgm-games-modal .epgm-game-body,
.epgm-games-modal-drawer .epgm-game-body {
    display: block;
}

/* Modal Internal Title (Scrolls with content) */
.epgm-modal-title-block {
    padding: 0 0 16px 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
}
.epgm-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}
.epgm-modal-subtitle {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

[data-theme='dark'] #epgm-games-modal,
[data-theme='dark'] .epgm-games-modal-drawer {
    background: var(--color-surface);
    color: var(--color-text);
    border-right-color: var(--color-border);
}
[data-theme='dark'] #epgm-games-modal .epgm-modal-header,
[data-theme='dark'] .epgm-games-modal-drawer .epgm-modal-header {
    background: #1f2937;
    border-bottom-color: var(--color-border);
}

/* =========================================================
   SETUP SCROLLING FIXES
   ========================================================= */
.epgm-setup-wrapper {
    overflow-y: visible !important;
    max-height: none !important;
    display: block !important;
    padding-bottom: 20px;
}

.epgm-player-pool {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    margin-top: 8px;
    background: var(--bg-elev);
}

body.epgm-setup-active {
    overflow: auto !important;
}

@keyframes epgm-pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.epgm-deleting-glow {
    animation: epgm-pulse-red 1.5s infinite;
    color: #dc3545 !important;
    border-color: #dc3545 !important;
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

/* Ensure the trash icon stays visible and red */
.epgm-deleting-glow i, 
.epgm-deleting-glow svg {
    color: #dc3545 !important;
}


/* =========================================================
   Stroke Border Indicators (Games Display)
   - Left/Right border for stroke allocation in Team/6-6-6 matches
   - Uses pseudo-elements for robust rendering over cell backgrounds
   - V3: Box-shadow fallback + Data Attribute + Sticky Content Fix
   ========================================================= */
.epgm-game-table td {
    position: relative !important; /* Anchor for border indicators */
    z-index: 1; /* Ensure stacking context */
    min-width: 60px; /* [FIX] Prevent columns from collapsing to zero width in fixed layout */
}

/* Base Pseudo-Element Style */
.epgm-bdr-l,
.epgm-bdr-r {
    position: relative !important; /* Ensure pseudo-elements anchor even outside .epgm-game-table */
}

.epgm-bdr-l::before {
    content: " " !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 6px !important;
    background-color: var(--color-accent, #3b82f6) !important;
    z-index: 22 !important; /* Above cell (1), below sticky cols (25) */
    pointer-events: none !important;
}

.epgm-bdr-r::after {
    content: " " !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    right: 0 !important;
    width: 6px !important;
    background-color: var(--color-accent, #3b82f6) !important;
    z-index: 22 !important; /* Above cell (1), below sticky cols (25) */
    pointer-events: none !important;
}

/* Fallback: CSS Box Shadow for robustness (if pseudo is hidden) */
td[data-strokes="1"].epgm-bdr-l {
    box-shadow: inset 6px 0 0 0 var(--color-accent, #3b82f6) !important;
}
td[data-strokes="1"].epgm-bdr-r {
    box-shadow: inset -6px 0 0 0 var(--color-accent, #3b82f6) !important;
}
td[data-strokes="1"].epgm-bdr-l.epgm-bdr-r {
    box-shadow: inset 6px 0 0 0 var(--color-accent, #3b82f6), inset -6px 0 0 0 var(--color-accent, #3b82f6) !important;
}

/* Sticky Content Wrapper */
.epgm-sticky-content {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    line-height: 1.2;
}

/* =========================================================
   STICKY COLUMN Z-INDEX FIX (Rabbit Game Overlap)
   - Ensure sticky columns sit ABOVE the stroke indicators (z-index 10)
   ========================================================= */
.epgm-sticky-col-1,
.epgm-sticky-col-2 {
    z-index: 100 !important;
}
.epgm-game-table.sticky-head thead th,
.epgm-table-container.has-sticky-cols thead th {
    z-index: 105 !important;
}
/* Intersection of sticky header + sticky col needs highest z-index */
.epgm-table-container.has-sticky-cols thead th.epgm-sticky-col-1,
.epgm-table-container.has-sticky-cols thead th.epgm-sticky-col-2 {
    z-index: 110 !important;
}

/* Fix for 6-6-6 Balanced Strokes Toggle on Mobile */
.epgm-balance-opt-unique .epgm-switch-2 {
    max-width: 420px;
}
@media (max-width: 480px) {
    .epgm-balance-opt-unique .epgm-switch-2 {
        max-width: 100%;
        min-height: 44px; /* Ensure enough height for wrapped text */
    }
    .epgm-balance-opt-unique .epgm-switch-2 label {
        white-space: normal; /* Allow wrapping */
        font-size: 11px;
        line-height: 1.15;
        padding: 4px 2px;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }
}

/* Responsive adjustments for other setup switches */
.epgm-switch-team-mode { max-width: 200px; }
.epgm-switch-scoring { max-width: 200px; }
.epgm-switch-hc-rule { max-width: 340px; }
.epgm-switch-payout { max-width: 280px; }

@media (max-width: 480px) {
    .epgm-switch-team-mode,
    .epgm-switch-scoring,
    .epgm-switch-hc-rule,
    .epgm-switch-payout {
        max-width: 100%;
        min-height: 44px;
    }
    .epgm-switch-team-mode label,
    .epgm-switch-scoring label,
    .epgm-switch-hc-rule label,
    .epgm-switch-payout label {
        white-space: normal;
        font-size: 11px;
        line-height: 1.15;
        padding: 4px 2px;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        text-align: center;
    }
}
/* =========================================================
   FIX: 6-6-6 Table Alignment (Floating Header / Width Issues)
   - Force fixed layout to ensure header and body columns align
   - Set explicit widths for structural columns (Hole, Status)
   ========================================================= */
.epgm-game-table.epgm-666-seg {
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: separate;
}

/* Ensure header cells match body cells */
.epgm-game-table.epgm-666-seg th,
.epgm-game-table.epgm-666-seg td {
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Specific Column Widths */
.epgm-game-table.epgm-666-seg th:first-child, 
.epgm-game-table.epgm-666-seg td:first-child {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
}

/* Status Columns */
.epgm-game-table.epgm-666-seg .epgm-run-col {
    width: 36px !important;
    min-width: 36px !important;
    padding: 0 2px !important;
}

/* Player/Team Columns - Auto expand */
.epgm-game-table.epgm-666-seg th:not(:first-child):not(.epgm-run-col),
.epgm-game-table.epgm-666-seg td:not(:first-child):not(.epgm-run-col) {
    width: auto;
    white-space: normal !important;
    vertical-align: middle !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    line-height: 1.3 !important;
}

/* 6-6-6 Points Formatting */
.epgm-666-pts {
    display: inline-block;
    font-weight: 700;
    color: var(--color-accent, #3b82f6);
    margin-right: 6px;
    background: rgba(59, 130, 246, 0.1);
    padding: 1px 4px;
    border-radius: 4px;
    line-height: 1;
    white-space: nowrap !important;
}

/* =========================================================
   Baseball Table — Mobile Fit
   Shrink Hole / Score / Pts header labels so all columns
   fit inside the modal drawer on small screens.
   ========================================================= */
.epgm-baseball-table {
    table-layout: fixed;
    width: 100%;
}
.epgm-baseball-table thead th {
    font-size: 0.7rem;
    padding: 3px 1px;
    white-space: nowrap;
    text-align: center;
}
/* Player name row keeps a larger, readable size */
.epgm-baseball-table thead tr:first-child th:not(:first-child) {
    font-size: 0.8rem;
}
.epgm-baseball-table tbody td {
    font-size: 0.8rem;
    padding: 3px 1px;
    text-align: center;
}
.epgm-baseball-table thead th:first-child,
.epgm-baseball-table tbody td:first-child {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    padding-left: 4px;
    padding-right: 4px;
}

/* =========================================================
   Rabbit Table — Mobile Fit & Captured-Row Highlight
   ========================================================= */

/* Highlight rows where a rabbit is captured (points awarded) */
tr.epgm-rabbit-captured-row {
    background-color: rgba(20, 184, 166, 0.12);
}
[data-theme='dark'] tr.epgm-rabbit-captured-row {
    background-color: rgba(20, 184, 166, 0.18);
}
tr.epgm-rabbit-captured-row td.epgm-sticky-col-1,
tr.epgm-rabbit-captured-row td.epgm-sticky-col-2 {
    background-color: rgba(20, 184, 166, 0.12) !important;
}
[data-theme='dark'] tr.epgm-rabbit-captured-row td.epgm-sticky-col-1,
[data-theme='dark'] tr.epgm-rabbit-captured-row td.epgm-sticky-col-2 {
    background-color: rgba(20, 184, 166, 0.18) !important;
}