/* [90-reports] Rapports de combat et Dossier (messagerie) */
/* ==========================================================================
   RAPPORT DE COMBAT — fenêtre VICTOIRE / DÉFAITE
   Face-à-face (portraits en pied, Respect au centre, boosts), bandeau des pertes,
   partie basse par onglet, pied « Rapport de Rixe » + bouton ATTAQUE gris
   ========================================================================== */
#battle-report-modal { z-index: 210; }
.battle-report-box { width: 780px; height: 96%; } /* taille fixe : pas de saut d'un onglet à l'autre */
.battle-report-box .modal-crown-title { min-width: 300px; font-size: 22px; letter-spacing: 1.5px; }
.br-body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }

/* ---------- Face-à-face ---------- */
.br-versus {
  position: relative;
  flex-shrink: 0; /* le face-à-face garde sa hauteur : c'est la partie basse qui défile si la place manque */
  height: 236px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(49, 53, 57, 0.55), transparent 70%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.55));
  border-bottom: 1px solid #5e4b33;
}
.br-side { position: absolute; top: 0; bottom: 0; width: 250px; }
.br-side-left { left: 0; }
.br-side-right { right: 0; }
.br-ident {
  position: absolute;
  top: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.br-side-left .br-ident { left: 14px; }
.br-side-right .br-ident { right: 14px; flex-direction: row-reverse; text-align: right; }
.br-name { color: #caa068; font-size: 14px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.br-sub { color: var(--text-cream); font-size: 11.5px; }
/* blason : écusson clair */
.br-crest {
  width: 32px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f2ece4, #b8ae98);
  clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%);
  color: #205443;
  font-family: 'Limelight', serif;
  font-size: 13px;
  font-weight: 900;
}
.br-crest img { width: 24px; height: 24px; object-fit: contain; margin-top: -4px; }
.br-verdict {
  position: absolute;
  top: 66px;
  z-index: 3;
  color: var(--text-cream);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 15px;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 3px #000;
}
.br-side-left .br-verdict { right: 6px; }
/* Ouverture du rapport : GAGNANT / PERDANT tombent comme un tampon (battleReportFx.js) */
.br-fx-stamp { animation: br-stamp 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes br-stamp {
  0% { opacity: 0; transform: scale(2.2) rotate(-8deg); }
  70% { opacity: 1; transform: scale(0.94) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.br-side-right .br-verdict { left: 6px; }
.br-portraits {
  position: absolute;
  bottom: 0;
  height: 196px;
  display: flex;
  align-items: flex-start;
}
.br-side-left .br-portraits { left: 24px; }
.br-side-right .br-portraits { right: 10px; flex-direction: row-reverse; }
.br-portraits img {
  height: 330px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.8));
}
.br-side-right .br-portraits img + img { margin-right: -46px; height: 300px; margin-top: 18px; filter: brightness(0.85) drop-shadow(0 0 6px rgba(0, 0, 0, 0.8)); }

.br-center {
  position: absolute;
  left: 250px;
  right: 250px;
  top: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.br-coin { position: absolute; left: 0; top: 4px; width: 62px; height: 62px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8)); }
.br-center-head { margin-left: 70px; text-align: center; }
.br-label {
  color: #c7985b;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 13.5px;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 2px #000;
}
.br-respect {
  min-width: 170px;
  margin-top: 2px;
  padding: 2px 10px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.6) 20%, rgba(0, 0, 0, 0.6) 80%, transparent);
  color: #fff;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.br-label-boosts { margin: 14px 0 6px; }
.br-boost-row {
  width: 270px;
  height: 28px;
  margin-bottom: 6px;
  display: flex;
  align-items: stretch;
  gap: 2px;
}
.br-boost-val {
  width: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  border: 1px solid var(--gold-brass);
  color: #d8b588;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.br-boost-row .br-boost-val:last-child { color: #fff; border-color: #8a8a8a; }
.br-boost-name {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #5a5a5a 0%, #2a2a2a 50%, #141414 51%, #222 100%);
  border: 1px solid #000;
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.4px;
}

/* bandeau des pertes sous les portraits */
.br-statband {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.85));
}
.br-stats { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 16px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.br-neg { color: #ce4535; margin-right: 10px; }
.br-stats-right .br-neg { margin: 0 0 0 10px; }
.br-star { width: 22px; height: 22px; }
.br-gun { width: 24px; height: 24px; }
.br-flip { transform: scaleX(-1); }

/* ---------- Partie basse (onglets) ---------- */
.br-lower { flex: 1 1 236px; min-height: 236px; padding: 12px 16px 0; box-sizing: border-box; overflow-y: auto; } /* prend la place libre : le pied descend en bas de la fenêtre */
.br-pane.hidden { display: none; }
.br-summary { display: flex; gap: 18px; height: 100%; }
.br-summary-left { width: 270px; flex-shrink: 0; }
.br-loot-title { color: #fff; font-size: 15px; margin-bottom: 4px; }
.br-loot { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-bottom: 12px; }
.br-loot-row {
  height: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  background: linear-gradient(180deg, #3a3a3a, #1e1e1e);
  border: 1px solid #000;
  color: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.br-loot-icon { width: 18px; height: 18px; flex-shrink: 0; }
.br-loot-item { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 3px 8px; background: linear-gradient(180deg, #3a3a3a, #1e1e1e); border: 1px solid #000; font-size: 13px; }
.br-loot-item-img { width: 34px; height: 34px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.br-loot-item-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.br-loot-item-name small { color: #bbb; }
.br-loot-item-lost { opacity: 0.5; }
.br-flavor { color: #fff; font-size: 14px; line-height: 1.35; }
.br-scene {
  flex: 1;
  height: 205px;
  padding: 2px;
  background: linear-gradient(180deg, var(--gold-sand), #785e3c);
}
.br-scene img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(0.75) contrast(1.05); }

.br-units-title { color: #fff; font-size: 13px; margin-bottom: 6px; }
.br-units { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.br-unit-head { color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.br-unit-row { display: flex; justify-content: space-between; gap: 10px; padding: 1px 0; color: #fff; font-size: 12.5px; }
.br-unit-name b { color: #c7985b; font-weight: 400; }
/* Niveau de boxe [Lx] : couleurs relevées sur les rapports de l'original (crochets blancs, chiffre coloré) */
.br-lv { color: #fff; }
.br-lv-1 { color: #fff; }
.br-lv-2 { color: #80bca6; }
.br-lv-3 { color: #66a5e1; }
.br-lv-4 { color: #ac6efa; }
.br-lv-5 { color: #d8ae78; }
.br-lv-6 { color: #33cccc; }
.br-lv-7 { color: #46b98f; }
.br-lv-8 { color: #b99d79; }
.br-unit-count { font-variant-numeric: tabular-nums; white-space: nowrap; }
.br-unit-count.br-hurt { color: #ee958b; }
.br-dim { color: #8a8a8a; }

.br-boost-table { width: 100%; border-collapse: collapse; font-size: 13px; color: #fff; }
.br-boost-table th { color: #c7985b; font-weight: 400; text-align: center; padding: 6px; border-bottom: 1px solid #5e4b33; }
.br-boost-table td { padding: 7px; text-align: center; border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-variant-numeric: tabular-nums; }
.br-boost-table td:first-child { text-align: left; color: #dacab4; }
.br-note { margin-top: 12px; color: #b8b0a0; font-size: 12px; line-height: 1.4; }

.br-after-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.45);
  border-left: 3px solid var(--gold-brass);
  color: #fff;
  font-size: 12.5px;
}
.br-after-row strong { color: #c7985b; font-weight: 700; }
.br-after-row em { color: #a8a090; font-style: normal; font-size: 11.5px; }

/* ---------- Pied ---------- */
.br-footer {
  flex-shrink: 0;
  height: 46px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(160, 127, 84, 0.35);
}
.br-ref { color: var(--text-cream); font-size: 11.5px; line-height: 1.35; }
/* Lieu du combat, épingle rouge et nom doré comme dans l'original */
.br-place { display: flex; align-items: center; gap: 5px; color: #c8a67a; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-pin { width: 14px; height: 14px; flex: none; }
.br-attack-btn {
  min-width: 150px;
  height: 28px;
  background: linear-gradient(180deg, #8a8a8a 0%, #5a5a5a 48%, #3a3a3a 52%, #4a4a4a 100%);
  border: 1px solid #d0d0d0;
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 2px #000;
  color: #e8e8e8;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 13px;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 1px #000;
  cursor: pointer;
}
.br-attack-btn:hover { filter: brightness(1.2); }
/* Courrier : « TOUT EFFACER » est irréversible, il ne ressemble pas à « SUPPRIMER LES LUS » */
#rep-btn-clear-all {
  background: linear-gradient(180deg, #3f876f 0%, #255948 48%, #173b2f 52%, #1c4a3b 100%);
  border-color: #cda775;
}

/* ==========================================================================
   DOSSIER — liste des rapports façon messagerie
   ========================================================================== */
.dossier-box { width: 760px; }
.dossier-body { height: 430px; padding: 12px 16px 0; box-sizing: border-box; }
.dossier-list-view { height: 100%; display: flex; flex-direction: column; }
.dossier-head,
.dossier-row {
  display: grid;
  grid-template-columns: 34px 1fr 96px 96px 28px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
}
.dossier-head {
  height: 26px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #5a5a5a 0%, #2a2a2a 50%, #141414 51%, #222 100%);
  border: 1px solid #000;
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.dossier-rows {
  flex: 1;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid #352e25;
  border-top: none;
}
.dossier-row {
  height: 38px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #a8a090;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}
.dossier-row:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.dossier-row:hover { background: rgba(160, 127, 84, 0.16); }
.dossier-row.unread { color: #fff; font-weight: 700; }
.dossier-row.unread .dc-icon::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ce4535;
  box-shadow: 0 0 0 1px #000;
}
.dc-icon {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #1a1c1d, #08090a);
  border: 1px solid var(--gold-brass);
  border-radius: 3px;
}
.dossier-head .dc-icon { background: none; border: none; }
.dc-icon svg { width: 20px; height: 20px; }
.dc-subject { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dc-date { text-align: right; font-weight: 400; font-variant-numeric: tabular-nums; color: #a8a090; }
.dc-tag {
  display: inline-block;
  min-width: 78px;
  padding: 2px 0;
  border-radius: 3px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.dc-won { background: linear-gradient(180deg, #49a181, #1e5c45); color: #fff; }
.dc-lost { background: linear-gradient(180deg, #ba4234, #6c1f16); color: #fff; }
.dc-info { background: linear-gradient(180deg, #4a4a4a, #1c1c1c); color: #cda775; border: 1px solid #6d5a41; }
.dc-del {
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #6a6458;
  font-size: 12px;
  cursor: pointer;
}
.dc-del:hover { color: #fff; background: var(--red-blood); border-color: #cda775; }
.dossier-empty { padding: 30px 16px; text-align: center; color: #a8a090; font-size: 13px; }

.dossier-detail-view { height: 100%; overflow-y: auto; }
.dossier-detail-view.hidden,
.dossier-list-view.hidden,
.dossier-actions.hidden { display: none; }

.dossier-footer {
  height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dossier-count { color: #a8a090; font-size: 12px; }
.dossier-count.hidden { display: none; }
.dossier-actions { display: flex; gap: 10px; }

/* Rapport de combat : bâtiment visé, tel que sur la carte de la Ville */
.br-target-art {
  position: absolute;
  right: 8px;
  bottom: 26px;
  width: 244px;
  height: 162px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.br-target-art img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.9));
}
/* le libellé GAGNANT / PERDANT reste lisible au-dessus du bâtiment */
.br-side-right .br-verdict { top: 54px; }

/* conteneur de la promo 2e contremaître : ne crée pas d'écart quand il est vide */
#card-second-builder-slot:empty { display: none; }

/* Multi-marches : la 1re sur la rangée de l'icône, les suivantes
   en retrait dans un panneau sombre, barre plus courte et bouton « SPEED » réduit */
#queue-slot-marches { position: relative; }
/* proportions relevées sur l'original : panneau collé sous la barre principale,
   de son début à sa fin, piste plus courte et bouton SPEED à l'intérieur */
.march-inline-card.march-sub {
  height: 17px;
  /* remonte sous la piste de la marche précédente (la rangée a 4 px de marge sous sa piste) */
  margin: -4px 54px 0 1px;
  background: linear-gradient(180deg, #111213, var(--ink-black));
  border: 1px solid #93764f;
  border-top-color: #5e4b33;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}
.march-inline-card.march-sub .queue-progress-track {
  top: 3px;
  bottom: 3px;
  left: 4px;
  right: 40px;
  border-left: 1px solid #817463;
}
.march-inline-card.march-sub .march-text { margin: 0 40px 0 4px; padding-left: 6px; }
.march-inline-card.march-sub .btn-speedup-march {
  width: 34px;
  height: 11px;
  right: 3px;
  top: 2px;
  font-size: 7px;
  line-height: 9px;
}
#queue-slot-marches.marches-collapsed .march-sub { display: none; }

/* bouton or à triangle rouge : sous le panneau, au début de la barre, à cheval sur son bord bas */
.march-collapse-btn {
  display: none;
  position: absolute;
  left: var(--q-h);
  bottom: -12px;
  z-index: 3;
  width: 15px;
  height: 15px;
  padding: 0;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, #f2dec5 0%, #d3ab77 45%, #936b37 100%);
  border: 1px solid #4a3316;
  border-radius: 2px;
  color: #b83628;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.march-collapse-btn svg { width: 11px; height: 11px; }
#queue-slot-marches.multi.expanded .march-collapse-btn { display: flex; }
#queue-slot-marches.marches-collapsed .march-collapse-btn svg { transform: rotate(180deg); }
#queue-slot-marches.multi.expanded { margin-bottom: 12px; }

/* Rapports et courrier : le texte se sélectionne (copier un nom, des coordonnées), les boutons non */
#reports-modal *:not(button):not(.modal-corner-close),
#battle-report-modal *:not(button):not(.modal-corner-close) { user-select: text; }
