/* poker trainer — table design cloned from the classic PokerStars 6-max layout:
   dark surround, green oval felt with rail + inner ring, seat pills (avatar/name/stack),
   centered pot + community cards, bet chips toward table center, action bar bottom-right. */

.pk-page { max-width: 1180px; margin: 0 auto; }
.pk-page h1 { margin: 0 0 .2em; font-size: 1.7rem; }

.pk-layout { display: flex; gap: 18px; align-items: flex-start; }
.pk-main { flex: 1 1 auto; min-width: 0; }
.pk-side { flex: 0 0 330px; }
/* odds hidden → give the whole column back to the table */
.pk-layout.odds-collapsed .pk-side { flex: 0 0 auto; }
.pk-layout.odds-collapsed .pk-prob-head { margin-bottom: 0; }
.pk-layout.odds-collapsed .pk-prob-head h2 { display: none; }
@media (max-width: 980px) {
  .pk-layout { flex-direction: column; }
  .pk-side { flex: 1 1 auto; width: 100%; }
  .pk-layout.odds-collapsed .pk-side { width: auto; align-self: flex-end; }
}

/* ── the table ─────────────────────────────────────────────────────── */
.pk-table-wrap {
  position: relative;
  background: radial-gradient(ellipse at 50% 30%, #262019 0%, #151210 75%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.pk-felt {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9.5;
  max-height: 560px;
  border-radius: 46% / 58%;
  background:
    radial-gradient(ellipse at 50% 38%, #2f7d4f 0%, #226440 55%, #1a5434 100%);
  box-shadow:
    inset 0 0 0 10px #3a2c22,            /* wooden rail */
    inset 0 0 0 12px #57412f,
    inset 0 0 60px rgba(0, 0, 0, .55),
    0 18px 40px rgba(0, 0, 0, .5);
}
.pk-table-wrap.idle .pk-felt { aspect-ratio: 16 / 7; max-height: 300px; }
.pk-felt-cta {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; pointer-events: none; text-shadow: 0 2px 6px #0009;
}
.pk-felt-cta b { color: #dff3e6; font-size: 1.25rem; letter-spacing: .03em; }
.pk-felt-cta span { color: #dff3e699; font-size: .85rem; }

.pk-felt::after {                          /* inner ring like the Stars felt */
  content: "";
  position: absolute; inset: 9%;
  border-radius: 46% / 58%;
  border: 2px solid rgba(255, 255, 255, .07);
  pointer-events: none;
}

.pk-center {
  position: absolute; left: 50%; top: 44%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 6; pointer-events: none;   /* community cards always paint above seats */
}
.pk-pot { color: #dff3e6; font-size: .95rem; font-weight: 600; text-shadow: 0 1px 3px #0009; min-height: 1.3em; }
.pk-board { display: flex; gap: 6px; min-height: 66px; }

/* ── cards ─────────────────────────────────────────────────────────── */
.pk-card {
  width: 46px; height: 64px; border-radius: 6px;
  background: #fdfdf8; color: #16181d;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; line-height: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .45);
}
.pk-card .rank { font-size: 1.25rem; }
.pk-card .suit { font-size: 1.05rem; }
.pk-card.red { color: #c62828; }
.pk-card.back {
  background:
    repeating-linear-gradient(45deg, #5a3fd4 0 6px, #4c33b8 6px 12px);
  border: 3px solid #fdfdf8;
}
.pk-cards { display: flex; gap: 4px; justify-content: center; min-height: 50px; }
.pk-cards .pk-card { width: 36px; height: 50px; border-radius: 5px; }
.pk-cards .pk-card .rank { font-size: 1rem; }
.pk-cards .pk-card .suit { font-size: .85rem; }

/* ── seats ─────────────────────────────────────────────────────────── */
.pk-seat {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: opacity .25s;
}
.pk-seat.folded { opacity: .38; }
.s-bottom   { left: 50%;  top: 88%; }
.s-left     { left: 11%;  top: 62%; }
.s-topleft  { left: 16%;  top: 22%; }
.s-top      { left: 50%;  top: 10%; }
.s-topright { left: 84%;  top: 22%; }
.s-right    { left: 89%;  top: 62%; }

.pk-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(12, 10, 16, .92);
  border: 1px solid #000;
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5);
  position: relative;
  white-space: nowrap;
}
.pk-seat.acting .pk-pill {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, .55), 0 0 18px rgba(201, 162, 39, .45);
}
.pk-seat.winner .pk-pill {
  border-color: #58d68d;
  box-shadow: 0 0 0 2px rgba(88, 214, 141, .6), 0 0 22px rgba(88, 214, 141, .5);
}
.pk-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #2a2438; display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.pk-who { display: flex; flex-direction: column; line-height: 1.15; }
.pk-name { font-size: .82rem; font-weight: 700; color: var(--ink); }
.pk-name .pk-skill { color: var(--muted); font-style: normal; font-weight: 500; font-size: .72rem; }
.pk-stack { font-size: .8rem; color: var(--accent); font-weight: 600; }

.pk-btn-disc {
  position: absolute; right: -10px; top: -8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fdfdf8; color: #16181d;
  font-size: .68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px #000a;
}

.pk-bet-chip {
  background: rgba(0, 0, 0, .55);
  border: 1px solid rgba(255, 255, 255, .15);
  color: #ffe9a8;
  font-size: .78rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
  margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
.pk-bet-chip .pk-chip { width: 12px; height: 12px; }
.pk-bet-chip .pk-col .pk-chip + .pk-chip { margin-bottom: -9px; }
/* physical chip piles: one column per denomination, chips overlap upward */
.pk-pile { display: inline-flex; gap: 3px; align-items: flex-end; }
.pk-col { display: flex; flex-direction: column-reverse; position: relative; }
/* tall stacks compress: less of each chip shows the deeper the column */
.pk-pot-pile .pk-chip { width: 11px; height: 11px; border-width: 1.5px; }
.pk-pot-pile .pk-col .pk-chip + .pk-chip { margin-bottom: -9px; }
.pk-chip {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, .55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .55);
  box-sizing: border-box; flex: none;
}
.pk-col .pk-chip + .pk-chip { margin-bottom: -10px; }

/* the pot's pile under the pot label */
.pk-pot-pile { min-height: 16px; display: flex; justify-content: center; }

/* small pile beside each player's pill = their stack */
.pk-pillrow { display: flex; align-items: center; gap: 5px; }
.pk-stack-pile .pk-chip { width: 10px; height: 10px; border-width: 1.5px; }
.pk-stack-pile .pk-col .pk-chip + .pk-chip { margin-bottom: -7px; }

/* staging pile while sizing a raise */
.pk-raise-preview {
  position: absolute; left: 63%; top: 79%;
  display: flex; align-items: center; gap: 7px;
  background: rgba(0, 0, 0, .5); border: 1px dashed rgba(255, 255, 255, .35);
  border-radius: 999px; padding: 4px 12px;
  color: #ffe9a8; font-size: .82rem; font-weight: 700;
  z-index: 20; pointer-events: none;
}
.pk-raise-preview span { color: var(--muted); font-size: .68rem; font-weight: 500; }
@keyframes chip-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.pk-bet-chip.pop { animation: chip-pop .25s ease-out; }
.pk-chip-fly {
  position: absolute; z-index: 30; width: 16px; height: 16px; border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, .55); box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .5); pointer-events: none;
  transition: left .55s cubic-bezier(.4, 0, .6, 1), top .55s cubic-bezier(.4, 0, .6, 1), opacity .55s;
}
@keyframes pot-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); } }
.pk-pot.pulse { animation: pot-pulse .45s ease-out; }
.pk-card.ghost { opacity: .55; outline: 2px dashed rgba(255, 255, 255, .5); outline-offset: -2px; }
/* bets sit between the pill and the table center */
.s-bottom   .pk-bet-chip { order: -1; margin-bottom: 4px; }
.s-top      .pk-cards, .s-topleft .pk-cards, .s-topright .pk-cards,
.s-left     .pk-cards, .s-right   .pk-cards { order: 2; }
.s-top      .pk-bet-chip, .s-topleft .pk-bet-chip, .s-topright .pk-bet-chip,
.s-left     .pk-bet-chip, .s-right  .pk-bet-chip { order: 3; }
.s-top      .pk-handlabel, .s-topleft .pk-handlabel, .s-topright .pk-handlabel,
.s-left     .pk-handlabel, .s-right  .pk-handlabel { order: 4; }

.pk-handlabel {
  background: rgba(0, 0, 0, .68); color: #9fe3b9;
  font-size: .68rem; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; margin-top: 2px;
  white-space: nowrap;
}

/* ── status strip + action bar ─────────────────────────────────────── */
.pk-strip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 10px; flex-wrap: wrap;
}
.pk-hero-hand { color: #9fe3b9; font-weight: 600; min-height: 1.3em; }
.pk-strip-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.pk-session { color: var(--muted); font-size: .85rem; }
#pk-next { font-weight: 700; }

.pk-actionbar {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px;
}
.pk-actionbar button { font-weight: 700; }
.pk-bar-hand { display: none; }
#pk-btn-fold  { background: #6a2330; color: #ffd9df; }
#pk-btn-check, #pk-btn-call { background: #2e7d32; color: #eafff0; }
#pk-btn-raise { background: var(--accent); }
.pk-raise-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pk-raise-group input[type="range"] { width: 140px; }
.pk-raise-group input[type="number"] { width: 90px; padding: 8px 10px; }
.pk-presets { display: flex; gap: 4px; }
.pk-presets button {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-size: .75rem; padding: 5px 8px; border-radius: 7px; font-weight: 600;
}
.pk-presets button:hover { color: var(--ink); background: #ffffff10; filter: none; }

/* ── setup + log ───────────────────────────────────────────────────── */
.pk-setup {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 12px 0;
}
.pk-setup label { color: var(--muted); font-size: .9rem; }
.pk-setup select {
  font: inherit; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
}
.pk-setup #pk-deal { margin-left: auto; font-weight: 700; }
@media (max-width: 700px) { .pk-setup #pk-deal { margin-left: 0; width: 100%; } }
.pk-log {
  margin-top: 12px; background: #00000045; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
  height: 150px; overflow-y: auto;
  font-family: ui-monospace, monospace; font-size: .78rem; color: var(--muted);
}
.pk-log div { padding: 1px 0; }

/* ── probability side panel ────────────────────────────────────────── */
.pk-prob-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pk-prob-head h2 { margin: 0; font-size: 1.05rem; }
.pk-prob { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.pk-odds-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .88rem;
}
.pk-odds-row span { color: var(--muted); flex: 1 1 auto; min-width: 0; }
.pk-odds-row b { flex: 0 0 auto; white-space: nowrap; text-align: right; }
.pk-odds-row .pk-sub {
  display: block; font-style: normal; color: var(--muted);
  font-size: .74rem; opacity: .75;
}
.pk-odds-row b.good, .pk-verdict.good { color: #58d68d; }
.pk-odds-row b.bad,  .pk-verdict.bad  { color: var(--err); }
.pk-verdict { margin-top: 8px; font-size: .85rem; font-weight: 600; }
.pk-inline-card {
  background: #fdfdf8; color: #16181d; border-radius: 4px;
  padding: 1px 5px; font-weight: 800; font-size: .85rem;
}
.pk-inline-card.red { color: #c62828; }
.pk-hint { color: var(--muted); font-size: .85rem; }

/* mode toggle: Study (absolute odds) ⇄ My hand (mapped to the live situation) */
.pk-mode {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin: 14px 0 4px;
  border: 1px solid var(--line); border-radius: 9px; overflow: hidden;
}
.pk-mode button {
  background: transparent; border: none; border-radius: 0;
  color: var(--muted); font-size: .8rem; font-weight: 700; padding: 7px 0;
}
.pk-mode button + button { border-left: 1px solid var(--line); }
.pk-mode button:hover { filter: none; color: var(--ink); background: #ffffff0a; }
.pk-mode button.active { background: rgba(201, 162, 39, .16); color: var(--accent); }
.pk-mode-note { font-size: .75rem; color: var(--muted); margin: 2px 0 8px; }

/* tabs: equal-width grid — they can never rag onto a lonely second row */
.pk-tabs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 4px 0 8px;
}
.pk-tab {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-size: .74rem; padding: 6px 2px; border-radius: 7px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pk-tab.active { color: var(--accent); border-color: var(--accent); background: rgba(201,162,39,.1); }
.pk-tab:hover { filter: none; color: var(--ink); }

/* tables: fixed layout, numeric columns right-aligned in tabular figures, zebra rows */
.pk-tabpane table { width: 100%; border-collapse: collapse; font-size: .82rem; table-layout: fixed; }
.pk-tabpane th, .pk-tabpane td {
  text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis;
}
.pk-tabpane th:first-child, .pk-tabpane td:first-child { width: 44%; }
.pk-tabpane th:not(:first-child), .pk-tabpane td:not(:first-child) {
  text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pk-tabpane thead th { color: var(--muted); font-weight: 600; font-size: .76rem; }
.pk-tabpane tbody tr:nth-child(odd) { background: #ffffff05; }
.pk-tabpane .pk-dim { color: var(--muted); font-size: .72rem; display: block; line-height: 1.25; }
.pk-tabpane h3 { font-size: .9rem; margin: 2px 0 2px; }
.pk-tabpane p { font-size: .82rem; color: var(--muted); margin: 6px 0; }

/* "map my hand" highlights */
.pk-tabpane tr.hl { background: rgba(201, 162, 39, .16) !important; }
.pk-tabpane tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--accent); color: var(--ink); }
.pk-tabpane td.hl { color: var(--accent); font-weight: 700; }
.pk-you-note {
  background: rgba(201, 162, 39, .1); border: 1px solid rgba(201, 162, 39, .35);
  border-radius: 7px; padding: 5px 8px !important;
  color: var(--ink) !important; font-size: .78rem !important;
}
.pk-tier { padding: 6px 8px; border-left: 3px solid transparent; border-radius: 4px; margin: 2px 0; }
.pk-tier.hl { border-left-color: var(--accent); background: rgba(201, 162, 39, .1); }
.pk-prob.study .live-col { display: none; }
.pk-prob.study .live-only { display: none; }
.pk-prob:not(.study) .study-only { display: none; }
.pk-prob:not(.study) .study-col { display: none; }
.pk-prob:not(.study) .pk-tier:not(.hl) { opacity: .35; }
.live-only .pk-you-note { display: block; margin: 6px 0; }

/* suggested play (My-hand mode only) */
.pk-prob.study .live-only { display: none; }
.pk-rec {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px;
  margin-top: 10px; padding: 8px 10px;
  background: #00000040; border: 1px solid var(--line); border-radius: 8px;
  font-size: .85rem;
}
.pk-rec span { color: var(--muted); }
.pk-rec b {
  padding: 2px 10px; border-radius: 999px; font-size: .8rem;
}
.pk-rec b.rec-raise { background: var(--accent); color: #1a1300; }
.pk-rec b.rec-check { background: #2e7d32; color: #eafff0; }
.pk-rec b.rec-fold  { background: #6a2330; color: #ffd9df; }
.pk-rec i { font-style: normal; color: var(--muted); font-size: .78rem; grid-column: 1 / -1; }
.pk-rec .pk-size, .pk-rec .pk-alt {
  border-top: 1px dashed var(--line); padding-top: 5px; line-height: 1.4;
}
.pk-rec .pk-size b, .pk-rec .pk-alt b {
  background: none; padding: 0; border-radius: 0; color: var(--ink);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
}

/* reads-from-the-betting addendum under the suggested play */
.pk-read {
  margin-top: 8px; padding: 8px 10px;
  background: #00000040; border: 1px solid var(--line); border-radius: 8px;
  font-size: .8rem;
}
.pk-read span {
  color: var(--ink); font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.pk-read ul { margin: 5px 0 0; padding-left: 16px; color: var(--muted); }
.pk-read li { margin: 3px 0; line-height: 1.4; }
.pk-read .pk-read-rec {
  display: block; font-style: normal; margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed var(--line);
  color: var(--accent); font-size: .78rem; font-weight: 600;
}

/* lifetime stats line under the log */
.pk-stats {
  margin-top: 8px; color: var(--muted); font-size: .8rem; line-height: 1.5;
}
.pk-stats b { color: var(--ink); }
.pk-stats a { color: var(--muted); font-size: .72rem; margin-left: 6px; }

/* live equity bar */
.pk-eqbar {
  height: 7px; border-radius: 4px; background: #00000055;
  border: 1px solid var(--line); overflow: hidden; margin: 6px 0 2px;
}
.pk-eqbar i {
  display: block; height: 100%; background: var(--accent);
  border-radius: 3px; transition: width .3s;
}
.pk-eqbar i.good { background: #58d68d; }
.pk-eqbar i.bad { background: var(--err); }

/* 13×13 preflop chart: pairs diagonal, suited upper-right, offsuit lower-left */
.pk-grid169 {
  display: grid; grid-template-columns: repeat(13, 1fr); gap: 1px;
  margin: 8px 0 6px; user-select: none;
}
.pk-c {
  font-size: .52rem; font-weight: 700; line-height: 1;
  text-align: center; padding: 4px 0; border-radius: 2px; cursor: pointer;
  letter-spacing: -.02em;
}
.pk-c.t-premium  { background: var(--accent); color: #1a1300; }
.pk-c.t-strong   { background: #2e7d32; color: #eafff0; }
.pk-c.t-playable { background: #2f6f8f; color: #e8f6ff; }
.pk-c.t-fold     { background: #262019; color: #6f665b; }
.pk-c:hover { filter: brightness(1.25); }
.pk-c.sel { outline: 2px solid var(--ink); outline-offset: -1px; }
.pk-c.me {
  outline: 2px solid #fff; outline-offset: -1px;
  box-shadow: 0 0 8px rgba(255, 255, 255, .8); z-index: 1; position: relative;
}
.pk-legend {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-size: .72rem; color: var(--muted); margin: 4px 0 2px;
}
.pk-legend i {
  display: inline-block; width: 9px; height: 9px; border-radius: 2px;
  margin-right: 4px; vertical-align: -1px;
}
.pk-legend .lg-premium  { background: var(--accent); }
.pk-legend .lg-strong   { background: #2e7d32; }
.pk-legend .lg-playable { background: #2f6f8f; }
.pk-legend .lg-fold     { background: #262019; border: 1px solid var(--line); }
.pk-grid-info { min-height: 2.4em; }

.pk-learn-toggle { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }

.hidden { display: none !important; }


/* ── mobile: playable on a phone ───────────────────────────────────── */
button, .pk-tab, .pk-presets button, .pk-mode button { touch-action: manipulation; }

@media (max-width: 700px) {
  .pk-page h1 { font-size: 1.3rem; margin-top: 4px; }
  .pk-page .sub { font-size: .82rem; margin: 2px 0 10px; }
  /* setup: clean 2-column grid, labels above controls */
  .pk-setup { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  .pk-setup > label { display: flex; flex-direction: column; gap: 4px; font-size: .7rem;
    text-transform: uppercase; letter-spacing: .04em; }
  .pk-setup select { width: 100%; max-width: none; padding: 10px 8px; font-size: 16px; }
  .pk-setup .pk-learn-toggle { flex-direction: row; align-items: center; gap: 7px;
    font-size: .8rem; text-transform: none; letter-spacing: 0; }
  .pk-setup #pk-deal { grid-column: 1 / -1; width: 100%; min-height: 46px; }
  .pk-table-wrap.idle .pk-felt { aspect-ratio: 16 / 9; max-height: 220px; }

  .pk-table-wrap { padding: 8px; border-radius: 12px; }
  /* portrait oval, like mobile poker clients */
  .pk-felt { aspect-ratio: 3 / 3.9; max-height: none; border-radius: 48% / 40%; }
  .pk-felt::after { border-radius: 48% / 40%; }
  .s-bottom   { top: 90%; }
  .s-left     { left: 12%; top: 65%; }
  .s-topleft  { left: 13%; top: 26%; }
  .s-top      { top: 9%; }
  .s-topright { left: 87%; top: 26%; }
  .s-right    { left: 88%; top: 65%; }
  .pk-board { gap: 3px; }

  .pk-card { width: 35px; height: 49px; border-radius: 4px; }
  .pk-card .rank { font-size: .92rem; }
  .pk-card .suit { font-size: .8rem; }
  .pk-cards { min-height: 40px; gap: 3px; }
  .pk-cards .pk-card { width: 28px; height: 39px; border-radius: 3px; }
  .pk-cards .pk-card .rank { font-size: .78rem; }
  .pk-cards .pk-card .suit { font-size: .66rem; }
  .pk-board { gap: 4px; min-height: 55px; }
  .pk-center { top: 45%; }
  .pk-pot { font-size: .8rem; }

  .pk-pill { padding: 3px 9px 3px 4px; gap: 5px; }
  .pk-avatar { width: 24px; height: 24px; font-size: .85rem; }
  .pk-name { font-size: .7rem; }
  .pk-name .pk-skill { display: none; }
  .pk-stack { font-size: .68rem; }
  .pk-stack-pile { display: none; }        /* too busy at phone size */
  .pk-bet-chip { font-size: .66rem; padding: 2px 7px; gap: 4px; }
  .pk-bet-chip .pk-chip { width: 9px; height: 9px; }
  .pk-handlabel { font-size: .58rem; padding: 1px 7px; }
  .pk-btn-disc { width: 16px; height: 16px; font-size: .56rem; right: -7px; top: -6px; }
  .pk-raise-preview { left: 50%; top: 74%; transform: translateX(-50%); font-size: .7rem; padding: 3px 9px; }

  .pk-bar-hand { display: flex !important; align-items: center; gap: 6px; grid-column: 1 / -1;
    color: var(--muted); font-size: .82rem; font-weight: 600; }
  /* action bar: sticky, thumb-sized */
  .pk-actionbar {
    position: sticky; bottom: 6px; z-index: 40;
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
  }
  .pk-actionbar > button { min-height: 46px; font-size: 1rem; }
  .pk-raise-group { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr; gap: 6px; }
  #pk-btn-raise { min-height: 44px; }
  .pk-raise-group input[type="number"] { width: 100%; font-size: 16px; }  /* stops iOS zoom */
  .pk-raise-group input[type="range"] { grid-column: 1 / -1; width: 100%; margin: 2px 0 0; }
  .pk-presets { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .pk-presets button { padding: 10px 2px; font-size: .78rem; }

  .pk-strip { gap: 8px; }
  .pk-strip-right { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .pk-log { height: 110px; font-size: .7rem; }
  .pk-stats { font-size: .72rem; }
}


/* ── analytics modal ───────────────────────────────────────────────── */
.pk-modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 6, 12, .8); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 4vh 14px; overflow-y: auto;
}
.pk-modal-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  max-width: 720px; width: 100%; padding: 18px 20px; margin-bottom: 4vh;
}
.pk-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.pk-modal-head h2 { margin: 0; font-size: 1.2rem; }
#pk-analytics-body h3 { font-size: .95rem; margin: 18px 0 6px; color: var(--accent); }
#pk-analytics-body table { width: 100%; border-collapse: collapse; font-size: .85rem; }
#pk-analytics-body th, #pk-analytics-body td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); }
#pk-analytics-body th { color: var(--muted); font-weight: 600; font-size: .76rem; }
#pk-analytics-body td:not(:first-child), #pk-analytics-body th:not(:first-child) {
  text-align: right; font-variant-numeric: tabular-nums;
}
#pk-analytics-body tbody tr:nth-child(odd) { background: #ffffff05; }
#pk-analytics-body .good { color: #58d68d; }
#pk-analytics-body .bad { color: var(--err); }
#pk-analytics-body .pk-dim { color: var(--muted); font-size: .74rem; }
.pk-an-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px; margin: 10px 0;
}
.pk-an-stat {
  background: #00000040; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 8px; text-align: center;
}
.pk-an-stat b { display: block; font-size: 1.25rem; }
.pk-an-stat span { color: var(--muted); font-size: .7rem; }
.pk-an-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .pk-an-cols { grid-template-columns: 1fr; } }


/* jargon tooltips */
dfn.tip {
  font-style: normal; border-bottom: 1px dotted var(--muted);
  cursor: help; position: relative; outline: none;
}
dfn.tip:hover::after, dfn.tip:focus::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 7px);
  transform: translateX(-50%);
  width: 230px; padding: 8px 10px;
  background: #0d0a13; border: 1px solid var(--accent); border-radius: 8px;
  color: var(--ink); font-size: .74rem; font-weight: 400; line-height: 1.45;
  text-align: left; text-transform: none; letter-spacing: 0;
  z-index: 200; white-space: normal; pointer-events: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
}
dfn.tip:hover::before, dfn.tip:focus::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 2px);
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--accent); z-index: 200;
}

/* scrollable all-hands table */
.pk-an-scroll { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pk-an-scroll table { margin: 0; }
.pk-an-scroll thead th { position: sticky; top: 0; background: var(--panel); }


/* grade card */
.pk-grade { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.pk-grade-badge {
  width: 58px; height: 58px; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 800; color: #1a1300;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.pk-grade-badge.g-A { background: #58d68d; }
.pk-grade-badge.g-B { background: #a3d977; }
.pk-grade-badge.g-C { background: var(--accent); }
.pk-grade-badge.g-D { background: #e08a3c; }
.pk-grade-badge.g-F { background: #e05252; color: #fff; }
.pk-grade-info b { display: block; font-size: .95rem; }
.pk-grade-info i { color: var(--muted); font-style: normal; font-size: .78rem; }


/* EV trend bars */
.pk-evtrend {
  display: flex; align-items: flex-end; gap: 5px;
  height: 52px; padding: 2px 4px 0;
  border-bottom: 1px solid var(--line); margin-bottom: 10px;
}
.pk-evbar { width: 26px; border-radius: 3px 3px 0 0; }
.pk-evbar.good { background: #58d68d; }
.pk-evbar.mid { background: var(--accent); }
.pk-evbar.bad { background: #e05252; }
