/* 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%, #241f2e 0%, #14111a 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-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;
}
.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; }
.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-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; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .88rem;
}
.pk-odds-row span { color: var(--muted); }
.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;
}

/* 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: #241f2e; color: #6c6478; }
.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: #241f2e; 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; }
