/* ==========================================================================
   Mis binders (#/<juego>/binders; binders-view.js): las portadas de tus binders, como en una
   estantería. La tapa de cada uno la dibuja binder.css (.bt-binder); aquí, la página, la cuadrícula,
   el pie de cada portada, el hueco de «Nuevo binder», arrastrar para ordenar y las páginas.
   ========================================================================== */

.bp-page { gap: 22px; }

/* Pestañas de los juegos en los que tienes binders: cada uno con su color */
.bp-gdot { width: 7px; height: 9px; border-radius: 1.5px; background: var(--g, var(--accent)); flex: none; }
.bp-games a:not(.active) .bp-gdot { opacity: .75; }

/* Cómo se ordenan (con varios) o para qué sirven varios (con uno o dos) */
.bp-help { display: flex; align-items: center; gap: 8px; margin: -6px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.bp-help .i { width: 15px; height: 15px; flex: none; color: var(--faint); }
.bp-hint::before { background: var(--accent); }
.bp-hint > .i { color: var(--accent-2); }
.bp-hint b { display: block; font-family: var(--serif); font-size: var(--fs-lg); font-weight: 500; color: var(--text); }
.bp-hint p { margin: 2px 0 0; max-width: 72ch; }

/* ---------- La cuadrícula ---------- */
.bp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 30px 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bp-tile { position: relative; display: grid; align-content: start; gap: 11px; min-width: 0; }
.bp-open {
  container-type: inline-size;
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform var(--dur-2) var(--ease);
}
.bp-open:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }
@media (hover: hover) {
  .bp-open:hover { transform: translateY(-4px); }
  .bp-open:hover .bt-binder .cover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), inset 0 -10px 26px rgba(0, 0, 0, .32), 0 26px 44px -10px rgba(0, 0, 0, .7), 0 6px 14px rgba(0, 0, 0, .38); }
}
.bp-open:active { transform: translateY(-1px) scale(.99); }
/* «Abierto»: el que tienes abierto en el álbum, con la etiqueta montada en el borde de arriba de la tapa */
.tagx.bp-flag { position: absolute; top: 0; left: 50%; z-index: 3; transform: translate(-50%, -50%); background: color-mix(in srgb, var(--accent) 20%, var(--surface-2)); box-shadow: 0 0 0 1px var(--accent-line), 0 3px 10px rgba(0, 0, 0, .5); }

/* El pie: el valor (la cifra, en serifa), debajo cartas y porcentaje, y a la derecha su menú */
.bp-cap { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "value more" "stats more"; align-items: center; gap: 3px 6px; min-width: 0; padding: 0 0 0 2px; }
.bp-value { grid-area: value; font-family: var(--serif); font-size: 18px; line-height: 1.1; font-weight: 500; letter-spacing: -.01em; font-variant-numeric: tabular-nums lining-nums; color: var(--text); }
.bp-stats { grid-area: stats; display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bp-stats > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.bp-more { grid-area: more; margin-right: -6px; color: var(--muted); }
.bp-more:hover, .bp-more[aria-expanded="true"] { color: var(--text); }
/* El que tienes abierto en el álbum */
.bp-tile.is-open .bt-binder .cover { outline: 1.5px solid var(--accent-line); outline-offset: 4px; }

/* ---------- «Nuevo binder» ---------- */
.bp-new { aspect-ratio: 4 / 5; border-radius: 12px; border: 1.5px dashed var(--line-3); background: color-mix(in srgb, var(--surface) 55%, transparent); color: var(--text-2); transition: border-color var(--dur-1), background var(--dur-1), color var(--dur-1); }
.bp-new:hover { border-color: var(--accent-line); background: var(--accent-glow); color: var(--text); }
.bp-new-in { display: grid; justify-items: center; align-content: center; gap: 6px; height: 100%; padding: 12%; }
.bp-new-in .i { width: 26px; height: 26px; margin-bottom: 4px; color: var(--accent-2); }
.bp-new-in b { font-family: var(--serif); font-size: 19px; font-weight: 500; color: var(--text); }
.bp-new-in span { color: var(--muted); font-size: var(--fs-xs); line-height: 1.45; }

/* ---------- Cargando ---------- */
.bp-skel { pointer-events: none; }
.bp-skel-cover { display: block; aspect-ratio: 4 / 5; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.bp-skel-line { display: block; width: 60%; height: 10px; border-radius: var(--r-xs); background: var(--surface-2); }

/* ---------- Arrastrar para ordenar ---------- */
/* El sitio que deja la que llevas: una funda vacía con borde de puntos */
.bp-tile.bp-lifted .bp-open, .bp-tile.bp-lifted .bp-cap { visibility: hidden; }
.bp-tile.bp-lifted::before { content: ""; position: absolute; inset: 0 0 auto; aspect-ratio: 4 / 5; border-radius: 12px; border: 1.5px dashed var(--accent-line); background: var(--accent-glow); }
.bp-ghost { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; will-change: transform; }
.bp-ghost-in { display: grid; gap: 11px; transform: rotate(-1.6deg) scale(1.04); transform-origin: 30% 20%; filter: drop-shadow(0 24px 36px rgba(0, 0, 0, .55)); transition: transform .18s var(--ease); }
.bp-ghost .bp-open { container-type: inline-size; }
.bp-ghost .bt-binder { transform: none !important; }
.bp-ghost.drop-landing { transition: transform .2s var(--ease); }
.bp-ghost.drop-landing .bp-ghost-in { transform: none; }
body.bp-dragging, body.bp-dragging * { cursor: grabbing !important; }
body.bp-dragging .bp-grid { user-select: none; }

/* ---------- Páginas ---------- */
.bp-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 4px; }
.bp-pager .btn { min-width: 34px; justify-content: center; font-variant-numeric: tabular-nums; }
.bp-pager .btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.bp-range { width: 100%; text-align: center; color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

/* ---------- Pantallas pequeñas ---------- */
@media (max-width: 900px) {
  /* En la barra, «Deshacer» va en la primera fila, junto a la cuenta (no hace falta una fila para él) */
  body[data-section="binders"] .topbar > .section-tools { order: 2; width: auto; margin-left: auto; }
  body[data-section="binders"] .topbar > .lang-btn { margin-left: 0; }
  .bp-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 16px; }
  .bp-page .page-head .ph-actions { width: 100%; }
}
@media (max-width: 700px) {
  body[data-section="binders"] .section-tools .label { display: none; }
  body[data-section="binders"] .section-tools .btn { width: 40px; padding: 0; justify-content: center; }
}
@media (max-width: 520px) {
  .bp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .bp-help { font-size: var(--fs-xs); }
  .bp-value { font-size: 16px; }
  .bp-stats { font-size: var(--fs-2xs); }
  .bp-new-in b { font-size: 16px; }
  .bp-new-in span { display: none; }
  .bp-page .ph-actions .btn { flex: 1; justify-content: center; }
}
@media (pointer: coarse) {
  .bp-more { min-width: 40px; min-height: 40px; }
}
