@import url("/clubroom/playing-cards.css");
@import url("/clubroom/poker-controls.css");
@import url("/clubroom/poker-chips.css");
html:has(.poker-page),
body.poker-page {
  overflow-x: clip;
}
.card-game {
  max-width: 1240px;
  margin: 5px auto 0;
}
.card-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  min-height: 44px;
  color: #a9b99f;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.card-status #stage-label {
  color: #d7c99f;
}
.card-table {
  position: relative;
  margin: 72px auto 124px;
  width: calc(100% - 110px);
  height: clamp(390px, calc(100dvh - 450px), 530px);
  border-radius: 45% / 48%;
  border: 20px solid #263029;
  background:
    radial-gradient(ellipse at 43% 30%, #38776044, transparent 68%), url("/clubroom/assets/felt.svg"), #245b48;
  box-shadow:
    0 0 0 2px #72766040,
    0 5px 0 9px #151f18,
    0 9px 0 11px #493d2f,
    0 24px 37px #0009,
    inset 0 0 0 2px #62886b32,
    inset 0 15px 40px #00180f70;
  isolation: isolate;
}
.table-engraving {
  position: absolute;
  left: 50%;
  top: 69%;
  transform: translateX(-50%);
  font: 15px var(--serif);
  letter-spacing: 6px;
  color: #c8d4ae1c;
  pointer-events: none;
}
.board-area {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  min-width: 300px;
}
.pot {
  font: 27px var(--serif);
  color: #f0dfb8;
  min-height: 43px;
  font-variant-numeric: tabular-nums;
}
.pot small {
  display: block;
  font: 9px var(--sans);
  letter-spacing: 2px;
  color: #b3c6a8;
  margin-bottom: 8px;
}
.board,
.hand {
  display: flex;
  justify-content: center;
  gap: 9px;
}
.playing-card {
  display: block;
  position: relative;
  flex-shrink: 0;
  width: 82px;
  aspect-ratio: 73/105;
  filter: drop-shadow(1px 4px 3px #051b1359);
  border-radius: 5px;
}
.poker-page .card-inner {
  position: absolute;
  inset: 0;
}
.poker-page .card-back::after {
  content: "♣";
}
.poker-page .playing-card {
  container-type: inline-size;
  perspective: 900px;
}
.playing-card.empty .card-inner {
  visibility: hidden;
}
.poker-page .card-corner {
  font-size: 26cqw;
  left: 8%;
  top: 5%;
}
.poker-page .card-corner small {
  font-size: 17cqw;
}
.poker-page .card-corner.bottom {
  inset: auto 8% 5% auto;
}
.poker-page .card-suit {
  font-size: 48cqw;
}
.playing-card.empty {
  background: #092f2226;
  border: 1px solid #94b18d3d;
  filter: none;
}
.seats-layer {
  position: absolute;
  inset: 0;
}
.seat {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 116px;
  z-index: 2;
}
.seat-info {
  border-radius: 9px;
  padding: 9px 12px;
  min-width: 122px;
  text-align: center;
  background: linear-gradient(145deg, #293d2e, #19271e);
  box-shadow: 0 5px 16px #0005;
  border: 1px solid #bac19b27;
}
.seat.hero .seat-info {
  background: #4b5440;
  border-color: #c6bf8850;
}
.seat.turn .seat-info {
  box-shadow:
    0 0 0 2px #d7bd80,
    0 6px 20px #0005;
}
.seat-name {
  font-size: 11px;
  color: #d0d8c5;
  max-width: 115px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.seat-stack {
  font: 18px var(--serif);
  color: #e1d6b4;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.seat-hand {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: -4px;
  position: relative;
}
.seat-hand .playing-card {
  width: 48px;
  border-radius: 3px;
}
.seat.hero .seat-hand .playing-card {
  width: 90px;
}
.seat.folded {
  opacity: 0.45;
}
.seat.hero.folded {
  opacity: 1;
}
.seat.hero.folded .seat-info {
  opacity: 0.65;
}
.dealer {
  position: absolute;
  right: -17px;
  top: 16px;
  background: #e1ddc4;
  border-radius: 50%;
  color: #354433;
  width: 21px;
  height: 21px;
  font-size: 10px;
  display: grid;
  place-items: center;
  box-shadow: 1px 2px 3px #0006;
}
.seat-status {
  min-height: 13px;
  margin-top: 3px;
  font-size: 9px;
  color: #b6c1a5;
}
.board-area #hand-result {
  font-size: 12px;
  color: #e4d8ad;
  min-height: 25px;
  max-width: 380px;
  line-height: 1.7;
  margin: 15px auto 0;
}
.player-wallet {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 46px;
  font-size: 12px;
  color: #bcc8b2;
}
.player-wallet strong {
  font: 25px var(--serif);
  font-variant-numeric: tabular-nums;
  color: #e1d1a3;
}
.player-wallet #wallet-unit {
  font-size: 10px;
  color: #8f9d86;
}
.player-wallet #my-hand-name {
  margin-left: auto;
  color: #d4c495;
  font-size: 11px;
}
.cards-waiting {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 20px 26px;
  border-radius: 10px;
  background: #142d23ee;
  text-align: center;
  z-index: 4;
  max-width: 90%;
  box-shadow: 0 8px 50px #00130e80;
}
.cards-waiting p {
  line-height: 1.7;
  margin-bottom: 12px;
  font-size: 13px;
}
.cards-waiting button[hidden] + * {
  margin: 0;
}
.card-table.baccarat {
  margin-top: 20px;
  margin-bottom: 24px;
  height: clamp(255px, calc(100dvh - 460px), 390px);
  border-radius: 45% 45% 32% 32%;
  width: calc(100% - 45px);
}
.baccarat-hands {
  position: absolute;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 82px;
  width: 85%;
  max-width: 750px;
  text-align: center;
}
.baccarat-hands .eyebrow {
  margin-bottom: 13px;
  color: #c2c5a3;
  font-size: 11px;
  letter-spacing: 4px;
}
.baccarat-hands .hand {
  min-height: 94px;
}
.baccarat-hands strong {
  display: block;
  margin-top: 14px;
  font: 27px var(--serif);
  color: #e8ddba;
}
.baccarat-hands .playing-card {
  width: 61px;
}
.baccarat-result {
  position: absolute;
  bottom: 9%;
  left: 5%;
  right: 5%;
  font-size: 14px;
  text-align: center;
  color: #eeddae;
}
.bet-spots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 9px;
}
.bet-spot {
  position: relative;
  min-height: 78px;
  padding: 11px;
  border: 1px solid #7d927344;
  background: #20392887;
  border-radius: 8px;
  color: #ded7be;
}
.bet-spot:first-child,
.bet-spot:nth-child(2),
.bet-spot:nth-child(3) {
  grid-column: span 2;
  min-height: 88px;
}
.bet-spot:nth-child(4),
.bet-spot:nth-child(5),
.bet-spot:nth-child(6) {
  grid-column: span 2;
}
.bet-spot[data-spot="player"] {
  background: #29445780;
  border-color: #637f914f;
}
.bet-spot[data-spot="banker"] {
  background: #543b3480;
  border-color: #a8766b4f;
}
.bet-spot[data-spot="tie"] {
  background: #374b3280;
}
.bet-spot strong {
  font: 19px var(--serif);
  display: block;
  letter-spacing: 0.5px;
}
.bet-spot small {
  display: block;
  color: #a5b39a;
  font-size: 10px;
  margin-top: 6px;
}
.bet-spot .stake {
  position: absolute;
  right: 11px;
  top: 10px;
  padding: 5px 8px;
  border-radius: 15px;
  background: #cfb47f;
  color: #202e21;
  font-size: 11px;
  font-weight: 600;
}
.chip-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 18px;
}
.chip-values {
  display: flex;
  gap: 12px;
  margin-right: auto;
  flex-wrap: wrap;
}
.chip-values button {
  width: 51px;
  height: 51px;
  position: relative;
  border-radius: 50%;
  background-size: cover;
  display: grid;
  place-items: center;
  color: #efe5c4;
  font-size: 11px;
  font-weight: 600;
  outline-offset: 3px;
}
.chip-values button::before {
  content: "";
  background: #25392a;
  border-radius: 50%;
  width: 29px;
  height: 29px;
  position: absolute;
  z-index: 0;
}
.chip-values button span {
  position: relative;
}
.chip-values button.selected {
  outline: 2px solid #d3bd86;
  transform: translateY(-3px);
}
.road-heading {
  display: flex;
  justify-content: space-between;
  color: #a7b79a;
  font-size: 11px;
  margin: 10px 0;
}
.baccarat-road {
  display: grid;
  grid-template-rows: repeat(6, 18px);
  grid-auto-flow: column;
  grid-auto-columns: 22px;
  gap: 4px;
  overflow-x: auto;
  min-height: 127px;
  padding: 7px;
  background: #17261b;
  border-radius: 8px;
}
.road-dot {
  width: 17px;
  height: 17px;
  border: 2px solid #7394ae;
  border-radius: 50%;
  font-size: 9px;
  text-align: center;
  line-height: 13px;
  color: #bed2e1;
}
.road-dot.banker {
  border-color: #bc7567;
  color: #e1b2a6;
}
.road-dot.tie {
  border-color: #8dba87;
  color: #c7dcad;
}
.disconnected .poker-controls,
.disconnected .baccarat-controls {
  opacity: 0.6;
}
@media (max-width: 1000px) {
  .card-table {
    width: calc(100% - 76px);
  }
  .seat-info {
    min-width: 108px;
  }
  .seat {
    min-width: 104px;
  }
  .seat.hero .seat-hand .playing-card {
    width: 78px;
  }
  .playing-card {
    width: 70px;
  }
  .board-area {
    min-width: 270px;
  }
  .baccarat-hands {
    gap: 30px;
  }
  .baccarat-hands .playing-card {
    width: 56px;
  }
}
@media (max-width: 619px) {
  .poker-page .brand-word,
  .baccarat-page .brand-word {
    display: none;
  }
  .card-table.poker {
    height: clamp(420px, calc(100svh - 350px), 570px);
    width: calc(100% - 36px);
    border-width: 12px;
    border-radius: 46% / 26%;
    margin-top: 53px;
    margin-bottom: 138px;
  }
  .seat {
    min-width: 75px;
  }
  .seat-info {
    padding: 7px 8px;
    min-width: 78px;
    border-radius: 7px;
  }
  .seat-name {
    font-size: 10px;
    max-width: 74px;
  }
  .seat-stack {
    font-size: 15px;
    margin-top: 4px;
  }
  .seat-hand .playing-card {
    width: 34px;
  }
  .seat.hero .seat-hand .playing-card {
    width: 72px;
  }
  .seat.hero .seat-info {
    min-width: 100px;
  }
  .seat-status {
    font-size: 8px;
    max-width: 76px;
    min-height: 11px;
  }
  .dealer {
    width: 17px;
    height: 17px;
    font-size: 9px;
    right: -11px;
    top: 11px;
  }
  .board-area {
    min-width: 0;
    width: 100%;
    top: 48%;
  }
  .board {
    gap: 4px;
  }
  .board .playing-card {
    width: clamp(42px, calc((100vw - 116px) / 5), 60px);
  }
  .pot {
    font-size: 21px;
    min-height: 38px;
  }
  .pot small {
    font-size: 8px;
  }
  .board-area #hand-result {
    font-size: 10px;
    max-width: 80%;
    margin-top: 10px;
    line-height: 1.6;
  }
  .table-engraving {
    font-size: 10px;
    letter-spacing: 3px;
    top: 65%;
  }
  .card-status {
    font-size: 10px;
    gap: 10px;
    min-height: 35px;
  }
  .card-game {
    margin-top: 0;
  }
  .player-wallet {
    gap: 8px;
    min-height: 38px;
    flex-wrap: wrap;
  }
  .player-wallet strong {
    font-size: 21px;
  }
  .player-wallet #my-hand-name {
    font-size: 10px;
  }
  .card-table.baccarat {
    width: 100%;
    border-width: 12px;
    height: 252px;
    border-radius: 40% 40% 24% 24%;
    margin: 10px auto 18px;
  }
  .baccarat-hands {
    gap: 12px;
    max-width: 100%;
    width: 96%;
    top: 43%;
  }
  .baccarat-hands .eyebrow {
    font-size: 9px;
    letter-spacing: 2px;
    margin-bottom: 10px;
  }
  .baccarat-hands .hand {
    gap: 3px;
    min-height: 70px;
  }
  .baccarat-hands .playing-card {
    width: 40px;
  }
  .baccarat-hands strong {
    font-size: 22px;
    margin-top: 10px;
  }
  .baccarat-result {
    font-size: 12px;
    bottom: 10%;
    line-height: 1.5;
  }
  .bet-spots {
    gap: 7px;
  }
  .bet-spot {
    padding: 10px 6px;
    min-height: 65px;
  }
  .bet-spot strong {
    font-size: 15px;
  }
  .bet-spot small {
    font-size: 9px;
  }
  .bet-spot:first-child,
  .bet-spot:nth-child(2),
  .bet-spot:nth-child(3) {
    min-height: 80px;
  }
  .bet-spot .stake {
    position: static;
    display: inline-block;
    font-size: 10px;
    padding: 3px 7px;
    margin-top: 5px;
  }
  .chip-tools {
    gap: 8px;
    flex-wrap: wrap;
  }
  .chip-values {
    width: 100%;
    justify-content: center;
    gap: 13px;
  }
  .chip-tools > .button-quiet {
    flex: 1;
    min-height: 40px;
    font-size: 11px;
  }
  .chip-values button {
    width: 45px;
    height: 45px;
    font-size: 10px;
  }
  .card-game .form-error {
    font-size: 12px;
  }
  .table-chat {
    margin-top: 4px;
  }
  .cards-waiting {
    padding: 16px 22px;
    min-width: 210px;
  }
  .cards-waiting p {
    font-size: 12px;
  }
}
