/* [99-diplomacy] Pactes & Guerres de Familles : fenêtre au gabarit commun (.game-modal-box.diplomacy-window)
   Cadre, couronne, croix et défilement viennent de 50-modal.css ; taille 860x610 de 99-modal-uniform.css ;
   boutons (.kw-btn) et panneaux (.kw-panel) de 98-panel-window.css. Cette feuille ne fait que le contenu.
   Valeurs dynamiques passées par variables CSS : --fam (couleur de famille) et --pct (jauge de guerre). */

.diplomacy-window .diplo-content { gap: 10px; font-size: 14px; color: var(--text-cream); }
.diplomacy-window .diplo-content > * { flex-shrink: 0; }

/* Ligne de rang (Soldat, Don...) */
.diplo-role-line {
  font-size: 13px; color: #c9c0b4; text-align: center; padding: 0 0 2px;
}
.diplo-role-line strong { color: var(--gold-pale); }

/* Titre de section : Limelight laiton sur filet */
.diplo-section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 6px 0 0; padding: 0 0 5px;
  font-family: 'Limelight', serif; font-size: 14px; font-weight: 700; letter-spacing: 1px;
  color: var(--gold-pale); text-shadow: 0 1px 2px #000;
  border-bottom: 1px solid var(--gold-bronze);
}

/* Chargement et erreur */
.diplo-war-loading { padding: 18px; text-align: center; font-size: 14px; color: #b9ae98; }
.diplo-error {
  padding: 14px 18px; text-align: center; font-size: 14px; color: #ee958b;
  background: #16241f; border: 1px solid #2b6f58;
}

/* Paix armée */
.diplo-peace-box.kw-panel { display: flex; align-items: center; gap: 16px; padding: 12px 18px; }
.diplo-peace-box .peace-icon { font-size: 32px; line-height: 1; }
.diplo-peace-box h4 { margin: 0 0 4px; font-family: 'Limelight', serif; font-size: 15px; letter-spacing: 1px; color: var(--gold-pale); }
.diplo-peace-box p { margin: 0; font-size: 13px; line-height: 1.4; color: #d7cfc5; }

/* Guerre active : panneau teinté de rouge sombre */
.war-duel-card.kw-panel { background-color: #1b312a; padding: 12px 18px; --c: var(--gold-soft); border-color: #224a3d; }
.war-duel-header {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid rgba(222, 196, 162, 0.25);
}
.war-duel-tag { font-family: 'Limelight', serif; font-size: 13px; font-weight: 700; letter-spacing: 1px; color: #ee958b; }
.war-duel-timer { font-size: 14px; font-weight: 700; color: var(--gold-pale); font-variant-numeric: tabular-nums; }
.war-duel-stage { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 10px; }
.war-side { display: flex; align-items: center; gap: 12px; flex: 1; }
.war-side-b { justify-content: flex-end; }
.war-side-b .war-side-info { text-align: right; }
.war-side-logo { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)); }
.war-side-info h3 { margin: 0 0 2px; font-family: 'Limelight', serif; font-size: 14px; letter-spacing: 0.8px; color: #ede6dc; }
.war-points-count { font-family: 'Limelight', serif; font-size: 22px; font-weight: 700; line-height: 1; color: var(--gold-pale); }
.war-points-count small { font-size: 12px; color: #b9ae98; }
.war-vs-badge {
  margin: 0 16px; padding: 4px 12px; border-radius: 12px;
  font-family: 'Limelight', serif; font-size: 14px; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #e45545 0, #c83a2a 50%, #a22b1e 100%); border: 2px solid var(--gold-soft);
  box-shadow: 0 0 10px rgba(200, 58, 42, 0.55);
  animation: pulse-vs 2s infinite ease-in-out;
}
@keyframes pulse-vs { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.war-gauge-bar { width: 100%; height: 10px; margin-bottom: 8px; overflow: hidden; background: #0c1613; border: 1px solid #224a3d; border-radius: 2px; }
.war-gauge-fill { height: 100%; width: var(--pct, 50%); background: linear-gradient(90deg, var(--gold-bronze), var(--gold-pale)); transition: width 0.3s ease; }
.war-duel-footer { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: #b9ae98; }
.war-duel-footer strong { color: #ede6dc; }

/* Les 5 familles : 2 colonnes, ma famille en pleine largeur */
.diplo-families-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.diplo-fam-card.kw-panel {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px;
  border-left: 5px solid var(--fam, var(--gold-bronze));
}
.diplo-fam-card.is-my-family { grid-column: 1 / -1; background-color: #4d4234; border-color: var(--gold-bronze); border-left-width: 5px; }
.diplo-fam-card-top { display: flex; align-items: center; gap: 12px; }
.diplo-fam-logo { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.diplo-fam-main-info { flex: 1; min-width: 0; }
.diplo-fam-main-info h4 { margin: 0 0 2px; font-family: 'Limelight', serif; font-size: 14px; letter-spacing: 0.6px; color: #ede6dc; }
.diplo-fam-don { font-size: 13px; color: var(--text-cream); }
.diplo-fam-don strong { color: var(--gold-pale); }
.diplo-fam-meta { font-size: 12px; color: #c9c0b4; }
.diplo-fam-status-col { flex-shrink: 0; }

/* Pastilles de statut */
.diplo-badge { display: inline-block; padding: 3px 8px; border-radius: 3px; font-size: 12px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap; }
.diplo-badge.diplo-mine { background: var(--gold-soft); color: #181512; }
.diplo-badge.diplo-war { background: #a22b1e; color: #fff; border: 1px solid #ee958b; animation: pulse-vs 2s infinite ease-in-out; }
.diplo-badge.diplo-pna { background: #366353; color: #fff; border: 1px solid #7ad4b3; }
.diplo-badge.diplo-neutral { background: #2c2c2c; color: #d7cfc5; border: 1px solid #8a8a8a; }

/* Boutons d'action : .kw-btn.is-small, la variante change la teinte */
.diplo-fam-actions { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid rgba(222, 196, 162, 0.2); }
.diplo-action-btn { flex: 1; text-transform: none; letter-spacing: 0.2px; line-height: 1.25; }
.diplo-action-btn.btn-break-pna { color: #f1a39a; border-color: #a22b1e; }
.diplo-action-btn.btn-war-active { color: #f1a39a; border-color: #633f3b; }
.diplo-action-btn:disabled { opacity: 0.75; }

/* Archives : tableau sombre dans un panneau */
.diplo-history-wrap.kw-panel { padding: 0; }
.diplo-history-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--text-cream); }
.diplo-history-table thead th {
  padding: 7px 10px; text-align: left; font-family: 'Limelight', serif; font-size: 12px; letter-spacing: 0.8px;
  color: var(--gold-pale); background: #1a1a1a; border-bottom: 1px solid var(--gold-bronze);
}
.diplo-history-table td { padding: 6px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.diplo-history-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.18); }
.diplo-history-table .is-center { text-align: center; }
.diplo-history-table .is-right { text-align: right; }
.diplo-hist-logo { width: 18px; height: 18px; margin-right: 6px; vertical-align: middle; object-fit: contain; }
.diplo-td-score { font-weight: 700; color: var(--gold-pale); }
.diplo-td-win { font-weight: 700; color: #7ad4b3; }
.diplo-td-win.is-draw { color: #b9ae98; }
.diplo-td-date { color: #b9ae98; }
.diplo-history-table td.diplo-history-empty { padding: 16px; text-align: center; font-style: italic; color: #b9ae98; }
