/* ═══════════════════════════════════════════════
   cards.css — Trade modals, dev cards,
               resource display
   Settlers of Catan — Browser Edition
═══════════════════════════════════════════════ */

/* ══════════════════════════
   MODAL OVERLAY
══════════════════════════ */

#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* ══════════════════════════
   MODAL BASE
══════════════════════════ */

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  min-width: 360px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 16px;
  color: var(--accent);
}

/* ══════════════════════════
   RESOURCE GRID
══════════════════════════ */

.resource-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 12px 0;
}

/* ── Resource card ── */
.res-card {
  background: var(--panel-light);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.res-card:hover {
  border-color: var(--text-muted);
  background: #2e4060;
}

.res-card.selected {
  border-color: var(--accent);
  background: rgba(233, 196, 106, 0.15);
}

.res-card.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Resource card icon (32×32 colored square) ── */
.res-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  margin: 0 auto 4px;
}

.res-card-icon.ri-wood  { background: var(--res-wood); }
.res-card-icon.ri-brick { background: var(--res-brick); }
.res-card-icon.ri-wheat { background: var(--res-wheat); }
.res-card-icon.ri-sheep { background: var(--res-sheep); }
.res-card-icon.ri-ore   { background: var(--res-ore); }

.res-card-name {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.res-card-count {
  font-size: 18px;
  font-weight: bold;
  color: var(--text);
  line-height: 1;
}

/* ── Trade arrows separator ── */
.trade-arrows {
  text-align: center;
  font-size: 20px;
  color: var(--accent);
  margin: 8px 0;
  line-height: 1;
}

/* ══════════════════════════
   TRADE TABS
══════════════════════════ */

.trade-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.trade-tab {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.trade-tab:hover {
  color: var(--text);
}

.trade-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ══════════════════════════
   DEV CARD HAND
══════════════════════════ */

.devcard-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0;
}

.devcard {
  width: 80px;
  background: linear-gradient(135deg, #1a2a3a, #243447);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.15s;
  user-select: none;
}

.devcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  border-color: #f5d47a;
}

.devcard:active {
  transform: translateY(-2px);
}

.devcard-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 4px;
}

.devcard-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.devcard-type {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.2;
}

.devcard.used {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Dev card play buttons (in play-devcard modal) */
.devcard-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: linear-gradient(135deg, #1a2a3a, #243447);
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.15s;
}
.devcard-btn:hover {
  background: linear-gradient(135deg, #243447, #2e4060);
  border-color: #f5d47a;
}
.card-count {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 10px;
}
.no-cards {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}

.devcard.new-card {
  border-color: #80b918;
}

/* ══════════════════════════
   MODAL ACTIONS
══════════════════════════ */

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}

/* ══════════════════════════
   COUNTER OFFER SECTION
══════════════════════════ */

.counter-offer-section {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

.counter-offer-section p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ══════════════════════════
   STEPPER CONTROLS
══════════════════════════ */

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--panel-light);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.15s;
  flex-shrink: 0;
}

.stepper button:hover:not(:disabled) {
  background: #3a526a;
}

.stepper button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepper-val {
  width: 32px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: var(--text);
}

/* ══════════════════════════
   STEAL PLAYER LIST
══════════════════════════ */

#steal-player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.steal-player-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s;
  text-align: left;
}

.steal-player-btn:hover {
  border-color: var(--accent);
  background: rgba(233, 196, 106, 0.1);
}

.steal-player-btn .player-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.steal-player-btn .steal-card-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* ══════════════════════════
   DISCARD MODAL
══════════════════════════ */

#discard-remaining {
  font-size: 13px;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 600;
}

/* ══════════════════════════
   GAME OVER MODAL
══════════════════════════ */

#gameover-winner {
  font-size: 24px;
  text-align: center;
  margin: 16px 0;
  font-weight: bold;
  color: var(--accent);
}

#gameover-scores {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gameover-score-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--panel-light);
  border-radius: 6px;
  font-size: 14px;
}

.gameover-score-row .player-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gameover-score-row .score-vp {
  margin-left: auto;
  font-weight: bold;
  color: var(--accent);
}

/* ══════════════════════════
   TRADE RESPOND DETAILS
══════════════════════════ */

#trade-respond-details {
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

#trade-respond-details strong {
  color: var(--text);
}

/* ══════════════════════════
   YOP / MONOPOLY GRIDS
══════════════════════════ */

#yop-remaining,
#monopoly-selected {
  font-size: 13px;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 600;
  text-align: center;
}
