/* LIF Poker · Constructor de rangos — estilos acotados a .lif-rb
 * Independiente: no depende de preflop-lab.css. Fuentes Bebas Neue + Montserrat ya cargadas por el sitio. */

.lif-rb {
  --rb-card: #0a1a2f;
  --rb-deep: #06121f;
  --rb-surface: #0f243f;
  --rb-btn: #14304f;
  --rb-btn-hover: #1f4570;
  --rb-b1: #1a3050;
  --rb-b2: #25405e;
  --rb-b3: #3a5573;
  --rb-b4: #4a6285;
  --rb-text: #f1f5f9;
  --rb-text-2: #e2e8f0;
  --rb-text-3: #cbd5e1;
  --rb-muted: #94a3b8;
  --rb-tab-off: #6b89b0;
  --rb-accent: #6ECFF0;
  --rb-total: #FBBF24;
  --rb-danger: #f87171;
  --rb-display: 'Bebas Neue', sans-serif;
  --rb-body: 'Montserrat', system-ui, sans-serif;

  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 16px;
  font-family: var(--rb-body);
  font-size: 13px;
  color: var(--rb-text-2);
}
.lif-rb *, .lif-rb *::before, .lif-rb *::after { box-sizing: border-box; }
.lif-rb button, .lif-rb input, .lif-rb select, .lif-rb textarea { font: inherit; color: inherit; }
.lif-rb :focus-visible { outline: 2px solid var(--rb-accent); outline-offset: 2px; }

.lif-rb-card {
  border-radius: 12px;
  overflow: hidden;
  background: var(--rb-card);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
  border: 1px solid var(--rb-b1);
}

/* Header */
.lif-rb-header {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 22px; background: var(--rb-deep); border-bottom: 1px solid var(--rb-b1);
}
.lif-rb-title { font-family: var(--rb-display); font-size: 20px; letter-spacing: 2px; color: var(--rb-accent); }
.lif-rb-stats { display: flex; gap: 14px; font-size: 12px; color: var(--rb-muted); }
.lif-rb-stat-num { color: var(--rb-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.lif-rb-stat-pct { color: var(--rb-total); font-weight: 600; font-variant-numeric: tabular-nums; }
.lif-rb-header-reset { margin-left: auto; }

/* Body */
.lif-rb-body { display: flex; gap: 22px; padding: 22px; flex-wrap: wrap; align-items: flex-start; }
.lif-rb-matrix { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.lif-rb-side { flex: 0 1 400px; min-width: 300px; display: flex; flex-direction: column; gap: 18px; }

/* Matriz */
.lif-rb-grid {
  display: grid;
  grid-template-columns: 22px repeat(13, minmax(0, 1fr));
  grid-template-rows: 20px repeat(13, minmax(0, 1fr));
  gap: 1px;
  aspect-ratio: 1 / 1;
  user-select: none; -webkit-user-select: none;
  touch-action: none; /* permite pintar arrastrando con el dedo */
}
.lif-rb-axis {
  font-family: var(--rb-display); font-size: 13px; color: var(--rb-accent);
  display: flex; align-items: center; justify-content: center;
}
.lif-rb-cell {
  position: relative; z-index: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 0; overflow: hidden; cursor: pointer;
  font-size: clamp(8px, 1vw, 12px);
  background: #2a3851;
}
.lif-rb-cell.is-pair { z-index: 1; }
.lif-rb-grid.has-pair-outline .lif-rb-cell.is-pair { outline: 2px solid #b5793a; outline-offset: -2px; }
.lif-rb-cell.is-selected, .lif-rb-grid.has-pair-outline .lif-rb-cell.is-selected {
  outline: 2px solid var(--rb-accent); outline-offset: -1px; z-index: 2;
}
.lif-rb-cell-label, .lif-rb-cell-pct {
  position: relative; z-index: 1; color: var(--rb-text); line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7); pointer-events: none;
}
.lif-rb-cell-label { font-weight: 500; }
.lif-rb-cell-pct { font-size: .7em; opacity: .85; }
.lif-rb-cell-pct:empty { display: none; }

.lif-rb-under { margin-left: 23px; display: flex; flex-direction: column; gap: 8px; }
.lif-rb-bar { height: 8px; border-radius: 2px; width: 100%; background: #2a3851; }
.lif-rb-bar--brush { height: 6px; }
.lif-rb-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lif-rb-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  background: var(--rb-btn); border: 1px solid var(--rb-b4); border-radius: 3px;
  font-size: 12px; color: var(--rb-text-2);
}
.lif-rb-chip-pct { color: var(--rb-muted); font-variant-numeric: tabular-nums; }
.lif-rb-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }

/* Etiquetas y filas */
.lif-rb-label { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 500; color: var(--rb-muted); }
.lif-rb-row { display: flex; align-items: center; gap: 6px; }
.lif-rb-row--wrap { flex-wrap: wrap; }
.lif-rb-row--sep { padding-top: 8px; border-top: 1px solid var(--rb-b1); }
.lif-rb-push { margin-left: auto; }
.lif-rb-muted { font-size: 12px; color: var(--rb-muted); }
.lif-rb-help { margin: 0; font-size: 13px; color: var(--rb-muted); line-height: 1.5; }
.lif-rb-help--sm { font-size: 12px; }
.lif-rb-help code { color: var(--rb-text-3); }

/* Botones */
.lif-rb-btn {
  font-family: var(--rb-display); font-size: 14px; letter-spacing: 1px; line-height: 1.5;
  padding: 5px 14px; border-radius: 3px; border: 1px solid var(--rb-b3);
  background: var(--rb-btn); color: var(--rb-text-3); cursor: pointer; white-space: nowrap;
}
.lif-rb .lif-rb-btn { color: var(--rb-text-3); }
.lif-rb-btn:hover { background: var(--rb-btn-hover); border-color: var(--rb-b4); }
.lif-rb .lif-rb-btn:hover { color: var(--rb-text); }
.lif-rb-btn--sm { font-size: 13px; padding: 3px 10px; }
.lif-rb .lif-rb-btn--accent { color: var(--rb-accent); }
.lif-rb .lif-rb-btn--primary {
  border-color: var(--rb-accent); background: linear-gradient(180deg, #6ECFF0, #5ab8d9);
  color: var(--rb-card); box-shadow: 0 2px 6px rgba(110, 207, 240, .35);
}
.lif-rb .lif-rb-btn--primary:hover { color: var(--rb-card); filter: brightness(1.06); }
.lif-rb .lif-rb-btn--ghost { background: transparent; color: var(--rb-muted); padding: 5px 12px; }
.lif-rb .lif-rb-btn--ghost:hover { background: transparent; border-color: var(--rb-danger); color: var(--rb-danger); }
.lif-rb .lif-rb-link-danger {
  border: 0; background: transparent; color: var(--rb-tab-off); cursor: pointer; font-size: 12px; padding: 3px 4px;
}
.lif-rb .lif-rb-link-danger:hover { color: var(--rb-danger); }

/* Pincel */
.lif-rb-brush { display: flex; flex-direction: column; gap: 8px; }
.lif-rb-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.lif-rb-action {
  background: var(--rb-surface); border: 1px solid var(--rb-b2); border-radius: 6px;
  overflow: hidden; display: flex; flex-direction: column; opacity: .8;
}
.lif-rb-action.is-on { border-color: var(--rb-b4); opacity: 1; }
.lif-rb-card-head { display: flex; align-items: center; gap: 4px; padding: 5px 8px; }
.lif-rb-swatch {
  width: 14px; height: 14px; flex: none; position: relative; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .6); border-radius: 2px; background: rgba(255, 255, 255, .25);
}
.lif-rb-swatch input[type=color] {
  position: absolute; inset: -4px; width: 24px; height: 24px; opacity: 0; cursor: pointer; border: 0; padding: 0;
}
.lif-rb .lif-rb-card-name {
  flex: 1; min-width: 0; background: transparent; border: 0; padding: 0;
  font-size: 12px; font-weight: 700; letter-spacing: .5px; text-align: center; color: inherit;
}
.lif-rb .lif-rb-card-x {
  flex: none; width: 14px; height: 14px; border: 0; background: transparent; color: inherit;
  opacity: .6; cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
}
.lif-rb .lif-rb-card-x:hover { opacity: 1; }
.lif-rb-stepper { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 8px 4px; }
.lif-rb .lif-rb-step {
  width: 22px; height: 22px; border: 1px solid var(--rb-b3); border-radius: 3px;
  background: var(--rb-btn); color: var(--rb-text-3); cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
}
.lif-rb .lif-rb-step:hover { background: var(--rb-btn-hover); }
.lif-rb .lif-rb-weight {
  width: 50px; height: 24px; text-align: center; padding: 0;
  border: 1px solid var(--rb-b2); border-radius: 3px; background: var(--rb-deep); color: var(--rb-text);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
.lif-rb .lif-rb-weight::-webkit-inner-spin-button, .lif-rb .lif-rb-weight::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.lif-rb-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; padding: 0 8px 8px; }
.lif-rb .lif-rb-preset {
  border: 1px solid var(--rb-b3); background: var(--rb-btn); color: var(--rb-text-3);
  border-radius: 3px; font-size: 10px; font-weight: 600; padding: 3px 0; min-width: 0;
  text-align: center; cursor: pointer; font-variant-numeric: tabular-nums;
}
.lif-rb .lif-rb-preset.is-active { border-color: var(--rb-accent); background: rgba(110, 207, 240, .15); color: var(--rb-accent); }
.lif-rb-palettes { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.lif-rb-palettes .lif-rb-label { margin-right: 4px; }
.lif-rb .lif-rb-palette {
  display: flex; gap: 2px; padding: 3px; border: 1px solid var(--rb-b3);
  background: var(--rb-btn); border-radius: 3px; cursor: pointer;
}
.lif-rb .lif-rb-palette.is-active { border-color: var(--rb-accent); }
.lif-rb-palette span { width: 12px; height: 12px; border-radius: 2px; display: block; }

/* Pestañas */
.lif-rb-tabbox { display: flex; flex-direction: column; gap: 12px; }
.lif-rb-tabs { display: flex; background: var(--rb-surface); border: 1px solid var(--rb-b2); border-radius: 3px; overflow: hidden; }
.lif-rb .lif-rb-tab {
  flex: 1; border: 0; background: transparent; color: var(--rb-tab-off);
  font-family: var(--rb-display); font-size: 15px; letter-spacing: 1.5px; padding: 8px 6px; cursor: pointer;
}
.lif-rb .lif-rb-tab + .lif-rb-tab { border-left: 1px solid var(--rb-b2); }
.lif-rb .lif-rb-tab.is-active { color: var(--rb-accent); background: rgba(110, 207, 240, .08); box-shadow: inset 0 -2px 0 var(--rb-accent); }
.lif-rb-panel { display: flex; flex-direction: column; gap: 12px; }

/* Combos */
.lif-rb-combo-title { display: flex; align-items: baseline; gap: 8px; }
.lif-rb-combo-hand { font-size: 20px; font-weight: 600; color: var(--rb-text); }
.lif-rb-combos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.lif-rb-tile {
  border-radius: 4px; padding: 5px 6px; display: flex; flex-direction: column; gap: 5px;
  min-height: 84px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.lif-rb-tile-label {
  display: flex; align-items: center; gap: 3px; align-self: flex-start;
  font-family: 'Montserrat', 'Segoe UI Symbol', 'Apple Symbols', sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: .3px; line-height: 1.2;
  background: #f8fafc; border-radius: 3px; padding: 2px 7px; text-shadow: none;
}
.lif-rb-suit-s { color: #1e293b; }
.lif-rb-suit-h { color: #dc2626; }
.lif-rb-suit-d { color: #2563eb; }
.lif-rb-suit-c { color: #16a34a; }
.lif-rb-tile-rows {
  display: grid; grid-template-columns: 1fr auto; column-gap: 6px;
  font-size: 9.5px; line-height: 1.35; margin-top: auto; color: var(--rb-text);
}
.lif-rb-tile-name { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lif-rb-tile-w { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Resumen */
.lif-rb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lif-rb-table th {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rb-b2);
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 500; color: var(--rb-muted);
}
.lif-rb-table td { padding: 7px 8px; border-bottom: 1px solid var(--rb-b1); }
.lif-rb-table .lif-rb-num { text-align: right; font-variant-numeric: tabular-nums; }
.lif-rb-table .lif-rb-total-row td { border-bottom: 0; color: var(--rb-total); }
.lif-rb-table .lif-rb-total-row td:first-child { font-weight: 600; }
.lif-rb-inline { display: inline-flex; align-items: center; gap: 8px; }

/* Texto */
.lif-rb .lif-rb-textarea {
  width: 100%; min-height: 160px; resize: vertical; padding: 8px 10px;
  background: var(--rb-deep); border: 1px solid var(--rb-b2); border-radius: 6px;
  color: var(--rb-text-2); font-family: ui-monospace, monospace; font-size: 12px;
}
.lif-rb .lif-rb-select {
  height: 30px; padding: 0 8px; max-width: 100%;
  background: var(--rb-btn); border: 1px solid var(--rb-b3); border-radius: 3px; color: var(--rb-text-2); font-size: 12px;
}
.lif-rb-msg { font-size: 12px; color: var(--rb-muted); }

/* Guardados */
.lif-rb .lif-rb-input {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px;
  background: var(--rb-deep); border: 1px solid var(--rb-b2); border-radius: 3px; color: var(--rb-text-2); font-size: 13px;
}
.lif-rb-saved { display: flex; flex-direction: column; gap: 6px; }
.lif-rb-saved-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--rb-surface); border: 1px solid var(--rb-b2); border-radius: 6px;
}
.lif-rb-thumb { width: 36px; height: 36px; border-radius: 3px; flex: none; }
.lif-rb-saved-info { flex: 1; min-width: 0; }
.lif-rb-saved-name { font-size: 13px; font-weight: 600; color: var(--rb-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lif-rb-saved-meta { font-size: 11px; color: var(--rb-muted); }

/* Footer */
.lif-rb-footer {
  padding: 10px 22px; font-size: 11px; text-align: center;
  background: var(--rb-deep); color: var(--rb-muted); border-top: 1px solid var(--rb-b1);
}

@media (max-width: 560px) {
  .lif-rb { padding: 12px 0; }
  .lif-rb-body { padding: 14px 10px; gap: 16px; }
  .lif-rb-side { min-width: 0; flex-basis: 100%; }
  .lif-rb-header { padding: 12px 14px; }
}
   /* Fase 1: acciones fijas */
   .lif-rb-size { width: 4.5em; }
   span.lif-rb-card-name { flex: 1; font-weight: 600; }