/* ============================================================
   LIF Preflop Lab v2 — Stylesheet (v2.1 — layout fixes)
   ============================================================
   Conventions:
   - All classes prefixed `.lif-pl-` to avoid collisions with the rest of LIF
   - Two themes via `.lif-pl-lab.dark` / `.lif-pl-lab.light`
   - Variables exposed at the root of `.lif-pl-lab` so other tools can override

   Changes vs v2.0:
   - Max-width 1100px + margin auto on the Lab (no longer stretches)
   - Spot card content centered (header, meta, options, grid all aligned)
   - Grid size up from 580px → 720px max
   - Cells 36px → 42px tall
   - All font sizes +1px for better readability
   - Mobile breakpoint at 768px
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Montserrat:wght@400;500;600&display=swap');

.lif-pl-lab {
  /* Brand palette */
  --lif-teal:        #6ECFF0;
  --lif-teal-deep:   #5ab8d9;
  --lif-amber:       #FBBF24;
  /* Action palette */
  --col-fold:        #2a3851;
  --col-call:        #3DB87E;
  --col-raise:       #E89829;
  --col-jam:         #C5283D;
  /* Layout */
  --gap-row: 14px;
  --pill-radius: 3px;
  --card-radius: 12px;
  --content-max: 1100px;
  --grid-max: 720px;

  border-radius: var(--card-radius);
  overflow: hidden;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  position: relative;

  /* Center the whole Lab in wide containers */
  max-width: var(--content-max);
  margin: 0 auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.lif-pl-lab * { box-sizing: border-box; }

/* ---------- THEMES ---------- */
.lif-pl-lab.dark {
  --bg-app:         #0a1a2f;
  --bg-elevated:    #0f243f;
  --bg-deep:        #06121f;
  --bg-pill:        #14304f;
  --bg-pill-hover:  #1f4570;
  --bg-pill-off:    #0d1d33;
  --border-faint:   #1a3050;
  --border:         #25405e;
  --border-pill:    #3a5573;
  --border-strong:  #4a6285;
  --text:           #e2e8f0;
  --text-strong:    #f1f5f9;
  --text-muted:     #94a3b8;
  --text-mute2:     #cbd5e1;
  --text-dim:       #6b89b0;
  --text-disabled:  #4a5568;
  background: var(--bg-app);
  color: var(--text);
}
.lif-pl-lab.light {
  --bg-app:         #f4f6fb;
  --bg-elevated:    #ffffff;
  --bg-deep:        #1e293b;
  --bg-pill:        #ffffff;
  --bg-pill-hover:  #f1f5f9;
  --bg-pill-off:    #f8fafc;
  --border-faint:   #e2e8f0;
  --border:         #cbd5e1;
  --border-pill:    #cbd5e1;
  --border-strong:  #94a3b8;
  --text:           #1e293b;
  --text-strong:    #0f172a;
  --text-muted:     #64748b;
  --text-mute2:     #475569;
  --text-dim:       #64748b;
  --text-disabled:  #94a3b8;
  background: var(--bg-app);
  color: var(--text);
}

/* ---------- TOP BAR ---------- */
.lif-pl-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-faint);
}
.lif-pl-lab.light .lif-pl-topbar { background: var(--bg-deep); color: #f1f5f9; }
.lif-pl-ttl {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--lif-teal) !important;
}
.lif-pl-tools { display: flex; gap: 8px; align-items: center; }
.lif-pl-iconbtn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.12s ease;
}
.lif-pl-lab.light .lif-pl-iconbtn { color: #cbd5e1; border-color: #cbd5e1; }
.lif-pl-iconbtn:hover { border-color: var(--lif-teal); color: var(--lif-teal); }

/* ---------- MAIN NAV (3 tabs) ---------- */
.lif-pl-mainnav {
  display: flex;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.lif-pl-mtab {
  flex: 1;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 2.5px;
  padding: 16px 12px 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--text-dim);
  border-bottom: 3px solid transparent;
  position: relative;
  text-align: center;
  transition: all 0.15s ease;
  outline: none;
}
.lif-pl-mtab:hover:not(.on) { color: var(--text-mute2); background: rgba(110,207,240,0.04); }
.lif-pl-mtab.on { color: var(--lif-teal); border-bottom-color: var(--lif-teal); background: rgba(110,207,240,0.08); }
.lif-pl-mtab.on::before {
  content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; background: var(--lif-teal);
}
.lif-pl-mtab-sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  letter-spacing: 1px;
  display: block;
  margin-top: 4px;
  opacity: 0.75;
  font-weight: 400;
  text-transform: none;
}

/* ---------- PICKERS (pill rows) ---------- */
.lif-pl-pickers {
  padding: 18px 22px;
  display: flex; flex-direction: column;
  gap: var(--gap-row);
}
.lif-pl-pg { display: flex; flex-direction: column; gap: 6px; }
.lif-pl-pg-lbl {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-muted);
}
.lif-pl-pg-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lif-pl-slot { font-size: 12px; min-width: 110px; color: var(--text-mute2); }

.lif-pl-pill {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 5px 14px;
  border-radius: var(--pill-radius);
  cursor: pointer;
  line-height: 1.5;
  outline: none;
  position: relative;
  border: 1px solid var(--border-pill);
  background: var(--bg-pill);
  color: var(--text-mute2);
  transition: all 0.12s ease;
}
.lif-pl-pill:hover:not(.lif-disabled):not(.on) {
  background: var(--bg-pill-hover);
  border-color: var(--border-strong);
  color: var(--text-strong);
}
.lif-pl-pill.on {
  background: linear-gradient(180deg, var(--lif-teal) 0%, var(--lif-teal-deep) 100%);
  border-color: var(--lif-teal);
  color: #0a1a2f;
  box-shadow: 0 2px 6px rgba(110,207,240,0.35);
}
.lif-pl-pill.lif-disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: var(--bg-pill-off);
  border-color: var(--border-faint);
  color: var(--text-disabled);
}
.lif-pl-warn-tt {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 7px 10px;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: var(--text-mute2);
  letter-spacing: 0;
  line-height: 1.4;
  pointer-events: none;
  z-index: 100;
}
.lif-pl-pill.lif-disabled:hover .lif-warn-tt { display: block; }

/* ---------- SPOT CARD (all content centered) ---------- */
.lif-pl-spot {
  padding: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.lif-pl-spot-ttl {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text-strong);
  margin-bottom: 4px;
}
.lif-pl-spot-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }
.lif-pl-acts-lbl {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.lif-pl-acts-row {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 18px;
  justify-content: center;
}
.lif-pl-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--bg-pill);
  border: 1px solid var(--border-strong);
  border-radius: var(--pill-radius);
  font-size: 12px;
  color: var(--text);
}
.lif-pl-act-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ---------- 13x13 GRID ---------- */
.lif-pl-gw { display: flex; justify-content: center; width: 100%; }
.lif-pl-grid {
  display: grid;
  grid-template-columns: 24px repeat(13, 1fr);
  grid-template-rows: 22px repeat(13, 42px);
  gap: 1px;
  width: 100%;
  max-width: var(--grid-max);
  overflow: visible;
}
.lif-pl-ax {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  color: var(--lif-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}
.lif-pl-cell {
  position: relative;
  cursor: pointer;
  background: var(--col-fold);
}
.lif-pl-cell.lif-show-tt { z-index: 50; }
.lif-pl-cell.lif-pinned { outline: 2px solid var(--lif-teal); outline-offset: -1px; z-index: 60; }
.lif-pl-fills { position: absolute; inset: 0; display: flex; }
.lif-pl-fills > span { height: 100%; }
.lif-pl-lbl {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  justify-content: center;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  pointer-events: none;
  line-height: 1;
}
.lif-pl-lbl-pct { font-size: 9px; opacity: 0.85; font-weight: 400; }

/* ---------- TOOLTIP ---------- */
.lif-pl-tt {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 9px 11px;
  display: none;
  pointer-events: none;
  white-space: nowrap;
  font-size: 12px;
  min-width: 200px;
  z-index: 100;
  text-align: left;
}
.lif-pl-lab.light .lif-pl-tt { background: var(--bg-deep); color: #e2e8f0; }
.lif-pl-cell.lif-show-tt .lif-pl-tt { display: block; }
.lif-pl-cell.lif-tt-below .lif-pl-tt { bottom: auto; top: calc(100% + 6px); }
.lif-pl-tt-h {
  color: var(--lif-amber);
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 13px;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 1px;
}
.lif-pl-tt-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.lif-pl-tt-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.lif-pl-tt-act { color: #e2e8f0; flex: 1; }
.lif-pl-lab.light .lif-pl-tt-act { color: #f1f5f9; }
.lif-pl-tt-freq { color: var(--text-muted); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.lif-pl-tt-ev { min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.lif-pl-tt-ev.lif-pos { color: #6ee7a3; }
.lif-pl-tt-ev.lif-neg { color: #f87171; }

/* ---------- FOOTER ---------- */
.lif-pl-foot {
  padding: 12px 22px;
  font-size: 11px;
  text-align: center;
  background: var(--bg-deep);
  color: var(--text-muted);
  border-top: 1px solid var(--border-faint);
}
.lif-pl-foot-pin { color: var(--lif-teal); font-weight: 500; }

/* ---------- STUB / EMPTY STATE ---------- */
.lif-pl-stub { padding: 80px 22px; text-align: center; }
.lif-pl-stub-ttl {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  color: var(--lif-teal);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.lif-pl-stub-txt { color: var(--text-muted); font-size: 13px; max-width: 460px; margin: 0 auto; line-height: 1.5; }

/* ---------- CONFIG DRAWER ---------- */
.lif-pl-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); z-index: 150; display: none; }
.lif-pl-overlay.show { display: block; }
.lif-pl-drawer {
  position: absolute; top: 0; right: 0; height: 100%; width: 320px;
  background: var(--bg-elevated); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.25s ease;
  z-index: 200; overflow-y: auto;
}
.lif-pl-drawer.open { transform: translateX(0); }
.lif-pl-drawer-hdr {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.lif-pl-drawer-ttl {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 17px;
  letter-spacing: 1.5px;
  color: var(--lif-teal);
}
.lif-pl-drawer-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 18px; }
.lif-pl-cfg-section { display: flex; flex-direction: column; gap: 8px; }
.lif-pl-cfg-lbl {
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-muted);
}
.lif-pl-cfg-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-pill);
  border: 1px solid var(--border-pill);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.12s;
  font-size: 13px;
}
.lif-pl-cfg-toggle:hover { border-color: var(--border-strong); }
.lif-pl-cfg-switch {
  width: 34px; height: 19px;
  border-radius: 10px;
  background: var(--border-pill);
  position: relative;
  transition: background 0.12s;
  flex-shrink: 0;
}
.lif-pl-cfg-switch.on { background: var(--lif-teal); }
.lif-pl-cfg-switch::after {
  content: '';
  position: absolute;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: transform 0.12s;
}
.lif-pl-cfg-switch.on::after { transform: translateX(15px); }
.lif-pl-cfg-segrow { display: flex; gap: 4px; }
.lif-pl-cfg-seg {
  flex: 1;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 7px 8px;
  background: var(--bg-pill);
  border: 1px solid var(--border-pill);
  border-radius: 3px;
  color: var(--text-mute2);
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
}
.lif-pl-cfg-seg.on {
  background: linear-gradient(180deg, var(--lif-teal) 0%, var(--lif-teal-deep) 100%);
  border-color: var(--lif-teal);
  color: #0a1a2f;
}

/* ---------- RESPONSIVE (mobile/tablet) ---------- */
@media (max-width: 768px) {
  .lif-pl-lab { max-width: 100%; border-radius: 0; box-shadow: none; }
  .lif-pl-mtab { font-size: 16px; letter-spacing: 1.5px; padding: 12px 8px 10px; }
  .lif-pl-mtab-sub { font-size: 9px; }
  .lif-pl-pickers { padding: 14px 14px; }
  .lif-pl-spot { padding: 16px 14px; }
  .lif-pl-grid {
    grid-template-columns: 18px repeat(13, 1fr);
    grid-template-rows: 18px repeat(13, 28px);
  }
  .lif-pl-lbl { font-size: 10px; }
  .lif-pl-lbl-pct { font-size: 8px; }
  .lif-pl-slot { min-width: 88px; font-size: 11px; }
  .lif-pl-drawer { width: 100%; }
}