/**
 * Ce qui s'ouvre par-dessus : la bulle de survol et le panneau latéral
 * (détail d'une mort, zones, listes de CD, fiche joueur, résumé).
 */

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  background: var(--float);
  border: 1px solid var(--line-float);
  border-radius: 8px;
  padding: 8px 10px;
  max-width: 340px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.6);
  font-size: 12.5px;
  line-height: 1.5;
}
.tooltip .t {
  font-weight: 650;
  margin-bottom: 2px;
}
.tooltip .k {
  color: var(--muted);
}
.tooltip .idle-note {
  color: var(--c-miss);
}
.tooltip .seg-rows {
  margin: 5px 0 3px;
  border-top: 1px solid var(--line-strong);
  padding-top: 4px;
}
.tooltip .seg-row {
  display: grid;
  grid-template-columns: 1fr auto 40px;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.5;
}
.tooltip .seg-row b {
  font-family: var(--mono);
}
.tooltip .seg-row .k {
  text-align: right;
}
.tooltip .time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.tooltip .tip-ico {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px var(--line-float);
}
/* tooltips.js (Wowhead) pose sa bulle sous le curseur sans la neutraliser : elle
   vole alors le survol de l'icône, qui se rallume et s'éteint en boucle. */
.wowhead-tooltip {
  pointer-events: none !important;
}

/* ---------- Drawer mort ---------- */
.drawer {
  position: fixed;
  top: 52px;
  right: 0;
  bottom: 0;
  width: var(--drawer-w);
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 46px rgba(0, 0, 0, 0.45);
  padding: 0;
}
/* Comparaisons : à gauche du principal. Largeur et position viennent de ui/drawer.js,
   qui les range côte à côte. */
.drawer.compare {
  z-index: 79;
}
/* Le bord gauche, à tirer pour élargir. Seul le corps défile : le bord reste en place. */
.drawer-grip {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  width: 7px;
  z-index: 3;
  cursor: ew-resize;
}
.drawer-grip:hover,
.drawer-resizing .drawer-grip {
  background: var(--line-hot);
}
/* Pendant le tirage, le texte ne se sélectionne pas sous le pointeur. */
.drawer-resizing {
  cursor: ew-resize;
  user-select: none;
}
.drawer-top {
  position: relative;
  z-index: 2;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.drawer-top.solo {
  justify-content: flex-end;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.drawer-ctl {
  position: relative;
  display: flex;
  gap: 6px;
}
.drawer .drawer-more {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}
/* Les options du panneau : sur le principal seulement, elles valent pour tous. */
.drawer-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 230px;
  padding: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
}
.drawer h2 {
  margin: 0 0 2px;
  font-size: 17px;
}
/* La croix vit dans la barre fixe, pas dans le contenu qui défile. */
.drawer .close {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
/* Le retour d'un détail vers la liste d'où il a été ouvert. */
.drawer .back {
  padding: 4px 10px;
  font-size: 12.5px;
  color: var(--muted);
}
.drawer .back:hover {
  color: var(--fg);
}
/* La croix est tracée, pas écrite : le glyphe « × » n'est centré dans aucune police. */
.drawer .close::before,
.drawer .close::after {
  content: '';
  grid-area: 1 / 1;
  width: 13px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
}
.drawer .close::before {
  transform: rotate(45deg);
}
.drawer .close::after {
  transform: rotate(-45deg);
}
.drawer .close:hover {
  background: var(--c-miss);
  border-color: var(--c-miss);
  color: #fff;
}
/* ---------- Détail d'une mort ---------- */
.death-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
}
/* Trois blocs (pourquoi, réactions, chronologie) : l'air entre eux fait la lecture. */
.death-sec {
  margin-top: 28px;
}
.drawer .death-sec .causes {
  gap: 10px;
  margin: 0;
}
.drawer .death-sec .moment {
  margin: 14px 0 0;
}
.death-uses {
  display: grid;
  gap: 10px;
  font-size: 12.5px;
}
.death-uses-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: center;
}
.death-uses-row > span:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
.death-use {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.death-use .ico {
  width: 18px;
  height: 18px;
  border-radius: 3px;
}
/* Le « i » discret : ce qu'on a masqué se lit au survol, pas en plein texte. */
.info {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font: italic 600 9px/1 var(--sans);
  text-transform: none;
  vertical-align: 1px;
}

.drawer-label {
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.hit {
  display: grid;
  grid-template-columns: 44px 22px minmax(0, 1fr) 132px;
  gap: 2px 8px;
  align-items: center;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line-soft);
}
.hit .ts {
  grid-area: 1 / 1 / 3 / 2;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.hit .ico {
  grid-area: 1 / 2 / 3 / 3;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--sunken);
  box-shadow: 0 0 0 1px var(--line);
  display: block;
}
.hit .what {
  grid-area: 1 / 3 / 2 / 4;
  min-width: 0;
}
.hit .sp {
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hit .src {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hit .amt {
  grid-area: 1 / 4 / 2 / 5;
  text-align: right;
  font-family: var(--mono);
  font-size: 12.5px;
}
/* Fond léger : rouge = dégât, vert = soin, bleu = CD défensif, ambre = consommable. */
.hit.dmg {
  background: rgba(255, 77, 94, 0.07);
}
.hit.heal {
  background: rgba(45, 212, 167, 0.07);
}
.hit.dmg .amt {
  color: var(--text-bad);
}
.hit.heal .amt {
  color: var(--text-good);
}
.hit .track {
  grid-area: 2 / 3 / 3 / 4;
  position: relative;
  height: 7px;
  background: var(--sunken-2);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.hit .track i {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
}
.hit .track .kept {
  left: 0;
  background: #3a4a63;
}
.hit.dmg .track .delta {
  background: var(--c-death);
}
.hit.heal .track .delta {
  background: var(--lvl-good);
}
.hit .hpv {
  grid-area: 2 / 4 / 3 / 5;
  text-align: right;
  font-size: 10px;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.hit.use {
  grid-template-columns: 44px 22px minmax(0, 1fr) auto;
  background: rgba(91, 155, 255, 0.14);
  border-left: 2px solid var(--d-major);
  padding-left: 6px;
  margin: 2px 0;
  border-radius: 0 5px 5px 0;
}
.hit.use .what {
  grid-area: 1 / 3 / 3 / 4;
}
.hit.use .tag {
  grid-area: 1 / 4 / 3 / 5;
  font-size: 14px;
}
.hit.use.conso {
  border-left-color: var(--c-conso);
  background: rgba(216, 166, 87, 0.12);
}
.hit.use.immunity {
  border-left-color: var(--d-immunity);
}
.hit.use.external {
  border-left-color: var(--d-external);
}
.hit.use.raid {
  border-left-color: var(--d-raid);
}
.hit.use.self-heal {
  border-left-color: var(--text-good);
}
.hit.use.minor {
  border-left-color: var(--d-minor);
}
.hit.use.idle {
  border-left-color: var(--c-miss);
}
.hit.use.idle .src {
  color: var(--c-miss);
}

/* ---------- Détail des zones ---------- */
.zone {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 96px;
  gap: 3px 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.zone:last-child {
  border-bottom: 0;
}
.zone .ico {
  grid-area: 1 / 1 / 3 / 2;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--sunken);
  box-shadow: 0 0 0 1px var(--line);
  display: block;
}
.zone .what {
  min-width: 0;
}
.zone .sp {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zone .src {
  font-size: 11px;
  color: var(--muted);
}
.zone .amt {
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--c-interrupt);
}
.zone .amt small {
  color: var(--muted);
  font-size: 10.5px;
}
/* Liste des CD lancés : l'heure remplace la barre de proportion. */
.zone.use-row {
  grid-template-columns: 46px 26px minmax(0, 1fr) auto;
}
.zone.use-row .ico {
  grid-area: auto;
}
.zone.use-row .ts {
  font-size: 12px;
  color: var(--muted);
}
.zone.use-row.idle {
  border-left: 2px solid var(--c-miss);
  padding-left: 8px;
}
.zone.use-row .k {
  color: var(--muted);
  font-size: 11px;
}
.idle-tag {
  padding: 2px 7px;
  border: 1px solid var(--c-miss);
  border-radius: 999px;
  color: var(--c-miss);
  font-size: 10.5px;
  white-space: nowrap;
}
/* Chiffre qui ouvre sa liste dans le panneau latéral. */
td.num.link {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
td.num.link:hover {
  color: var(--accent);
}

.zone .track {
  grid-area: 2 / 2 / 3 / 4;
  height: 6px;
  background: var(--sunken-2);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.zone .track i {
  display: block;
  height: 100%;
  background: var(--c-interrupt);
  opacity: 0.55;
}

/* ---------- Fiche joueur ---------- */
.pf-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pf-peers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}
.pf-peer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  font: inherit;
  cursor: pointer;
}
.pf-peer .cls-icon {
  width: 17px;
  height: 17px;
  border-radius: 3px;
}
/* Les autres joueurs, repliés en raid : ils suivent la même spé une fois dépliés. */
[data-peers-rest] {
  display: contents;
}
.pf-peers-all {
  padding: 2px 8px;
  font-size: 12px;
}
.pf-peer:hover {
  border-color: var(--line-strong);
}
/* Déjà ouvert à côté : un second clic le referme. */
.pf-peer.on {
  border-color: currentColor;
  background: var(--panel);
}
.pf-title .cls-icon {
  width: 22px;
  height: 22px;
}
.kpis.compact {
  gap: 18px;
  margin: 22px 0 14px;
}
.kpis.compact .v {
  font-size: 17px;
}
/* Les compteurs bruts : tout ce que le joueur a lancé, sans jugement. */
.pf-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
  font-size: 11.5px;
}
.act {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}
.act b {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.act.zero {
  opacity: 0.45;
}
.pf-sec {
  margin-top: 20px;
}
.source-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--sunken);
}
.source-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(140px, 1.7fr) repeat(8, 58px);
  gap: 6px;
  align-items: center;
  min-width: 820px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: right;
}
.source-table.heal .source-row {
  grid-template-columns: minmax(150px, 1fr) minmax(140px, 1.7fr) repeat(9, 58px);
  min-width: 890px;
}
.source-row:last-child {
  border-bottom: 0;
}
.source-row > :first-child {
  text-align: left;
}
.source-row > * {
  position: relative;
  z-index: 1;
}
.source-head {
  background: var(--panel-2);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.source-name {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  font-family: var(--sans);
  font-size: 11.5px;
}
.source-name .ico,
.activity-count .ico,
.activity-list .ico {
  width: 17px;
  height: 17px;
  flex: none;
  border-radius: 3px;
}
.source-name .spell,
.activity-count .spell,
.activity-list .spell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-amount {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 17px;
  padding: 0 4px;
  overflow: hidden;
}
.source-amount i {
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: var(--source-share);
  background: color-mix(in srgb, var(--accent) 48%, transparent);
}
.source-amount small {
  color: var(--fg);
  font-family: var(--sans);
  font-size: 10px;
}
.activity-total {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}
.activity-total b {
  color: var(--fg);
}
.activity-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.activity-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 6px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-2);
  font-size: 11px;
}
.activity-count b {
  font-family: var(--mono);
}
.activity-list {
  border-top: 1px solid var(--line-soft);
}
/* « Voir tout » sous les premières lignes du cycle. */
.activity-all {
  display: block;
  margin: 10px auto 0;
}
.activity-event {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  border-bottom: 1px solid var(--line-soft);
}
.activity-event time {
  min-width: 42px;
  white-space: nowrap;
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}
.activity-death {
  color: var(--c-death);
}
.activity-rez {
  color: var(--c-rez);
}
.activity-boss {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
}
.activity-event > i {
  width: 1px;
  align-self: stretch;
  background: var(--line-strong);
}
.activity-gap {
  position: relative;
  padding: 6px 0 6px 54px;
  color: var(--muted);
  font-size: 10.5px;
  font-style: italic;
}
.activity-gap::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 48px;
  border-left: 1px dashed var(--line-float);
}
.pf-death {
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
.pf-death:last-child {
  border-bottom: 0;
}
.pf-death-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.pf-death .victim {
  border: 0;
  background: transparent;
  color: var(--c-death);
  font: inherit;
  padding: 0;
  cursor: pointer;
}
.pf-death .victim:hover {
  text-decoration: underline;
}
/* Le titre coiffe la grille des joueurs : il occupe la ligne entière. */
.pcards > .table-title {
  grid-column: 1 / -1;
}
