/*
 * The blackjack table. The shell, buttons, chips and seats' plates come from common.css; this is the
 * felt's own furniture - the shoe, the dealer, seats' hands and the cards.
 */

/* Shoe depth, so players can see a shuffle coming. */
.shoe {
  width: 54px;
  height: 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.shoe-fill {
  height: 100%;
  width: 0;
  background: var(--ink-dim);
  transition: width 0.4s ease;
}

/* ------------------------------------------------------------------ felt */

.felt {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 4px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dealer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 8px;
}

.label-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.notice {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--gold);
}

.seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
  align-items: start;
}

.seat {
  padding: 9px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.seat-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.seat-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.seat-balance {
  font-size: 12px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  flex: none;
}

.hand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 7px;
  border: 1px solid transparent;
}

/* The specific box being decided, which matters once a seat has split. */
.hand.active {
  border-color: rgba(232, 193, 90, 0.5);
  background: rgba(232, 193, 90, 0.07);
}

.hand-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.hand-total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hand-bet {
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.seat-footer {
  overflow-wrap: anywhere;
  font-size: 12px;
  color: var(--ink-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 6px;
}

.net.up { color: var(--win); font-weight: 700; }
.net.down { color: var(--lose); font-weight: 700; }

/* ------------------------------------------------------------------ cards */

.cards {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  min-height: 58px;
  align-items: flex-end;
}

.card {
  width: 40px;
  height: 56px;
  border-radius: 5px;
  background: #f7f5ef;
  color: #1c1c1c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-weight: 700;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  flex: none;
  animation: deal 0.22s ease-out;
}

.card.red { color: #c0392b; }

.card-rank { font-size: 16px; line-height: 1; }
.card-suit { font-size: 14px; line-height: 1; }

/* The dealer's hole card. Deliberately has no rank to render - the server does not send it. */
.card.facedown {
  background: repeating-linear-gradient(
    45deg,
    #7b2230 0 5px,
    #94293a 5px 10px
  );
  box-shadow: inset 0 0 0 3px #f7f5ef, 0 2px 5px rgba(0, 0, 0, 0.35);
}

.dealer .cards { min-height: 60px; }

@keyframes deal {
  from { transform: translateY(-14px) scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}

#idle-message { margin: 0; }

/* Narrow activity frames and phone screens. */
@media (max-width: 460px) {
  .seats { grid-template-columns: minmax(0, 1fr); }
  .card { width: 34px; height: 48px; }
  .card-rank { font-size: 14px; }
}
