/* FRAGS & DEATHS - secao isolada, todas as regras com escopo .pvp-history */
.pvp-history, .pvp-history * { box-sizing: border-box; }
.pvp-history { margin: 0; }
/* ---------- 2. Secao ---------- */
.pvp-history {
  --pvp-history-bg: #261A40;
  --pvp-history-card: #36274F;
  --pvp-history-border: #594568;
  --pvp-history-gold: #F1CE79;
  --pvp-history-gold-border: #C9A34F;
  --pvp-history-light: #F4F0F9;
  --pvp-history-head: #E7DFF1;
  --pvp-history-head-border: #D4C6E0;
  --pvp-history-row-a: #FAF7FC;
  --pvp-history-row-b: #F0EAF7;
  --pvp-history-ink: #322044;
  --pvp-history-ink-mid: #4D2C70;
  /* #857491 fica em 4.0:1 em texto pequeno; #6D5A7D chega a 5.8:1 (AA) */
  --pvp-history-ink-soft: #6D5A7D;
  --pvp-history-ink-faint: #857491;
  --pvp-history-on-dark-soft: #BDB0D1;
  --pvp-history-green: #7FD8A0;
  --pvp-history-green-ink: #2F6B45;
  --pvp-history-green-bg: #E4F3E8;
  --pvp-history-green-border: #BFE0CB;
  --pvp-history-red: #F08A96;
  --pvp-history-red-ink: #8E2F3E;
  --pvp-history-red-bg: #FBE7EA;
  --pvp-history-red-border: #EBC7CE;

  container-type: inline-size;
  container-name: pvp-history;
  position: relative;
  width: 100%;
  color: var(--pvp-history-light);
  font-family: Verdana, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  line-height: 1.35;
}
.pvp-history [hidden] { display: none !important; }
.pvp-history .pvp-history-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pvp-history .pvp-history-ico {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 2.1 Cabecalho fechado (36-42px) ---------- */
.pvp-history .pvp-history-toggle {
  -webkit-appearance: none; appearance: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 40px; margin: 0; padding: 0 12px 0 14px;
  background: linear-gradient(90deg, #33244F 0%, #261A40 55%, #2B1D47 100%);
  border: 1px solid var(--pvp-history-gold-border);
  border-radius: 8px;
  color: var(--pvp-history-gold);
  font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.pvp-history .pvp-history-toggle:hover {
  border-color: var(--pvp-history-gold);
  box-shadow: 0 0 0 1px rgba(241, 206, 121, .22), 0 6px 16px rgba(0, 0, 0, .38);
}
.pvp-history .pvp-history-toggle:focus-visible {
  outline: 2px solid var(--pvp-history-gold); outline-offset: 2px;
}
.pvp-history .pvp-history-toggle-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.pvp-history .pvp-history-ico--gold { color: var(--pvp-history-gold); }
.pvp-history .pvp-history-title {
  font-size: 13px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--pvp-history-gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pvp-history .pvp-history-toggle-side { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pvp-history .pvp-history-toggle-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--pvp-history-gold); opacity: .88;
}
.pvp-history .pvp-history-chev { width: 16px; height: 16px; transition: transform .22s ease; }
.pvp-history .pvp-history-toggle[aria-expanded="true"] .pvp-history-chev { transform: rotate(180deg); }

/* ---------- 2.2 Painel expandido ---------- */
.pvp-history .pvp-history-panel {
  margin-top: 8px; padding: 14px;
  background: linear-gradient(180deg, #2C1F4A 0%, #261A40 42%, #241839 100%);
  border: 1px solid var(--pvp-history-border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .36);
  animation: pvp-history-open .22s ease-out;
}
@keyframes pvp-history-open {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pvp-history .pvp-history-who {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 0 0 14px;
}
.pvp-history .pvp-history-who-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--pvp-history-card); border: 1px solid var(--pvp-history-border);
  color: var(--pvp-history-gold);
}
.pvp-history .pvp-history-who-ico .pvp-history-ico { width: 14px; height: 14px; }
.pvp-history .pvp-history-who-name { font-size: 13px; font-weight: 700; color: var(--pvp-history-light); }
.pvp-history .pvp-history-who-sep { color: var(--pvp-history-ink-faint); }
.pvp-history .pvp-history-who-voc { font-size: 11px; color: var(--pvp-history-on-dark-soft); }

/* ---------- 2.3 PvP Statistics ---------- */
.pvp-history .pvp-history-section-head { display: flex; align-items: center; gap: 10px; margin: 0 0 9px; }
.pvp-history .pvp-history-section-title {
  margin: 0; font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--pvp-history-on-dark-soft); white-space: nowrap;
}
.pvp-history .pvp-history-rule {
  flex: 1 1 auto; height: 1px; min-width: 12px;
  background: linear-gradient(90deg, var(--pvp-history-border), rgba(89, 69, 104, 0));
}
.pvp-history .pvp-history-stats-body { position: relative; }
.pvp-history .pvp-history-cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.pvp-history .pvp-history-card {
  position: relative; overflow: hidden; min-width: 0;
  display: flex; flex-direction: column; gap: 7px;
  padding: 12px 12px 11px;
  background: var(--pvp-history-card);
  border: 1px solid var(--pvp-history-border);
  border-radius: 10px;
}
.pvp-history .pvp-history-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--pvp-history-card-accent, var(--pvp-history-gold)); opacity: .95;
}
.pvp-history .pvp-history-card--justified { --pvp-history-card-accent: var(--pvp-history-green); }
.pvp-history .pvp-history-card--unjustified { --pvp-history-card-accent: var(--pvp-history-red); }
.pvp-history .pvp-history-card--deaths { --pvp-history-card-accent: var(--pvp-history-on-dark-soft); }
.pvp-history .pvp-history-card-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pvp-history .pvp-history-card-ico { color: var(--pvp-history-card-accent); display: inline-flex; }
.pvp-history .pvp-history-card-ico .pvp-history-ico { width: 15px; height: 15px; }
.pvp-history .pvp-history-card-label {
  font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--pvp-history-on-dark-soft);
  min-width: 0; overflow-wrap: anywhere;
}
.pvp-history .pvp-history-card-value {
  font-size: 26px; font-weight: 700; line-height: 1;
  color: var(--pvp-history-light); font-variant-numeric: tabular-nums;
}

/* ---------- 2.4 Combat History (area clara) ---------- */
.pvp-history .pvp-history-history {
  margin-top: 14px; padding: 10px;
  background: var(--pvp-history-light);
  border: 1px solid var(--pvp-history-head-border);
  border-radius: 10px;
  color: var(--pvp-history-ink);
  box-shadow: inset 0 1px 0 #fff;
}
.pvp-history .pvp-history-history-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; padding: 1px 2px 10px;
}
.pvp-history .pvp-history-history-title {
  margin: 0; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--pvp-history-ink-mid);
}

/* seletor de periodo */
.pvp-history .pvp-history-seg {
  display: inline-flex; align-items: stretch; gap: 3px; padding: 3px;
  background: #fff; border: 1px solid var(--pvp-history-head-border); border-radius: 9px;
}
.pvp-history .pvp-history-seg-btn {
  -webkit-appearance: none; appearance: none;
  min-height: 44px; margin: 0; padding: 0 11px;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  color: var(--pvp-history-ink-mid);
  font: inherit; font-size: 10.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.pvp-history .pvp-history-seg-btn:hover { background: var(--pvp-history-row-b); }
.pvp-history .pvp-history-seg-btn:focus-visible { outline: 2px solid var(--pvp-history-ink-mid); outline-offset: 1px; }
.pvp-history .pvp-history-seg-btn.is-active {
  background: var(--pvp-history-ink-mid);
  border-color: var(--pvp-history-ink-mid);
  color: var(--pvp-history-light);
}

/* ---------- 2.5 Paineis recolhiveis ---------- */
.pvp-history .pvp-history-acc { display: flex; flex-direction: column; gap: 8px; }
.pvp-history .pvp-history-acc-item {
  border: 1px solid var(--pvp-history-head-border);
  border-radius: 9px; background: var(--pvp-history-row-a); overflow: hidden;
}
.pvp-history .pvp-history-acc-btn {
  -webkit-appearance: none; appearance: none;
  display: flex; align-items: center; gap: 8px;
  width: 100%; min-height: 44px; margin: 0; padding: 0 12px;
  background: var(--pvp-history-head); border: 0;
  color: var(--pvp-history-ink);
  font: inherit; font-size: 11.5px; font-weight: 700; text-align: left;
  cursor: pointer; transition: background .16s ease;
}
.pvp-history .pvp-history-acc-btn:hover { background: #DED4EC; }
.pvp-history .pvp-history-acc-btn:focus-visible { outline: 2px solid var(--pvp-history-ink-mid); outline-offset: -3px; }
.pvp-history .pvp-history-acc-title { flex: 1 1 auto; min-width: 0; }
.pvp-history .pvp-history-acc-count {
  flex: 0 0 auto; padding: 1px 8px; border-radius: 999px;
  background: #fff; border: 1px solid var(--pvp-history-head-border);
  color: var(--pvp-history-ink-mid); font-size: 10px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pvp-history .pvp-history-acc-chev {
  flex: 0 0 auto; width: 16px; height: 16px;
  color: var(--pvp-history-ink-mid); transition: transform .22s ease;
}
.pvp-history .pvp-history-acc-btn[aria-expanded="true"] .pvp-history-acc-chev { transform: rotate(180deg); }
.pvp-history .pvp-history-acc-body { border-top: 1px solid var(--pvp-history-head-border); }

/* ---------- 2.6 Linhas do historico ---------- */
.pvp-history .pvp-history-list { list-style: none; margin: 0; padding: 0; }
.pvp-history .pvp-history-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px;
  padding: 9px 12px; align-items: start;
}
.pvp-history .pvp-history-row:nth-child(even) { background: var(--pvp-history-row-b); }
.pvp-history .pvp-history-row-ico { display: inline-flex; margin-top: 1px; color: var(--pvp-history-ink-faint); }
.pvp-history .pvp-history-row-ico .pvp-history-ico { width: 16px; height: 16px; }
.pvp-history .pvp-history-row--kill .pvp-history-row-ico { color: #4E9C6A; }
.pvp-history .pvp-history-row--death .pvp-history-row-ico { color: #B4576A; }
.pvp-history .pvp-history-row-body { min-width: 0; }
.pvp-history .pvp-history-row-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.pvp-history .pvp-history-row-name {
  font-size: 11.5px; font-weight: 700; color: var(--pvp-history-ink);
  min-width: 0; overflow-wrap: anywhere;
}
.pvp-history .pvp-history-row-name a {
  color: inherit; text-decoration: none; border-bottom: 1px solid rgba(77, 44, 112, .3);
}
.pvp-history .pvp-history-row-name a:hover { border-bottom-color: var(--pvp-history-ink-mid); }
.pvp-history .pvp-history-row-lvl { font-size: 10.5px; color: var(--pvp-history-ink-soft); white-space: nowrap; }
.pvp-history .pvp-history-row-meta {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 1px 5px;
  margin-top: 2px; font-size: 10.5px; color: var(--pvp-history-ink-soft);
}
.pvp-history .pvp-history-row-date {
  margin-left: auto; white-space: nowrap; color: var(--pvp-history-ink-soft);
  font-variant-numeric: tabular-nums;
}
.pvp-history .pvp-history-killer {
  color: var(--pvp-history-ink-mid); font-weight: 700; text-decoration: none;
  border-bottom: 1px solid rgba(77, 44, 112, .28);
}
.pvp-history .pvp-history-killer:hover { border-bottom-color: var(--pvp-history-ink-mid); }
.pvp-history .pvp-history-env { color: var(--pvp-history-ink-soft); font-style: italic; }
.pvp-history .pvp-history-comma { color: var(--pvp-history-ink-soft); }
.pvp-history .pvp-history-tag {
  flex: 0 0 auto; margin-left: auto; padding: 2px 7px; border-radius: 999px;
  border: 1px solid transparent; font-size: 9.5px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; line-height: 1.5;
}
.pvp-history .pvp-history-tag--kill {
  color: var(--pvp-history-green-ink); background: var(--pvp-history-green-bg);
  border-color: var(--pvp-history-green-border);
}
.pvp-history .pvp-history-tag--death {
  color: var(--pvp-history-red-ink); background: var(--pvp-history-red-bg);
  border-color: var(--pvp-history-red-border);
}

/* ---------- 2.7 Paginacao ---------- */
.pvp-history .pvp-history-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; border-top: 1px solid var(--pvp-history-head-border);
  background: #F7F2FB;
}
.pvp-history .pvp-history-pager-btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; min-width: 44px; padding: 0 10px;
  background: #fff; border: 1px solid var(--pvp-history-head-border); border-radius: 8px;
  color: var(--pvp-history-ink-mid); font: inherit; font-size: 10.5px; font-weight: 700;
  cursor: pointer; transition: background .16s ease, border-color .16s ease;
}
.pvp-history .pvp-history-pager-btn:hover:not(:disabled) {
  background: var(--pvp-history-row-b); border-color: var(--pvp-history-ink-faint);
}
.pvp-history .pvp-history-pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pvp-history .pvp-history-pager-btn:focus-visible { outline: 2px solid var(--pvp-history-ink-mid); outline-offset: 2px; }
.pvp-history .pvp-history-pager-info {
  font-size: 10px; color: var(--pvp-history-ink-soft);
  font-variant-numeric: tabular-nums; text-align: center;
}

/* ---------- 2.8 Estados: vazio / erro ---------- */
.pvp-history .pvp-history-state {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 14px; text-align: center;
}
.pvp-history .pvp-history-state-ico { color: var(--pvp-history-ink-faint); }
.pvp-history .pvp-history-state-ico .pvp-history-ico { width: 26px; height: 26px; }
.pvp-history .pvp-history-state-title { margin: 0; font-size: 11.5px; font-weight: 700; color: var(--pvp-history-ink); }
.pvp-history .pvp-history-state-text { margin: 0; max-width: 34ch; font-size: 10.5px; color: var(--pvp-history-ink-soft); }
.pvp-history .pvp-history-retry {
  -webkit-appearance: none; appearance: none;
  min-height: 44px; margin-top: 6px; padding: 0 16px; border-radius: 8px;
  background: var(--pvp-history-ink-mid); border: 1px solid var(--pvp-history-ink-mid);
  color: var(--pvp-history-light); font: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: background .16s ease;
}
.pvp-history .pvp-history-retry:hover { background: #5B3684; }
.pvp-history .pvp-history-retry:focus-visible { outline: 2px solid var(--pvp-history-ink-mid); outline-offset: 2px; }
.pvp-history .pvp-history-state--dark .pvp-history-state-title { color: var(--pvp-history-light); }
.pvp-history .pvp-history-state--dark .pvp-history-state-text { color: var(--pvp-history-on-dark-soft); }
.pvp-history .pvp-history-state--dark .pvp-history-state-ico { color: var(--pvp-history-on-dark-soft); }
.pvp-history .pvp-history-state--dark .pvp-history-retry {
  background: var(--pvp-history-gold);
  border-color: var(--pvp-history-gold);
  color: #2A1B45;
}
.pvp-history .pvp-history-state--dark .pvp-history-retry:hover { background: #FFE3A6; }

/* ---------- 2.9 Esqueletos de carregamento ---------- */
.pvp-history .pvp-history-skel {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, #3B2C57 25%, #493760 37%, #3B2C57 63%);
  background-size: 400% 100%;
  animation: pvp-history-shimmer 1.4s ease infinite;
}
.pvp-history .pvp-history-skel--value { width: 52px; height: 24px; }
.pvp-history .pvp-history-skel--label { width: 70%; height: 9px; }
.pvp-history .pvp-history-skel--line { height: 9px; width: 100%; }
.pvp-history .pvp-history-skel--line-short { width: 58%; }
.pvp-history .pvp-history-skel--light {
  background: linear-gradient(90deg, #E7DFF1 25%, #F2EDF8 37%, #E7DFF1 63%);
  background-size: 400% 100%;
}
.pvp-history .pvp-history-row--skel .pvp-history-skel { height: 9px; margin: 2px 0; }
@keyframes pvp-history-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ---------- 2.10 Rodape ---------- */
.pvp-history .pvp-history-foot {
  margin: 12px 0 2px; text-align: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--pvp-history-on-dark-soft);
}

/* ---------- 3. Responsividade pelo container real ---------- */
@container pvp-history (max-width: 600px) {
  .pvp-history .pvp-history-panel { padding: 12px; }
  .pvp-history .pvp-history-card { padding: 10px 10px 9px; }
  .pvp-history .pvp-history-card-value { font-size: 23px; }
  .pvp-history .pvp-history-seg-btn { padding: 0 8px; font-size: 10px; }
  .pvp-history .pvp-history-history { padding: 9px; }
}
@container pvp-history (max-width: 470px) {
  .pvp-history .pvp-history-history-head { align-items: stretch; }
  .pvp-history .pvp-history-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .pvp-history .pvp-history-seg-btn { padding: 0 4px; font-size: 9.5px; }
  .pvp-history .pvp-history-cards { gap: 8px; }
  .pvp-history .pvp-history-card { padding: 9px 8px 8px; gap: 5px; }
  .pvp-history .pvp-history-card-label { font-size: 9px; letter-spacing: .04em; }
  .pvp-history .pvp-history-card-value { font-size: 21px; }
  .pvp-history .pvp-history-card-ico .pvp-history-ico { width: 13px; height: 13px; }
  .pvp-history .pvp-history-row { padding: 9px 10px; }
  .pvp-history .pvp-history-acc-btn { padding: 0 10px; font-size: 11px; }
}
@container pvp-history (max-width: 350px) {
  .pvp-history .pvp-history-title { font-size: 11.5px; letter-spacing: .07em; }
  .pvp-history .pvp-history-toggle-label { font-size: 9.5px; }
  .pvp-history .pvp-history-panel { padding: 10px; }
  /* icone em cima do rotulo: "Unjustified" nao cabe ao lado em telas estreitas */
  .pvp-history .pvp-history-card-top { flex-direction: column; align-items: flex-start; gap: 5px; }
  .pvp-history .pvp-history-card { padding: 9px 3px 8px; }
  .pvp-history .pvp-history-card-value { font-size: 19px; }
  .pvp-history .pvp-history-card-label { font-size: 8px; letter-spacing: 0; overflow-wrap: normal; word-break: keep-all; }
  .pvp-history .pvp-history-who-sep { display: none; }
  .pvp-history .pvp-history-row-meta { gap: 1px 4px; }
  .pvp-history .pvp-history-seg-btn { font-size: 9px; }
  .pvp-history .pvp-history-row-date { margin-left: 0; width: 100%; }
}

/* ---------- 4. Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  .pvp-history *, .pvp-history *::before, .pvp-history *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
