/* Texas Hold'em table. Server-rendered, no JavaScript. */

.pk {
  --felt-1: #2a7195;
  --felt-2: #1b5476;
  --felt-3: #0f3450;
  --rail: #0d1524;
  --rail-hi: #2a3a58;
  --wood: #6b4a2e;
  --card: #fdfcf9;
  --s-s: #15233f;
  --s-h: #c62828;
  --s-d: #1c56b8;
  --s-c: #1f7a44;
}

.pk-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  margin-bottom: 14px;
}
.pk-top h1 {
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
  margin: 0;
  line-height: 1;
}
.pk-top .pk-bank {
  flex: 1 1 340px;
  min-width: 0;
  margin: 0;
}
.pk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 18px;
}
.pk-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin: 0;
}
.pk-head p {
  margin: 0;
  color: var(--ink-soft);
}

/* ---------- Bankroll strip ---------- */

.pk-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  padding: 10px 18px;
  margin-bottom: 14px;
}
.pk-bank dl {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
  margin: 0;
}
.pk-bank dl div {
  display: flex;
  flex-direction: column-reverse;
}
.pk-bank dt {
  font-size: 0.82rem;
  color: var(--ink-faint);
}
.pk-bank dd {
  margin: 0;
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.pk-bonus {
  margin: 0 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  max-width: 34ch;
  line-height: 1.3;
}
.pk-bonus-chip {
  display: inline-grid;
  place-items: center;
  width: 2.1em;
  height: 2.1em;
  border-radius: 50%;
  background: #e0a526;
  border: 0.24em dashed #fff;
  box-shadow: 0 0 0 1.5px #b07e12;
  flex: none;
}
.pk-bonus b {
  color: var(--ok);
}

/* ---------- Room and table ---------- */

.pk-room {
  background: radial-gradient(120% 90% at 50% 0%, #243554 0%, #15233f 55%, #0e182c 100%);
  border-radius: 16px;
  padding: clamp(10px, 2vw, 20px) clamp(8px, 2.4vw, 26px) 0;
  color: #fff;
  overflow: hidden;
}

.pk-table {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 2.25 / 1;
  max-width: 1040px;
  margin: 0 auto;
}
.pk-rail {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--rail-hi) 0%, var(--rail) 22%, var(--rail) 78%, #05080f 100%);
  box-shadow: 0 1.6cqw 3.2cqw rgba(0, 0, 0, 0.55), inset 0 0.2cqw 0 rgba(255, 255, 255, 0.12);
  padding: 1.9cqw;
}
.pk-felt {
  position: absolute;
  inset: 1.9cqw;
  border-radius: 999px;
  border: 0.9cqw solid var(--wood);
  background: radial-gradient(ellipse at 50% 45%, var(--felt-1) 0%, var(--felt-2) 52%, var(--felt-3) 100%);
  box-shadow: inset 0 0 0 0.18cqw rgba(255, 214, 150, 0.35), inset 0 0 5cqw rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.pk-felt::before {
  /* the betting line */
  content: '';
  position: absolute;
  inset: 13% 9%;
  border-radius: 999px;
  border: 0.2cqw solid rgba(255, 255, 255, 0.13);
}
.pk-felt-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 58%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  opacity: 0.17;
  color: #fff;
  font-weight: 850;
  font-size: 1.9cqw;
  letter-spacing: -0.02em;
  white-space: nowrap;
  pointer-events: none;
}
.pk-felt-mark svg {
  width: 5.2cqw;
  height: 5.2cqw;
}
.pk-felt-mark svg circle:first-child {
  fill: none;
}

/* ---------- Cards ---------- */

.pk-card {
  --w: clamp(34px, 5.6cqw, 62px);
  position: relative;
  display: inline-block;
  width: var(--w);
  height: calc(var(--w) * 1.4);
  border-radius: calc(var(--w) * 0.1);
  background: var(--card);
  box-shadow: 0 0.15em 0.4em rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(21, 35, 63, 0.16);
  font-family: var(--font);
  line-height: 1;
  vertical-align: top;
  flex: none;
}
.pk-card.pk-lg {
  --w: clamp(38px, 6.2cqw, 68px);
}
.pk-card.pk-sm {
  --w: 26px;
  border-radius: 4px;
}
.pk-s-s {
  color: var(--s-s);
}
.pk-s-h {
  color: var(--s-h);
}
.pk-s-d {
  color: var(--s-d);
}
.pk-s-c {
  color: var(--s-c);
}
.pk-idx {
  position: absolute;
  left: 9%;
  top: 7%;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 34%;
}
.pk-idx b {
  font-weight: 850;
  font-size: calc(var(--w) * 0.42);
  letter-spacing: -0.07em;
  margin-left: -0.07em;
}
.pk-idx i {
  font-style: normal;
  font-size: calc(var(--w) * 0.3);
  margin-top: 0.04em;
}
.pk-pip {
  position: absolute;
  right: 8%;
  bottom: 5%;
  font-size: calc(var(--w) * 0.62);
}
.pk-sm .pk-pip {
  display: none;
}
.pk-sm .pk-idx {
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}
.pk-sm .pk-idx b {
  font-size: 13px;
}
.pk-sm .pk-idx i {
  font-size: 11px;
}
.pk-back {
  background-color: #b81f17;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 0 2px, transparent 2px 7px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 0 2px, transparent 2px 7px);
  box-shadow: 0 0.15em 0.4em rgba(0, 0, 0, 0.45), inset 0 0 0 calc(var(--w) * 0.06) var(--card);
}
.pk-back::after {
  content: '';
  position: absolute;
  inset: 28% 16%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Ccircle cx='24' cy='24' r='20.5' fill='%23fff' stroke='%23d42a20' stroke-width='5'/%3E%3Cg fill='%2315233f'%3E%3Ccircle cx='24' cy='13.8' r='3.7'/%3E%3Cpath d='M17.6 21.2c0-1.5 1.2-2.7 2.7-2.7h7.4c1.5 0 2.7 1.2 2.7 2.7v9.4h-2.8v8.2h-7.2v-8.2h-2.8z'/%3E%3C/g%3E%3Cpath d='M10.2 10.2 37.8 37.8' stroke='%23d42a20' stroke-width='5'/%3E%3C/svg%3E")
    center / contain no-repeat;
  border-radius: 50%;
  box-shadow: 0 0 0 calc(var(--w) * 0.03) #fff;
}
.pk-slot {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 0.16cqw rgba(255, 255, 255, 0.2);
}
.pk-cards {
  display: flex;
  gap: 0.6cqw;
}
.pk-hole .pk-card:first-child {
  transform: rotate(-4deg);
}
.pk-hole .pk-card:nth-child(2) {
  margin-left: -1.4cqw;
  transform: rotate(4deg) translateY(0.25cqw);
}
.pk-winner-cards .pk-card {
  box-shadow: 0 0 0 0.3cqw #ffd76a, 0 0.15em 0.4em rgba(0, 0, 0, 0.45);
}
.pk-folded {
  opacity: 0.45;
  filter: grayscale(0.4);
}

/* ---------- Seats ---------- */

.pk-seat {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 1.4cqw;
  z-index: 2;
  /* center the hole cards on the table axis; the plate hangs to the right */
  transform: translateX(calc(-1 * clamp(38px, 6.2cqw, 68px) * 0.9));
}
.pk-seat-top {
  top: 7.5%;
}
.pk-seat-bottom {
  bottom: 7.5%;
}
.pk-plate {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9cqw;
  padding: 0.6cqw 2cqw 0.6cqw 0.6cqw;
  min-width: 15cqw;
  background: linear-gradient(180deg, #1f3053, #0f192d);
  border: 0.18cqw solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  box-shadow: 0 0.5cqw 1.2cqw rgba(0, 0, 0, 0.45);
}
.pk-plate img {
  width: clamp(26px, 4cqw, 44px);
  height: clamp(26px, 4cqw, 44px);
  border-radius: 50%;
  border: 0.18cqw solid #fff;
  object-fit: cover;
  background: #fff;
  flex: none;
}
.pk-plate-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.pk-name {
  font-weight: 650;
  font-size: clamp(11px, 1.45cqw, 16px);
  color: #cfdbef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 18cqw;
}
.pk-stack {
  font-weight: 850;
  font-size: clamp(13px, 1.95cqw, 21px);
  font-variant-numeric: tabular-nums;
}
.pk-turn .pk-plate {
  border-color: #8fc0ff;
  box-shadow: 0 0 0 0.35cqw rgba(143, 192, 255, 0.35), 0 0.5cqw 1.2cqw rgba(0, 0, 0, 0.45);
}
.pk-tag {
  position: absolute;
  left: calc(100% + 1.1cqw);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
  font-size: clamp(10px, 1.35cqw, 15px);
  padding: 0.45cqw 1cqw 0.3cqw;
  border-radius: 0.7cqw;
  box-shadow: 0 0.3cqw 0.8cqw rgba(0, 0, 0, 0.4);
}
.pk-tag::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 0.55cqw solid transparent;
  border-right-color: #fff;
}
.pk-tag-turn {
  background: #8fc0ff;
}
.pk-tag-turn::before {
  border-right-color: #8fc0ff;
}

.pk-dealer {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: clamp(18px, 2.7cqw, 30px);
  height: clamp(18px, 2.7cqw, 30px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #eceff4 65%, #c5ccd7 100%);
  color: var(--ink);
  font-weight: 900;
  font-size: clamp(10px, 1.5cqw, 16px);
  box-shadow: 0 0.3cqw 0.6cqw rgba(0, 0, 0, 0.5), inset 0 -0.2cqw 0 rgba(0, 0, 0, 0.15);
  padding-top: 0.2cqw;
}
.pk-dealer-top {
  left: 38%;
  top: 15%;
}
.pk-dealer-bottom {
  left: 38%;
  bottom: 15%;
}

/* ---------- Chips, bets, pot ---------- */

.pk-bet {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.7cqw;
  z-index: 2;
}
.pk-bet {
  left: 61%;
  transform: none;
}
.pk-bet-top {
  top: 29%;
}
.pk-bet-bottom {
  bottom: 29%;
}
.pk-amount,
.pk-pot-label {
  font-weight: 800;
  font-size: clamp(11px, 1.55cqw, 17px);
  font-variant-numeric: tabular-nums;
  background: rgba(4, 12, 26, 0.5);
  padding: 0.35cqw 1cqw 0.2cqw;
  border-radius: 999px;
  white-space: nowrap;
}
.pk-chips {
  display: inline-flex;
  align-items: center;
}
.pk-chip {
  --c: #c62828;
  width: clamp(14px, 2.2cqw, 24px);
  height: clamp(14px, 2.2cqw, 24px);
  border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0 52%, rgba(255, 255, 255, 0.9) 52% 58%, var(--c) 58%);
  border: clamp(2px, 0.36cqw, 4px) dashed rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 0.25cqw 0 rgba(0, 0, 0, 0.35);
  flex: none;
}
.pk-chip + .pk-chip {
  margin-left: clamp(-10px, -1.3cqw, -6px);
}
.pk-pot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}
.pk-pot-row {
  position: absolute;
  bottom: calc(100% + 1.4cqw);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.7cqw;
}
.pk-result {
  position: absolute;
  top: calc(100% + 1.6cqw);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: var(--ink);
  font-weight: 750;
  font-size: clamp(11px, 1.55cqw, 17px);
  padding: 0.7cqw 1.6cqw 0.5cqw;
  border-radius: 999px;
  box-shadow: 0 0.4cqw 1.2cqw rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}
.pk-result-win {
  box-shadow: 0 0 0 0.3cqw #ffd76a, 0 0.4cqw 1.2cqw rgba(0, 0, 0, 0.45);
}

/* ---------- Action bar ---------- */

.pk-actions {
  max-width: 1040px;
  margin: clamp(12px, 2vw, 22px) auto 0;
  padding: 14px clamp(10px, 2vw, 20px) 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
}
.pk-actions form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}
.pk-actions .btn {
  border-color: #fff;
}
.pk-actions .btn:not(.btn-primary) {
  background: transparent;
  color: #fff;
}
.pk-actions .btn:not(.btn-primary):hover {
  background: rgba(255, 255, 255, 0.12);
}
.pk-actions .btn-primary {
  background: #fff;
  color: var(--ink);
}
.pk-actions .btn-primary:hover {
  background: #dfe7f5;
  color: var(--ink);
}
.pk-actions .pk-fold {
  border-color: #ff9b93;
  color: #ffd3cf !important;
}
.pk-status-line {
  font-size: 1rem;
  color: #dfe7f5;
}
.pk-status-line b {
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.pk-raise {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.pk-raise label {
  font-weight: 700;
  font-size: 0.95rem;
}
.pk-raise input[type='number'] {
  width: 7.5em;
  padding: 9px 10px;
  background: #0b1322;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}
.pk-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pk-actions .pk-presets .btn {
  border-color: rgba(255, 255, 255, 0.45);
}
.pk-wait {
  color: #dfe7f5;
}

/* ---------- Below the table ---------- */

.pk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .pk-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.pk-text {
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.6;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  padding: 14px 16px;
  margin: 0 0 16px;
}
.pk-log {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.95rem;
}
.pk-log li {
  margin: 2px 0;
}
.pk-lobby {
  margin-top: clamp(24px, 4vw, 40px);
}
.pk-stakes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.pk-stake {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-control);
  padding: 16px 18px;
}
.pk-stake h3 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}
.pk-stake p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.pk-stake form {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}
.pk-stake input {
  width: 8.5em;
}
.pk-mini-cards {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}
.pk-net-pos {
  color: var(--ok);
  font-weight: 750;
}
.pk-net-neg {
  color: var(--signal);
  font-weight: 750;
}
.pk-section-title {
  margin-top: 0;
}
.pk-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}
.pk-inline-form input[type='number'] {
  width: 8em;
}

@media (max-width: 640px) {
  .pk-table {
    aspect-ratio: 1 / 1.12;
  }
  .pk-card {
    --w: 11.5cqw;
  }
  .pk-card.pk-lg {
    --w: 13cqw;
  }
  .pk-seat {
    flex-direction: column;
    gap: 0;
    transform: translateX(-50%);
  }
  .pk-seat-top {
    top: 5%;
  }
  .pk-seat-bottom {
    bottom: 4%;
    flex-direction: column;
  }
  .pk-plate {
    margin-top: -3cqw;
    min-width: 36cqw;
    padding: 1cqw 3cqw 1cqw 1cqw;
  }
  .pk-plate img {
    width: 8cqw;
    height: 8cqw;
  }
  .pk-name {
    font-size: 3.2cqw;
    max-width: 26cqw;
  }
  .pk-stack {
    font-size: 4cqw;
  }
  .pk-tag {
    left: calc(100% + 1.5cqw);
    font-size: 3cqw;
    padding: 1cqw 1.8cqw 0.6cqw;
    white-space: normal;
    width: max-content;
    max-width: 24cqw;
    line-height: 1.2;
  }
  .pk-tag::before {
    border-width: 1.2cqw;
  }
  .pk-bonus {
    margin-left: 0;
  }
  .pk-amount,
  .pk-pot-label,
  .pk-result {
    font-size: 3.2cqw;
  }
  .pk-result {
    white-space: normal;
    text-align: center;
    width: 70cqw;
  }
  .pk-felt-mark {
    display: none;
  }
  .pk-bet {
    left: 68%;
    transform: none;
  }
  .pk-bet-top {
    top: 31%;
  }
  .pk-bet-bottom {
    bottom: 31%;
  }
  .pk-dealer-top {
    left: 18%;
    top: 16%;
  }
  .pk-dealer-bottom {
    left: 18%;
    bottom: 16%;
  }
  .pk-chip {
    width: 4.4cqw;
    height: 4.4cqw;
  }
  .pk-hole .pk-card:nth-child(2) {
    margin-left: -3cqw;
  }
}
