/* ==========================================================================
   Myths – Banlist Castillo (extras sobre public_decks.css)
   ========================================================================== */

.page-banlist .site-header {
  background: var(--bg-panel);
  border-bottom-color: var(--color-border);
}

/* —— Resumen compacto + gráficos bajo demanda —— */
.bl-stats-section {
  padding-top: 0.35rem;
  padding-bottom: 0.75rem;
}

.page-banlist .bl-stats {
  padding: 0.75rem 0.95rem 0.8rem;
}

.bl-stats__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.bl-stats__intro {
  flex: 0 0 auto;
  min-width: 0;
}

.bl-stats__intro .pd-deck-stats__kicker {
  margin: 0 0 0.1rem;
}

.bl-stats__intro h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #e8eef5;
}

.bl-stats__spark {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 3px #12161e;
  background: #1a2030;
}

.bl-stats__chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.bl-stats__chips li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0a0e14;
  font-size: 0.72rem;
  color: #8b97a8;
}

.bl-stats__chips strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: #e8eef5;
  font-variant-numeric: tabular-nums;
}

.bl-stats__chip--prohibida strong { color: #fca5a5; }
.bl-stats__chip--max1 strong { color: #fcd34d; }
.bl-stats__chip--max2 strong { color: #fdba74; }

.bl-stats__details {
  margin-top: 0.55rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 0.45rem;
}

.bl-stats__toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  padding: 0.2rem 0;
  color: #7dd3fc;
  font-size: 0.8rem;
  font-weight: 600;
  user-select: none;
}

.bl-stats__toggle::-webkit-details-marker {
  display: none;
}

.bl-stats__toggle-hint {
  font-weight: 500;
  font-size: 0.72rem;
  color: #8b97a8;
}

.bl-stats__toggle-chevron {
  margin-left: auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid #7dd3fc;
  border-bottom: 1.5px solid #7dd3fc;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  opacity: 0.85;
}

.bl-stats__details[open] .bl-stats__toggle-chevron {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.bl-stats__grid {
  margin-top: 0.65rem;
  gap: 0.65rem 0.85rem;
}

/* Entrada al abrir «Ver distribución» */
@keyframes bl-stats-grid-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bl-stats-panel-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bl-stats-donut-in {
  from {
    opacity: 0;
    transform: scale(0.82) rotate(-12deg);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes bl-stats-col-in {
  from {
    transform: scaleY(0);
    opacity: 0.35;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes bl-stats-fill-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes bl-stats-legend-in {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Animaciones ligadas a [open]: empiezan en el primer frame (sin parpadeo).
   .is-restart corta un frame a opacity 0 para re-disparar al reabrir. */
.bl-stats__details[open].is-restart .bl-stats__grid,
.bl-stats__details[open].is-restart .pd-deck-stats__panel,
.bl-stats__details[open].is-restart .pd-donut,
.bl-stats__details[open].is-restart .pd-legend li,
.bl-stats__details[open].is-restart .pd-col__bar,
.bl-stats__details[open].is-restart .pd-bar__fill {
  animation: none !important;
  opacity: 0;
  transform: none;
}

.bl-stats__details[open]:not(.is-restart) .bl-stats__grid {
  animation: bl-stats-grid-in 0.28s ease both;
}

.bl-stats__details[open]:not(.is-restart) .pd-deck-stats__panel {
  animation: bl-stats-panel-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bl-stats__details[open]:not(.is-restart) .pd-deck-stats__panel:nth-child(1) { animation-delay: 0.04s; }
.bl-stats__details[open]:not(.is-restart) .pd-deck-stats__panel:nth-child(2) { animation-delay: 0.1s; }
.bl-stats__details[open]:not(.is-restart) .pd-deck-stats__panel:nth-child(3) { animation-delay: 0.16s; }
.bl-stats__details[open]:not(.is-restart) .pd-deck-stats__panel:nth-child(4) { animation-delay: 0.22s; }

.bl-stats__details[open]:not(.is-restart) .pd-donut {
  animation: bl-stats-donut-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: inherit;
}

.bl-stats__details[open]:not(.is-restart) .pd-legend li {
  animation: bl-stats-legend-in 0.35s ease both;
}

.bl-stats__details[open]:not(.is-restart) .pd-legend li:nth-child(1) { animation-delay: 0.14s; }
.bl-stats__details[open]:not(.is-restart) .pd-legend li:nth-child(2) { animation-delay: 0.2s; }
.bl-stats__details[open]:not(.is-restart) .pd-legend li:nth-child(3) { animation-delay: 0.26s; }
.bl-stats__details[open]:not(.is-restart) .pd-legend li:nth-child(4) { animation-delay: 0.32s; }
.bl-stats__details[open]:not(.is-restart) .pd-legend li:nth-child(5) { animation-delay: 0.38s; }

.bl-stats__details[open]:not(.is-restart) .pd-col__bar {
  transform-origin: bottom center;
  animation: bl-stats-col-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bl-stats__details[open]:not(.is-restart) .pd-col:nth-child(1) .pd-col__bar { animation-delay: 0.2s; }
.bl-stats__details[open]:not(.is-restart) .pd-col:nth-child(2) .pd-col__bar { animation-delay: 0.24s; }
.bl-stats__details[open]:not(.is-restart) .pd-col:nth-child(3) .pd-col__bar { animation-delay: 0.28s; }
.bl-stats__details[open]:not(.is-restart) .pd-col:nth-child(4) .pd-col__bar { animation-delay: 0.32s; }
.bl-stats__details[open]:not(.is-restart) .pd-col:nth-child(5) .pd-col__bar { animation-delay: 0.36s; }
.bl-stats__details[open]:not(.is-restart) .pd-col:nth-child(6) .pd-col__bar { animation-delay: 0.4s; }
.bl-stats__details[open]:not(.is-restart) .pd-col:nth-child(7) .pd-col__bar { animation-delay: 0.44s; }
.bl-stats__details[open]:not(.is-restart) .pd-col:nth-child(8) .pd-col__bar { animation-delay: 0.48s; }

.bl-stats__details[open]:not(.is-restart) .pd-bar__fill {
  transform-origin: left center;
  animation: bl-stats-fill-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bl-stats__details[open]:not(.is-restart) .pd-bar:nth-child(1) .pd-bar__fill { animation-delay: 0.22s; }
.bl-stats__details[open]:not(.is-restart) .pd-bar:nth-child(2) .pd-bar__fill { animation-delay: 0.28s; }
.bl-stats__details[open]:not(.is-restart) .pd-bar:nth-child(3) .pd-bar__fill { animation-delay: 0.34s; }
.bl-stats__details[open]:not(.is-restart) .pd-bar:nth-child(4) .pd-bar__fill { animation-delay: 0.4s; }
.bl-stats__details[open]:not(.is-restart) .pd-bar:nth-child(5) .pd-bar__fill { animation-delay: 0.46s; }
.bl-stats__details[open]:not(.is-restart) .pd-bar:nth-child(6) .pd-bar__fill { animation-delay: 0.52s; }

@media (prefers-reduced-motion: reduce) {
  .bl-stats__details[open] .bl-stats__grid,
  .bl-stats__details[open] .pd-deck-stats__panel,
  .bl-stats__details[open] .pd-donut,
  .bl-stats__details[open] .pd-legend li,
  .bl-stats__details[open] .pd-col__bar,
  .bl-stats__details[open] .pd-bar__fill {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

.page-banlist .bl-stats .pd-deck-stats__panel {
  padding: 0.65rem 0.7rem;
}

.page-banlist .bl-stats .pd-deck-stats__panel h3 {
  margin-bottom: 0.45rem;
  font-size: 0.76rem;
}

/* Donuts (restricción / tipo): centrar el contenido en el alto del panel. */
.page-banlist .bl-stats .pd-deck-stats__panel:has(.pd-donut-row) {
  display: flex;
  flex-direction: column;
}

.page-banlist .bl-stats .pd-deck-stats__panel:has(.pd-donut-row) .pd-donut-row {
  flex: 1 1 auto;
  align-items: center;
  min-height: 0;
}

/* Curva de coste: estira al alto del panel (misma fila que los otros gráficos). */
.page-banlist .bl-stats .pd-deck-stats__panel:has(.pd-cols) {
  display: flex;
  flex-direction: column;
}

.page-banlist .bl-stats .pd-cols {
  flex: 1 1 auto;
  min-height: 5.25rem;
  align-items: stretch;
}

.page-banlist .bl-stats .pd-col {
  height: 100%;
  justify-content: flex-end;
}

.page-banlist .bl-stats .pd-col__bar-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 3.25rem;
}

/* Sin scroll interno: mostramos top 6 ediciones en el template. */

@media (min-width: 1100px) {
  .page-banlist .bl-stats__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .bl-stats__chips {
    justify-content: flex-start;
    width: 100%;
  }

  .bl-stats__toggle-hint {
    display: none;
  }
}

/* Píldoras de restricción (filtro cliente) */
.page-banlist .pd-card-filter {
  cursor: pointer;
  font: inherit;
}

.bl-filter--prohibida.is-active {
  background: #f87171;
  border-color: #f87171;
  color: #0a0e14;
}

.bl-filter--prohibida.is-active span {
  background: rgba(10, 14, 20, 0.2);
  color: #0a0e14;
}

.bl-filter--max1.is-active {
  background: #fbbf24;
  border-color: #fbbf24;
  color: #0a0e14;
}

.bl-filter--max1.is-active span {
  background: rgba(10, 14, 20, 0.2);
  color: #0a0e14;
}

.bl-filter--max2.is-active {
  background: #fb923c;
  border-color: #fb923c;
  color: #0a0e14;
}

.bl-filter--max2.is-active span {
  background: rgba(10, 14, 20, 0.2);
  color: #0a0e14;
}

/* Toolbar búsqueda / edición */
.bl-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin: 1rem 0 1.5rem;
}

.bl-toolbar__search {
  flex: 1 1 14rem;
  min-width: 12rem;
}

.bl-toolbar .form-select {
  flex: 0 1 12rem;
  min-width: 10rem;
}

.bl-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Secciones por restricción */
.bl-section {
  margin-bottom: 2rem;
}

.bl-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.bl-section__titles h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--pd-text, var(--color-text));
}

.bl-section__titles p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--pd-muted, var(--color-text-muted));
}

.bl-section__count {
  flex-shrink: 0;
  min-width: 2rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  background: var(--pd-raised, #1a2030);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--pd-muted, var(--color-text-muted));
}

.bl-section--prohibida .bl-section__titles h2 {
  color: #fca5a5;
}

.bl-section--max1 .bl-section__titles h2 {
  color: #fcd34d;
}

.bl-section--max2 .bl-section__titles h2 {
  color: #fdba74;
}

/* Badge de restricción en minis */
.bl-mini-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  z-index: 1;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  color: #0a0e14;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.bl-mini-badge--prohibida {
  background: #f87171;
}

.bl-mini-badge--max1 {
  background: #fbbf24;
}

.bl-mini-badge--max2 {
  background: #fb923c;
}

.bl-mini--prohibida .pd-mini__img-wrap {
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, 0.35);
}

.bl-mini--max1 .pd-mini__img-wrap {
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.35);
}

.bl-mini--max2 .pd-mini__img-wrap {
  box-shadow: inset 0 0 0 1px rgba(251, 146, 60, 0.35);
}

.bl-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--pd-muted, var(--color-text-muted));
}

.bl-empty p {
  margin: 0 0 1rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .bl-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .bl-toolbar .form-select,
  .bl-toolbar__search {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }
}


