/* =========================
   Game Tables (Consolidated Component)
   Extracted from main.css
   ========================= */

/* =========================
   Game Tables (Consolidated Component)
   ========================= */
.vegas-wrap,
.banker-wrap {
  overflow-x: auto;
  overflow-y: auto;
  touch-action: pan-x pan-y;
  overscroll-behavior: contain;
  padding-bottom: 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  scroll-behavior: auto;
}

/* Desktop wheel should continue scrolling naturally when hovering table cells. */
@media (hover: hover) and (pointer: fine) {
  .vegas-wrap,
  .banker-wrap {
    overscroll-behavior: auto;
    overscroll-behavior-y: auto;
  }
}
.vegas-table,
.banker-table,
.skins-table,
.junk-table {
  width: max(100%, 720px);
  border-collapse: separate;
  border-spacing: 0;
}

.banker-table,
.skins-table,
.junk-table {
  width: max(100%, 820px);
}

.vegas-table th,
.vegas-table td,
.banker-table th,
.banker-table td,
.skins-table th,
.skins-table td,
.junk-table th,
.junk-table td {
  border-bottom: 2px solid var(--line);
  padding: 4px 6px;
  text-align: center;
  white-space: nowrap;
  font-size: var(--text-lg);
}

.vegas-table thead th,
.banker-table thead th,
.skins-table thead th,
.junk-table thead th {
  position: sticky;
  top: var(--game-sticky-head-top, 0px);
  background: var(--table-head-bg);
  padding-top: calc(4px * var(--game-header-height-scale, 1));
  padding-bottom: calc(4px * var(--game-header-height-scale, 1));
  z-index: var(--z-sticky-header);
  transform: translateZ(0);
}.vegas-table thead th,
  .banker-table thead th,
  .skins-table thead th,
  .junk-table thead th,
  #wolfTable thead th,
  #hiloHoleTable thead th {
  touch-action: pan-x pan-y;
}

.vegas-table thead th:first-child,
.banker-table thead th:first-child,
.skins-table thead th:first-child,
.junk-table thead th:first-child {
  z-index: var(--z-sticky-corner);
  background-color: var(--panel);
}

.vegas-table tfoot td,
.banker-table tfoot td,
.skins-table tfoot td,
.junk-table tfoot td {
  background: var(--table-head-bg);
  font-weight: 700;
  height: var(--touch-min);
  padding: 8px;
  font-size: var(--text-lg);
}

.vegas-table tfoot tr:first-child td,
.banker-table tfoot tr:first-child td,
.skins-table tfoot tr:first-child td,
.junk-table tfoot tr:first-child td {
  border-top: 2px solid var(--line);
}

.vegas-table tfoot tr:last-child td,
.banker-table tfoot tr:last-child td,
.skins-table tfoot tr:last-child td,
.junk-table tfoot tr:last-child td {
  border-bottom: none;
}

/* Restore bottom border on the last player row in skins tbody —
   the global tr:last-child rule strips it. */
#skinsBody tr:last-child td,
#skinsBody tr:last-child th {
  border-bottom: 2px solid var(--line);
}
/* Restore bottom border on the last Hi-Lo hole-by-hole row —
   the global tr:last-child rule strips it. */
#hiloHoleBody tr:last-child td,
#hiloHoleBody tr:last-child th {
  border-bottom: 2px solid var(--line);
}

/* Restore bottom border on last rows for game hole/result tables —
   the global tr:last-child rule strips it. */
#vegasBody tr:last-child td,
#vegasBody tr:last-child th,
#bankerBody tr:last-child td,
#bankerBody tr:last-child th,
#junkBody tr:last-child td,
#junkBody tr:last-child th,
#wolfBody tr:last-child td,
#wolfBody tr:last-child th {
  border-bottom: 2px solid var(--line);
}

.vegas-table tfoot td:first-child,
.banker-table tfoot td:first-child,
.skins-table tfoot td:first-child,
.junk-table tfoot td:first-child {
  text-align: left;
  padding-left: 12px;
  background: var(--table-head-bg);
}

.vegas-table th:first-child,
.vegas-table td:first-child,
.banker-table th:first-child,
.banker-table td:first-child,
.skins-table th:first-child,
.skins-table td:first-child,
.junk-table th:first-child,
.junk-table td:first-child {
  width: 40px;
  min-width: 40px;
  padding-left: 4px;
  padding-right: 4px;
  position: sticky;
  left: 0;
  background-color: var(--panel);
  z-index: var(--z-sticky-col);
  border-right: 2px solid var(--line);
  transform: translateZ(0);
}

#junkTable thead th:first-child,
#junkTable tbody td:first-child,
#wolfTable thead th:first-child,
#wolfTable tbody td:first-child {
  width: 52px;
  min-width: 52px;
}

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

/* Kept even though the dark rules above now use var(--table-head-bg): the
   sticky first-child corner rules in this file (spec 0,2,2, later than
   main.css) would otherwise out-cascade main.css's universal light
   `thead th / tfoot td` override (also 0,2,2) and paint the corner cells
   var(--panel) / var(--panel-alt) in light. Literals re-pointed at the
   dictionary tokens (exact-value swap in light). */
:root[data-theme="light"] .vegas-table thead th,
:root[data-theme="light"] .banker-table thead th,
:root[data-theme="light"] .skins-table thead th,
:root[data-theme="light"] .junk-table thead th,
:root[data-theme="light"] .vegas-table tfoot td,
:root[data-theme="light"] .banker-table tfoot td,
:root[data-theme="light"] .skins-table tfoot td,
:root[data-theme="light"] .junk-table tfoot td {
  background: var(--table-head-bg);
  color: var(--ink-strong);
}

/* Vegas-table tbody density (moved from junk.css). */
#vegasTable tbody td,
#vegasTable tbody th {
  padding-top: var(--space-xs);
  padding-bottom: var(--space-xs);
}
