/* ==========================================================================
   UNO BOARD LAYOUT (4-seat cross layout + center draw/discard piles)
   ========================================================================= */
.table {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
  max-width: 1100px;
  margin: 0 auto 15px auto;
  align-items: center;
}

.seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: white;
}

.seat-top {
  grid-column: 2;
  grid-row: 1;
}

.seat-left {
  grid-column: 1;
  grid-row: 2;
}

.seat-right {
  grid-column: 3;
  grid-row: 2;
}

.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);
}

.uno-badge {
  font-size: 11px;
  font-weight: bold;
  background: #ffeb3b;
  color: #222;
  border-radius: 8px;
  padding: 1px 7px;
  letter-spacing: 0.5px;
}

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

.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 — draw pile / discard pile / active color
   ========================================================================= */
.center-zone {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 30px;
}

.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-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;
}

.current-color {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 12px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 3px 10px;
}

.current-color .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.current-color .dot.uno-red {
  background: #d32f2f;
}

.current-color .dot.uno-yellow {
  background: #f2b705;
}

.current-color .dot.uno-green {
  background: #2e7d32;
}

.current-color .dot.uno-blue {
  background: #1565c0;
}

/* ==========================================================================
   UNO CARDS (CSS-drawn — no card art needed for the custom deck)
   ========================================================================= */
.uno-card {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 36px;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.85);
  user-select: none;
  box-sizing: border-box;
  text-align: center;
  line-height: 1.1;
}

.uno-card.uno-card-text {
  font-size: 16px;
}

.uno-card.uno-red {
  background: #d32f2f;
}

.uno-card.uno-yellow {
  background: #f2b705;
  color: #222;
}

.uno-card.uno-green {
  background: #2e7d32;
}

.uno-card.uno-blue {
  background: #1565c0;
}

.uno-card.uno-wild {
  background: conic-gradient(#d32f2f 0turn 0.25turn, #1565c0 0.25turn 0.5turn, #2e7d32 0.5turn 0.75turn, #f2b705 0.75turn 1turn);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

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

.hand-row .card-slot {
  position: relative;
  width: 70px;
  aspect-ratio: 70 / 100;
  cursor: pointer;
  transition: transform 0.15s;
}

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

.hand-row .card-slot.unplayable {
  opacity: 0.5;
  cursor: default;
}

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

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

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

.action-note {
  text-align: center;
  color: #ffeb3b;
  font-weight: bold;
  min-height: 18px;
  margin: 0 0 6px 0;
  font-size: 13px;
}

/* ==========================================================================
   MODALS — difficulty / color choice / round & game end
   ========================================================================= */
.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;
}

.color-choice-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 15px 0;
}

.color-swatch {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.color-swatch:hover {
  transform: scale(1.06);
}

.color-swatch.uno-red {
  background: #d32f2f;
}

.color-swatch.uno-yellow {
  background: #f2b705;
}

.color-swatch.uno-green {
  background: #2e7d32;
}

.color-swatch.uno-blue {
  background: #1565c0;
}

.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;
}

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

  .uno-card {
    font-size: 30px;
  }

  .uno-card.uno-card-text {
    font-size: 12px;
  }

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

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

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

  .center-zone {
    gap: 16px;
  }

  .color-swatch {
    width: 46px;
    height: 46px;
  }
}
