/* ---------- Game switch ---------- */
.games { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.games button {
  border: 0; background: transparent; cursor: pointer; border-radius: 999px; padding: 6px 14px;
  font: italic 500 16px var(--f-display); color: var(--muted);
}
.games button:hover { color: var(--text); }
.games button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }

/* ---------- Oval table ---------- */
.pk-stage {
  --cw: clamp(34px, 7.2cqw, 68px);
  position: relative;
  container-type: inline-size;
  aspect-ratio: 16 / 10.4;
  max-width: 100%;
  margin-block: 16px 18px;
}
.pk-felt {
  position: absolute; inset: 12% 9% 13%;
  border-radius: 50%;
  background: radial-gradient(ellipse 80% 75% at 50% 40%, var(--felt-hi) 0%, var(--felt) 48%, var(--felt-deep) 100%);
  box-shadow:
    0 0 0 14px var(--rail), 0 0 0 15px var(--rail-hi), 0 0 0 17px #0d0605,
    0 26px 60px rgba(0,0,0,.6), inset 0 0 90px rgba(0,0,0,.45);
}
.pk-felt::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: .16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.pk-felt::after {
  content: ""; position: absolute; inset: 7%; border-radius: 50%; pointer-events: none;
  border: 1.5px solid rgba(216,178,92,.3);
}
.pk-print {
  position: absolute; left: 50%; top: 13%; translate: -50% 0;
  font: italic 500 clamp(11px, 2cqw, 17px) var(--f-display); letter-spacing: .06em;
  color: var(--gold); opacity: .72; white-space: nowrap;
}
.pk-center {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 1;
}
.pk-pot {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 2px 12px 2px 4px; border-radius: 999px; background: rgba(0,0,0,.35);
  font: 600 15px var(--f-ui); color: var(--gold-hi); font-variant-numeric: tabular-nums;
}
.pk-pot::before, .pk-bet::before {
  content: ""; width: 18px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, #1f7a4a 0 45%, transparent 46%), repeating-conic-gradient(#f3ecdd 0 18deg, #1f7a4a 18deg 60deg);
  box-shadow: inset 0 0 0 2px #1f7a4a, 0 1px 0 rgba(0,0,0,.5);
}
.pk-board { display: flex; gap: calc(var(--cw) * .1); }
.pk-board .card + .card { margin-left: 0; }
.pk-slot {
  width: var(--cw); aspect-ratio: 5 / 7; border-radius: 6px; flex: none;
  border: 1.5px dashed rgba(216,178,92,.3);
}
.pk-msg {
  min-height: 1.6em; max-width: min(92cqw, 520px); text-align: center;
  font: 600 15px/1.3 var(--f-ui); color: var(--felt-text); letter-spacing: .02em; text-wrap: balance;
}
.pk-msg:empty { visibility: hidden; }
.pk-msg b { color: var(--gold-hi); }

/* Seats */
.seat {
  position: absolute; translate: -50% -50%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: opacity .25s;
}
.seat.me { flex-direction: row; gap: 10px; }
.seat-cards { display: flex; min-height: calc(var(--cw) * 1.4); }
.seat.bot .seat-cards { --cw: clamp(24px, 4.6cqw, 44px); }
.seat.me .seat-cards { --cw: clamp(42px, 8.6cqw, 80px); }
.seat-cards .card + .card { margin-left: calc(var(--cw) * -.3); }
.seat.me .seat-cards .card + .card { margin-left: calc(var(--cw) * .06); }
.seat.bot .seat-cards { margin-bottom: calc(var(--cw) * -.5); }
.seat.bot .plate { z-index: 1; }
.seat.bot.shown .seat-cards { --cw: clamp(30px, 5.6cqw, 52px); margin-bottom: 2px; }
.seat.folded .seat-cards { visibility: hidden; }
.seat.folded .plate { opacity: .55; }
.plate {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 3px 12px 3px 3px; border-radius: 999px;
  background: rgba(22, 15, 12, .92); border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
  transition: border-color .2s, box-shadow .2s;
}
.avatar {
  width: 32px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--av, #555); color: #fff; font: italic 700 15px var(--f-display);
}
.plate-text { display: flex; flex-direction: column; line-height: 1.15; }
.plate-name { font: 600 13.5px var(--f-ui); letter-spacing: .03em; white-space: nowrap; }
.plate-stack { font: 600 13px var(--f-ui); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.plate-style { font: 500 11px var(--f-ui); color: var(--faint); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.pos-chip {
  font: 700 10.5px/1.5 var(--f-ui); letter-spacing: .08em; padding: 0 5px; border-radius: 4px;
  background: rgba(216,178,92,.18); color: var(--gold-hi);
}
.pos-chip:empty { display: none; }
.seat.acting .plate { border-color: var(--gold-hi); box-shadow: 0 0 0 3px rgba(240,210,138,.3), 0 6px 16px rgba(0,0,0,.4); }
.seat.winner .plate { border-color: var(--win); box-shadow: 0 0 0 3px rgba(131,220,164,.35), 0 6px 16px rgba(0,0,0,.4); }
.act-bubble {
  position: absolute; left: 50%; top: calc(100% + 4px); translate: -50% 0; z-index: 2;
  padding: 1px 8px; border-radius: 6px; white-space: nowrap;
  background: var(--paper); color: var(--ink);
  font: 700 11px/1.6 var(--f-ui); letter-spacing: .06em; text-transform: uppercase;
  animation: pop .2s ease-out both;
}
.act-bubble:empty { display: none; }
.act-bubble.fold { background: #5a4a40; color: #e8ddd0; }
.act-bubble.raise { background: var(--c-double); color: #fff; }
.act-bubble.win { background: var(--win); color: #06301a; }

.pk-bet {
  position: absolute; translate: -50% -50%; z-index: 1;
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 13.5px var(--f-ui); color: var(--felt-text); font-variant-numeric: tabular-nums;
  animation: pop .2s ease-out both;
}
.dealer-btn {
  position: absolute; translate: -50% -50%; z-index: 1;
  width: 24px; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: #f7f2e6; color: #1b1b1b; font: 700 11px var(--f-ui);
  box-shadow: 0 2px 0 rgba(0,0,0,.45), inset 0 0 0 2px #d9cfb9;
  transition: left .45s ease, top .45s ease;
}
.card.win-card .card-face { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 16px rgba(240,210,138,.65); }
.card.dim { filter: brightness(.5) saturate(.6); transition: filter .3s; }

/* Sizer */
.pk-sizer { gap: 8px 12px; }
.btn.sm { min-height: 34px; padding: 5px 10px; font-size: 13px; }
#pkSlider { width: min(280px, 70vw); accent-color: var(--gold); }

/* Side panel pieces */
.pk-hand-name { margin: 0; font: 500 21px/1.2 var(--f-display); text-wrap: balance; }
.pk-hand-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.pk-hand-sub:empty { display: none; }
.pk-draws { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.pk-draws:empty { display: none; }
.pk-draws li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.pk-draws li b { font: 600 14px var(--f-ui); color: var(--gold-hi); white-space: nowrap; }
.pk-draws li.soft { color: var(--faint); }
.meter-wrap { margin-top: 12px; }
.meter-labels { display: flex; justify-content: space-between; gap: 8px; font: 600 12.5px var(--f-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.meter-labels b { color: var(--text); font-size: 15px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.meter { position: relative; height: 12px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.meter-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--c-hit); transition: width .4s ease, background .3s; }
.meter-fill.short { background: var(--c-surr); }
.meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--paper); border-radius: 2px; transition: left .4s ease; }
.pk-log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; color: var(--muted); }
.pk-log li b { color: var(--text); font-weight: 600; }
.pk-log li.street { margin-top: 4px; font: 600 12px var(--f-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.pk-log li.street:first-child { margin-top: 0; }
.pk-log li.win { color: var(--win); }

/* ---------- Hold'em drills ---------- */
.pk-drill { --cw: clamp(46px, 11vw, 78px); }
.sd-row { display: flex; flex-wrap: wrap; gap: 18px 34px; justify-content: center; align-items: flex-start; }
.sd-player, .sd-board { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sd-cards { display: flex; gap: 6px; }
.sd-cards .card + .card { margin-left: 0; }
.sd-name { min-height: 1.4em; font: 600 15px var(--f-ui); text-align: center; max-width: 18ch; text-wrap: balance; }
.sd-name.good { color: var(--win); }
.po-facts { display: flex; flex-wrap: wrap; gap: 14px 36px; justify-content: center; }
.po-facts > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.po-v { font: 700 38px/1 var(--f-display); color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.po-v.sm { font: 600 18px/2.1 var(--f-ui); color: var(--felt-text); }

/* ---------- Hold'em learn ---------- */
.ladder { list-style: none; margin: 0; padding: 0; display: grid; }
.ladder li {
  display: grid; grid-template-columns: 28px minmax(180px, 1fr) auto; gap: 6px 16px; align-items: center;
  padding-block: 10px; border-bottom: 1px solid var(--line);
}
.ladder .rank-no { font: italic 700 20px var(--f-display); color: var(--gold); }
.ladder .rank-name { font: 600 17px var(--f-ui); letter-spacing: .02em; }
.ladder .rank-desc { display: block; font: 400 13.5px var(--f-body); color: var(--muted); }
.ladder .rank-odds { display: block; font: 600 12.5px var(--f-ui); color: var(--faint); letter-spacing: .04em; margin-top: 2px; }
.ladder-cards { display: flex; gap: 4px; --cw: 38px; }
.ladder-cards .card + .card { margin-left: 0; }
.ladder-cards .card.dim { filter: brightness(.45) saturate(.5); }
.matrix { display: grid; grid-template-columns: repeat(13, minmax(30px, 1fr)); gap: 2px; min-width: 430px; max-width: 640px; }
.mx {
  aspect-ratio: 1; border: 0; border-radius: 3px; padding: 0; cursor: pointer;
  font: 600 11.5px var(--f-ui); letter-spacing: -.01em;
  background: var(--panel-2); color: var(--faint);
}
.mx.in { color: #fff; }
.mx.p-UTG { background: #7a2f25; }
.mx.p-HJ { background: #a8543a; }
.mx.p-CO { background: #b98a3e; color: #2a1e05; }
.mx.p-SB { background: #5f8f6e; }
.mx.p-BTN { background: #3e6f86; }
.mx.faded { opacity: .28; }
.mx.sel { outline: 2px solid var(--paper); outline-offset: 1px; }
.mx:hover { filter: brightness(1.18); }
.seg button .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.formula {
  font: italic 500 22px var(--f-display); color: var(--gold-hi);
  padding: 10px 16px; border-left: 2px solid var(--gold); background: var(--panel); border-radius: 0 8px 8px 0; width: fit-content;
}
.pay .num { font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .games button { padding: 5px 11px; font-size: 15px; }
  .pk-stage { aspect-ratio: 1 / 1.12; --cw: clamp(30px, 9.4cqw, 44px); }
  .pk-felt { inset: 13% 11% 16%; box-shadow: 0 0 0 9px var(--rail), 0 0 0 10px var(--rail-hi), 0 0 0 11px #0d0605, 0 18px 40px rgba(0,0,0,.6), inset 0 0 60px rgba(0,0,0,.45); }
  .pk-print { top: 9%; }
  .pk-board { gap: 3px; }
  .seat.me { flex-direction: column; gap: 4px; }
  .seat.bot .seat-cards { --cw: 24px; }
  .seat.me .seat-cards { --cw: 48px; }
  .plate { padding-right: 8px; gap: 5px; }
  .avatar { width: 24px; font-size: 12px; }
  .plate-name { font-size: 11.5px; }
  .plate-stack { font-size: 11.5px; }
  .plate-style { display: none; }
  .pk-msg { font-size: 13px; }
  .pk-bet { font-size: 12px; }
  .pk-pot { font-size: 13px; }
  .ladder li { grid-template-columns: 24px 1fr; }
  .ladder-cards { grid-column: 2; --cw: 32px; }
  .sd-cards { gap: 4px; }
}
