/* Raid (Fiche d'une cible, Calculer un raid) : les retouches d'après les maquettes du 8 oct. 2026, après tools.css (qui garde le socle commun des outils).
   Une feuille par page : les sessions qui refont chaque page ne se marchent pas dessus. */

/* ─── Le bandeau « Lié au plan » (fiche et calcul, un plan ouvert) ─────────────────────────────────────── */
.rd-context {
  gap: 8px 16px;
  margin: 0;
  padding: 12px 20px;
  border: 1px solid var(--line-gold);
  border-top: 0;
  background: linear-gradient(180deg, #1d1813, #15120e);
}
.rd-context > .rd-context__label {
  flex: none;
  color: var(--text-soft);
  font: 500 0.95rem "Roboto Condensed", sans-serif;
}
.rd-context > .rd-context__name {
  display: inline-flex;
  flex: 1 1 200px;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.rd-context__name i {
  color: var(--text-soft);
}
.rd-context__name b {
  overflow: hidden;
  color: var(--cream);
  font: 700 1rem "Roboto Condensed", sans-serif;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rd-context .rd-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text-soft);
  font: 500 0.9rem "Roboto Condensed", sans-serif;
  cursor: pointer;
}
.rd-context .rd-context__back {
  color: var(--cream);
  font-weight: 700;
  font-size: 0.98rem;
}
.rd-context .rd-link:hover,
.rd-context .rd-link:focus-visible {
  color: var(--gold);
}
.rd-tabs + .rd-context + .tools-panel {
  border-top: 0;
}

/* ─── Fiche d'une cible ─────────────────────────────────────────────────────────────────────────────── */
/* Plus de barre au-dessus : la colonne des cibles et la fiche commencent en haut du cadre */
.rd-view[data-view="sheet"] .rd-sheet {
  margin-top: -6px;
}
/* À gauche : la recherche, la catégorie, puis le matériau et les cibles */
.rd-pickbar {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.rd-pickbar .rd-search input {
  min-height: 46px;
  font-size: 0.98rem;
}
.rd-pickbar .rd-catpick {
  width: 100%;
}

/* À droite : partager et les engins de siège en haut, puis la cible */
.rd-view[data-view="sheet"] .rd-detail {
  min-width: 0;
  padding: 20px 26px 24px 24px;
}
.rd-detail__tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 6px;
}
/* Les engins de siège, en case à cocher : la case, le titre et les engins dessous */
.rd-siege-switch.rd-check {
  flex-direction: row-reverse;
  gap: 12px;
  min-height: 0;
  padding: 4px 6px;
  border-color: transparent;
  background: none;
}
.rd-siege-switch.rd-check > .fa-chess-rook {
  display: none;
}
.rd-siege-switch.rd-check:hover,
.rd-siege-switch.rd-check:has(input:checked) {
  border-color: transparent;
  background: none;
}
.rd-siege-switch.rd-check b {
  font-size: 0.95rem;
}
.rd-check__box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--edge-strong);
  background: #0f0d0b;
}
.rd-siege-switch.rd-check:has(input:checked) .rd-check__box {
  border-color: var(--cream);
  background: var(--picked-bg);
}
.rd-siege-switch.rd-check:has(input:checked) .rd-check__box::before {
  content: "";
  width: 6px;
  height: 11px;
  margin-top: -3px;
  border: solid var(--cream);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.rd-siege-switch.rd-check:hover .rd-check__box {
  border-color: var(--gold);
}

/* La cible : sans cadre, sur le fond de la fiche ; le nom en grand */
.rd-view[data-view="sheet"] .rd-answer {
  border: 0;
  background: none;
}
.rd-view[data-view="sheet"] .rd-answer__head {
  padding: 0 0 18px;
  border: 0;
  background: none;
}
.rd-view[data-view="sheet"] .rd-answer__title h4 {
  font-size: 2.1rem;
}

/* Les trois méthodes : une carte chacune, le liseré et le titre de leur couleur ; la choisie en brun éclairci */
.rd-mcards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.rd-mcard {
  --mc: var(--c-explosives);
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--edge);
  border-left: 3px solid var(--mc);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mc) 12%, transparent), transparent 60%),
    linear-gradient(180deg, #221c16, #17130f);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.rd-mcard.is-melee { --mc: var(--c-melee); }
.rd-mcard.is-guns { --mc: var(--c-guns); }
.rd-mcard:hover,
.rd-mcard:focus-visible {
  border-color: var(--edge-strong);
  border-left-color: var(--mc);
}
.rd-mcard.is-on {
  border-color: rgba(240, 228, 204, 0.55);
  border-left-color: var(--mc);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--mc) 16%, transparent), transparent 60%),
    var(--picked-bg);
}
.rd-mcard__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mc);
  font: 700 0.92rem "Roboto Condensed", sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rd-mcard__body {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}
.rd-mcard__body > span:last-child {
  display: grid;
  min-width: 0;
}
.rd-mcard__body b {
  color: var(--cream);
  font: 700 1.35rem "Roboto Condensed", sans-serif;
  line-height: 1.15;
}
.rd-mcard__body small {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.rd-mcard__body small:last-child:not(:nth-child(2)) {
  color: var(--text);
}
.rd-mcard__none {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-style: italic;
}

/* Le détail : le titre à gauche, la quantité et « Ajouter au raid » à droite, puis le tableau */
.rd-mhead {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 16px;
  margin: 22px 0 12px;
}
.rd-mhead h4 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--gold);
  font: 700 1.02rem "Roboto Condensed", sans-serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.rd-mhead__add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.rd-mhead__add .rd-sheet__qty {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}
.rd-mtable-wrap {
  border: 1px solid var(--edge);
}
.rd-mtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.rd-mtable thead th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--edge-strong);
  background: var(--surface-3);
  color: var(--cream);
  font: 700 0.92rem Roboto, sans-serif;
  text-align: left;
  white-space: nowrap;
}
.rd-mtable thead th small {
  color: var(--text-soft);
  font-weight: 400;
  font-size: 0.8rem;
}
.rd-mtable tbody tr {
  border-top: 1px solid var(--edge);
  background: rgba(var(--shadow-rgb), 0.18);
}
.rd-mtable tbody tr:nth-child(even) {
  background: rgba(var(--sheen-rgb), 0.015);
}
.rd-mtable tbody tr.is-best {
  background: color-mix(in srgb, var(--picked-bg) 70%, transparent);
  box-shadow: inset 3px 0 0 var(--gold);
}
.rd-mtable tbody th,
.rd-mtable td {
  padding: 7px 14px;
  vertical-align: middle;
}
.rd-mtable tbody th {
  color: var(--cream);
  font-weight: 500;
  text-align: left;
}
.rd-mtable tbody th {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}
.rd-mtable tbody th > span:last-child {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.rd-mtable td {
  color: var(--text);
}
.rd-mtable__count b {
  color: var(--cream);
  font: 700 1.05rem "Roboto Condensed", sans-serif;
}
.rd-mtable .rd-sulfur {
  gap: 8px;
  color: var(--text);
  font: 400 0.95rem Roboto, sans-serif;
}
.rd-mtable__muted {
  color: var(--text-soft);
  font-style: italic;
}
.rd-mtable__none {
  padding: 14px 16px;
  border: 1px solid var(--edge);
}
#tg-methods .rd-more-link {
  margin-top: 10px;
}
#tg-siege-list:not(:empty) {
  margin-top: 16px;
}
.rd-detail #tg-why {
  margin-top: 16px;
}

/* Le tableau de référence : replié par son titre (le chevron à droite), les moyens en onglets soulignés */
.rd-ref summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.rd-ref summary span::before,
.rd-ref[open] summary span::before {
  content: none;
}
.rd-ref__ic {
  color: var(--gold);
  font-size: 1.1rem;
}
.rd-ref__legend {
  margin-left: auto;
}
.rd-ref__chev {
  color: var(--gold);
  font-size: 1.05rem;
  transition: transform 0.2s;
}
.rd-ref[open] .rd-ref__chev {
  transform: rotate(180deg);
}
.rd-ref .rd-modes {
  gap: 0;
  border: 0;
  border-bottom: 1px solid var(--edge);
  background: none;
}
.rd-ref .rd-modes button,
.rd-ref .rd-modes button + button {
  margin-bottom: -1px;
  padding: 8px 18px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text);
  font-weight: 700;
}
.rd-ref .rd-modes button:hover,
.rd-ref .rd-modes button:focus-visible {
  background: none;
  color: var(--cream);
}
.rd-ref .rd-modes button.is-on {
  border-bottom-color: var(--gold);
  background: none;
  box-shadow: none;
  color: var(--gold);
}
.rd-ref .rd-modes button::after {
  content: none;
}

/* ─── Calculer un raid ──────────────────────────────────────────────────────────────────────────────── */
.rc-col {
  display: grid;
  gap: 14px;
  min-width: 0;
}
/* Les engins de siège : une carte à eux, l'interrupteur à côté du titre */
.rc-siege {
  border-top-width: 1px;
}
.rc-siege .rd-siege-switch {
  justify-content: flex-start;
  width: 100%;
  min-height: 64px;
  padding: 12px 20px;
  border: 0;
  background: none;
}
.rc-siege .rd-siege-switch > .fa-chess-rook {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  color: var(--gold);
}
.rc-siege .rd-siege-switch b {
  font-size: 1.1rem;
}
.rc-siege .rd-siege-switch > span {
  flex: 0 1 auto;
}
.rc-siege .rd-siege-switch:has(input:checked) {
  background: var(--picked-bg);
}

/* Les cibles à détruire : sans phrase sous le titre ; une liste vide le dit */
.rc-rows .rc-empty {
  padding: 16px 12px;
  border: 1px dashed var(--edge-strong);
  color: var(--text-soft);
  font-size: 0.9rem;
  list-style: none;
}

/* Ajouter une cible : la recherche à droite du titre, la catégorie et le matériau sur une ligne */
.rc-catalog {
  padding-top: 4px;
}
.rc-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
}
.rc-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.rc-filter[hidden] {
  display: none;
}
.rc-filter > span:first-child {
  flex: none;
  color: var(--cream);
  font: 700 0.95rem Roboto, sans-serif;
}
.rc-filter > span:first-child::after {
  content: "\00a0:";
}
html[lang="en"] .rc-filter > span:first-child::after {
  content: ":";
}
.rc-filter > span:last-child {
  flex: 1 1 auto;
  min-width: 0;
}
.rc-filter .rd-catpick {
  width: 100%;
  min-width: 0;
}
.rd-gradepick__ic {
  position: absolute;
  left: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  pointer-events: none;
}
.rd-gradepick__ic img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.rc-catalog .rd-tiles {
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

/* Le résultat : partager en haut à droite (souligné de miel), le titre et son résumé */
.rc-compare {
  border-top-width: 1px;
}
.rc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: 0 20px;
  padding: 16px 0 14px;
  border-bottom: 2px solid var(--gold);
}
.rc-actions .rd-to-plan {
  margin-right: 0;
}
.rc-result p {
  font-size: 0.95rem;
}
.rc-result p b {
  color: var(--gold);
  font-weight: 700;
}

/* La stratégie : en tête de l'onglet, le titre en miel au-dessus du menu */
.rc-pick {
  display: grid;
  gap: 8px;
  margin-top: 0;
}
.rc-pick__label {
  color: var(--gold);
  font: 700 0.92rem "Roboto Condensed", sans-serif;
}
.rc-pick .rd-catpick {
  width: 100%;
}
.rc-pick + .rc-note {
  margin: 8px 0 0;
  line-height: 1.45;
}
/* Le matériel nécessaire : la ligne du résultat, teintée du rouge des explosifs, le soufre en grand à droite */
.rc-gear li {
  border-color: color-mix(in srgb, var(--c-explosives) 55%, transparent);
  border-left: 3px solid var(--c-explosives);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--c-explosives) 18%, transparent), transparent 70%),
    linear-gradient(180deg, rgba(42, 35, 28, 0.9), rgba(24, 20, 16, 0.95));
}
.rc-gear b {
  font: 700 1.15rem "Roboto Condensed", sans-serif;
}
.rc-gear .rc-count b {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cream);
  font-size: 1.7rem;
  line-height: 1;
}
.rc-gear .rc-count img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.rc-gear .rc-total {
  grid-template-columns: minmax(0, 1fr) auto;
  padding-left: 14px;
  border-color: var(--edge);
  border-left-color: var(--gold);
  background: rgba(var(--shadow-rgb), 0.22);
  color: var(--cream);
  font: 700 1rem "Roboto Condensed", sans-serif;
  text-transform: uppercase;
}
/* Les ressources en trois colonnes, comme la maquette */
.rc-compare .rc-res {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rc-compare .rc-res b {
  font-size: 1.05rem;
}
.rc-compare .rc-res small {
  font-size: 0.8rem;
}
/* Les étapes de fabrication : repliables, ouvertes d'office */
.rd-more[data-more="craft"] {
  margin-top: 14px;
}
.rd-more[data-more="craft"] > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.rd-more[data-more="craft"] > summary {
  color: var(--cream);
  font: 700 0.95rem Roboto, sans-serif;
}
.rd-more[data-more="craft"] > summary i {
  color: var(--gold);
}
.rd-more[data-more="craft"] > summary small {
  flex-basis: 100%;
  padding-left: 26px;
  color: var(--text-soft);
  font: 400 0.82rem Roboto, sans-serif;
}
.rd-more[data-more="craft"] .rc-res {
  margin-top: 8px;
}

/* ─── Petits écrans ─────────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .rd-mcards {
    grid-template-columns: minmax(0, 1fr);
  }
  .rd-mcard {
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
  }
}
@media (max-width: 760px) {
  .rd-view[data-view="sheet"] .rd-detail {
    padding: 18px 16px 20px;
  }
  .rd-detail__tools {
    justify-content: space-between;
  }
  .rd-view[data-view="sheet"] .rd-answer__title h4 {
    font-size: 1.6rem;
  }
  .rd-mcard {
    grid-template-columns: minmax(0, 1fr);
  }
  .rd-mhead__add {
    width: 100%;
    justify-content: space-between;
  }
  .rd-mtable {
    font-size: 0.86rem;
  }
  .rd-mtable tbody th {
    display: table-cell;
    min-width: 0;
  }
  .rd-mtable thead th {
    white-space: normal;
  }
  .rd-mtable thead th small {
    display: block;
  }
  .rd-mtable .rd-sulfur img,
  .rd-mtable tbody th .rd-slot {
    display: none;
  }
  .rc-gear .rc-count b {
    font-size: 1.35rem;
  }
  .rd-mtable thead th,
  .rd-mtable tbody th,
  .rd-mtable td {
    padding-inline: 10px;
  }
  .rc-filters {
    grid-template-columns: minmax(0, 1fr);
  }
  .rc-compare .rc-res {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rd-context {
    padding: 10px 14px;
  }
}
