.bjcsf-wrap { margin: 1.5rem 0; }
.bjcsf-h2 { font-size: 1.6rem; margin: 0 0 0.75rem 0; }
.bjcsf-h3 { font-size: 1.25rem; margin: 1rem 0 0.75rem 0; }
.bjcsf-box { padding: 1rem; border: 1px solid #ddd; border-radius: 10px; background: #fff; }
.bjcsf-error { border-color: #c0392b; }

.bjcsf-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #eee; border-radius: 10px; }
.bjcsf-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.bjcsf-table caption { text-align: left; padding: 0.75rem; font-weight: 600; }
.bjcsf-table th, .bjcsf-table td { padding: 0.55rem 0.6rem; border-top: 1px solid #eee; border-right: 1px solid #f3f3f3; text-align: center; white-space: nowrap; }
.bjcsf-table thead th { position: sticky; top: 0; background: #fafafa; z-index: 1; border-top: none; }
.bjcsf-table tbody th { text-align: left; background: #fcfcfc; position: sticky; left: 0; z-index: 1; border-right: 1px solid #eee; }

.bjcsf-legend { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; font-size: 0.95rem; margin-top: 0.6rem; }
.bjcsf-legend span strong { display: inline-block; min-width: 1.2rem; }

.bjcsf-tabs { margin-top: 0.5rem; }
.bjcsf-tablist { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.bjcsf-tab { border: 1px solid #ddd; padding: 0.5rem 0.75rem; border-radius: 999px; cursor: pointer; }
.bjcsf-tab.is-active { border-color: #bbb; }
.bjcsf-section { display: none; }
.bjcsf-section.is-active { display: block; }

.bjcsf-solver { margin-top: 1.25rem; padding: 1rem; border: 1px solid #eee; border-radius: 10px; }
.bjcsf-solver-form { display: grid; gap: 0.75rem; grid-template-columns: 1fr; max-width: 520px; }
@media (min-width: 700px) { .bjcsf-solver-form { grid-template-columns: 1fr 1fr; } }
.bjcsf-label { display: grid; gap: 0.35rem; font-weight: 600; }
.bjcsf-select { padding: 0.45rem 0.5rem; border: 1px solid #ddd; border-radius: 8px; }
.bjcsf-btn { display: inline-block; padding: 0.55rem 0.85rem; border-radius: 10px; border: 1px solid #ddd; cursor: pointer; text-decoration: none; font-weight: 600; }
.bjcsf-btn:hover { background: #f7f7f7; }
.bjcsf-btn-secondary { opacity: 0.95; }
.bjcsf-solver-live, .bjcsf-solver-result { margin-top: 0.75rem; font-size: 1rem; }

.bjcsf-downloads { margin-top: 1.25rem; padding: 1rem; border: 1px solid #eee; border-radius: 10px; }
.bjcsf-download-buttons { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.bjcsf-lede { margin: 0 0 1rem 0; max-width: 70ch; }

.bjcsf-table-small { min-width: 0; }


/* Mobile UX: keep first column visible and white during horizontal scroll */
.bjcsf-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bjcsf-table thead th:first-child { position: sticky; left: 0; z-index: 3; }
.bjcsf-table tbody th[scope="row"] { position: sticky; left: 0; z-index: 2; }
.bjcsf-table tbody th[scope="row"], .bjcsf-table thead th:first-child { box-shadow: 1px 0 0 rgba(0,0,0,.06); }

/* Solver boxes: readable on mobile */
.bjcsf-solver-form { display: grid; gap: .75rem; }
.bjcsf-solver-picked { margin-bottom: .35rem; }
.bjcsf-solver-reco { font-size: 1.05em; }


.bjcsf-solver-box { margin-top: .75rem; padding: .85rem; border: 1px solid rgba(0,0,0,.12); border-radius: 12px; }
.bjcsf-solver-box-empty { display: none; }


.bjcsf-dealer-span { text-align: center; font-weight: 700; }

.bjcsf-player-head { font-weight: 700; }

/* Subtle highlight for dealer Ace column */
.bjcsf-table thead tr:last-child th:last-child { background: rgba(0,0,0,.03); }
.bjcsf-table tbody td:last-child { background: rgba(0,0,0,.03); }

/* Unified background for dealer header area */
.bjcsf-table thead th:not(.bjcsf-player-head) {
  background: rgba(0,0,0,.06);
}

/* Sticky dealer header + z-index layering (mobile scroll) */
.bjcsf-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

/* Second header row sits below first */
.bjcsf-table thead tr:nth-child(2) th {
  top: 2.45rem;
  z-index: 4;
}

/* Keep first column above body cells when scrolling horizontally */
.bjcsf-table thead th:first-child {
  left: 0;
  z-index: 6;
}
.bjcsf-table tbody th[scope="row"] {
  z-index: 5;
}

/* The dealer span cell should remain above other header cells */
.bjcsf-dealer-span {
  z-index: 5;
}

/* Ensure header background covers underlying cells */
.bjcsf-table thead th { background-clip: padding-box; }

/* Stabil headerhøjde så sticky offset passer */
.bjcsf-table thead th {
  padding-top: .6rem;
  padding-bottom: .6rem;
}

/* Dark table theme adjustments */
.bjcsf-table,
.bjcsf-table th,
.bjcsf-table td {
  border: none !important;
}

/* White text */
.bjcsf-table th,
.bjcsf-table td {
  color: #ffffff;
}

/* Background color replacements */
.bjcsf-table {
  background: #161616;
}
.bjcsf-table thead th {
  background: #111111;
}
.bjcsf-table tbody tr:nth-child(even) td,
.bjcsf-table tbody tr:nth-child(even) th {
  background: #161616;
}
.bjcsf-table tbody tr:nth-child(odd) td,
.bjcsf-table tbody tr:nth-child(odd) th {
  background: #111111;
}

/* GLOBAL DARK MODE OVERRIDES FOR BLACKJACK SKEMA */
.bjcsf-wrap,
.bjcsf-wrap * {
  color: #ffffff !important;
}

/* Remove all remaining borders */
.bjcsf-wrap table,
.bjcsf-wrap th,
.bjcsf-wrap td,
.bjcsf-wrap fieldset,
.bjcsf-wrap input,
.bjcsf-wrap select {
  border: none !important;
}

/* Fix remaining white cells */
.bjcsf-wrap th,
.bjcsf-wrap td {
  background-color: #111111;
}

/* Zebra rows refined */
.bjcsf-wrap tbody tr:nth-child(even) td,
.bjcsf-wrap tbody tr:nth-child(even) th {
  background-color: #161616;
}

/* Solver styling to match tables */
.bjcsf-solver,
.bjcsf-solver select,
.bjcsf-solver option {
  background: #111111;
  color: #ffffff;
}

.bjcsf-solver-box {
  background: #161616;
  border: none;
}

.bjcsf-solver select {
  padding: .6rem;
  border-radius: 6px;
}

/* Remove any leftover legend text defensively */
.bjcsf-wrap .bjcsf-legend,
.bjcsf-wrap .bjcsf-legend * {
  display: none !important;
}


/* v1.5.3: Dark UI fixes */
.bjcsf-player-head {
  background: #111111 !important;
}

/* Active tab should not have white background */
.bjcsf-tab.is-active {
  background: transparent !important;
  color: #ffffff !important;
}
