/* The table's whole palette, scale and motion. Noir, monochrome, arcade grit:
   true black, one ink, a CRT's scanlines and grain, backlit pixel numerals,
   smooth motion. Scoped so the archived product theme cannot bleed in, and so a later
   theme can redefine these tokens without touching components.

   Rules: inverted fill means "act on this" and nothing else. Anything raised
   (cards, buttons) carries the same hard pixel edge. The pixel face is for
   display numerals only; everything else is monospaced. No gradients. */
.poker-lab {
  --lab-bg: #050505;
  --lab-panel: #050505;
  --lab-ink: #f0f0ea;
  --lab-muted: #94958f;
  --lab-faint: #7a7c77;
  --lab-line: #2b2c2a;
  --lab-line-strong: #74766f;
  --lab-inverse: #050505;
  --lab-overlay: #050505eb;
  --lab-edge: 2px 2px 0 var(--lab-line-strong);
  --lab-edge-ink: 2px 2px 0 var(--lab-ink);

  /* One arcade face for the whole interface, in capitals. Monospace survives
     only on card faces, card text and prose (settings, odds help).
     Jersey runs small and condensed, so its five sizes sit higher. */
  --lab-t-xs: 0.9375rem;
  --lab-t-sm: 1.0625rem;
  --lab-t-md: 1.1875rem;
  --lab-t-lg: 1.4375rem;
  --lab-t-xl: 1.875rem;
  --lab-ui: var(--font-pixel), var(--font-geist-mono), monospace;
  --lab-mono: var(--font-geist-mono), ui-monospace, monospace;
  --lab-display: var(--lab-ui);
  --lab-lit: #ffffff;
  /* Backlit: a hot core, then light bleeding into the black around it. */
  --lab-glow:
    0 0 1px rgb(255 255 255 / 0.8), 0 0 5px rgb(255 255 255 / 0.45),
    0 0 14px rgb(255 255 255 / 0.25), 0 2px 28px rgb(255 255 255 / 0.14);
  /* Light spilling out from under a card. */
  --lab-underglow:
    2px 2px 0 var(--lab-line-strong), 0 12px 28px -8px rgb(255 255 255 / 0.36),
    0 0 20px rgb(255 255 255 / 0.08);
  --lab-underglow-small: 0 8px 18px -6px rgb(255 255 255 / 0.32), 0 0 12px rgb(255 255 255 / 0.07);

  /* Motion. */
  --lab-fast: 90ms;
  --lab-deal: 260ms;
  --lab-move: 420ms;
  --lab-award: 620ms;
  --lab-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --lab-ease-move: cubic-bezier(0.5, 0, 0.2, 1);
  --lab-ease-think: linear;

  --lab-space: 1.75rem;
  --lab-card-w: 3.8rem;
  --lab-card-h: 5.15rem;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  color: var(--lab-ink);
  background: var(--lab-bg);
  font-family: var(--lab-ui);
  font-size: var(--lab-t-md);
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  -webkit-user-select: text;
  user-select: text;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.poker-lab *,
.poker-lab *::before,
.poker-lab *::after {
  box-sizing: border-box;
}
/* CRT grit over everything: scanlines, then a jittering grain. */
.poker-lab:not(.lab-dialog)::before,
.poker-lab:not(.lab-dialog)::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
}
.poker-lab:not(.lab-dialog)::before {
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgb(0 0 0 / 0.13) 2px 3px);
}
.poker-lab:not(.lab-dialog)::after {
  inset: -8px;
  opacity: 0.09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -0.45'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
.poker-lab button,
.poker-lab input {
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  border-radius: 0;
  touch-action: manipulation;
}
.poker-lab button,
.poker-lab a {
  -webkit-tap-highlight-color: transparent;
}
.poker-lab button {
  cursor: pointer;
}
.poker-lab button:disabled {
  cursor: default;
  opacity: 0.3;
}
.poker-lab :focus-visible {
  outline: 2px solid var(--lab-ink);
  outline-offset: 4px;
}
.poker-lab ::selection {
  background: var(--lab-ink);
  color: var(--lab-inverse);
}
.poker-lab a {
  color: inherit;
}
.poker-lab kbd {
  font: inherit;
  font-size: var(--lab-t-xs);
  opacity: 0.6;
  border: 1px solid currentColor;
  min-width: 1.125rem;
  padding: 0 0.2rem;
  line-height: 1rem;
  text-align: center;
}
.lab-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.lab-cursor {
  animation: lab-blink 1.05s steps(1) infinite;
}
.lab-loading {
  justify-content: center;
  align-items: center;
  color: var(--lab-muted);
}

/* ── controls ─────────────────────────────────────────────── */
.lab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-height: 2.75rem;
  min-width: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--lab-line-strong);
  background: var(--lab-panel);
  color: var(--lab-ink);
  box-shadow: var(--lab-edge);
  white-space: nowrap;
  transition:
    background var(--lab-fast),
    color var(--lab-fast),
    border-color var(--lab-fast),
    box-shadow var(--lab-fast),
    transform var(--lab-fast);
}
.lab-button:not(:disabled):active {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.lab-button:disabled {
  box-shadow: none;
}
.lab-button-primary {
  color: var(--lab-inverse);
  background: var(--lab-ink);
  border-color: var(--lab-ink);
}
.lab-button-bracket {
  min-height: 2.75rem;
  min-width: 0;
  gap: 0.15rem;
  padding: 0.25rem 0.45rem;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--lab-muted);
  font-size: var(--lab-t-sm);
}
.lab-button-bracket::before {
  content: "[";
  color: var(--lab-faint);
}
.lab-button-bracket::after {
  content: "]";
  color: var(--lab-faint);
}
.lab-button-bracket.is-on {
  color: var(--lab-ink);
}
.lab-button-bracket:not(:disabled):active {
  transform: none;
}

/* ── status line ──────────────────────────────────────────── */
.lab-review p {
  margin: 0.3rem 0;
}
.lab-recent-summary > p {
  color: var(--lab-muted);
  font-size: var(--lab-t-xs);
}
.lab-header {
  min-height: 3rem;
  padding: 0 var(--lab-space);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px dashed var(--lab-line);
  font-size: var(--lab-t-sm);
  color: var(--lab-muted);
  letter-spacing: 0.02em;
}
.lab-header b {
  color: var(--lab-ink);
  font-weight: 400;
}
.lab-dot {
  color: var(--lab-faint);
  margin-inline: 0.45rem;
}
.lab-status-hand {
  color: var(--lab-ink);
  white-space: nowrap;
}
.lab-header nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem;
}
.lab-notice {
  padding: 0.75rem var(--lab-space);
  font-size: var(--lab-t-sm);
  border-bottom: 1px solid var(--lab-line-strong);
}
.lab-mobile-history {
  display: none;
}

/* ── layout ───────────────────────────────────────────────── */
.lab-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17.5rem;
  flex: 1;
  min-height: auto;
}
.lab-table-column {
  min-width: 0;
  padding: 0.5rem var(--lab-space) 0;
  display: flex;
  flex-direction: column;
}

/* ── felt ─────────────────────────────────────────────────── */
.lab-felt {
  /* Seat centres, dealer button spots, and how far toward the pot a bet sits. */
  --s0x: 50%;
  --s0y: 85%;
  --s1x: 13%;
  --s1y: 64%;
  --s2x: 23%;
  --s2y: 24%;
  --s3x: 50%;
  --s3y: 13%;
  --s4x: 77%;
  --s4y: 24%;
  --s5x: 87%;
  --s5y: 64%;
  --d0x: 59.5%;
  --d0y: 79%;
  --d1x: 22.5%;
  --d1y: 50%;
  --d2x: 32%;
  --d2y: 17%;
  --d3x: 59.5%;
  --d3y: 8%;
  --d4x: 68%;
  --d4y: 17%;
  --d5x: 77.5%;
  --d5y: 50%;
  --pot-y: 50%;
  position: relative;
  flex: 1;
  min-height: 25rem;
  width: 100%;
}
.lab-felt.has-board {
  --pot-y: calc(50% + 2.6rem);
}
.lab-felt.has-hud {
  --s3y: 17%;
}
.lab-at-0 {
  --sx: var(--s0x);
  --sy: var(--s0y);
  --dx: var(--d0x);
  --dy: var(--d0y);
  --bf: 0.54;
}
.lab-at-1 {
  --sx: var(--s1x);
  --sy: var(--s1y);
  --dx: var(--d1x);
  --dy: var(--d1y);
  --bf: 0.44;
}
.lab-at-2 {
  --sx: var(--s2x);
  --sy: var(--s2y);
  --dx: var(--d2x);
  --dy: var(--d2y);
  --bf: 0.44;
}
.lab-at-3 {
  --sx: var(--s3x);
  --sy: var(--s3y);
  --dx: var(--d3x);
  --dy: var(--d3y);
  --bf: 0.44;
}
.lab-at-4 {
  --sx: var(--s4x);
  --sy: var(--s4y);
  --dx: var(--d4x);
  --dy: var(--d4y);
  --bf: 0.44;
}
.lab-at-5 {
  --sx: var(--s5x);
  --sy: var(--s5y);
  --dx: var(--d5x);
  --dy: var(--d5y);
  --bf: 0.44;
}
.lab-rail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.lab-rail ellipse {
  vector-effect: non-scaling-stroke;
}
.lab-rail ellipse {
  fill: none;
  shape-rendering: crispEdges;
}
.lab-rail-band {
  stroke: var(--lab-line-strong);
  stroke-width: 2;
}
.lab-rail-tacks {
  stroke: var(--lab-line-strong);
  stroke-width: 2;
  stroke-dasharray: 2 7;
}
.is-replay .lab-rail-band {
  stroke-dasharray: 8 6;
}
.lab-board {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  white-space: nowrap;
}
.lab-community {
  display: flex;
  gap: 0.5rem;
}

/* Cards: unchanged from the original — bold rank, solid suit, a hard edge. */
.lab-card {
  font-family: var(--lab-mono);
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--lab-card-w);
  height: var(--lab-card-h);
  border: 1px solid var(--lab-ink);
  border-radius: 0.3rem;
  color: var(--lab-ink);
  background: var(--lab-bg);
  box-shadow: var(--lab-underglow);
  line-height: 1.15;
  flex: none;
  transition: opacity 320ms ease;
}
.lab-card-rank {
  font-size: 1.4rem;
  font-weight: 500;
}
.lab-card-suit {
  font-size: 1.55rem;
  margin-top: 0.2rem;
}
.lab-card-small {
  width: 2.15rem;
  height: 2.95rem;
  border-radius: 0.2rem;
  box-shadow: var(--lab-underglow-small);
}
.lab-card-back.lab-card-small {
  box-shadow: none;
}
.lab-card-small .lab-card-rank {
  font-size: 0.875rem;
}
.lab-card-small .lab-card-suit {
  font-size: 1rem;
  margin-top: 0.05rem;
}
.lab-card-back {
  color: var(--lab-faint);
  border-color: var(--lab-line);
  background: repeating-conic-gradient(var(--lab-line) 0 25%, var(--lab-bg) 0 50%) 0 0 / 4px 4px;
}
.lab-card-back > span {
  background: var(--lab-bg);
  width: 1rem;
  text-align: center;
  font-size: 1rem;
}
.lab-card-empty {
  border: 1px dotted var(--lab-line-strong);
  background: transparent;
  box-shadow: none;
}
.lab-card.is-dim {
  opacity: 0.28;
}
.lab-deal {
  animation: lab-wipe var(--lab-deal) var(--lab-ease) backwards;
}

.lab-pot {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--lab-t-sm);
  color: var(--lab-muted);
  letter-spacing: 0.04em;
}
.lab-pot-mark {
  display: inline-flex;
  align-self: center;
  animation: lab-pot-tap 180ms var(--lab-ease) both;
}
.lab-seat-own.is-turn .lab-hole .lab-card {
  translate: 0 -0.2rem;
}
.lab-seat-own .lab-hole .lab-card {
  transition:
    opacity 320ms ease,
    translate var(--lab-fast);
}
.lab-turn-marker {
  width: 0.3rem;
  height: 0.3rem;
  background: currentColor;
  rotate: 45deg;
  flex: none;
}
.lab-pot strong {
  font-family: var(--lab-display);
  font-size: var(--lab-t-xl);
  font-weight: 400;
  line-height: 1;
  color: var(--lab-lit);
  text-shadow: var(--lab-glow);
  margin-left: 0.25rem;
}
.lab-pot.is-awarded {
  animation: lab-fade-out 300ms ease 520ms both;
}
.lab-chip {
  width: 1.1rem;
  height: 1rem;
  flex: none;
}
.lab-dealer-btn {
  position: absolute;
  left: var(--dx);
  top: var(--dy);
  width: 1.5rem;
  height: 1.5rem;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--lab-ink);
  background: var(--lab-bg);
  box-shadow: var(--lab-edge);
  font-family: var(--lab-display);
  font-weight: 400;
  font-size: var(--lab-t-md);
  color: var(--lab-lit);
  text-shadow: var(--lab-glow);
  text-transform: uppercase;
  z-index: 2;
  transition:
    left 640ms var(--lab-ease-move),
    top 640ms var(--lab-ease-move);
}

/* Chips in front: on the line from the seat toward the pot. */
.lab-commit {
  position: absolute;
  left: calc(var(--sx) + (50% - var(--sx)) * var(--bf));
  top: calc(var(--sy) + (50% - var(--sy)) * var(--bf));
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.45rem;
  font-size: var(--lab-t-sm);
  color: var(--lab-ink);
  background: var(--lab-bg);
  border: 1px dashed var(--lab-line-strong);
  white-space: nowrap;
  z-index: 2;
  animation: lab-bet-in 260ms var(--lab-ease) both;
}
.lab-commit.lab-sweeping {
  animation: lab-sweep var(--lab-move) var(--lab-ease-move) both;
}
.lab-award {
  position: absolute;
  transform: translate(-50%, -50%);
  color: var(--lab-ink);
  z-index: 3;
  pointer-events: none;
  animation: lab-award var(--lab-award) var(--lab-ease-move) 480ms both;
}
.lab-award .lab-chip {
  width: 1.4rem;
  height: 1.25rem;
}

/* ── seats ────────────────────────────────────────────────── */
.lab-seat {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  width: 9.25rem;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 1;
}
.lab-hole {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.95rem;
  margin-bottom: 0.5rem;
}
.lab-fold-slot {
  width: 4.6rem;
  height: 2.95rem;
  border: 1px dotted var(--lab-line-strong);
  border-radius: 0.2rem;
  opacity: 0.6;
  animation: lab-fade-in 320ms ease both;
}
.lab-plaque {
  background: var(--lab-bg);
  padding: 0.1rem 0.5rem 0.35rem;
}
.lab-seat-name {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 -0.5rem;
  height: 1.5rem;
  overflow: hidden;
  font-size: var(--lab-t-sm);
  white-space: nowrap;
  transition:
    background var(--lab-fast),
    color var(--lab-fast);
}
.lab-player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lab-think {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--lab-ink);
  mix-blend-mode: difference;
  animation-name: lab-think;
  animation-timing-function: var(--lab-ease-think);
  animation-fill-mode: forwards;
}
.lab-stack {
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-top: 0.3rem;
  font-size: var(--lab-t-lg);
}
.lab-hud {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  padding-top: 0.2rem;
  font-size: var(--lab-t-xs);
  color: var(--lab-muted);
  font-variant-numeric: tabular-nums;
}
.lab-stack > span:first-child {
  font-family: var(--lab-display);
  font-weight: 400;
  font-size: var(--lab-t-lg);
  line-height: 1;
  color: var(--lab-lit);
  text-shadow: var(--lab-glow);
}
.lab-seat.is-folded .lab-stack > span:first-child {
  text-shadow: none;
}
.lab-seat-action {
  margin-top: 0.4rem;
  color: var(--lab-muted);
  font-size: var(--lab-t-xs);
  letter-spacing: 0.04em;
  min-height: 1.1rem;
  white-space: nowrap;
}
.lab-win {
  font-family: var(--lab-display);
  font-weight: 400;
  font-size: var(--lab-t-md);
  line-height: 1.3;
  color: var(--lab-lit);
  text-shadow: var(--lab-glow);
  display: inline-block;
  animation: lab-rise 600ms var(--lab-ease) 700ms both;
}
.lab-seat-own .lab-card-small {
  width: 2.7rem;
  height: 3.6rem;
}
.lab-seat-own .lab-hole {
  min-height: 3.6rem;
}
.lab-seat-own .lab-fold-slot {
  width: 5.7rem;
  height: 3.6rem;
}
.lab-seat-own .lab-card-rank {
  font-size: 1.125rem;
}
.lab-seat-own .lab-card-suit {
  font-size: 1.25rem;
}
.lab-seat.is-turn .lab-seat-name {
  background: var(--lab-ink);
  color: var(--lab-inverse);
}
.lab-seat.is-turn .lab-seat-action {
  color: var(--lab-ink);
}
/* The winner's name flashes three times, then stays framed. */
.lab-seat.is-winner .lab-seat-name {
  outline: 1px solid var(--lab-ink);
  outline-offset: -1px;
  animation: lab-flash 960ms steps(1) 700ms both;
}
.lab-seat.is-folded .lab-plaque > * {
  opacity: 0.35;
}

.lab-seat.is-folded .lab-hud {
  opacity: 1;
}

/* ── action line + odds ───────────────────────────────────── */
.lab-feedback {
  border-top: 1px dashed var(--lab-line);
  border-bottom: 1px dashed var(--lab-line);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.1rem;
  font-size: var(--lab-t-sm);
}
.lab-feedback-prefix {
  color: var(--lab-faint);
}
.lab-feedback-line {
  flex: 1;
  min-width: 0;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lab-feedback-line .lab-cursor {
  color: var(--lab-muted);
}
.lab-live-odds {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left: 1px solid var(--lab-line);
  padding-left: 1rem;
  margin-left: auto;
  flex: none;
  align-self: stretch;
}
.lab-odds-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  white-space: nowrap;
  line-height: 1.3;
  min-width: 3.25rem;
}
.lab-odds-metric > span {
  font-size: var(--lab-t-xs);
  color: var(--lab-muted);
}
.lab-odds-metric > strong {
  font-size: var(--lab-t-md);
  font-weight: 400;
}
.lab-equity-bar {
  position: relative;
  width: 8.5rem;
  height: 0.4rem;
  border: 1px solid var(--lab-line-strong);
}
.lab-equity-bar > span {
  position: absolute;
  inset: 1px auto 1px 1px;
  background: repeating-linear-gradient(90deg, var(--lab-ink) 0 4px, transparent 4px 6px);
  transition: width var(--lab-move) var(--lab-ease-move);
}
.lab-equity-bar > i {
  position: absolute;
  top: -0.35rem;
  bottom: -0.35rem;
  width: 1px;
  background: var(--lab-ink);
  transition: left var(--lab-move) ease;
}
.lab-odds-help {
  position: relative;
}
.lab-odds-help > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  list-style: none;
  cursor: pointer;
  color: var(--lab-muted);
}
.lab-odds-help > summary::before {
  content: "[";
  color: var(--lab-faint);
}
.lab-odds-help > summary::after {
  content: "]";
  color: var(--lab-faint);
}
.lab-odds-help > summary::-webkit-details-marker {
  display: none;
}
.lab-odds-help > div {
  font-family: var(--lab-mono);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.6;
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 0.5rem);
  width: min(28rem, calc(100vw - 3.5rem));
  padding: 1rem;
  border: 1px solid var(--lab-line-strong);
  background: var(--lab-panel);
  box-shadow: var(--lab-edge);
  font-size: var(--lab-t-sm);
  max-height: 50dvh;
  overflow: auto;
}
.lab-odds-help p + p {
  margin-top: 0.75rem;
}
.lab-odds-help b {
  font-weight: 400;
}

/* ── betting ──────────────────────────────────────────────── */
.lab-controls {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) auto minmax(0, 1.45fr);
  gap: 1.5rem;
  padding: 1.25rem 0 1.5rem;
  align-items: center;
  min-height: 9rem;
}
.lab-decision {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.lab-decision strong {
  font-size: var(--lab-t-lg);
  font-weight: 400;
  white-space: nowrap;
}
.lab-decision > span:last-child {
  font-size: var(--lab-t-sm);
  color: var(--lab-muted);
}
.lab-decision .lab-display {
  font-family: var(--lab-display);
  font-size: var(--lab-t-xl);
  font-weight: 400;
  line-height: 1.2;
  color: var(--lab-lit);
  text-shadow: var(--lab-glow);
}
.lab-basic-actions {
  display: flex;
  gap: 0.75rem;
}
:where(.lab-basic-actions) .lab-button {
  min-width: 7.5rem;
  min-height: 3rem;
  justify-content: space-between;
}
.lab-pre-actions {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.lab-pre {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 7.5rem;
  min-height: 3rem;
  padding: 0 0.9rem;
  border: 1px dashed var(--lab-line);
  background: none;
  color: var(--lab-muted);
  font-size: var(--lab-t-sm);
  transition:
    color var(--lab-fast),
    border-color var(--lab-fast);
}
.lab-pre.is-on {
  border-style: solid;
  border-color: var(--lab-ink);
  color: var(--lab-ink);
}
.lab-wager {
  padding-left: 1.5rem;
  border-left: 1px solid var(--lab-line);
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.lab-sizing {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.lab-sizing > label {
  font-size: var(--lab-t-xs);
  color: var(--lab-muted);
  white-space: nowrap;
}
.lab-readout {
  font-size: var(--lab-t-xs);
  color: var(--lab-muted);
  white-space: nowrap;
}
.poker-lab input[type="number"] {
  width: 5rem;
  padding: 0.25rem 0.5rem;
  min-height: 2.75rem;
  font-size: var(--lab-t-lg);
  color: var(--lab-ink);
  border: 1px solid var(--lab-line-strong);
  background: var(--lab-bg);
  box-shadow: inset 2px 2px 0 #000;
  appearance: textfield;
}
.poker-lab input::-webkit-inner-spin-button {
  appearance: none;
}
.lab-presets {
  display: flex;
  margin-left: auto;
}
.lab-presets .lab-button-bracket {
  padding-inline: 0.4rem;
}
.lab-presets .lab-button-bracket::before,
.lab-presets .lab-button-bracket::after {
  content: none;
}
.lab-raise-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}
:where(.lab-raise-row) .lab-button {
  flex: none;
  min-width: 8.5rem;
  min-height: 2.75rem;
  justify-content: space-between;
}
.lab-slider {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.lab-tick {
  position: absolute;
  top: calc(50% + 0.4rem);
  width: 1px;
  height: 0.35rem;
  background: var(--lab-line-strong);
  pointer-events: none;
}
.lab-tick > span {
  position: absolute;
  top: 0.35rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--lab-t-xs);
  color: var(--lab-faint);
  white-space: nowrap;
}
.poker-lab input[type="range"] {
  appearance: none;
  background: transparent;
  height: 2.75rem;
  min-width: 0;
  width: 100%;
  margin: 0;
  accent-color: var(--lab-ink);
}
.poker-lab input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: var(--lab-line-strong);
}
.poker-lab input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  height: 1rem;
  width: 0.45rem;
  margin-top: -0.5rem;
  background: var(--lab-ink);
  box-shadow: var(--lab-edge);
}
.poker-lab input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--lab-line-strong);
}
.poker-lab input[type="range"]::-moz-range-thumb {
  height: 1rem;
  width: 0.45rem;
  border: 0;
  border-radius: 0;
  background: var(--lab-ink);
}
.poker-lab input:disabled {
  opacity: 0.3;
}

.lab-hand-complete {
  min-height: 9rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}
.lab-complete-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lab-review {
  max-width: 34rem;
  font-size: var(--lab-t-xs);
  color: var(--lab-muted);
  line-height: 1.6;
}

.lab-review summary {
  cursor: pointer;
  color: var(--lab-ink);
  padding: 0.25rem 0;
}
.lab-review details {
  text-transform: none;
}
.lab-recent-summary {
  border-top: 1px dashed var(--lab-line);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.lab-complete-actions .lab-button-primary {
  min-width: 11rem;
  min-height: 3rem;
  justify-content: space-between;
}
.lab-auto-deal {
  position: relative;
  overflow: hidden;
}
.lab-auto-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--lab-inverse);
  transform-origin: left;
  pointer-events: none;
  animation: lab-auto-fill linear both;
}
.lab-auto-marker {
  display: none;
  font-size: var(--lab-t-xs);
}

.lab-replay-controls {
  min-height: 9rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
}
.lab-replay-top,
.lab-replay-bottom {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.lab-replay-top > div {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lab-replay-top .lab-button-primary {
  min-width: 6rem;
}
.lab-replay-bottom > span {
  min-width: 3.5rem;
  font-size: var(--lab-t-xs);
  color: var(--lab-muted);
  text-align: right;
}

/* ── side panel ───────────────────────────────────────────── */
.lab-side {
  max-height: calc(100dvh - 3rem);
  overflow: auto;
  background: var(--lab-bg);
  border-left: 1px dashed var(--lab-line);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.75rem 1rem;
  min-width: 0;
}
.lab-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--lab-t-xs);
  letter-spacing: 0.08em;
  color: var(--lab-muted);
  margin-bottom: 1rem;
}
.lab-section-heading > span:last-child {
  color: var(--lab-faint);
}
.poker-lab dl {
  margin: 0;
}
.poker-lab dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  font-size: var(--lab-t-sm);
}
.poker-lab dt {
  color: var(--lab-muted);
}
.poker-lab dd {
  text-align: right;
}
.lab-spark {
  display: block;
  width: 100%;
  height: 2.4rem;
  margin-top: 0.4rem;
  overflow: visible;
}
.lab-spark polyline {
  fill: none;
  stroke: var(--lab-ink);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.lab-spark circle {
  fill: var(--lab-ink);
}
.lab-spark-zero {
  stroke: var(--lab-line);
  stroke-dasharray: 2 3;
}
.lab-activity-section {
  border-top: 1px dashed var(--lab-line);
  border-bottom: 1px dashed var(--lab-line);
  margin-top: 1.75rem;
  padding: 1.5rem 0;
}
.lab-activity {
  height: 13rem;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--lab-line) transparent;
}
.lab-activity li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 1.35rem;
  align-items: center;
  font-size: var(--lab-t-sm);
  color: var(--lab-faint);
}
.lab-activity b {
  font-weight: 400;
  color: var(--lab-muted);
}
.lab-activity li.is-new,
.lab-activity li.is-new b {
  color: var(--lab-ink);
}
.lab-activity li.is-new {
  animation: lab-fade-in 300ms ease both;
}
.lab-activity .lab-log-board {
  justify-content: flex-start;
  gap: 0.75rem;
  font-size: var(--lab-t-xs);
  letter-spacing: 0.04em;
  border-top: 1px dashed var(--lab-line);
  margin-top: 0.4rem;
  padding-top: 0.4rem;
}
.lab-activity .lab-log-board:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}
.lab-card-text {
  font-family: var(--lab-mono);
  font-size: 0.75rem;
  letter-spacing: 0;
  margin-right: 0.45em;
  white-space: nowrap;
}
.lab-card-sep {
  color: var(--lab-faint);
  margin-right: 0.45em;
}
.lab-history-section {
  padding-top: 1.25rem;
  flex: 1;
}
.lab-history {
  max-height: 15rem;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--lab-line) transparent;
}
.lab-history button {
  width: 100%;
  display: flex;
  text-align: left;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.5rem 0;
  border: 0;
  border-bottom: 1px solid var(--lab-line);
  background: none;
  color: inherit;
}
.lab-history button > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  font-size: var(--lab-t-sm);
}
.lab-history b {
  font-size: var(--lab-t-xs);
  font-weight: 400;
  color: var(--lab-faint);
}
.lab-history :where(button > span:first-child) > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lab-history-delta {
  font-size: var(--lab-t-sm);
  flex: none;
}
.lab-history p {
  font-size: var(--lab-t-sm);
  color: var(--lab-faint);
}

/* ── dialog ───────────────────────────────────────────────── */
.poker-lab.lab-dialog {
  min-height: 0;
  display: none;
  border: 1px solid var(--lab-line-strong);
  box-shadow: var(--lab-edge);
  padding: 1.5rem;
  margin: auto;
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  color: var(--lab-ink);
  background: var(--lab-panel);
}
.poker-lab.lab-dialog[open] {
  display: block;
}
.lab-dialog::backdrop {
  background: var(--lab-overlay, #090a0be6);
  backdrop-filter: blur(3px);
}
.lab-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px double var(--lab-line);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.lab-dialog-heading h2 {
  font-size: var(--lab-t-sm);
  font-weight: 400;
  letter-spacing: 0.08em;
}
.lab-settings p {
  font-family: var(--lab-mono);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
  color: var(--lab-muted);
  line-height: 1.9;
  margin-bottom: 1.25rem;
}
.lab-settings dl {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--lab-line);
}
.lab-settings details {
  border-top: 1px solid var(--lab-line);
  padding-top: 1rem;
  margin-bottom: 2rem;
}
.lab-settings summary {
  cursor: pointer;
  min-height: 2.75rem;
}
.lab-settings > a {
  font-size: var(--lab-t-xs);
  color: var(--lab-faint);
}
.lab-name-row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.lab-name-row input {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--lab-line-strong);
  background: var(--lab-bg);
  color: var(--lab-ink);
  font-family: var(--lab-mono);
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}
.lab-name-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-block: 1rem;
}
.lab-setting-toggle {
  margin-bottom: 1.5rem;
}
.lab-settings .lab-setting-toggle > p {
  margin: 0.25rem 0 0;
}

/* A skipped hand still animates, but never queues visuals behind its 50 ms
   actions. Leave the CRT cursor alone; speeding its blink would cause flicker. */
.poker-lab.is-skipping {
  --lab-fast: 35ms;
  --lab-deal: 35ms;
  --lab-move: 35ms;
  --lab-award: 35ms;
}
:where(.poker-lab.is-skipping) .lab-card {
  transition-duration: 35ms;
}
:where(.poker-lab.is-skipping) .lab-pot-mark,
:where(.poker-lab.is-skipping) .lab-commit,
:where(.poker-lab.is-skipping) .lab-fold-slot,
:where(.poker-lab.is-skipping) .lab-activity li.is-new {
  animation-duration: 35ms;
}
:where(.poker-lab.is-skipping) .lab-award,
:where(.poker-lab.is-skipping) .lab-win {
  animation-delay: 0ms;
  animation-duration: 35ms;
}
:where(.poker-lab.is-skipping) .lab-pot.is-awarded {
  animation: lab-fade-out 35ms ease both;
}
:where(.poker-lab.is-skipping) .lab-seat.is-winner .lab-seat-name {
  animation: lab-fade-in 35ms ease both;
}

/* ── motion ───────────────────────────────────────────────── */
@keyframes lab-auto-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}
@keyframes lab-pot-tap {
  from {
    scale: 0.85;
  }
  to {
    scale: 1;
  }
}
@keyframes lab-wipe {
  from {
    clip-path: inset(0 0 100% 0);
    transform: translateY(-6px);
  }
  to {
    clip-path: inset(0 0 0 0);
    transform: none;
  }
}
@keyframes lab-think {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}
@keyframes lab-bet-in {
  from {
    opacity: 0;
    scale: 0.6;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}
@keyframes lab-sweep {
  from {
    opacity: 1;
  }
  to {
    left: 50%;
    top: var(--pot-y);
    opacity: 0;
  }
}
@keyframes lab-award {
  from {
    left: 50%;
    top: var(--pot-y);
    opacity: 1;
  }
  to {
    left: var(--sx);
    top: var(--sy);
    opacity: 0;
  }
}
@keyframes lab-rise {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes lab-fade-in {
  from {
    opacity: 0;
  }
}
@keyframes lab-fade-out {
  to {
    opacity: 0.25;
  }
}
@keyframes lab-blink {
  50% {
    opacity: 0;
  }
}
@keyframes lab-flash {
  0%,
  33%,
  66% {
    background: var(--lab-ink);
    color: var(--lab-inverse);
  }
  16%,
  50%,
  83%,
  100% {
    background: transparent;
  }
}

/* ── hover (pointer devices only) ─────────────────────────── */
@media (hover: hover) {
  .lab-button:not(:disabled):not(.lab-button-bracket):hover {
    border-color: var(--lab-ink);
    box-shadow: var(--lab-edge-ink);
  }
  .lab-button-bracket:not(:disabled):hover,
  .lab-pre:hover,
  .lab-odds-help > summary:hover {
    color: var(--lab-ink);
  }
  .lab-history button:hover {
    background: var(--lab-line);
  }
  .lab-settings a:hover {
    color: var(--lab-ink);
  }
}

/* ── responsive ───────────────────────────────────────────── */
@media (min-width: 1200px) and (min-height: 800px) {
  .lab-felt {
    min-height: max(25rem, calc(100dvh - 20rem));
  }
}
@media (max-width: 1250px) {
  .lab-controls {
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding-block: 1rem;
  }
  .lab-wager {
    grid-column: 1 / -1;
    padding-left: 0;
    border-left: 0;
  }
}
@media (max-width: 1279px) {
  .lab-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .lab-side {
    display: none;
  }
  .lab-mobile-history {
    display: inline-flex;
  }
  .lab-felt {
    min-height: 26rem;
  }
  :where(.lab-basic-actions) .lab-button {
    min-width: 6rem;
    padding-inline: 0.75rem;
  }
}
@media (max-width: 1000px) {
  .lab-equity-bar {
    width: 5rem;
  }
  .lab-header {
    grid-template-columns: auto 1fr auto;
  }
  .lab-status-hand {
    justify-self: center;
  }
}
@media (max-width: 850px) {
  .poker-lab {
    --lab-space: 1.25rem;
  }
  .lab-felt {
    min-height: 34rem;
  }
  .lab-header {
    grid-template-columns: 1fr auto;
    row-gap: 0;
    padding-block: 0.25rem;
  }
  .lab-status-hand {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: start;
  }
  .lab-feedback:has(.lab-live-odds) {
    flex-wrap: wrap;
    padding-block: 0.5rem;
  }
  .lab-live-odds {
    flex-basis: 100%;
    justify-content: space-between;
    border-left: 0;
    border-top: 1px solid var(--lab-line);
    padding: 0.5rem 0 0;
    margin-left: 0;
  }
  .lab-equity-bar {
    flex: 1;
  }
}
@media (max-width: 600px) {
  .poker-lab {
    --lab-space: 0.875rem;
    --lab-card-w: 2.5rem;
    --lab-card-h: 3.55rem;
  }
  .lab-felt {
    --s1x: 16%;
    --s5x: 84%;
    --s2x: 19%;
    --s2y: 27%;
    --s4x: 81%;
    --s4y: 27%;
    --s0y: 86%;
    --d1x: 22%;
    --d5x: 78%;
    --d2x: 32%;
    --d4x: 68%;
    min-height: 32rem;
  }
  .lab-seat {
    width: 6.5rem;
  }
  .lab-seat-name {
    gap: 0.2rem;
  }
  .lab-community {
    gap: 0.3rem;
  }
  .lab-card-rank {
    font-size: 1.125rem;
  }
  .lab-card-suit {
    font-size: 1.2rem;
  }
  .lab-card-small {
    width: 1.7rem;
    height: 2.4rem;
  }
  .lab-card-small .lab-card-rank {
    font-size: 0.75rem;
  }
  .lab-card-small .lab-card-suit {
    font-size: 0.875rem;
  }
  .lab-fold-slot {
    width: 3.7rem;
    height: 2.4rem;
  }
  .lab-board {
    gap: 0.5rem;
  }
  .lab-header nav .lab-button-bracket:not(.lab-mobile-history):not(:last-child) {
    font-size: var(--lab-t-xs);
  }
  .lab-controls {
    gap: 0.75rem;
  }
  .lab-decision > span:last-child {
    display: none;
  }
  :where(.lab-basic-actions) .lab-button {
    min-width: 4.75rem;
  }
  .lab-basic-actions kbd {
    display: none;
  }
  .lab-sizing {
    flex-wrap: wrap;
    gap: 0.25rem;
  }
  .lab-presets {
    width: 100%;
    justify-content: space-between;
  }
  .lab-hand-complete {
    min-height: 10rem;
    gap: 1rem;
    flex-direction: column;
    align-items: stretch;
  }
  .lab-replay-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}
@media (max-height: 800px) and (min-width: 851px) {
  .lab-header {
    min-height: 2.75rem;
  }
  .poker-lab {
    --lab-card-w: 3.25rem;
    --lab-card-h: 4.3rem;
  }
  .lab-felt {
    min-height: 24.5rem;
  }
  .lab-board {
    gap: 0.5rem;
  }
  .lab-seat-own .lab-card-small {
    width: 2.4rem;
    height: 3.2rem;
  }
  .lab-side {
    padding-top: 1.25rem;
  }
  .lab-activity {
    height: 9rem;
  }
  .lab-history {
    max-height: 9rem;
  }
  .lab-controls,
  .lab-hand-complete,
  .lab-replay-controls {
    min-height: 7.5rem;
    padding-block: 0.75rem;
  }
  .lab-feedback {
    min-height: 2.75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .poker-lab *,
  .poker-lab *::before,
  .poker-lab *::after {
    /* biome-ignore lint/complexity/noImportantStyles: system reduced motion overrides more specific card and turn rules. */
    animation: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: system reduced motion overrides more specific card and turn rules. */
    transition: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: system reduced motion overrides more specific card and turn rules. */
    scroll-behavior: auto !important;
  }
  .lab-sweeping,
  .lab-award,
  .lab-think {
    display: none;
  }
  .lab-auto-progress {
    display: none;
  }
  .lab-auto-marker {
    display: inline;
  }
}
