/* TableBoard — casino felt, anchors, cards, chips, mascot */

.table-board {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  box-shadow: inset 0 0 80px 20px rgba(0, 0, 0, 0.25);
}

/* Felt: dark edges → lighter center, spotlight */
.table-board__felt {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 85% 75% at 50% 45%,
    #157a3d 0%,
    #0f6b3a 22%,
    #0a5029 50%,
    #083d20 75%,
    #052a16 100%
  );
}

.table-board__felt::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  pointer-events: none;
}

.table-board__vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 140px 40px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* Printed markings: dealer arc, bet circle, insurance, inner shadow */
.table-board__marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.table-board__marks::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  height: 56%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.table-board__marks::after {
  content: "";
  position: absolute;
  top: 16%;
  left: 12%;
  right: 12%;
  bottom: 26%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  box-shadow: inset 0 0 30px 4px rgba(0, 0, 0, 0.2);
}

.table-board__insurance {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translate(-50%, 0);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.12);
  text-transform: uppercase;
}

.table-board__insurance::before {
  content: "Insurance pays 2:1";
}

/* Invisible anchors for layout */
.table-board__anchors {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.table-board__anchor {
  position: absolute;
  width: 54px;
  height: 72px;
  visibility: hidden;
}

.table-board__anchor[data-anchor="shoe"] {
  top: 6%;
  right: 8%;
  width: 50px;
  height: 68px;
}

.table-board__dealer {
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.table-board__anchor[data-anchor^="dealer-"] {
  position: relative;
  flex-shrink: 0;
}

.table-board__anchor[data-anchor="bet"] {
  bottom: 32%;
  left: 50%;
  transform: translate(-50%, 50%);
  width: 70px;
  height: 40px;
  top: auto;
}


/* Player hands container */
.table-board__player-hands {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: flex-end;
}

.table-board__hand {
  display: flex;
  gap: 4px;
  justify-content: center;
  align-items: flex-end;
}

.table-board__anchor[data-anchor^="player-"] {
  position: relative;
  flex-shrink: 0;
}

/* Cards layer: above felt, below overlay */
.table-board__cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.table-board__card {
  position: absolute;
  width: 50px;
  height: 70px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
  background: #fff;
  color: #1a1a1a;
  will-change: transform;
}

.table-board__card .card-rank { line-height: 1; }
.table-board__card .card-suit { font-size: 0.6rem; margin-top: 2px; opacity: 0.85; }

.table-board__card.hole {
  background: linear-gradient(145deg, #1a237e 0%, #283593 100%);
  color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.table-board__card.hole .card-suit { opacity: 0.5; }

.table-board__card.red { color: #c41e3a; }
.table-board__card.hole.red { color: rgba(255, 255, 255, 0.9); }

/* Chip stack + bet label: to the right of Claude mascot, never on top */
.table-board__chip-bet-group {
  position: absolute;
  bottom: 5%;
  left: 62%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  z-index: 4;
}

.table-board__chips {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  transition: transform 0.2s ease;
}

.table-board__chips.pop {
  animation: chipPop 0.35s ease;
}

@keyframes chipPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.table-board__chip {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  margin-bottom: -10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-board__chip:first-child { margin-bottom: 0; }

.table-board__chip-denom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.02em;
}

.table-board__chip.gold { background: linear-gradient(145deg, #e5b84d 0%, #c9920f 50%, #a67c0a 100%); }
.table-board__chip.gold .table-board__chip-denom { color: rgba(0, 0, 0, 0.5); text-shadow: 0 1px 0 rgba(255,255,255,0.4); }
.table-board__chip.red { background: linear-gradient(145deg, #d44a4a 0%, #b01010 50%, #8b0000 100%); }
.table-board__chip.blue { background: linear-gradient(145deg, #3578e8 0%, #1d5cc7 50%, #1a4d9e 100%); }
.table-board__chip.green { background: linear-gradient(145deg, #1eb854 0%, #0f8c3a 50%, #0d6b2e 100%); }
.table-board__chip.black { background: linear-gradient(145deg, #4a5568 0%, #2d3748 50%, #1a202c 100%); }

.table-board__chip-value {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Result banner */
.table-board__result-banner {
  position: absolute;
  top: 12%;
  left: 50%;
  transform: translate(-50%, 0);
  padding: 0.5rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  z-index: 4;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  pointer-events: none;
}

.table-board__result-banner.visible {
  opacity: 1;
  visibility: visible;
}

.table-board__result-banner.win {
  background: rgba(63, 185, 80, 0.95);
  color: #fff;
}

.table-board__result-banner.loss {
  background: rgba(248, 81, 73, 0.95);
  color: #fff;
}

.table-board__result-banner.push {
  background: rgba(139, 148, 158, 0.9);
  color: #fff;
}

.table-board__result-banner.bj {
  background: linear-gradient(135deg, #d4a84b 0%, #b8860b 100%);
  color: #fff;
}

.table-board__result-banner.bust {
  background: rgba(248, 81, 73, 0.95);
  color: #fff;
}

.table-board__dealer-total,
.table-board__player-totals {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  z-index: 2;
  pointer-events: none;
}

.table-board__dealer-total {
  top: 28%;
}

.table-board__player-totals {
  bottom: 32%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: center;
}

.table-board__player-totals .hand-total {
  font-size: 0.95rem;
}

/* Dealer overlay — top center */
.table-board__dealer-overlay {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding-top: 0.5rem;
  pointer-events: none;
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.table-board__dealer-img {
  width: 125px;
  height: auto;
  max-height: 100px;
  object-fit: contain;
  object-position: top center;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

/* Mascot overlay — always visible, not clipped */
.table-board__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 0.75rem;
  z-index: 3;
  overflow: visible;
}

.table-board__mascot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 140px;
}

.table-board__mascot-wrap img {
  width: 200px;
  height: auto;
  max-height: 180px;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
  animation: mascotIdle 3s ease-in-out infinite;
}

@keyframes mascotIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.table-board__mascot-placeholder {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  animation: mascotIdle 3s ease-in-out infinite;
}

.table-board__status-label {
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  min-height: 1.2em;
}

.table-board__options-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.table-board__options-panel.visible {
  opacity: 1;
  visibility: visible;
}

.table-board__options-panel .opt-btn {
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  transition: background 0.15s, box-shadow 0.15s;
}

.table-board__options-panel .opt-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

.table-board__options-panel .opt-btn.selected {
  background: rgba(63, 185, 80, 0.4);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 10px rgba(63, 185, 80, 0.5);
}

.table-board__speech-bubble {
  margin-bottom: 0.4rem;
  padding: 0.45rem 0.65rem;
  background: rgba(255, 255, 255, 0.96);
  color: #1a1a1a;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  white-space: nowrap;
  max-width: 180px;
  text-align: center;
}

.table-board__speech-bubble.visible {
  opacity: 1;
  visibility: visible;
}
