/* ========== BIDDING ========== */
.bidding-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  flex: 1;
  justify-content: center;
}

/* ========== QUICK BID ROW ========== */
.quick-bid-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.quick-bid-btn {
  font-size: 0.78rem;
  padding: 4px 10px;
  min-height: 44px;
  min-width: 44px;
  border-radius: 6px;
  background: rgba(218, 165, 32, 0.15);
  border-color: var(--gold);
}

.quick-bid-btn:hover {
  background: rgba(218, 165, 32, 0.35);
}

/* ========== BID PROGRESS (FIX #3) ========== */
.bid-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  max-width: 400px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
}

.bid-progress-text {
  font-size: 0.75rem;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
}

.bid-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
}

.bid-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.bid-progress-green {
  background: #4a4;
}

.bid-progress-yellow {
  background: #da0;
}

.bid-progress-red {
  background: #c44;
}

/* ========== TRUMP INSPECTOR PICKER ========== */
.trump-inspector-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  max-width: 540px;
  width: 100%;
  margin: 12px auto;
}

.trump-inspect-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 2px solid var(--gold);
  background: rgba(0, 0, 0, 0.4);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.trump-inspect-btn:hover:not(:disabled) {
  background: rgba(218, 165, 32, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.trump-inspect-btn.disabled {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
}

.trump-inspect-symbol {
  font-size: 1.8rem;
  line-height: 1;
}

.trump-inspect-btn.red-suit .trump-inspect-symbol {
  color: var(--red);
}

body.four-color-deck .trump-inspect-btn.suit-C .trump-inspect-symbol {
  color: #1b7a2b;
}

body.four-color-deck .trump-inspect-btn.suit-D .trump-inspect-symbol {
  color: #1565c0;
}

body.four-color-deck .trump-inspect-btn.suit-H .trump-inspect-symbol {
  color: #c62828;
}

body.four-color-deck .trump-inspect-btn.suit-S .trump-inspect-symbol {
  color: #111111;
}

.trump-inspect-name {
  font-weight: bold;
  font-size: 0.85rem;
}

.trump-inspect-stats {
  font-size: 0.72rem;
  opacity: 0.75;
}

.trump-inspect-status {
  font-size: 0.68rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

.trump-inspect-status.has-marriage {
  background: rgba(46, 125, 50, 0.3);
  color: #81c784;
}

.trump-inspect-status.no-marriage {
  background: rgba(198, 40, 40, 0.25);
  color: #e57373;
}

/* ========== MELD CHART (FIX #1) ========== */
.meld-chart-toggle {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}

.meld-chart-container {
  width: 100%;
  max-width: 500px;
  overflow-x: auto;
  margin-top: 0.5rem;
}

/* ========== MELD TABLE ========== */
.meld-container {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}

/* Fix #1: 4-column meld layout */
.meld-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  width: 100%;
}

.meld-column {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  min-width: 0; /* allow columns to shrink */
}

.meld-column h3 {
  text-align: center;
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  color: var(--gold);
}

/* Bid-winning team gets a different background tint */
.meld-column.declarer-team {
  background: rgba(0, 80, 30, 0.5);
  border-color: var(--gold);
}

/* Bid winner indicator above the 4 columns */
.bid-winner {
  text-align: center;
  font-size: 1rem;
  color: var(--gold);
  padding: 6px;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
}

/* Merged from the two duplicate .meld-total blocks (column totals and the
   end-of-combo total) — identical shared declarations, union of the rest. */
.meld-total {
  font-weight: bold;
  color: var(--gold);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.partnership-totals {
  display: flex;
  justify-content: space-around;
  padding: 0.75rem;
  font-size: 1.1rem;
  font-weight: bold;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.trump-indicator {
  text-align: center;
  padding: 0.5rem;
  font-size: 1rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.trump-suit {
  font-size: 1.5rem;
}

.bid-coverage {
  text-align: center;
  font-size: 0.9rem;
  padding: 0.25rem;
}

.bid-coverage.covered { color: #4a4; }
.bid-coverage.uncovered { color: #e44; }

.confirm-section {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.5rem;
}

.confirm-badge {
  font-size: 0.8rem;
  color: #4a4;
}

/* ========== MELD CARD DISPLAY (FIX #2) ========== */
.meld-combos {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.meld-combo {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meld-combo-label {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 500;
}

.meld-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 3px;
}

.meld-card {
  width: 44px;
  height: 60px;
  margin-right: 0 !important;
}

.meld-card .card-corner.top-left {
  top: 2px;
  left: 2px;
  width: 14px;
}

.meld-card .rank {
  font-size: 10px;
}

.meld-card .mini-suit {
  font-size: 9px;
}

.meld-card .suit.center-pip {
  font-size: 22px;
}

.meld-card .card-corner.bottom-right {
  display: none;
}

/* Fix #5: Hand summary card at end of each hand */
.hand-summary {
  max-width: 500px;
  margin: 0 auto;
  background: rgba(0,0,0,0.5);
  border: 2px solid var(--gold);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.hand-summary h2 {
  color: var(--gold);
  margin-bottom: 16px;
}

.hand-summary-teams {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  margin: 12px 0;
}

.hand-summary-team {
  text-align: center;
  flex: 1;
}

.hand-summary-team .team-name {
  font-weight: bold;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.hand-summary-team .team-breakdown {
  font-size: 0.85rem;
  opacity: 0.8;
}

.hand-summary-team .team-total {
  font-size: 1rem;
  margin-top: 4px;
}

.hand-summary-result {
  margin: 12px 0;
  padding: 8px;
  border-radius: 6px;
  font-weight: bold;
}

.hand-summary-result.bid-made {
  background: rgba(68,170,68,0.2);
  color: #4a4;
}

.hand-summary-result.bid-set {
  background: rgba(204,68,68,0.2);
  color: #c44;
}

.hand-summary-game-scores {
  display: flex;
  justify-content: space-around;
  margin-top: 12px;
  font-size: 1.1rem;
  font-weight: bold;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.meld-lost { color: #c44; font-weight: bold; }
.meld-saved { color: #4a4; }

/* ========== MELD MATRIX TABLE ========== */
.meld-matrix-table {
  width: 100%;
  border-collapse: collapse;
}

.meld-matrix-table th,
.meld-matrix-table td {
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.meld-matrix-table th {
  color: var(--gold);
  font-weight: bold;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.8rem;
}

.meld-matrix-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.meld-matrix-table td:not(:first-child) {
  color: #ffd700;
  font-weight: bold;
}

/* ========== MOBILE RESPONSIVE (extracted per-component from the style.css mega-block) ========== */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1024px) and (pointer: coarse) {
  .meld-columns {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .meld-column {
    padding: 4px;
  }

  .meld-cards .card,
  .meld-card {
    width: 32px;
    height: 46px;
  }

  .meld-combo-label {
    font-size: 0.7rem;
  }

  /* Fix #7: Bid input and meld buttons full-width */
  .confirm-section {
    flex-direction: column;
    align-items: stretch;
  }

  .confirm-section .btn {
    width: 100%;
  }

  .bid-progress {
    font-size: 0.8rem;
  }

  .bid-progress-text {
    font-size: 0.75rem;
  }

  /* Fix #9: Hand summary full-width */
  .hand-summary {
    max-width: 100%;
    padding: 12px;
    margin: 8px;
    font-size: 0.85rem;
  }

  .hand-summary h2 {
    font-size: 1.2rem;
  }
}
