/* Diplomacy & Treaties — Spectator Styles */

.diplomacy-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
}

.diplomacy-section {
  margin-bottom: 24px;
}

.diplomacy-section h3 {
  font-size: 1.2em;
  margin-bottom: 12px;
  color: #e5e7eb;
}

.diplomacy-loading {
  text-align: center;
  color: #9ca3af;
  padding: 40px;
}

.diplomacy-empty {
  text-align: center;
  color: #6b7280;
  padding: 20px;
  font-style: italic;
}

/* Reputation Bar */
.diplomacy-rep-bar {
  position: relative;
  height: 22px;
  background: #374151;
  border-radius: 11px;
  overflow: hidden;
  flex: 1;
  min-width: 120px;
}

.diplomacy-rep-fill {
  height: 100%;
  border-radius: 11px;
  transition: width 0.6s ease;
}

.diplomacy-rep-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  white-space: nowrap;
}

/* Reputation Leaderboard */
.diplomacy-rep-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diplomacy-rep-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #1f2937;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.diplomacy-rep-row:hover {
  background: #374151;
  transform: translateX(2px);
}

.diplomacy-rep-row.selected {
  background: #1e3a5f;
  border: 1px solid #3b82f6;
}

.diplomacy-rank {
  font-weight: 700;
  color: #9ca3af;
  min-width: 30px;
}

.diplomacy-agent-name {
  font-weight: 600;
  color: #e5e7eb;
  min-width: 80px;
}

.diplomacy-rep-stats {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
}

/* Treaty Cards */
.diplomacy-treaty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.diplomacy-treaty-card {
  background: #1f2937;
  border-radius: 8px;
  padding: 14px;
  transition: transform 0.2s;
}

.diplomacy-treaty-card:hover {
  transform: translateY(-2px);
}

.diplomacy-treaty-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.diplomacy-treaty-icon {
  font-size: 20px;
}

.diplomacy-treaty-type {
  font-weight: 600;
  color: #e5e7eb;
  flex: 1;
}

.diplomacy-treaty-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.diplomacy-treaty-parties {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #d1d5db;
  font-size: 14px;
}

.diplomacy-arrow {
  color: #6b7280;
}

.diplomacy-treaty-timer {
  margin-top: 8px;
  font-size: 12px;
  color: #fbbf24;
}

.diplomacy-treaty-broken {
  margin-top: 8px;
  font-size: 12px;
  color: #ef4444;
}

/* Treaty Network */
.diplomacy-network {
  background: #111827;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.diplomacy-network-svg {
  max-width: 400px;
  width: 100%;
}

.diplomacy-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  font-size: 12px;
  color: #9ca3af;
}

/* History */
.diplomacy-history {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diplomacy-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #1f2937;
  border-radius: 6px;
  font-size: 13px;
  color: #d1d5db;
}

.diplomacy-broken-by {
  font-size: 11px;
  color: #ef4444;
}

/* Light Mode */
@media (prefers-color-scheme: light) {
  .diplomacy-section h3 { color: #1f2937; }
  .diplomacy-rep-bar { background: #e5e7eb; }
  .diplomacy-rep-row { background: #f9fafb; }
  .diplomacy-rep-row:hover { background: #f3f4f6; }
  .diplomacy-rep-row.selected { background: #dbeafe; border-color: #3b82f6; }
  .diplomacy-rank { color: #6b7280; }
  .diplomacy-agent-name { color: #1f2937; }
  .diplomacy-treaty-card { background: #f9fafb; }
  .diplomacy-treaty-type { color: #1f2937; }
  .diplomacy-treaty-parties { color: #374151; }
  .diplomacy-network { background: #f3f4f6; }
  .diplomacy-history-item { background: #f9fafb; color: #374151; }
}

/* Dark Mode Override */
[data-theme="dark"] .diplomacy-section h3 { color: #e5e7eb; }
[data-theme="dark"] .diplomacy-rep-bar { background: #374151; }
[data-theme="dark"] .diplomacy-rep-row { background: #1f2937; }
[data-theme="dark"] .diplomacy-treaty-card { background: #1f2937; }
[data-theme="dark"] .diplomacy-network { background: #111827; }
[data-theme="dark"] .diplomacy-history-item { background: #1f2937; }

/* Mobile Responsive */
@media (max-width: 768px) {
  .diplomacy-container { padding: 8px; }
  .diplomacy-treaty-grid { grid-template-columns: 1fr; }
  .diplomacy-rep-row { flex-wrap: wrap; }
  .diplomacy-rep-bar { min-width: 100%; margin-top: 4px; }
  .diplomacy-legend { flex-wrap: wrap; gap: 8px; }
  .diplomacy-network-svg { max-width: 300px; }
}
