/* ============================================================
   AntiCheat — lo propio del panel, encima de las primitivas ds-*.
   ------------------------------------------------------------
   Todo lo que se puede resolver con .ds-card / .ds-table / .ds-btn
   NO se repite aquí. Esto es sólo lo que el panel necesita y el
   design system no tiene: la barra de probabilidad, el veredicto,
   la ficha de un jugador y el modal de baneo. La identidad de una
   persona (avatar + nombre + correo) vive en ds.css como
   .ds-person: la usa también Recompensas.

   Los colores salen de los tokens del tema para que el modo
   oscuro (negro neutro) funcione sin una sola regla extra.
   ============================================================ */

/* ── Probabilidad ───────────────────────────────────────────
   Barra + número. El color lo pone el nivel de riesgo, no la
   celda: así la misma barra sirve en las cinco tablas. */
.ac-prob {
  display: flex;
  align-items: center;
  gap: 8px;
  --ac-risk: var(--green);
}

.ac-prob.is-medium { --ac-risk: var(--orange); }
.ac-prob.is-high   { --ac-risk: var(--rose); }

.ac-prob__track {
  flex: 1;
  min-width: 46px;
  height: 6px;
  border-radius: 999px;
  background: var(--ds-sunken);
  overflow: hidden;
}

.ac-prob__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ac-risk);
  transition: width var(--ds-slow, .3s) var(--ds-ease, ease);
}

.ac-prob__num {
  min-width: 34px;
  text-align: right;
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--ac-risk);
}

.ac-prob__none {
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-muted);
}

/* Números que piden atención dentro de una tabla. */
.ac-hot  { color: var(--rose); font-weight: 750; }
.ac-warm { color: var(--orange); font-weight: 700; }
.ac-star { color: var(--purple); }

/* ── Veredicto ──────────────────────────────────────────────
   La lectura en diez segundos. Un solo bloque con acento de
   color según el nivel; el resto hereda del tema. */
.ac-verdict { border-left: 3px solid var(--border-hover); }
.ac-verdict.is-low     { border-left-color: var(--green); }
.ac-verdict.is-medium  { border-left-color: var(--orange); }
.ac-verdict.is-high    { border-left-color: var(--rose); }
.ac-verdict.is-unknown { border-left-color: var(--border-hover); }

.ac-verdict__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 750;
  color: var(--text);
  margin-bottom: 10px;
}

.ac-verdict.is-low .ac-verdict__head    { color: var(--green); }
.ac-verdict.is-medium .ac-verdict__head { color: var(--orange); }
.ac-verdict.is-high .ac-verdict__head   { color: var(--rose); }

.ac-verdict__list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.ac-verdict__list li { margin: 3px 0; }
.ac-verdict__list strong { color: var(--text); }

.ac-verdict__line {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.ac-verdict__closing {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--ds-hairline, var(--border));
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text);
}

/* Banderas: el "por qué" corto, en chips. */
.ac-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.ac-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--orange-soft);
  color: var(--orange);
}

.ac-flag.is-high { background: var(--rose-soft); color: var(--rose); }

/* ── Ficha ──────────────────────────────────────────────────── */
.ac-profile__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ds-4, 14px);
  flex-wrap: wrap;
}

.ac-profile__acts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ds-card__head .ac-card__acts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ── Gráficas ───────────────────────────────────────────────── */
.ac-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--ds-4, 14px);
  margin-top: var(--ds-4, 14px);
}

.ac-charts .ds-card { margin-top: 0; }

.ac-chart { position: relative; height: 260px; }
.ac-chart--tall { height: 330px; }

@media (max-width: 900px) {
  .ac-charts { grid-template-columns: 1fr; }
}

/* ── Controles del tabbar ───────────────────────────────────── */
.ac-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  min-width: 260px;
  background: var(--ds-raised);
  border: 1px solid var(--border);
  border-radius: var(--ds-r-sm, 8px);
  color: var(--text-muted);
}

.ac-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  padding: 8px 0;
}

.ac-datepick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ac-datepick .ds-input { width: auto; padding: 7px 10px; }

/* ── Filas de tabla con estado ──────────────────────────────── */
.ac-clickable { cursor: pointer; }
.ds-table tbody tr.is-banned { opacity: .6; }
.ds-table tbody tr.is-clean td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.ds-table tbody tr.is-cheat td:first-child { box-shadow: inset 3px 0 0 var(--rose); }
.ds-table tbody tr.is-perfect td:first-child { box-shadow: inset 3px 0 0 var(--purple); }

/* ── Dispositivos ───────────────────────────────────────────── */
.ac-device + .ac-device {
  margin-top: var(--ds-4, 14px);
  padding-top: var(--ds-4, 14px);
  border-top: 1px solid var(--border);
}

.ac-device__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  margin-bottom: 10px;
}

.ac-device__head code {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--ds-sunken);
}

.ac-device__users {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

.ac-device__user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--ds-r-sm, 8px);
  background: var(--ds-sunken);
}

/* ── Modal de baneo ─────────────────────────────────────────── */
.ac-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s ease-out;
}

.ac-modal.is-open { opacity: 1; }

.ac-modal__veil {
  position: absolute;
  inset: 0;
  background: var(--ds-overlay, rgba(0, 0, 0, .6));
  backdrop-filter: blur(2px);
}

.ac-modal__card {
  position: relative;
  width: min(470px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--ds-raised);
  border: 1px solid var(--border);
  border-radius: var(--ds-r-lg, 14px);
  box-shadow: var(--ds-shadow-3, 0 20px 60px rgba(0, 0, 0, .3));
  transform: translateY(8px);
  transition: transform .15s ease-out;
}

.ac-modal.is-open .ac-modal__card { transform: none; }

.ac-modal__head,
.ac-modal__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

.ac-modal__head { border-bottom: 1px solid var(--border); justify-content: space-between; }

.ac-modal__foot {
  border-top: 1px solid var(--border);
  background: var(--ds-sunken);
  justify-content: flex-end;
}

.ac-modal__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--rose);
}

.ac-modal__title span { color: var(--text); }
.ac-modal__body { padding: 18px; }

/* Radios como tarjetas: el alcance del baneo se elige mal si es
   una lista de puntitos. */
.ac-picks { display: flex; flex-direction: column; gap: 8px; }

.ac-pick {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--ds-r-sm, 8px);
  cursor: pointer;
  transition: border-color var(--ds-fast, .15s), background var(--ds-fast, .15s);
}

.ac-pick:hover { border-color: var(--border-hover); background: var(--ds-sunken); }
.ac-pick:has(input:checked) { border-color: var(--rose); background: var(--rose-soft); }
.ac-pick input { margin-top: 3px; accent-color: var(--rose); }
.ac-pick__title { display: block; font-size: 13px; font-weight: 650; color: var(--text); }
.ac-pick__sub { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.ac-err {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--ds-r-sm, 8px);
  background: var(--rose-soft);
  color: var(--rose);
  font-size: 12px;
}

.ac-note--warn { border-color: var(--orange); color: var(--orange); }

/* ── Pie ────────────────────────────────────────────────────── */
.ac-foot {
  margin-top: var(--ds-4, 14px);
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* ── Respuestas de una partida ──────────────────────────────
   El detalle que se abre al hacer click en un jugador. Vive
   dentro de una fila de la tabla, así que hereda su ancho. */
.ac-caret {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 7px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(-45deg) translateY(-1px);
  transition: transform var(--ds-fast, .15s) var(--ds-ease, ease);
}

.ds-table tbody tr.is-open .ac-caret {
  transform: rotate(45deg) translateY(-2px);
  border-color: var(--primary);
}

.ds-table tbody tr.is-open { background: var(--ds-sunken); }
.ds-table tbody tr.ac-detailrow:hover { background: transparent; }
.ds-table tbody tr.ac-detailrow > td { padding: 0; background: var(--ds-sunken); }

.ac-answers {
  padding: var(--ds-4, 14px) var(--ds-5, 18px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ac-answers--loading,
.ac-answers--empty {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
}

.ac-answer {
  display: flex;
  align-items: flex-start;
  gap: var(--ds-3, 10px);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-hover);
  border-radius: var(--ds-r-sm, 8px);
  background: var(--ds-raised);
}

.ac-answer.is-medium { border-left-color: var(--orange); }
.ac-answer.is-high   { border-left-color: var(--rose); }

.ac-answer__n {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ds-sunken);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.ac-answer__main { flex: 1; min-width: 0; }

.ac-answer__q {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.4;
}

.ac-answer__pick {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.ac-answer__pick strong { color: var(--text); }

/* Cómo le fue al resto: el contexto que vuelve legible un tiempo. */
.ac-answer__pop {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.ac-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ds-sunken);
  border: 1px solid var(--ds-hairline, var(--border));
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.ac-pill strong {
  color: var(--text);
  font-family: var(--siti-f-mono, ui-monospace, monospace);
  font-weight: 650;
  font-size: 10.5px;
}

.ac-pill.is-hot {
  background: var(--primary-soft, rgba(255, 122, 34, .10));
  border-color: transparent;
  color: var(--siti-ink, #B84500);
  font-weight: 650;
}

.ac-pill.is-hot strong { color: inherit; }

.ac-answer.is-high .ac-pill.is-hot {
  background: rgba(239, 68, 68, .10);
  color: var(--rose);
}

.ac-answer__read {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--orange);
}

.ac-answer.is-high .ac-answer__read { color: var(--rose); }

.ac-answer__time {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  min-width: 76px;
}

.ac-answer__ms {
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.ac-answer.is-high .ac-answer__ms { color: var(--rose); }

.ac-answers__foot {
  font-size: 11.5px;
  color: var(--text-muted);
  padding-top: 2px;
}

.ac-answer { flex-wrap: wrap; }

.ac-answer__play {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.ac-answer__play:hover,
.ac-answer__play.is-open { border-color: var(--primary); color: var(--siti-ink, var(--primary)); }

@media (max-width: 700px) {
  .ac-answer__time { flex-direction: row; align-items: center; width: 100%; justify-content: flex-start; }
}

/* ── Evidencia: por qué salió ese porcentaje ─────────────────
   Dos renglones, uno por señal. Cada uno dice el número grande
   ("1 en 15,225"), lo ubica en una barra y lo explica en una
   línea. Es lo que se le enseña a un jugador que reclama, así
   que la frase importa tanto como la barra. */
.ac-ev {
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--ds-r-sm, 8px);
  background: var(--ds-raised);
  --ac-ev-c: var(--text-muted);
}

.ac-ev--na {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted);
}

.ac-ev__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ds-hairline, var(--border));
}

.ac-ev__title {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .01em;
  color: var(--text);
}

/* El número viejo se guarda a la vista: sirve para explicar por qué
   una sanción de antes puede no coincidir con la de hoy. */
.ac-ev__old {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ac-ev__row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  grid-template-areas:
    "label meter value"
    ".     note  note";
  align-items: center;
  gap: 4px 12px;
  padding: 10px 0;
}

.ac-ev__row + .ac-ev__row { border-top: 1px solid var(--ds-hairline, var(--border)); }
.ac-ev__row.is-muted { opacity: .72; }

.ac-ev__label {
  grid-area: label;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-secondary);
}

.ac-ev__value {
  grid-area: value;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-secondary);
}

.ac-ev__value strong { font-weight: 750; color: var(--ac-ev-c); }
.ac-ev__value strong.is-high    { --ac-ev-c: var(--rose); }
.ac-ev__value strong.is-medium  { --ac-ev-c: var(--orange); }
.ac-ev__value strong.is-low     { --ac-ev-c: var(--green); }

.ac-ev__na {
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-muted);
}

.ac-ev__meter { grid-area: meter; min-width: 0; }

.ac-ev__track {
  height: 6px;
  border-radius: 999px;
  background: var(--ds-sunken);
  overflow: hidden;
  --ac-risk: var(--green);
}

.ac-ev__track.is-medium { --ac-risk: var(--orange); }
.ac-ev__track.is-high   { --ac-risk: var(--rose); }

.ac-ev__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ac-risk);
  transition: width var(--ds-slow, .3s) var(--ds-ease, ease);
}

.ac-ev__note {
  grid-area: note;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

.ac-ev__note strong { color: var(--text-secondary); }

@media (max-width: 640px) {
  .ac-ev__row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label value"
      "meter meter"
      "note  note";
  }
}

/* Versión de una línea para celdas de tabla. */
.ac-evchip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: var(--ds-sunken);
  color: var(--text-muted);
}

.ac-evchip.is-medium { background: var(--orange-soft); color: var(--orange); }
.ac-evchip.is-high   { background: var(--rose-soft);   color: var(--rose); }
