/* ============================================================================
   bffr.fr/raid/simulateur - SIMULATEUR DE STATS (refonte du 2026-09-26, préfixe rsx-)
   ----------------------------------------------------------------------------
   Chargée par la route /raid/simulateur (option head de shell()), donc APRÈS
   raids/ds.css. Rendu : web/public/scripts/raid_sim.js (formules : raid_sim_engine.js).
   Remplace raid_sim.css, qui redéfinissait les variables de couleur sur :root
   (la page n'avait pas les mêmes teintes que le reste du site) et débordait à 390 px.
   Mise en page :
     >= 1200 px : équipement | contexte | résultats (collés à l'écran)
     961-1199   : équipement + contexte empilés | résultats collés
     <= 960     : résultats, équipement, contexte + barre flottante (puissance, coups)
   Règles : couleurs = variables de ds.css (teintes de tier/rareté = données, en style
   inline) ; aucun effet lourd sur les éléments répétés ; cibles tactiles >= 40 px.
   ============================================================================ */

/* ── 0. Bandeau + note de périmètre ────────────────────────────────────────── */
body.raidnew .rsx-scope {
  margin: -6px 0 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--hl);
}
body.raidnew .rsx-scope > summary {
  display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 16px;
  list-style: none; cursor: pointer; color: var(--txt2); font-size: .88rem; line-height: 1.35;
}
body.raidnew .rsx-scope > summary::-webkit-details-marker { display: none; }
body.raidnew .rsx-scope > summary:hover { color: var(--txt); }
body.raidnew .rsx-scope-i {
  display: inline-grid; place-items: center; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-dim); border: 1px solid var(--accent-line); color: var(--accent2); font: 800 .78rem/1 var(--font);
}
body.raidnew .rsx-scope-car { width: 16px; height: 16px; margin-left: auto; flex: 0 0 16px; opacity: .6; transition: transform .2s var(--ease); }
body.raidnew .rsx-scope[open] > summary .rsx-scope-car { transform: rotate(180deg); }
body.raidnew .rsx-scope > p { margin: 0; padding: 0 16px 14px 48px; color: var(--mut); font-size: .86rem; line-height: 1.6; }

/* ── 1. Briques communes ───────────────────────────────────────────────────── */
body.raidnew .rsim {
  font-variant-numeric: tabular-nums;
  /* Difficultés de boss sans teinte de rareté dans le catalogue : mêmes teintes que le wiki
     (raids/wiki.css, --w-divin-line et --w-secret). Information, hors thème, comme les raretés. */
  --rsx-divin: #a892ea; --rsx-secret: #ff6470;
}
body.raidnew .rsim *, body.raidnew .rsx-dock * { box-sizing: border-box; }
body.raidnew .rsx-mut { color: var(--mut); font-size: .8rem; line-height: 1.5; }
body.raidnew .rsx-ic { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; flex: 0 0 auto; }
body.raidnew .rsx-ic-s { width: 15px; height: 15px; }
body.raidnew .rsx-ph {
  display: grid; place-items: center; flex: 0 0 26px; width: 26px; height: 26px;
  color: var(--mut); border: 1px dashed var(--line2); border-radius: 8px; font-size: .72rem;
}
body.raidnew .rsx-tabs { margin: 0 0 18px; }
body.raidnew .rsx-card {
  min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 18px; box-shadow: var(--hl);
}
body.raidnew .rsx-head { margin: 0 0 14px; }
/* Titre de carte : .rgx-h2 (ds.css, taille et filet communs) ; la marge vient de .rsx-head. */
body.raidnew .rsx-h { margin: 0; }
body.raidnew .rsx-h-ic { width: 26px; height: 26px; object-fit: contain; flex: 0 0 26px; }
body.raidnew .rsx-head-s { margin: 6px 0 0; }
body.raidnew .rsx-sub {
  display: flex; align-items: center; gap: 10px; margin: 22px 0 12px;
  font: 700 .7rem/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--mut);
}
body.raidnew .rsx-sub::after { content: ""; flex: 1; height: 1px; background: var(--line); }
body.raidnew .rsx-head + .rsx-sub { margin-top: 4px; }

/* Champs */
body.raidnew .rsx-field { margin: 0 0 16px; min-width: 0; }
body.raidnew .rsx-lbl { display: block; margin: 0 0 8px; color: var(--mut); font-size: .76rem; font-weight: 650; letter-spacing: .02em; line-height: 1.35; }
body.raidnew .rsx-hint { margin-top: 7px; }
body.raidnew .rgmain .rsx-select { width: 100%; }

/* Contrôle segmenté */
body.raidnew .rsx-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 4px; padding: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 13px; }
body.raidnew .rsx-seg.is-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.raidnew .rsx-seg.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.raidnew .rsx-seg.is-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body.raidnew .rsx-segbtn {
  min-width: 0; min-height: 36px; padding: 4px 6px; border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  color: var(--mut); font: 650 .8rem/1.2 var(--font); text-align: center; transition: color .15s, background-color .15s;
}
body.raidnew .rsx-segbtn:hover { color: var(--txt); background: rgba(255, 255, 255, .04); }
body.raidnew .rsx-segbtn.on { background: var(--card2); color: var(--txt); box-shadow: var(--hl), 0 1px 2px rgba(0, 0, 0, .4), inset 0 -2px 0 var(--accent); }
/* Bouton à deux lignes (nom + précision, ex. zones vocales) : même forme pour tous les boutons du groupe. */
body.raidnew .rsx-segbtn.has-sub { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding-top: 5px; padding-bottom: 5px; }
body.raidnew .rsx-seg-t { white-space: nowrap; }
body.raidnew .rsx-seg-s { color: var(--mut); font-size: .72rem; font-weight: 600; line-height: 1.15; white-space: nowrap; }
body.raidnew .rsx-segbtn.on .rsx-seg-s { color: var(--accent2); }

/* Liste déroulante à icônes (panneau construit à l'ouverture) */
body.raidnew .rsx-dd { position: relative; min-width: 0; }
body.raidnew .rsx-dd-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 12px;
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 11px; cursor: pointer;
  color: var(--txt); font: 600 .9rem/1.2 var(--font); text-align: left; transition: border-color .15s;
}
body.raidnew .rsx-dd-btn:hover, body.raidnew .rsx-dd.open .rsx-dd-btn { border-color: var(--accent-line); }
body.raidnew .rsx-dd-btn .rsx-ic { width: 24px; height: 24px; }
body.raidnew .rsx-dd-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.raidnew .rsx-dd-sub { flex: 0 0 auto; color: var(--mut); font-size: .74rem; font-weight: 600; }
body.raidnew .rsx-dd-car { width: 16px; height: 16px; flex: 0 0 16px; color: var(--mut); transition: transform .15s; }
body.raidnew .rsx-dd.open .rsx-dd-car { transform: rotate(180deg); }
body.raidnew .rsx-dd.open { z-index: 50; }
body.raidnew .rsx-dd-panel {
  display: none; position: absolute; z-index: 80; top: calc(100% + 6px); left: 0; right: 0;
  padding: 6px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-m);
  box-shadow: var(--shadow-pop), var(--hl);
}
body.raidnew .rsx-dd.open .rsx-dd-panel { display: block; animation: rsx-pop .14s var(--ease); }
@keyframes rsx-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
body.raidnew .rgmain .rsx-dd-q { width: 100%; margin: 0 0 6px; min-height: 40px; }
body.raidnew .rsx-dd-list { position: relative; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
body.raidnew .rsx-dd-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 6px 10px;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer;
  color: var(--txt2); font: 550 .86rem/1.2 var(--font); text-align: left;
}
body.raidnew .rsx-dd-opt[hidden], body.raidnew .rsx-dd-none[hidden] { display: none; }
body.raidnew .rsx-dd-opt:hover { background: var(--card2); color: var(--txt); }
body.raidnew .rsx-dd-opt.sel { background: var(--accent-dim); color: var(--txt); }
body.raidnew .rsx-dd-opt .rsx-ic { width: 26px; height: 26px; }
body.raidnew .rsx-dd-none { padding: 14px 10px; color: var(--mut); font-size: .84rem; text-align: center; }

/* Bascule */
body.raidnew .rsx-toggle { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 4px 0 12px; cursor: pointer; color: var(--txt2); font-size: .86rem; line-height: 1.35; }
body.raidnew .rsx-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
body.raidnew .rsx-knob { position: relative; flex: 0 0 40px; width: 40px; height: 24px; border-radius: 999px; background: var(--line2); transition: background-color .15s; }
body.raidnew .rsx-knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--txt2); transition: transform .15s var(--ease); }
body.raidnew .rsx-toggle.on .rsx-knob { background: var(--accent); }
body.raidnew .rsx-toggle.on .rsx-knob::after { transform: translateX(16px); background: var(--on-accent); }
body.raidnew .rsx-toggle input:focus-visible + .rsx-knob { outline: 2px solid var(--accent); outline-offset: 2px; }
body.raidnew .rsx-toggle-l { flex: 1; min-width: 0; }

/* Compteur - / + */
body.raidnew .rsx-steppers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.raidnew .rsx-stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; margin-top: 8px; }
body.raidnew .rsx-field > .rsx-stepper:first-of-type:nth-child(2), body.raidnew .rsx-steppers .rsx-stepper { margin-top: 0; }
body.raidnew .rsx-step-l { min-width: 0; color: var(--mut); font-size: .8rem; font-weight: 600; }
/* margin-left:auto : un compteur sans libellé (Boss vaincus) se cale à droite comme les autres. */
body.raidnew .rsx-step-c { display: inline-flex; align-items: center; flex: 0 0 auto; margin-left: auto; background: var(--bg2); border: 1px solid var(--line2); border-radius: 11px; overflow: hidden; }
body.raidnew .rsx-stepbtn {
  width: 36px; height: 38px; border: 0; background: transparent; cursor: pointer;
  color: var(--txt2); font: 700 1.05rem/1 var(--font);
}
body.raidnew .rsx-stepbtn:hover { background: var(--card2); color: var(--accent2); }
body.raidnew .rgmain .rsx-stepin {
  width: 54px; min-height: 38px; padding: 0 4px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  border-radius: 0; background: transparent; color: var(--txt); text-align: center; font: 700 .92rem var(--font); -moz-appearance: textfield;
}
body.raidnew .rgmain .rsx-stepin:focus { box-shadow: none; background: var(--card2); }
body.raidnew .rsx-stepin::-webkit-outer-spin-button, body.raidnew .rsx-stepin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Cases à cocher (fruits, Haki, maîtrises) */
body.raidnew .rsx-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
body.raidnew .rsx-check {
  position: relative; display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 44px; padding: 6px 30px 6px 9px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; transition: border-color .13s, background-color .13s;
}
body.raidnew .rsx-check:hover { border-color: var(--line2); }
body.raidnew .rsx-check.on { border-color: var(--accent-line); background: var(--accent-dim); }
body.raidnew .rsx-cb { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
body.raidnew .rsx-check:has(.rsx-cb:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
body.raidnew .rsx-check-ic { width: 24px; height: 24px; object-fit: contain; flex: 0 0 24px; }
body.raidnew .rsx-check-b { display: flex; flex-direction: column; min-width: 0; }
body.raidnew .rsx-check-n { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--txt); font-size: .8rem; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
body.raidnew .rsx-check-s { color: var(--mut); font-size: .7rem; line-height: 1.3; }
body.raidnew .rsx-check-m { position: absolute; right: 9px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 5px; border: 1.5px solid var(--line2); }
body.raidnew .rsx-check.on .rsx-check-m { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--card2); }

/* Tiers (icônes de rang) */
body.raidnew .rsx-tiers { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
body.raidnew .rsx-tier {
  display: grid; place-items: center; min-width: 0; height: 46px; padding: 0;
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 11px; cursor: pointer;
  transition: border-color .13s, background-color .13s;
}
body.raidnew .rsx-tier:hover { border-color: var(--accent-line); }
body.raidnew .rsx-tier.on { border-color: var(--tc, var(--accent)); background: var(--card2); box-shadow: inset 0 0 0 1px var(--tc, var(--accent)); }
body.raidnew .rsx-tier-ic { display: block; width: 30px; height: 30px; object-fit: contain; }
body.raidnew .rsx-tier-l { font-weight: 800; font-size: .85rem; color: var(--tc, var(--txt)); }
body.raidnew .rsx-tiers.is-sm { gap: 4px; }
body.raidnew .rsx-tiers.is-sm .rsx-tier { height: 36px; border-radius: 9px; }
body.raidnew .rsx-tiers.is-sm .rsx-tier-ic { width: 22px; height: 22px; }

/* ── 2. Grille principale ──────────────────────────────────────────────────── */
body.raidnew .rsx-grid {
  display: grid; gap: 16px; align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(360px, 400px);
  grid-template-areas: "build ctx res";
}
body.raidnew .rsx-build { grid-area: build; }
body.raidnew .rsx-ctx { grid-area: ctx; }
body.raidnew .rsx-res { grid-area: res; }

/* ── 3. Colonne équipement ─────────────────────────────────────────────────── */
body.raidnew .rsx-real {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; padding: 10px 12px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
}
body.raidnew .rsx-real.is-ok { background: rgba(59, 224, 138, .06); background: color-mix(in srgb, var(--ok) 7%, transparent); border-color: rgba(59, 224, 138, .28); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
body.raidnew .rsx-real-t { flex: 1 1 200px; min-width: 0; color: var(--txt2); font-size: .82rem; line-height: 1.45; }
body.raidnew .rsx-real.is-ok .rsx-real-t { color: var(--ok); }
body.raidnew .rsx-realbtn {
  flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 1px solid var(--accent-line); border-radius: 10px; cursor: pointer;
  background: var(--accent-dim); color: var(--accent2); font: 700 .84rem var(--font); white-space: nowrap;
}
body.raidnew .rsx-realbtn:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
body.raidnew .rsx-realbtn:disabled { opacity: .55; cursor: progress; }
body.raidnew .rsx-realbtn:disabled:hover { background: var(--accent-dim); color: var(--accent2); border-color: var(--accent-line); }
/* Connecté mais profil illisible (pas encore de profil, service indisponible) : ton d'avertissement. */
body.raidnew .rsx-real.is-warn { border-color: var(--warn-line); }
body.raidnew .rsx-real.is-warn .rsx-real-t { color: var(--txt2); }
/* Élément du vrai build inconnu du simulateur (race, métier, fruit, familier) : ligne d'avertissement sous le statut. */
body.raidnew .rsx-real-w { order: 3; flex: 1 1 100%; padding: 8px 10px; border-radius: 9px; background: var(--warn-dim); border: 1px solid var(--warn-line); color: var(--txt2); font-size: .82rem; line-height: 1.45; }
body.raidnew .rsx-real-w::before { content: "!"; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px; border-radius: 50%; background: var(--warn); color: var(--on-accent); font-weight: 800; font-size: .72rem; vertical-align: 1px; }
body.raidnew .rsx-real.is-warn .rsx-real-t::before { content: "!"; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 7px; border-radius: 50%; background: var(--warn); color: var(--on-accent); font-weight: 800; font-size: .72rem; vertical-align: 1px; }

body.raidnew .rsx-pieces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0 0 16px; }
body.raidnew .rsx-piece { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 9px; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; font-size: .78rem; }
body.raidnew .rsx-piece .rsx-ic { width: 26px; height: 26px; }
body.raidnew .rsx-piece-n { min-width: 0; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

body.raidnew .rsx-pp-hint { margin: -4px 0 12px; }
body.raidnew .rsx-pp-hint b { color: var(--txt2); }
body.raidnew .rsx-alltier { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; padding: 10px; border: 1px dashed var(--line2); border-radius: 12px; }
body.raidnew .rsx-alltier .rsx-lbl { margin: 0; }
body.raidnew .rsx-pp { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
body.raidnew .rsx-pp-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
body.raidnew .rsx-pp-row.is-open { z-index: 60; }
body.raidnew .rsx-pp-top { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--txt); font-size: .82rem; font-weight: 650; }
body.raidnew .rsx-pp-ic { width: 24px; height: 24px; object-fit: contain; flex: 0 0 24px; }
body.raidnew .rsx-pp-slot { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.raidnew .rsx-pp-ench {
  flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; white-space: nowrap;
  color: var(--accent2); background: var(--accent-dim); border: 1px solid var(--accent-line);
}
body.raidnew .rsx-pp-row .rsx-dd-btn { background: var(--card); min-height: 42px; }
/* jamais d'opacity sur la ROW entière : elle créerait un contexte d'empilement et le menu ouvert
   se peindrait SOUS les rangées suivantes (et deviendrait semi-transparent). */
body.raidnew .rsx-pp-row.is-empty .rsx-pp-top { opacity: .6; }

body.raidnew .rsx-mast { margin: 4px 0 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
body.raidnew .rsx-mast > summary { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 12px; list-style: none; cursor: pointer; color: var(--txt2); font-size: .86rem; font-weight: 650; }
body.raidnew .rsx-mast > summary::-webkit-details-marker { display: none; }
body.raidnew .rsx-mast-n { color: var(--accent2); font-variant-numeric: tabular-nums; }
body.raidnew .rsx-mast-car { width: 16px; height: 16px; flex: 0 0 16px; margin-left: auto; opacity: .6; transition: transform .2s var(--ease); }
body.raidnew .rsx-mast[open] > summary .rsx-mast-car { transform: rotate(180deg); }
body.raidnew .rsx-mast-b { padding: 0 12px 12px; }
body.raidnew .rsx-mast-b > .rsx-mut { margin: 0 0 10px; }
body.raidnew .rsx-mast-act { display: flex; gap: 8px; margin: 0 0 10px; }
body.raidnew .rsx-mast-act .rgmini { min-height: 36px; }
body.raidnew .rsx-checks.is-mast { max-height: 360px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; scrollbar-width: thin; }
body.raidnew .rsx-checks.is-mast .rsx-check { background: var(--card); }
body.raidnew .rsim .rsx-flex { width: 100%; margin-top: 16px; min-height: 48px; line-height: 1.25; text-align: center; }

/* ── 4. Colonne contexte ───────────────────────────────────────────────────── */
body.raidnew .rsx-lock { display: flex; align-items: flex-start; gap: 9px; margin: -4px 0 12px; padding: 10px 12px; border: 1px dashed var(--line2); border-radius: 11px; color: var(--mut); font-size: .8rem; line-height: 1.45; }
body.raidnew .rsx-lock .rsx-ic { width: 18px; height: 18px; margin-top: 1px; opacity: .8; }

/* ── 5. Résultats ──────────────────────────────────────────────────────────── */
body.raidnew .rsx-res {
  position: sticky; top: calc(var(--head-h) + 16px); min-width: 0;
  max-height: calc(100vh - var(--head-h) - 32px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px; background: var(--card); border: 1px solid var(--line2); border-radius: var(--r-l); box-shadow: var(--hl);
}
body.raidnew .rsx-pw { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
body.raidnew .rsx-pw-k { color: var(--mut); font: 700 .7rem/1 var(--font); letter-spacing: .16em; text-transform: uppercase; }
body.raidnew .rsx-pw-v {
  margin-top: -2px; color: var(--accent2); font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em;
  font-size: clamp(2.1rem, 1.4rem + 1.6vw, 2.9rem); line-height: 1; overflow-wrap: anywhere;
}
body.raidnew .rsx-pw-s { color: var(--mut); font-size: .78rem; line-height: 1.45; }
body.raidnew .rsx-bd { display: flex; flex-direction: column; gap: 8px; }
body.raidnew .rsx-bdbar { display: flex; height: 8px; overflow: hidden; border-radius: 999px; background: var(--bg2); gap: 2px; }
body.raidnew .rsx-bdbar span { flex: none; min-width: 3px; height: 100%; border-radius: 2px; }
body.raidnew .rsx-bdlegend { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--mut); font-size: .74rem; }
body.raidnew .rsx-bdlegend span { display: inline-flex; align-items: center; gap: 5px; }
body.raidnew .rsx-bdlegend b { color: var(--txt2); font-weight: 650; }
body.raidnew .rsx-bdlegend i { width: 8px; height: 8px; border-radius: 2px; }
body.raidnew .rsx-mults { color: var(--txt2); font-size: .78rem; line-height: 1.5; }
body.raidnew .rsx-block { display: flex; flex-direction: column; gap: 8px; }
body.raidnew .rsx-bh { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--txt); font-size: .9rem; font-weight: 700; }
body.raidnew .rsx-bh .rsx-ic { width: 20px; height: 20px; }
body.raidnew .rsx-stats { display: flex; flex-direction: column; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
body.raidnew .rsx-st { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--line); }
body.raidnew .rsx-st:first-child { border-top: 0; }
body.raidnew .rsx-st-t { display: flex; flex-direction: column; flex: 1; min-width: 0; }
body.raidnew .rsx-st-k { color: var(--txt); font-size: .84rem; font-weight: 650; }
body.raidnew .rsx-st-d { color: var(--mut); font-size: .72rem; line-height: 1.35; }
body.raidnew .rsx-st-v { flex: 0 0 auto; color: var(--txt); font-size: 1.02rem; font-weight: 750; }
body.raidnew .rsx-dmg { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 2px 12px; }
body.raidnew .rsx-dmgrow { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 9px 0; border-top: 1px solid var(--line); }
body.raidnew .rsx-dmgrow:first-child { border-top: 0; }
body.raidnew .rsx-dmg-l { flex: 1 1 auto; color: var(--mut); font-size: .82rem; }
body.raidnew .rsx-dmg-v { color: var(--txt); font-size: 1.1rem; font-weight: 750; overflow-wrap: anywhere; }
body.raidnew .rsx-dmg-s { flex: 1 1 100%; color: var(--accent2); font-size: .74rem; text-align: right; }
body.raidnew .rsx-ctxline { padding: 0 2px; }
body.raidnew .rsx-ctxline.is-weak { color: var(--ok); }
body.raidnew .rsx-ctxline.is-res { color: var(--bad); }
body.raidnew .rsx-fp { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
body.raidnew .rsx-fp-tot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
body.raidnew .rsx-fp-tot b { color: var(--accent2); font-size: 1.08rem; }
body.raidnew .rsx-fp-list { display: flex; flex-direction: column; gap: 4px; }
body.raidnew .rsx-fp-item { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: .82rem; }
body.raidnew .rsx-fp-n { flex: 1; min-width: 0; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.raidnew .rsx-fp-m { flex: 0 0 auto; color: var(--mut); font-size: .74rem; }
body.raidnew .rsx-fp-d { flex: 0 0 auto; color: var(--txt); font-weight: 700; }
body.raidnew .rsx-kill {
  display: flex; flex-direction: column; gap: 6px; padding: 14px;
  background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--rc, var(--accent)); border-radius: 12px;
}
body.raidnew .rsx-kill-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.raidnew .rsx-kill-ic { width: 36px; height: 36px; object-fit: contain; flex: 0 0 36px; }
body.raidnew .rsx-kill-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
body.raidnew .rsx-kill-t b { color: var(--txt); font-size: .95rem; }
body.raidnew .rsx-kill-t small { color: var(--mut); font-size: .76rem; }
body.raidnew .rsx-kill-big { color: var(--txt2); font-size: .95rem; font-weight: 650; }
body.raidnew .rsx-kill-big b { color: var(--accent2); font-size: 1.5rem; font-weight: 800; margin-right: 2px; }
body.raidnew .rsx-kill-all { align-self: flex-start; min-height: 32px; display: inline-flex; align-items: center; font-size: .8rem; font-weight: 650; }

/* ── 6. Coups pour vaincre chaque boss ─────────────────────────────────────── */
body.raidnew .rsx-bosses { margin-top: 18px; scroll-margin-top: 80px; }
body.raidnew .rsx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
body.raidnew .rsx-chip-n { color: var(--mut); font-size: .72rem; font-weight: 600; }
body.raidnew .rgx-chip[aria-pressed="true"] .rsx-chip-n { color: inherit; opacity: .8; }
body.raidnew .rsx-dot { display: inline-block; flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--rc, var(--mut)); }
/* Carte (recette du 2026-09-27) : le NOM a toute la largeur sur sa ligne (2 lignes permises) ;
   difficulté/PV et nombre de coups se partagent la ligne du dessous (la difficulté passe sur deux
   lignes plutôt que de rogner le nom quand le nombre est énorme). 4 colonnes à 1440 px, 3 vers
   1100 px, 2 sur tablette, 1 au téléphone. Nom complet aussi dans l'attribut title de la carte. */
body.raidnew .rsx-bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
body.raidnew .rsx-bcard {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "ic name name" "ic meta num";
  align-items: center; align-content: center; gap: 4px 12px; min-width: 0; padding: 11px 14px 11px 12px;
  background: var(--bg2); border: 1px solid var(--line); border-left: 3px solid var(--rc, var(--line2)); border-radius: 12px;
  color: var(--txt2); font: inherit; text-align: left; cursor: pointer; transition: border-color .13s, background-color .13s;
}
body.raidnew .rsx-bcard:hover { background: var(--card2); border-color: var(--line2); border-left-color: var(--rc, var(--line2)); }
body.raidnew .rsx-bcard.on { background: var(--accent-dim); border-color: var(--accent-line); border-left-color: var(--rc, var(--accent)); }
body.raidnew .rsx-bcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.raidnew .rsx-bc-ic { grid-area: ic; width: 40px; height: 40px; object-fit: contain; }
body.raidnew .rsx-bcard .rsx-ph.rsx-bc-ic { flex: none; }
body.raidnew .rsx-bc-name {
  grid-area: name; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
  color: var(--txt); font-size: .9rem; font-weight: 700; line-height: 1.25;
}
body.raidnew .rsx-bc-m { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 5px; min-width: 0; color: var(--mut); font-size: .74rem; line-height: 1.3; }
body.raidnew .rsx-bc-d { color: var(--txt2); font-weight: 650; }
body.raidnew .rsx-bc-n { grid-area: num; justify-self: end; display: flex; align-items: baseline; gap: 4px; white-space: nowrap; line-height: 1.1; }
body.raidnew .rsx-bc-n b { color: var(--txt); font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; }
body.raidnew .rsx-bc-n small { color: var(--mut); font-size: .72rem; font-weight: 600; }
body.raidnew .rsx-bc-tag { padding: 1px 7px; border: 1px solid currentColor; border-radius: 999px; font-size: .66rem; font-weight: 700; line-height: 1.25; white-space: nowrap; }
body.raidnew .rsx-bc-tag.is-weak { color: var(--ok); }
body.raidnew .rsx-bc-tag.is-res { color: var(--bad); }
body.raidnew .rsx-bc-cur {
  padding: 1px 7px; border-radius: 999px; font-size: .66rem; font-weight: 750; line-height: 1.25; white-space: nowrap;
  color: var(--on-accent); background: var(--accent);
}
body.raidnew .rsx-bcard.on .rsx-bc-n b { color: var(--accent2); }

/* ── 7. Tableaux par tier ──────────────────────────────────────────────────── */
body.raidnew .rsx-tbar { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 12px; }
body.raidnew .rsx-tintro { margin: 0 0 12px; font-size: .84rem; }
body.raidnew .rsx-tintro b { color: var(--txt); }
body.raidnew .rsx-tscroll { overflow-x: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-m); }
body.raidnew .rsx-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
body.raidnew .rsx-table th { padding: 11px 13px; text-align: left; color: var(--mut); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); white-space: nowrap; }
body.raidnew .rsx-table td { padding: 10px 13px; border-bottom: 1px solid var(--line); color: var(--txt2); vertical-align: middle; }
body.raidnew .rsx-table tbody tr:last-child td { border-bottom: 0; }
body.raidnew .rsx-table tbody tr:hover td { background: rgba(255, 255, 255, .02); }
body.raidnew .rsx-table tr.is-sel td { background: var(--accent-dim); }
body.raidnew .rsx-table .rsx-tier-ic { width: 28px; height: 28px; }
body.raidnew .rsx-num { color: var(--accent2); font-weight: 750; }
body.raidnew .rsx-tierpill { display: inline-block; min-width: 28px; padding: 3px 8px; border-radius: 7px; text-align: center; color: var(--on-accent); font-weight: 800; font-size: .78rem; }
body.raidnew .rsx-sbh { margin: 22px 0 10px; }
body.raidnew .rsx-setbonus { max-width: 640px; padding: 2px 14px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r-m); }
body.raidnew .rsx-sbrow { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .84rem; color: var(--txt2); }
body.raidnew .rsx-sbrow:first-child { border-top: 0; }
body.raidnew .rsx-sbrow b { flex: 0 0 76px; color: var(--txt); }

/* ── 8. Barre flottante (téléphone et tablette) ────────────────────────────── */
body.raidnew .rsx-dock { display: none; }

/* ── 9. Adaptations ────────────────────────────────────────────────────────── */
@media (max-width: 1199px) {
  body.raidnew .rsx-grid { grid-template-columns: minmax(0, 1fr) minmax(330px, 370px); grid-template-areas: "build res" "ctx res"; }
}
@media (max-width: 960px) {
  body.raidnew .rsx-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "res" "build" "ctx"; gap: 14px; }
  body.raidnew .rsx-res { position: static; max-height: none; overflow: visible; }
  body.raidnew .rsx-card, body.raidnew .rsx-res { padding: 16px; border-radius: var(--r-m); }
  body.raidnew .rsx-scope > p { padding-left: 16px; }
  /* Barre flottante : enfant direct de body, au-dessus du bouton rond du chat (bas droite) et
     du bouton palette (bas gauche) ; cachée quand le chat est ouvert (son bouton reçoit .hide). */
  body.raidnew .rsx-dock {
    position: fixed; left: 14px; right: 14px; bottom: 82px; z-index: 1450;
    display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px;
    background: var(--card2); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--shadow-pop), var(--hl);
    color: var(--txt); font: inherit; text-align: left; cursor: pointer;
    opacity: 0; transform: translateY(12px); pointer-events: none; visibility: hidden;
    transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s linear .18s;
  }
  body.raidnew .rsx-dock.on { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 0s; }
  body.raidnew:has(.rgchat-fab.hide) .rsx-dock { display: none; }
  body.raidnew .rsx-dk-p, body.raidnew .rsx-dk-bt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
  body.raidnew .rsx-dock small { color: var(--mut); font-size: .68rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.raidnew .rsx-dk-p b { color: var(--accent2); font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
  body.raidnew .rsx-dk-b { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line2); }
  body.raidnew .rsx-dk-b .rsx-ic { width: 28px; height: 28px; }
  body.raidnew .rsx-dk-bt b { color: var(--txt); font-size: .92rem; white-space: nowrap; }
  body.raidnew .rsx-dk-car { width: 18px; height: 18px; flex: 0 0 18px; margin-left: auto; color: var(--mut); }
  /* Cibles tactiles */
  body.raidnew .rsx-segbtn { min-height: 40px; }
  body.raidnew .rsx-tiers.is-sm .rsx-tier { height: 40px; }
  body.raidnew .rsx-tiers.is-sm .rsx-tier-ic { width: 24px; height: 24px; }
  body.raidnew .rsx-stepbtn { width: 40px; height: 40px; }
  body.raidnew .rgmain .rsx-stepin { min-height: 40px; }
  body.raidnew .rsx-checks.is-mast { max-height: 420px; }
  /* Tableau -> cartes */
  body.raidnew .rsx-tscroll { overflow: visible; background: none; border: 0; }
  body.raidnew .rsx-table, body.raidnew .rsx-table tbody { display: block; }
  body.raidnew .rsx-table thead { display: none; }
  body.raidnew .rsx-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 0 0 8px; padding: 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; }
  body.raidnew .rsx-table tr.is-sel { border-color: var(--accent-line); background: var(--accent-dim); }
  body.raidnew .rsx-table td { display: block; padding: 0; border: 0; font-size: .82rem; }
  body.raidnew .rsx-table tbody tr:hover td, body.raidnew .rsx-table tr.is-sel td { background: none; }
  body.raidnew .rsx-table td.rsx-td-tier { grid-column: 1; grid-row: 1 / span 5; align-self: start; }
  body.raidnew .rsx-table td:not(.rsx-td-tier) { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
  body.raidnew .rsx-table td:not(.rsx-td-tier)::before { content: attr(data-l) " : "; color: var(--mut); font-size: .72rem; font-weight: 650; }
}
/* Tablette : les résultats prennent toute la largeur -> deux colonnes (statistiques | dégâts...). */
@media (min-width: 641px) and (max-width: 960px) {
  body.raidnew .rsx-res { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px 16px; }
  body.raidnew .rsx-res > .rsx-pw { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body.raidnew .rsx-seg.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.raidnew .rsx-tbar { grid-template-columns: minmax(0, 1fr); gap: 0; }
  body.raidnew .rsx-bgrid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body.raidnew .rsx-bcard { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 4px 11px; padding: 10px 12px 10px 11px; }
  body.raidnew .rsx-bc-ic { width: 36px; height: 36px; }
  /* Filtres de difficulté : une seule rangée qui défile au doigt (11 filtres = 4 rangées sinon),
     dans la marge intérieure de la carte (aucun débordement de la page). */
  body.raidnew .rsx-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 2px; scrollbar-width: none; overscroll-behavior-x: contain; }
  body.raidnew .rsx-chips::-webkit-scrollbar { display: none; }
  body.raidnew .rsx-chips .rgx-chip { flex: 0 0 auto; }
  /* raid_sim.js pose .is-l / .is-r quand il reste des pastilles à gauche / à droite : le masque (alpha
     seulement) estompe ce bord pour signaler qu'on peut faire défiler (même recette que le wiki). */
  body.raidnew .rsx-chips { --rsx-fl: 0px; --rsx-fr: 0px; }
  body.raidnew .rsx-chips.is-l { --rsx-fl: 40px; }
  body.raidnew .rsx-chips.is-r { --rsx-fr: 56px; }
  body.raidnew .rsx-chips.is-l, body.raidnew .rsx-chips.is-r {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--rsx-fl), #000 calc(100% - var(--rsx-fr)), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 var(--rsx-fl), #000 calc(100% - var(--rsx-fr)), transparent 100%);
  }
  body.raidnew .rsx-steppers { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body.raidnew .rsx-tier { height: 44px; }
  body.raidnew .rsx-tier-ic { width: 26px; height: 26px; }
  /* Planchers de lecture (charte §4.5) : texte courant 13 px ; étiquettes, pastilles et compteurs 12 px. */
  body.raidnew .rsx-card .rsx-sub, body.raidnew .rsx-pw .rsx-pw-k { font-size: .75rem; letter-spacing: .1em; }
  body.raidnew .rsx-pp-top .rsx-pp-ench, body.raidnew .rsx-dd-btn .rsx-dd-sub, body.raidnew .rsx-segbtn .rsx-seg-s { font-size: .75rem; }
  body.raidnew .rsx-check-b .rsx-check-s, body.raidnew .rgx-chip .rsx-chip-n { font-size: .75rem; }
  body.raidnew .rsx-bdlegend, body.raidnew .rsx-dmgrow .rsx-dmg-s { font-size: .75rem; }
  body.raidnew .rsx-st-t .rsx-st-d { font-size: .8125rem; }
  /* Texte courant (libellés de champ, explications, noms des cases) : 13 px (recette du 2026-09-27). */
  body.raidnew .rsim .rsx-lbl, body.raidnew .rsim .rsx-mut, body.raidnew .rsim .rsx-pw-s, body.raidnew .rsim .rsx-check-n, body.raidnew .rsim .rsx-lock, body.raidnew .rsim .rsx-kill-all { font-size: .8125rem; }
  body.raidnew .rsx-bcard .rsx-bc-m, body.raidnew .rsx-bc-m .rsx-bc-cur, body.raidnew .rsx-bc-n small { font-size: .75rem; }
  body.raidnew .rsx-dock small { font-size: .75rem; }
}
@media (max-width: 400px) {
  body.raidnew .rsx-seg.is-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  body.raidnew .rsx-checks, body.raidnew .rsx-pieces { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  body.raidnew .rsx-dd.open .rsx-dd-panel { animation: none; }
  body.raidnew .rsx-knob, body.raidnew .rsx-knob::after, body.raidnew .rsx-dd-car, body.raidnew .rsx-dock, body.raidnew .rsx-scope-car, body.raidnew .rsx-mast-car { transition: none; }
}
