/* ============================================================
   Preflop Trainer — Dark Theme
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #1a1d21;
  --surface:     #22262c;
  --surface2:    #2a2f38;
  --border:      #363c47;
  --text:        #e2e8f0;
  --text-muted:  #8896a8;
  --accent:      #4f8ef7;

  --fold-color:    #e05252;
  --call-color:    #4f8ef7;
  --raise-color:   #52c97a;
  --allin-color:   #b06ef5;

  --correct-bg:  #1c3a28;
  --close-bg:    #2d3015;
  --wrong-bg:    #3a1c1c;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

/* ---- Layout ---- */
#app { display: flex; flex-direction: column; min-height: 100vh; }

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
header h1 { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; color: var(--text); }

nav button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
nav button:hover       { color: var(--text); background: var(--surface2); }
nav button.active      { color: var(--accent); font-weight: 600; }

main { flex: 1; padding: 20px; max-width: 1200px; margin: 0 auto; width: 100%; }

/* Replayer needs the full viewport — break out of the 1200px max-width box */
main:has(#replayer-view.active) {
  max-width: 100%;
  padding: 0;
  margin: 0;
  width: 100%;
}

/* ---- Views ---- */
.view { display: none; }
.view.active { display: block; }

/* ---- Setup Panel ---- */
#setup-panel h2 { font-size: 18px; margin-bottom: 20px; }

.filter-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.filter-section h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.category-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.category-toggle.selected {
  border-color: var(--accent);
  background: #1a2640;
}
.category-toggle input { display: none; }
.category-toggle .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
}
.category-toggle.selected .dot { background: var(--accent); }

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider-row label { min-width: 140px; color: var(--text-muted); font-size: 13px; }
.slider-row input[type=range] {
  flex: 1;
  accent-color: var(--accent);
}
.slider-row .val {
  min-width: 36px;
  text-align: right;
  color: var(--text);
  font-weight: 600;
}

.count-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.count-row label { color: var(--text-muted); font-size: 13px; }
.count-row button {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.count-row button.selected {
  border-color: var(--accent);
  color: var(--accent);
  background: #1a2640;
}

#start-btn {
  margin-top: 8px;
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
#start-btn:hover { opacity: 0.88; }
#start-btn:disabled { opacity: 0.4; cursor: default; }

/* ---- Report button ---- */
#report-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
#report-btn:hover { color: #e05252; border-color: #e05252; }
#report-btn:disabled { opacity: 0.5; cursor: default; color: var(--raise-color); border-color: var(--raise-color); }

/* ---- Mark-as-Known button (appears post-answer, sits next to Next →) ---- */
#mark-known-btn {
  padding: 10px 24px;
  background: none;
  border: 1px solid #c8a84b;
  border-radius: 6px;
  color: #c8a84b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
#mark-known-btn:hover { color: #f0c040; border-color: #f0c040; background: rgba(240,192,64,0.07); }
#mark-known-btn:disabled { cursor: default; }
#mark-known-btn.known-confirmed {
  color: #52c97a;
  border-color: #52c97a;
  background: rgba(82,201,122,0.07);
  opacity: 0.9;
}

/* ---- Training Panel ---- */
#training-panel { display: none; }
#training-panel.active { display: flex; flex-direction: column; gap: 16px; }

#situation-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
#situation-title { font-weight: 700; font-size: 15px; }
#situation-text  { color: var(--text-muted); font-size: 13px; }
#session-counter { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
#session-accuracy { font-size: 13px; white-space: nowrap; }

/* ---- Poker Table Visualization ---- */
#table-viz-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  width: 100%;
}
#poker-table-container {
  position: relative;
  width: 100%;
  height: 420px;
}
#poker-table-felt {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 74%;
  height: 70%;
  background: #1a5c35;
  border-radius: 50%;
  border: 10px solid #7a5210;
  box-shadow: 0 0 0 3px #5a3c08, inset 0 4px 20px rgba(0,0,0,0.5);
}
#table-model-label {
  position: absolute;
  top: 36%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  letter-spacing: 3px;
  font-weight: 800;
  color: rgba(255,255,255,0.18);
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
}
#pot-total {
  position: absolute;
  top: 58%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
}
/* Chip stacks in the pot area */
.pot-chips {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  z-index: 3;
  pointer-events: none;
}
.pot-chip-imgs {
  display: flex;
  flex-direction: row;
  align-items: flex-end;  /* groups share a common baseline */
  gap: 3px;
  justify-content: center;
}
/* One group per denomination — chips stack vertically with overlap */
.chip-stack-group {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.chip-stack-group .chip-img + .chip-img {
  margin-top: -15px;  /* overlap: 24px chip − 9px peek = 15px hidden */
}
.chip-img {
  width: 24px;
  height: 24px;
  display: block;
  image-rendering: auto;
  flex-shrink: 0;
}
.pot-chip-amt {
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  line-height: 1;
}
.table-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.seat-chip {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--text-muted);
  transition: all 0.2s;
}
.seat-chip.seat-folded {
  opacity: 0.35;
}
.seat-chip.seat-call {
  background: #0f1f3d;
  border-color: var(--call-color);
  color: var(--call-color);
}
.seat-chip.seat-raise {
  background: #0f2d1a;
  border-color: var(--raise-color);
  color: var(--raise-color);
}
.seat-chip.seat-jam {
  background: #2d0f0f;
  border-color: var(--fold-color);
  color: var(--fold-color);
}
.seat-chip.seat-threebet {
  background: #1f1040;
  border-color: var(--allin-color);
  color: var(--allin-color);
}
.seat-chip.seat-limp {
  background: #2d1e00;
  border-color: #e8922a;
  color: #e8922a;
}
.seat-chip.seat-hero {
  width: 72px;
  height: 72px;
  background: #2d2000;
  border-color: #f0c040;
  color: #f0c040;
  border-width: 3px;
  font-size: 11px;
}
.seat-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
.seat-chip.seat-hero + .seat-name {
  color: #f0c040;
}
.seat-behind {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 2px;
  letter-spacing: 0.2px;
}
.dealer-btn {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #f0f0f0;
  border-radius: 50%;
  color: #111;
  font-size: 7px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  top: -4px;
  right: -4px;
  border: 1px solid #ccc;
  z-index: 3;
}

/* ---- Matrix header (label + villain/depth toggle buttons) ---- */
#matrix-header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
}
#matrix-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 1;
}
.depth-btn, #villain-range-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  background: none;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.depth-btn {
  border: 1px solid #5ccea8;
  color: #5ccea8;
}
.depth-btn:hover  { background: rgba(92,206,168,0.12); }
.depth-btn:disabled { opacity: 0.5; cursor: default; }
#villain-range-btn {
  border: 1px solid #4a9eff;
  color: #4a9eff;
}
#villain-range-btn:hover { background: rgba(74,158,255,0.12); }
#villain-range-btn:disabled { opacity: 0.5; cursor: default; }

/* ---- Hand Matrix ---- */
#matrix-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#hand-matrix {
  display: grid;
  grid-template-columns: repeat(13, 46px);
  grid-template-rows:    repeat(13, 46px);
  gap: 3px;
}
.matrix-cell {
  width: 46px; height: 46px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: default;
  position: relative;
  background: var(--surface2);
  color: transparent;
  transition: transform 0.1s;
  overflow: hidden;
}
.matrix-cell:hover { transform: scale(1.2); z-index: 10; color: #fff; }

/* ---- Range matrix hover tooltip ---- */
#matrix-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  background: #1a1e26;
  border: 1px solid #3a4150;
  border-radius: 7px;
  padding: 8px 11px;
  min-width: 130px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.55);
  pointer-events: none;
}
.tt-hand {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 6px;
  border-bottom: 1px solid #2d3340;
  padding-bottom: 4px;
}
.tt-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #c5cdd8;
  margin-top: 3px;
}
.tt-swatch {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.tt-name { flex: 1; }
.tt-pct  { font-weight: 600; color: #e2e8f0; }
.matrix-cell.out-of-range {
  opacity: 0.22;
  cursor: not-allowed;
  pointer-events: none;
}
.matrix-cell.flagged {
  box-shadow: inset 0 0 0 3px #fff;
  color: #fff;
}
.matrix-cell.flagged::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 15%,
    rgba(255,255,255,0.55) 40%,
    rgba(255,255,255,0.25) 55%,
    transparent 72%
  );
  pointer-events: none;
}
/* Priority-flagged: orange border + bright orange streak — highest drill priority */
.matrix-cell.priority-flagged {
  box-shadow: inset 0 0 0 3px #f0a030;
  color: #fff;
}
.matrix-cell.priority-flagged::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 15%,
    rgba(240,140,20,0.85) 40%,
    rgba(240,140,20,0.40) 55%,
    transparent 72%
  );
  pointer-events: none;
}

#flag-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  gap: 6px;
  width: 100%;
}
#flag-hint {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
  width: 100%;
  margin-top: 2px;
}
.flag-sel-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  background: none;
  border: 1px solid #f0a030;
  border-radius: 5px;
  color: #f0a030;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.flag-sel-btn:hover { background: rgba(240,160,48,0.12); }
/* Keep the old id-based rule pointing at the same style */
#flag-all-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  background: none;
  border: 1px solid #f0a030;
  border-radius: 5px;
  color: #f0a030;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
#flag-all-btn:hover { background: rgba(240,160,48,0.12); }
.matrix-cell.highlight {
  outline: 2px solid #fff;
  outline-offset: -1px;
  z-index: 5;
  color: #fff;
}

#matrix-legend {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background .12s, border-color .12s, color .12s;
  user-select: none;
}
.legend-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border);
  color: var(--text);
}
.legend-swatch {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ---- Bottom Panel ---- */
#bottom-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#hand-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

#seed-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  min-width: 64px;
}
#seed-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
#seed-display {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: #f0c040;
}
#hand-name {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
}
#model-tag {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text-muted);
}

.hand-meta {
  margin-left: auto;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hand-meta-item { font-size: 12px; color: var(--text-muted); }
.hand-meta-item span { color: var(--text); font-weight: 600; }

#action-buttons {
  display: flex;
  gap: 12px;
}
.action-btn {
  flex: 1;
  padding: 18px 10px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.action-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.action-btn:active { transform: translateY(0); }
.action-btn:disabled { opacity: 0.35; cursor: default; transform: none; }

.action-btn.fold  { background: var(--fold-color);  color: #fff; }
.action-btn.call  { background: var(--call-color);  color: #fff; }
.action-btn.raise { background: var(--raise-color); color: #111; }
.action-btn.allin { background: var(--allin-color); color: #fff; }

/* ---- Feedback ---- */
#feedback-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  display: none;
  flex-direction: column;
  gap: 12px;
}
#feedback-area.visible { display: flex; }

#verdict-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#verdict-badge {
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#verdict-badge.correct { background: #1f4d32; color: #52c97a; }
#verdict-badge.close   { background: #3d3c10; color: #c9c552; }
#verdict-badge.wrong   { background: #4d1f1f; color: #e05252; }
#verdict-text { color: var(--text-muted); font-size: 13px; }
.seed-dist {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}
.seed-dist.aggressive { background: #4d1f1f; color: #e05252; }
.seed-dist.passive    { background: #1a2a4d; color: #4f8ef7; }
.seed-dist.exact      { background: #1f4d32; color: #52c97a; }

#solver-breakdown { font-size: 13px; }
#solver-breakdown .action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
#solver-breakdown .action-label { min-width: 90px; font-weight: 600; }
.pct-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--surface2);
  border-radius: 4px;
  overflow: hidden;
}
.pct-bar { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.pct-text { min-width: 44px; text-align: right; color: var(--text-muted); font-size: 12px; }

.chosen-marker { font-size: 11px; color: var(--accent); margin-left: 4px; }

#hint-text {
  font-size: 12px;
  color: var(--text-muted);
  border-left: 3px solid var(--border);
  padding-left: 10px;
  line-height: 1.5;
}

/* ---- Self-grade row ---- */
#grade-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.grade-prompt {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.grade-inner {
  display: flex;
  gap: 8px;
}
.grade-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  transition: background 0.12s;
}
.grade-btn kbd {
  font-size: 10px;
  opacity: 0.50;
  font-family: inherit;
  font-weight: 400;
}
.grade-btn:disabled { opacity: 0.4; cursor: default; }
.grade-hard    { color: #d4813a; border-color: #d4813a; background: rgba(212,129,58,0.08); }
.grade-hard:not(:disabled):hover    { background: rgba(212,129,58,0.20); }
.grade-misclick { color: #8896a8; border-color: #8896a8; background: rgba(136,150,168,0.08); }
.grade-misclick:not(:disabled):hover { background: rgba(136,150,168,0.20); }
.grade-got-it  { color: #4f8ef7; border-color: #4f8ef7; background: rgba(79,142,247,0.08); }
.grade-got-it:not(:disabled):hover  { background: rgba(79,142,247,0.20); }
.grade-easy    { color: #52c97a; border-color: #52c97a; background: rgba(82,201,122,0.08); }
.grade-easy:not(:disabled):hover    { background: rgba(82,201,122,0.20); }

#next-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

#next-btn {
  padding: 10px 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#next-btn:hover { background: var(--border); }

/* ---- Progress bar ---- */
#progress-wrap {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ---- Claude Q&A ---- */
#claude-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#claude-area h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
}
#conversation {
  min-height: 40px;
  max-height: 200px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}
.msg { margin-bottom: 8px; }
.msg.user   { color: var(--text); }
.msg.claude { color: var(--text-muted); }
.msg.stub   { font-style: italic; }

#claude-input-row {
  display: flex;
  gap: 8px;
}
#question-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
#question-input:focus { border-color: var(--accent); }
#question-input::placeholder { color: var(--text-muted); }
#ask-btn {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
#ask-btn:hover { opacity: 0.85; }

/* ---- SRS Reset button (Stats view) ---- */
.stats-reset-row {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.reset-srs-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.reset-srs-btn:hover {
  border-color: #e05252;
  color: #e05252;
}

/* ---- SRS Toggle ---- */
.srs-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.srs-toggle-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}
.srs-toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ---- Stats View ---- */
#stats-view h2 { font-size: 18px; margin-bottom: 20px; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat-card .val {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-card .lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.stats-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.stats-table-wrap h3 { font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 6px 10px; color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 7px 10px; border-bottom: 1px solid var(--surface2); }
tr:last-child td { border-bottom: none; }

.score-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}
.score-pill.good { background: #1f4d32; color: #52c97a; }
.score-pill.ok   { background: #3d3c10; color: #c9c552; }
.score-pill.bad  { background: #4d1f1f; color: #e05252; }

/* ---- Done overlay ---- */
#done-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 16px;
}
#done-panel.visible { display: flex; }
#done-panel h2 { font-size: 28px; }
#done-panel p  { color: var(--text-muted); font-size: 15px; }
#done-panel button {
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}
#done-panel button:hover { opacity: 0.88; }

/* ---- Utility ---- */
.hidden { display: none !important; }

/* ---- Tooltips ---- */
/* Usage: add class="tooltip" and data-tooltip="..." to any element.
   Tooltip appears above by default; add .tip-below to flip it downward. */
.tooltip { position: relative; }
.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a2130;
  color: #c8d0dc;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  padding: 7px 11px;
  border-radius: 6px;
  border: 1px solid #2e3a4a;
  width: 200px;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 200;
}
.tooltip:hover::after { opacity: 1; }

/* Flip downward for buttons near the top of the screen */
.tooltip.tip-below::after {
  bottom: auto;
  top: calc(100% + 8px);
}


/* ---- Report modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-box {
  background: #1e2430;
  border: 1px solid #3a4560;
  border-radius: 10px;
  padding: 24px 28px;
  width: 440px;
  max-width: 92vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55);
}
.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e0e8f0;
  margin: 0 0 6px;
}
.modal-subtitle {
  font-size: 0.85rem;
  color: #8a9ab8;
  margin: 0 0 14px;
}
.modal-textarea {
  width: 100%;
  background: #141922;
  border: 1px solid #3a4560;
  border-radius: 6px;
  color: #c8d8e8;
  font-size: 0.85rem;
  padding: 10px 12px;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
  line-height: 1.5;
}
.modal-textarea:focus {
  outline: none;
  border-color: #5a7ab8;
}
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.modal-btn {
  padding: 7px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s;
}
.modal-btn-cancel {
  background: #2a3448;
  color: #8a9ab8;
}
.modal-btn-cancel:hover { background: #35425a; }
.modal-btn-submit {
  background: #3a6fc8;
  color: #fff;
}
.modal-btn-submit:hover { background: #4a80d8; }
.modal-btn-submit:disabled { background: #2a4a88; color: #7090c0; cursor: default; }

/* ---- Hotkey config table ---- */
.hotkey-table { border-collapse: collapse; width: 100%; max-width: 360px; }
.hotkey-table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted);
  padding: 0 0 8px; text-align: left;
}
.hotkey-table th:last-child { text-align: center; width: 120px; }
.hotkey-table td {
  font-size: 13px; color: var(--text);
  padding: 5px 0; border-top: 1px solid var(--border);
}
.hotkey-table td:last-child { text-align: center; }
.hk-btn {
  display: inline-block; min-width: 72px;
  padding: 5px 12px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 700;
  font-family: monospace; cursor: pointer; letter-spacing: .5px;
  transition: background .12s, border-color .12s;
}
.hk-btn:hover { background: #2e3a50; border-color: #5a7ab8; }
.hk-btn.hk-listening {
  background: #1a2e50; border-color: #4f8ef7;
  color: #4f8ef7; font-weight: 600; font-family: inherit;
  font-size: 11px; animation: hk-pulse 0.8s ease-in-out infinite;
}
@keyframes hk-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}
#reset-hotkeys-btn {
  background: var(--surface2); color: var(--text-muted);
  border: 1px solid var(--border);
}
#reset-hotkeys-btn:hover { background: #2a3448; color: var(--text); }

/* ---- Due session order toggle ---- */
.due-order-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.due-order-btn:hover { background: #2e3a50; color: var(--text); }


/* ============================================================
   Hand History Replayer
   ============================================================ */

#replayer-view {
  padding: 0;
  max-width: none;
  height: calc(100vh - 56px);
  overflow: hidden;
}

#replayer-root {
  height: 100%;
}

/* Layout */
.replayer-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* Left panel: hand list */
.replayer-hand-list {
  width: 280px;
  min-width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.rpl-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 6px;
}

.rpl-list-header-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.rpl-icon-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: background .12s, color .12s;
  flex-shrink: 0;
  padding: 0;
}
.rpl-icon-btn:hover { background: #2e3a50; color: var(--text); }

.rpl-list-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}

.rpl-custom-btn {
  font-size: 11px;
  padding: 4px 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.rpl-custom-btn:hover { background: #2e3a50; color: var(--text); }

.rpl-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.rpl-list-divider {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--accent);
  padding: 8px 12px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.rpl-hand-row {
  display: grid;
  grid-template-columns: 30px 38px 1fr auto;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: background .1s;
  font-size: 12px;
}
.rpl-hand-row:hover { background: var(--surface2); }
.rpl-hand-row.active {
  background: #1e2d4a;
  border-left: 3px solid var(--accent);
  padding-left: 7px;
}

.rpl-hand-num {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rpl-hand-time {
  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.rpl-hand-players {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}
.rpl-hand-icons {
  display: flex;
  gap: 2px;
  font-size: 11px;
  flex-shrink: 0;
}

/* Collapsed left panel — shows only hand numbers */
.replayer-hand-list.rpl-collapsed {
  width: 50px;
  min-width: 50px;
}
.replayer-hand-list.rpl-collapsed .rpl-list-title,
.replayer-hand-list.rpl-collapsed #rpl-4color-toggle-btn,
.replayer-hand-list.rpl-collapsed #rpl-load-custom-btn,
.replayer-hand-list.rpl-collapsed #rpl-time-toggle-btn {
  display: none;
}
/* Collapsed header: only the expand button is visible. Without
   hiding the 4-color toggle too the two buttons (2C + ◀) overflow
   the 50px collapsed width, pushing the collapse button off-screen
   and leaving no way to uncollapse the panel. */
.replayer-hand-list.rpl-collapsed .rpl-list-header {
  padding: 8px 6px;
  justify-content: center;
}
.replayer-hand-list.rpl-collapsed .rpl-hand-time,
.replayer-hand-list.rpl-collapsed .rpl-hand-players,
.replayer-hand-list.rpl-collapsed .rpl-hand-icons,
.replayer-hand-list.rpl-collapsed .rpl-list-divider {
  display: none;
}
.replayer-hand-list.rpl-collapsed .rpl-hand-row {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 5px 2px;
}
.replayer-hand-list.rpl-collapsed .rpl-hand-num {
  font-size: 9px;
}
.replayer-hand-list.rpl-collapsed .rpl-list-header-btns {
  gap: 2px;
}

/* Hide timestamps by default */
.rpl-list-scroll.rpl-hide-times .rpl-hand-time { display: none; }
.rpl-list-scroll.rpl-hide-times .rpl-hand-row {
  grid-template-columns: 30px 1fr auto;
}

/* Right panel: main */
.replayer-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;   /* right panel never scrolls — table stays fixed */
  padding: 10px 14px 0;
  gap: 8px;
  position: relative; /* anchor for report modal */
}

/* Tournament bar */
.rpl-tourn-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  flex-shrink: 0;
}
.rpl-report-btn {
  margin-left: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  background: #7f1d1d;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  letter-spacing: 0.3px;
  opacity: 0.85;
  transition: opacity .15s;
}
.rpl-report-btn:hover { opacity: 1; }

/* Report modal */
.rpl-report-modal {
  position: absolute;
  top: 36px; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0 12px;
}
.rpl-report-modal-inner {
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 14px 16px;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.rpl-report-modal-inner strong { color: #f1f5f9; font-size: 13px; }
.rpl-report-modal-hand { color: #94a3b8; font-size: 11px; }
.rpl-report-textarea {
  width: 100%;
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid #334155;
  border-radius: 5px;
  padding: 8px;
  font-size: 12px;
  resize: vertical;
  box-sizing: border-box;
}
.rpl-report-textarea::placeholder { color: #64748b; }
.rpl-report-modal-btns { display: flex; gap: 8px; }
.rpl-report-submit-btn {
  padding: 5px 14px; font-size: 12px; font-weight: 600;
  background: #dc2626; color: #fff; border: none; border-radius: 5px; cursor: pointer;
}
.rpl-report-submit-btn:hover { background: #ef4444; }
.rpl-report-submit-btn:disabled { opacity: 0.5; cursor: default; }
.rpl-report-cancel-btn {
  padding: 5px 14px; font-size: 12px; font-weight: 600;
  background: #334155; color: #cbd5e1; border: none; border-radius: 5px; cursor: pointer;
}
.rpl-report-cancel-btn:hover { background: #475569; }
.rpl-tourn-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.rpl-tourn-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Info row */
.rpl-info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  flex-shrink: 0;
}
.rpl-info-item { color: var(--text); }
.rpl-info-label { color: var(--text-muted); margin-right: 3px; font-weight: 600; }
.rpl-info-sep { color: var(--border); }

/* Payout ladder */
.rpl-payout-ladder {
  overflow-x: auto;
  flex-shrink: 0;
}
.rpl-payout-row {
  display: flex;
  gap: 4px;
  min-width: max-content;
}
.rpl-payout-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 64px;
  transition: border-color .15s;
}
.rpl-payout-spot.rpl-payout-bubble {
  border-color: var(--gold);
  background: #2a2000;
}
.rpl-payout-spot.rpl-payout-paid {
  opacity: 0.45;
}
.rpl-payout-place {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.rpl-payout-amount {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 2px;
}
.rpl-payout-player {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 1px;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rpl-payout-spot.rpl-payout-bubble .rpl-payout-place,
.rpl-payout-spot.rpl-payout-bubble .rpl-payout-player { color: var(--gold); }

/* Stack panel */
.rpl-stacks-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.rpl-stack-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.rpl-stack-table thead tr {
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.rpl-stack-table th {
  padding: 6px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.rpl-stack-table td {
  padding: 5px 10px;
  border-bottom: 1px solid #1e2229;
  vertical-align: middle;
}
.rpl-stack-row:last-child td { border-bottom: none; }
.rpl-stack-name { color: var(--text); font-weight: 600; }
.rpl-stack-chips { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpl-stack-bbs   { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.rpl-stack-bar-th { width: 180px; }
.rpl-stack-bar-cell { min-width: 120px; }
.rpl-stack-row.rpl-stack-inhand .rpl-stack-name { color: var(--accent); }

.rpl-chip-bar-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.rpl-chip-bar {
  height: 8px;
  background: var(--accent);
  border-radius: 4px;
  min-width: 2px;
  transition: width .3s;
}
.rpl-chip-pct {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 36px;
}

/* Hand info box */
.rpl-hand-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  flex-shrink: 0;
}
.rpl-hand-info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rpl-hand-num-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.rpl-hand-time-badge {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.rpl-hu-badge {
  font-size: 10px;
  font-weight: 700;
  background: #2a1a5a;
  color: #a080f0;
  border: 1px solid #5040a0;
  border-radius: 4px;
  padding: 1px 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.rpl-hand-seats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.rpl-seat {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
}
.rpl-seat-pos {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  background: #2a3040;
  border-radius: 3px;
  padding: 1px 5px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.rpl-seat-name { font-size: 12px; font-weight: 600; color: var(--text); }
.rpl-seat-stack { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.rpl-card-img {
  display: inline-block;
  height: 38px;
  width: auto;
  border-radius: 3px;
  margin: 0 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,.5);
  vertical-align: middle;
}

/* Hole cards — text-based (fits seat token bubbles) */
.rpl-card {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: #fff;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 15px;
  font-weight: 700;
  margin: 0 1px;
  line-height: 1.2;
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.rpl-card-rank { font-size: 15px; }
.rpl-card-suit { font-size: 13px; }

/* "?" placeholder for unknown / unrecorded hole cards. VPIP'ers whose
   cards weren't fully captured by the broadcast render a card-shaped
   slot with a "?" so the viewer sees that the cards exist but weren't
   logged — distinct from an empty seat (folded player). Greyed out
   so it visually reads as "missing data" rather than an actual card. */
.rpl-card.rpl-card-unknown {
  background: #cbd2da;
  color: #6b7180;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.rpl-card.rpl-card-unknown .rpl-card-rank { color: #6b7180; }
/* 4-color deck */
.rpl-suit-heart   { color: #d93030; }
.rpl-suit-diamond { color: #1565c0; }
.rpl-suit-club    { color: #2a7d32; }
.rpl-suit-spade   { color: #1a1d21; }

.rpl-seat-cards { display: inline-flex; gap: 1px; }

/* Board display */
.rpl-board-display {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 52px;
  flex-shrink: 0;
}
.rpl-board-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.rpl-board-street {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rpl-board-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  min-width: 32px;
}
.rpl-board-cards { display: inline-flex; gap: 2px; }
.rpl-board-placeholder {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* Action log */
.rpl-action-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  max-height: 150px;
  overflow-y: auto;
  flex-shrink: 0;
}
.rpl-action-log-inner { display: flex; flex-direction: column; gap: 2px; }

.rpl-log-street-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}
.rpl-log-street-header:first-child { margin-top: 0; }

.rpl-log-action {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 3px;
}
.rpl-log-player {
  font-weight: 700;
  color: var(--text);
  min-width: 80px;
}
.rpl-log-verb { color: var(--text-muted); }
.rpl-log-amount { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

.rpl-act-fold  .rpl-log-verb { color: #e05252; }
.rpl-act-call  .rpl-log-verb { color: #4f8ef7; }
.rpl-act-raise .rpl-log-verb { color: #3fc47a; }
.rpl-act-allin .rpl-log-verb { color: #b06ef5; font-weight: 700; }
.rpl-act-check .rpl-log-verb { color: var(--text-muted); }

/* Notable fold — hole cards shown inline */
.rpl-act-notable-fold { align-items: center; }
.rpl-notable-fold-cards {
  display: inline-flex;
  gap: 2px;
  margin-left: 6px;
}
.rpl-notable-fold-cards .rpl-card {
  font-size: 0.72em;
  padding: 1px 3px;
  opacity: 0.85;
}

/* Result banner */
.rpl-result-banner {
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.rpl-result-inner { display: flex; flex-direction: column; gap: 4px; }
.rpl-result-elim {
  font-size: 14px;
  font-weight: 700;
  color: #e05252;
}
.rpl-result-dbl {
  font-size: 14px;
  font-weight: 700;
  color: #3fc47a;
}
.rpl-result-fold,
.rpl-result-neutral {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.rpl-result-summary {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
  line-height: 1.5;
}

/* Step controls */
.rpl-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 16px;
  flex-shrink: 0;
}
.rpl-btn {
  padding: 7px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  font-family: inherit;
}
.rpl-btn:hover:not(:disabled) { background: #2e3a50; border-color: var(--accent); }
.rpl-btn:disabled { opacity: 0.35; cursor: default; }
.rpl-btn-hand {
  background: #1e2a3a;
  border-color: #3a4a5a;
}
.rpl-btn-hand:hover:not(:disabled) { background: #24364e; }
.rpl-step-counter {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 70px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Custom log modal */
.rpl-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.rpl-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.rpl-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.rpl-modal-help {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
}
.rpl-modal-help code {
  background: #1a1d21;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: monospace;
  font-size: 11px;
  color: var(--accent);
}
.rpl-modal-textarea {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-family: monospace;
  padding: 8px 10px;
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 10px;
}
.rpl-modal-textarea:focus { outline: none; border-color: var(--accent); }
.rpl-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.rpl-modal-btn {
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  font-family: inherit;
}
.rpl-modal-cancel { background: var(--surface2); color: var(--text-muted); }
.rpl-modal-cancel:hover { color: var(--text); }
.rpl-modal-submit { background: var(--accent); color: #fff; border-color: var(--accent); }
.rpl-modal-submit:hover { background: #3a7ae0; }
.rpl-modal-error {
  margin-top: 8px;
  padding: 6px 10px;
  background: #3a1515;
  border: 1px solid #8b3030;
  border-radius: 5px;
  color: #e08080;
  font-size: 12px;
}
.due-order-btn.shallow-first { color: #4f8ef7; border-color: #4f8ef7; }

/* ── Parse warnings banner (missing hand detection) ── */
.rpl-parse-warnings {
  background: #2e2200;
  border-bottom: 1px solid #7a5c00;
  padding: 6px 8px;
  font-size: 11px;
  color: #f0c040;
}
.rpl-warn-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 4px;
}
.rpl-warn-dismiss {
  background: none;
  border: none;
  color: #f0c040;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  opacity: 0.7;
}
.rpl-warn-dismiss:hover { opacity: 1; }
.rpl-warn-item {
  padding: 2px 0;
  color: #d4a820;
  line-height: 1.4;
}

/* ============================================================
   Replayer — Poker Table Visualization
   ============================================================ */

.rpl-table-wrap {
  padding: 0 16px;
  margin-bottom: 8px;
}

#rpl-table-container {
  position: relative;
  width: 100%;
  height: 520px;
}

#rpl-table-felt {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 72%; height: 78%;
  background: #1a5c35;
  border-radius: 50%;
  border: 10px solid #7a5210;
  box-shadow: 0 0 0 3px #5a3c08, inset 0 4px 20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Board cards on the felt */
#rpl-board-on-table {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  min-height: 24px;
}
#rpl-board-on-table .rpl-card-img {
  height: 62px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.7);
}
.rpl-board-gap { display: inline-block; width: 5px; }

#rpl-pot-display {
  display: flex;
  flex-direction: row;          /* multi-pot stacks line up horizontally */
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
}

/* Each pot stack (main / side 1 / side 2 / ...). Wraps a label,
   chip stack, and amount label vertically. Multi-pot layout puts
   them side-by-side in the center of the table. */
.rpl-pot-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rpl-pot-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.rpl-pot-chips {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  justify-content: center;
}

.rpl-pot-amt {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Seat positioning */
.rpl-table-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, -50%);
  z-index: 7;
}

/* Seat token (the circle) */
.rpl-seat-token {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--text-muted);
  transition: all 0.2s;
  overflow: hidden;
  gap: 2px;
}

.rpl-seat-token.rpl-seat-empty,
.rpl-seat-token.rpl-seat-inactive {
  opacity: 0.25;
}

.rpl-seat-token.rpl-seat-eliminated {
  opacity: 0.12;
  background: var(--surface);
}

.rpl-seat-token.rpl-seat-in-hand {
  border-color: var(--accent);
  background: #0f1f3d;
  color: var(--accent);
}

.rpl-seat-token.rpl-seat-folded {
  opacity: 0.35;
  background: var(--surface);
}

.rpl-seat-token.rpl-seat-called {
  border-color: var(--call-color);
  background: #0f1f3d;
  color: var(--call-color);
}

.rpl-seat-token.rpl-seat-raised {
  border-color: var(--raise-color);
  background: #0f2d1a;
  color: var(--raise-color);
}

.rpl-seat-token.rpl-seat-allin {
  border-color: var(--fold-color);
  background: #2d0f0f;
  color: var(--fold-color);
  border-width: 3px;
}

.rpl-seat-token.rpl-seat-limped {
  border-color: #e8922a;
  background: #2d1e00;
  color: #e8922a;
}

.rpl-seat-token.rpl-seat-checked {
  border-color: var(--text-muted);
  background: var(--surface2);
  color: var(--text-muted);
}

.rpl-seat-pos-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.rpl-seat-act-lbl {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.3px;
}

.rpl-seat-cards-inner {
  display: flex;
  gap: 1px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* Text hole cards — slightly larger in seat token context */
.rpl-seat-cards-inner .rpl-card {
  font-size: 16px;
  padding: 2px 5px;
}
.rpl-seat-cards-inner .rpl-card-suit {
  font-size: 14px;
}

.rpl-seat-name-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.rpl-seat-stack-lbl {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Dealer button — sits below chips so bet stacks are always readable */
.rpl-dealer-btn {
  position: absolute;
  width: 24px;
  height: 24px;
  background: #f8f8f8;
  border: 2px solid #bbb;
  border-radius: 50%;
  color: #111;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 5px rgba(0,0,0,0.6);
}

/* Pending bet chips on table — above dealer button, below seat labels */
.rpl-bet-chip {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, -50%);
  z-index: 6;
  pointer-events: none;
}
.rpl-bet-chips-img {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
}
.rpl-bet-amt {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 3px rgba(0,0,0,0.95);
  white-space: nowrap;
  letter-spacing: 0.3px;
}
.rpl-win-amt {
  color: var(--gold, #f7c948);
  font-size: 12px;
}
.rpl-pot-win { z-index: 4; }

/* Chip-count leaderboard between the action log and the paytable.
   Shows hand-start stacks ranked highest first, with folders dimmed
   as they drop out of the pot. BB's row excludes BBA via a "*" mark. */
.rpl-stack-leaderboard {
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  flex-shrink: 0;
}
.rpl-stack-board-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.rpl-stack-board-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 1px 0;
  font-size: 12px;
  transition: opacity 0.15s ease;
}
.rpl-stack-rank {
  color: var(--text-muted);
  text-align: right;
  font-size: 10px;
}
.rpl-stack-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rpl-stack-chips {
  font-family: 'Consolas', 'Monaco', monospace;
  color: var(--text);
  font-size: 11px;
}
.rpl-stack-board-row.rpl-stack-folded {
  opacity: 0.35;
}
/* VPIP'er still in the pot — green name. Lets the viewer scan the
   leaderboard and instantly see who's contesting. */
.rpl-stack-board-row.rpl-stack-vpip .rpl-stack-name {
  color: #5fb87a;
  font-weight: 600;
}
/* VPIP'd then folded — red name (kept at full opacity so the color
   reads, unlike passive folders which dim). */
.rpl-stack-board-row.rpl-stack-vpip-fold .rpl-stack-name {
  color: #d97070;
  font-weight: 600;
}

/* Mid-tournament deal notice — shown above the paytable when a
   deal has been applied at or before the current hand. */
.rpl-paytable-deal-notice {
  font-size: 11px;
  color: #d8a000;
  font-weight: 600;
  padding: 4px 8px;
  background: rgba(217, 176, 0, 0.08);
  border-bottom: 1px solid rgba(217, 176, 0, 0.3);
}
.rpl-stack-bb-mark {
  color: var(--accent);
  font-size: 10px;
  margin-left: 2px;
  cursor: help;
  font-weight: 700;
}

/* Paytable section at bottom of main panel */
.rpl-paytable-section {
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  margin-top: 4px;
}
.rpl-paytable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--surface);
}
.rpl-paytable-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}
.rpl-paytable-body {
  padding: 8px 14px 12px;
  background: var(--surface);
}

/* Paytable table (mirrors nn-payout-table from index.html) */
.rpl-paytable-table {
  border-collapse: collapse;
  font-size: 11px;
  white-space: nowrap;
}
.rpl-paytable-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 3px 10px 3px 0;
  font-size: 10px;
}
.rpl-paytable-table td {
  padding: 3px 10px 3px 0;
  color: var(--text-muted);
}
.rpl-paytable-table td:first-child { color: var(--text); font-weight: 600; min-width: 28px; }
.rpl-paytable-table td.payout-amt { color: var(--gold, #f7c948); font-weight: 600; }
.rpl-paytable-table tr.rpl-pay-paid td { opacity: 0.4; }
.rpl-paytable-table tr.rpl-pay-next td { color: var(--gold, #f7c948); }
.rpl-paytable-table tr.rpl-pay-next td:first-child { color: var(--gold, #f7c948); }

/* ============================================================
   Replayer Hub
   ============================================================ */

/* Tournament cards */
#hub-tournament-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hub-tourn-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color .15s;
}
.hub-tourn-card:hover { border-color: var(--accent); }
.hub-tourn-info { display: flex; flex-direction: column; gap: 3px; }
.hub-tourn-name { font-weight: 600; font-size: 14px; color: var(--text); }
.hub-tourn-meta { font-size: 11px; color: var(--text-muted); }
.hub-tourn-arrow { font-size: 18px; color: var(--text-muted); margin-left: 12px; transition: color .15s; }
.hub-tourn-card:hover .hub-tourn-arrow { color: var(--accent); }

/* Import form */
.hub-form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.hub-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 160px;
}
.hub-form-field--short { flex: 0 0 auto; min-width: 140px; max-width: 210px; }
.hub-form-field--full  { flex: 1 1 100%; }

.hub-form-field label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.hub-form-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
  font-size: 10px;
}
.hub-checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 8px 0;
}
.hub-checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent, #4f8ef7);
  cursor: pointer;
}
.hub-info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
  cursor: default;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
}
.hub-info-tip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 100;
}
.hub-info-tip:hover::after { opacity: 1; }
.hub-form-field input[type="text"],
.hub-form-field input[type="date"],
.hub-form-field input[type="number"],
.hub-form-field textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 7px 10px;
  resize: vertical;
  font-family: inherit;
}
.hub-form-field input:focus,
.hub-form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.hub-form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 6px;
}
.hub-import-error { color: #e05252; font-size: 12px; }

/* Field-level validation errors */
.hub-form-field input.hub-field-error,
.hub-form-field select.hub-field-error,
.hub-form-field textarea.hub-field-error {
  border-color: #e05252 !important;
  background: rgba(224, 82, 82, 0.07) !important;
}
.hub-seat-row input.hub-field-error {
  background: rgba(224, 82, 82, 0.1) !important;
  color: #e05252;
}
/* shake animation for submit-bounce feedback */
@keyframes hub-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-5px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}
.hub-shake { animation: hub-shake .35s ease; }

/* Select elements — match input styling */
.hub-form-field select {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 7px 10px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.hub-form-field select:focus { outline: none; border-color: var(--accent); }
.hub-form-field select:disabled { opacity: 0.45; cursor: default; }

/* Currency toggle */
.hub-currency-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.hub-currency-btn {
  flex: 1;
  padding: 7px 12px;
  background: var(--surface2);
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s;
  border-right: 1px solid var(--border);
}
.hub-currency-btn:last-child { border-right: none; }
.hub-currency-btn.active { background: var(--surface); color: var(--text); }
.hub-currency-btn:hover:not(.active) { color: var(--text); }

/* Seat grid */
.hub-seats-grid {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.hub-seats-header,
.hub-seat-row {
  display: grid;
  grid-template-columns: 68px 1fr 1fr 110px;
  gap: 0;
}
.hub-seats-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 12px;
}
.hub-seat-col-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  padding: 0 8px;
}
.hub-seat-row {
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.hub-seat-row:last-child { border-bottom: none; }
.hub-seat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 12px;
}
.hub-seat-row input {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.hub-seat-row input:focus { outline: none; background: rgba(255,255,255,.03); }

/* Broadcast chip preview */
.hub-chip-preview {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
  padding: 0 12px;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  min-height: 36px;
  transition: color .12s;
}
.hub-chip-preview.valid   { color: #5db87a; }
.hub-chip-preview.invalid { color: #e05252; }

/* Payout broadcast preview */
#hub-payout-preview {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.hub-payout-chip {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 9px;
  color: var(--text-muted);
}
.hub-payout-chip.valid   { color: #5db87a; border-color: #5db87a33; }
.hub-payout-chip.invalid { color: #e05252; border-color: #e0525233; }
/* Neutral chip (explicit zero = no payout) — dimmed but not an error */
.hub-payout-chip:not(.valid):not(.invalid) { opacity: 0.4; }

/* ============================================================
   Hand Logger (testing) — logger.css
   ============================================================ */

/* ---- Layout ---- */
.lg-main {
  display: flex;
  flex-direction: row;
  /* No fixed height or overflow:hidden — let the browser window scroll naturally */
}

.lg-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  /* Stick to viewport as the page scrolls; internal scroll for the hand list */
  position: sticky;
  top: 53px;           /* nav height */
  height: calc(100vh - 53px);
  overflow: hidden;
}

.lg-content {
  flex: 1;
  min-width: 0;
  padding: 20px 24px;
  /* No overflow-y — the browser window handles the only scroll bar */
}

/* ---- Sidebar ---- */
.lg-sidebar-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lg-tourn-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lg-hand-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.lg-hand-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.lg-hand-item:hover { background: var(--surface2); }

.lg-sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ---- Setup ---- */
.lg-setup {
  padding: 24px 28px;
  max-width: 900px;
}

.lg-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.lg-setup-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- Shared inputs ---- */
.lg-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 8px;
  outline: none;
  transition: border-color .15s;
}
.lg-input:focus { border-color: var(--accent); }
.lg-input option { background: var(--surface2); }

/* ---- Buttons ---- */
.lg-btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.lg-btn-primary:hover { opacity: .85; }

.lg-btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.lg-btn-secondary:hover { background: var(--surface); border-color: var(--accent); }

.lg-btn-sm {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}
.lg-btn-sm:hover { border-color: #e55; color: #e55; }

.lg-btn-all-fold {
  width: 100%;
  padding: 12px 0;
  margin-bottom: 10px;
  background: #1a3d22;
  color: #5db87a;
  border: 1px solid #3a6a48;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .3px;
  transition: background .15s;
}
.lg-btn-all-fold:hover { background: #1f4a29; }

/* ---- Hand form ---- */
.lg-hand-form {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lg-hand-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.lg-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--surface);
}

.lg-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ---- Stacks bar ---- */
.lg-stacks-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.lg-stack-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
}

.lg-pos-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  color: var(--accent);
  letter-spacing: .3px;
}

.lg-pos-sm {
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .2px;
  min-width: 36px;
}

/* ---- Action log ---- */
.lg-action-log {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.lg-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: var(--surface2);
  border-radius: 4px;
  font-size: 12px;
}

.lg-act-pos  { min-width: 40px; }
.lg-act-player { flex: 1; color: var(--text); }
.lg-act-move { font-weight: 600; min-width: 56px; }
.lg-act-del  { margin-left: auto; flex-shrink: 0; }

/* ---- Add-action row ---- */
.lg-add-action {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

/* ---- Hole cards ---- */
.lg-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lg-cards-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lg-card-slot {
  width: 38px;
  height: 30px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.lg-card-slot:hover { border-color: var(--accent); }
/* Flop combined button — wider to hold 3 cards side by side */
.lg-card-slot--flop { width: auto; min-width: 90px; gap: 5px; padding: 0 8px; letter-spacing: 1px; }

.lg-card-empty { color: var(--text-muted); font-size: 14px; }

/* ---- Card picker ---- */
.lg-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
}

.lg-picker-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  min-width: 340px;
}

.lg-pick-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lg-pick-row {
  display: flex;
  gap: 3px;
}

.lg-pick-cell {
  width: 28px;
  height: 26px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s, border-color .1s;
  padding: 0;
}
.lg-pick-cell:hover:not(.lg-pick-used) { background: var(--surface); border-color: var(--accent); }

/* Keyboard-nav focused cell — visible accent so the user can track
   where Enter will pick. Bright outline + subtle background so it
   stands out from regular hover. */
.lg-pick-cell.lg-pick-focused {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  outline: none;
}

.lg-pick-used {
  opacity: .25;
  cursor: not-allowed;
}

/* ---- Move color coding ---- */
.lg-move-open   { color: #5db87a; }
.lg-move-3bet   { color: #f7c948; }
.lg-move-4bet   { color: #f78c3a; }
.lg-move-5bet-plus, .lg-move-5betplus { color: #e55; }
.lg-move-call   { color: var(--accent); }
.lg-move-check  { color: var(--text-muted); }
.lg-move-fold   { color: #e05252; }
.lg-move-all-in { color: #b06ef5; }
.lg-move-bet    { color: #5db87a; }
.lg-move-raise  { color: #f7c948; }

/* ---- Blind raise prompt (shown when a blind level expires) ---- */
.lg-blind-raise-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}
.lg-blind-raise-prompt {
  background: #2a1f0a;
  border: 2px solid #c8932a;
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 560px;
  width: 100%;
}
.lg-blind-raise-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.lg-blind-raise-icon  { font-size: 28px; line-height: 1; flex-shrink: 0; }
.lg-blind-raise-title { font-size: 17px; font-weight: 700; color: #f0b030; }
.lg-blind-raise-info  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.lg-blind-raise-fields {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.lg-blind-raise-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lg-blind-raise-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lg-blind-raise-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Resume banner (shown on first load when a saved session is detected) ---- */
.lg-resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: #192e22;
  border: 1.5px solid #3a7a50;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.lg-resume-banner-text { flex: 1; min-width: 180px; }

/* ---- Setup form layout helpers ---- */
.lg-blind-header {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  padding-bottom: 4px;
}

.lg-blind-row, .lg-payout-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.lg-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 4px;
}

.lg-field-group label { font-size: 11px; font-weight: 600; }

.lg-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- Utilities ---- */
.lg-muted    { color: var(--text-muted); }
.lg-full-width { width: 100%; }

/* ── Two-column hand layout ── */
.lg-hand-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  align-items: start;
}
.lg-hand-left  { min-width: 0; }
.lg-hand-right { position: sticky; top: 73px; align-self: start; } /* 53px nav + 20px content padding */

/* ── Players panel ── */
.lg-players-panel { background: var(--surface2); border-radius: 8px; padding: 12px 14px; }
.lg-players-panel-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.lg-player-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--surface); }
.lg-player-row:last-of-type { border-bottom: none; }
.lg-player-folded { opacity: .35; }
.lg-player-next { background: #1a2e1a; border-radius: 5px; padding: 6px 5px; margin: 0 -5px; }
.lg-player-name  { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-player-right { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.lg-player-stack { font-size: 13px; font-weight: 700; }

/* Tiny "?" superscript inline with each player's stack value, signals
   that hover-tooltip info is available. Steve flagged that the
   tooltip was undiscoverable without a visible affordance. */
.lg-stack-help {
  font-size: 9px;
  color: var(--text-muted);
  margin-left: 2px;
  vertical-align: super;
  font-weight: 400;
  opacity: 0.7;
}
.lg-player-comm  { font-size: 11px; color: #e55; }
.lg-status-badge { font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 3px; letter-spacing: .04em; }
.lg-status-fold  { background: #333; color: var(--text-muted); }
.lg-status-allin { background: #5a1a1a; color: #f88; }

/* ── Pot display at the bottom of the players panel ── */
.lg-panel-pot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.lg-panel-pot-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.lg-panel-pot-value { font-size: 19px; font-weight: 700; color: var(--accent); }

/* ── Amount input group ── */
.lg-amount-group { display: flex; align-items: center; gap: 4px; }
.lg-add-action--pf { flex-wrap: wrap; }

/* ── Board card row ── */
.lg-board-card-row { display: flex; gap: 6px; margin-bottom: 8px; }

/* ── All-fold confirmed ── */
.lg-allfold-confirmed { display: flex; align-items: center; gap: 10px; background: #1c3a28; border: 1px solid #3a6a48; border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; color: #5db87a; font-weight: 600; }

/* ── All-in notice + winner buttons ── */
.lg-allin-notice { font-size: 12px; color: #f0b030; font-weight: 600; margin-bottom: 6px; }
.lg-winner-btns  { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.lg-winner-sel   { border-color: #5db87a !important; color: #5db87a !important; }

/* ── Stack diffs ── */
.lg-stack-diffs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; margin-top: 4px; }
.lg-diff-pos { color: #5db87a; }
.lg-diff-neg { color: #e55; }

/* ── Preflop actor row ── */
.lg-pf-actor-row  { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lg-pf-actor      { display: flex; align-items: center; gap: 8px; }
.lg-pf-pos        { font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; }
.lg-pf-name       { font-size: 20px; font-weight: 700; color: var(--text); }
.lg-pf-stack      { font-size: 13px; color: var(--text-muted); }
.lg-pf-undo       { font-size: 11px; white-space: nowrap; }

/* ── Preflop action buttons ── */
.lg-pf-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.lg-pf-btn  {
  flex: 1; min-width: 76px;
  padding: 10px 6px;
  border-radius: 6px;
  border: 2px solid transparent;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: filter .12s;
  background: var(--surface2); color: var(--text);
}
.lg-pf-btn:hover    { filter: brightness(1.2); }
.lg-pf-btn--fold    { background: #3d1818; border-color: #7a2828; color: #f87171; }
.lg-pf-btn--call    { background: #152338; border-color: #254870; color: #7ab3f5; }
.lg-pf-btn--minraise { background: #152e1e; border-color: #2e5c3a; color: #5db87a; }
.lg-pf-btn--raise   { background: #102510; border-color: #225022; color: #47a85e; }
.lg-pf-btn--allin   { background: #28103a; border-color: #522078; color: #c49ef5; }
.lg-pf-hotkey       { font-size: 10px; font-weight: 700; opacity: .65; background: rgba(255,255,255,.1); border-radius: 3px; padding: 1px 4px; line-height: 1.4; }

/* ── Preflop raise entry row ── */
.lg-pf-raise-row   { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.lg-pf-raise-input { width: 120px; }

/* ── Hole card prompt (pf_cards_for) ── */
.lg-pf-cards-prompt { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.lg-pf-cards-label  { font-size: 13px; }

/* ── Flags row ── */
.lg-flags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lg-flag-chip { display: flex; align-items: center; gap: 5px; font-size: 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; padding: 4px 8px; cursor: pointer; }
.lg-flag-chip:hover { border-color: var(--accent); }
.lg-flag-chip--highlight { border-color: #c8932a; }

/* ── Auto-derived flag badges (read-only green) ── */
.lg-flag-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: #5db87a; background: #162a1e; border: 1px solid #3a6a48; border-radius: 5px; padding: 4px 8px; }

/* ── Larger card picker ── */
.lg-picker-popup--large { width: 520px; max-width: 95vw; }
.lg-pick-grid--large .lg-pick-cell { width: 36px; height: 44px; font-size: 16px; font-weight: 700; }
