/* ==========================================================================
   GIN RUMMY BOARD LAYOUT
   ========================================================================= */
.table {
  max-width: 900px;
  margin: 0 auto 15px auto;
}

.opponent-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: white;
  margin-bottom: 10px;
}

.seat-name {
  font-weight: bold;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 10px;
  border-radius: 10px;
}

.seat-name.active-turn {
  background: #ffeb3b;
  color: #222;
}

.seat-score {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.cardback-fan {
  position: relative;
  height: 82px;
  width: 120px;
  margin: 0 auto;
}

.cardback-fan .card-back {
  position: absolute;
  width: 56px;
  height: 81px;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.cardback-fan .fan-count {
  position: absolute;
  bottom: -2px;
  right: 0;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border-radius: 8px;
  padding: 0 6px;
}

.center-zone {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 20px 0;
}

.pile-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pile-label {
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
}

.pile {
  position: relative;
  width: 90px;
  height: 130px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}

.pile .card-img,
.pile .card-back {
  width: 100%;
  height: 100%;
  margin: 0;
}

.pile.clickable {
  cursor: pointer;
  box-shadow: 0 0 0 3px #ffeb3b;
}

.pile.clickable:hover {
  transform: translateY(-4px);
}

.pile-count {
  position: absolute;
  bottom: -10px;
  right: -10px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 10px;
  padding: 2px 7px;
}

.seat-bottom-info {
  text-align: center;
  color: white;
  margin-bottom: 6px;
}

.action-bar {
  text-align: center;
  margin-bottom: 10px;
  min-height: 40px;
}

.action-bar button {
  width: auto;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: #c62828;
  color: white;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
}

.action-bar button:hover {
  background: #b71c1c;
}

.hand-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.hand-row .card-slot {
  position: relative;
  width: 90px;
}

.hand-row .card-img {
  cursor: pointer;
  transition: transform 0.15s;
}

.hand-row .card-img.playable:hover {
  transform: translateY(-8px);
}

.hand-row .card-img.unplayable {
  opacity: 0.55;
  cursor: default;
}

.status-line {
  text-align: center;
  color: white;
  font-weight: bold;
  min-height: 20px;
  margin-bottom: 8px;
}

.difficulty-options {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 15px 0;
  flex-wrap: wrap;
}

.difficulty-options button {
  width: auto;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  background: #333;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.difficulty-options button:hover {
  background: #444;
}

.score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}

.score-table th,
.score-table td {
  border: 1px solid #ccc;
  padding: 6px 10px;
  text-align: center;
}

.player-melds h4 {
  margin: 10px 0 4px 0;
  color: #2f4f2f;
}

.meld-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 6px 0;
}

.meld-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.meld-group .cards {
  display: flex;
  gap: 2px;
}

.meld-group .cards img {
  width: 34px;
  height: auto;
  border-radius: 3px;
  border: 1px solid #ccc;
}

.meld-group .label {
  font-size: 11px;
  color: #555;
}

.layoff-note {
  font-size: 13px;
  color: #555;
  font-style: italic;
}

@media (max-width: 700px) {
  .pile {
    width: 60px;
    height: 87px;
  }

  .hand-row .card-slot {
    width: 54px;
  }

  .cardback-fan {
    width: 60px;
    height: 44px;
  }

  .cardback-fan .card-back {
    width: 30px;
    height: 44px;
  }

  .center-zone {
    gap: 24px;
  }
}
