#album-overlay {
  position: fixed;
  inset: 0;
  z-index: 25000000;
  display: none;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #163a7a 0%, #070d1c 70%);
  color: #fff;
  padding: calc(4px + env(safe-area-inset-top)) 6px calc(8px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  overflow: hidden;
}
#album-overlay.abierto { display: flex; }
.album-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.album-top h2 {
  flex: 1;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.6px;
  color: #f5d76e;
}
.album-progreso {
  font-size: 10px;
  color: #cbd5e1;
  font-weight: 800;
}
.album-acciones {
  display: flex;
  gap: 5px;
  margin-bottom: 4px;
}
.album-acciones button {
  flex: 1;
  margin: 0;
  padding: 5px 4px;
  font-size: 10px;
}
.album-tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 4px;
}
.album-tab {
  flex: 1;
  margin: 0;
  padding: 5px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  cursor: pointer;
}
.album-tab.activo {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  border-color: #f5d76e;
  color: #fff;
}
.album-tab #album-count-rep {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 8px;
  background: #ef3b24;
  color: #fff;
  font-size: 9px;
}
.album-seccion.completa h3 {
  color: #f5d76e;
  border-left-color: #22c55e;
}
.album-sec-prog {
  float: right;
  font-size: 10px;
  color: #93c5fd;
  letter-spacing: 0;
  font-weight: 800;
}
.album-seccion.completa .album-sec-prog { color: #22c55e; }
.album-repe-intro {
  background: rgba(245, 215, 110, 0.08);
  border: 1px solid rgba(245, 215, 110, 0.35);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.album-repe-intro h3 {
  margin: 0 0 6px;
  color: #f5d76e;
  font-size: 14px;
}
.album-repe-intro p {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #cbd5e1;
}
.album-repe-vacio {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  padding: 28px 12px;
}
.album-trade-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(14, 86, 176, 0.88);
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-align: center;
  padding: 3px 2px;
}
.album-flipbook {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 0;
}
.album-nav-pag {
  width: 22px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  cursor: pointer;
  padding: 0;
}
.album-nav-pag:disabled {
  opacity: 0.22;
  cursor: default;
}
.album-libro {
  flex: 0 1 auto;
  width: min(100%, calc(100dvh * 0.52));
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 3 / 4.15;
  height: auto;
  min-width: 0;
  position: relative;
  perspective: 900px;
  perspective-origin: left center;
  transform-style: preserve-3d;
  overflow: hidden;
}
.album-hoja {
  position: absolute;
  inset: 0;
  height: auto;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(56, 120, 210, 0.42) 0%, transparent 52%),
    linear-gradient(165deg, #163a7a 0%, #0a1648 46%, #07102e 100%);
  color: #fff;
  border-radius: 3px 14px 14px 4px;
  padding: 5px 6px 6px;
  box-sizing: border-box;
  transform-origin: left center;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: inset -14px 0 22px rgba(0,8,28,0.28), 8px 10px 22px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.album-hoja::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.045) 0 2px, transparent 2px 7px),
    radial-gradient(circle at 18% 78%, rgba(245,215,110,0.12), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(255,255,255,0.08), transparent 28%);
}
.album-hoja-marca {
  position: absolute;
  inset: 12% 8% 16%;
  z-index: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0.16;
  text-align: center;
}
.album-hoja-marca img {
  width: 42%;
  max-width: 150px;
  height: auto;
  object-fit: contain;
  filter: brightness(10);
  margin-bottom: 8px;
}
.album-hoja-marca-tit {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 2.4px;
  color: #fff;
  text-transform: uppercase;
}
.album-hoja-marca-sub {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #f5d76e;
  text-transform: uppercase;
}
.album-hoja.tapa {
  background: #0a1648;
  color: #fff;
  justify-content: stretch;
  align-items: stretch;
  padding: 0;
  border: 2px solid rgba(255,255,255,0.18);
  overflow: hidden;
}
.album-tapa {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  padding: 0;
}
.album-tapa-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  background: #0a1648;
  pointer-events: none;
}
.album-tapa-prog {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(8,16,48,0.72);
  border: 1px solid rgba(255,255,255,0.45);
  color: #fff;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11px;
  letter-spacing: 0.3px;
}
.album-tapa-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.78);
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.album-hoja-head {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #f5d76e;
  margin-bottom: 4px;
  padding: 3px 4px 5px;
  border-bottom: 1px solid rgba(245, 215, 110, 0.45);
  flex-shrink: 0;
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
}
.album-hoja-head.completa { color: #86efac; border-bottom-color: rgba(134, 239, 172, 0.5); }
.album-hoja.hoja-bn {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(120, 120, 128, 0.38) 0%, transparent 52%),
    linear-gradient(165deg, #4a4a52 0%, #2a2a32 46%, #16161c 100%);
}
.album-hoja.hoja-bn .album-hoja-head,
.album-hoja.hoja-bn .album-hoja-marca,
.album-hoja.hoja-bn .album-ficha-club,
.album-hoja.hoja-bn .album-slot:not(.escudo) {
  filter: grayscale(1);
}
.album-hoja .album-grilla {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, max-content);
  justify-items: center;
  align-items: start;
  align-content: start;
  gap: 4px 6px;
}
.album-hoja.hoja-club-1 .album-grilla-jugadores {
  grid-template-rows: repeat(2, max-content);
  flex: 1 1 auto;
}
.album-fila-club {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex: 0 0 auto;
  max-height: none;
  min-height: 0;
  margin-bottom: 5px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.album-fila-club .album-slot.once {
  aspect-ratio: 504 / 360;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  max-width: none;
  max-height: 100%;
  align-self: center;
}
.album-fila-club .album-slot.escudo {
  aspect-ratio: 360 / 504;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  justify-self: center;
  align-self: center;
  box-sizing: border-box;
}
.album-ficha-club {
  position: relative;
  z-index: 3;
  min-width: 0;
  flex: 1 1 0;
  width: auto;
  max-width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #e8eef8;
  font-size: clamp(5.5px, 1.85vw, 8px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  text-align: center;
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
  padding: 0 1px;
  overflow: hidden;
  justify-self: stretch;
  align-self: stretch;
  box-sizing: border-box;
}
.album-ficha-club .ficha-nom {
  color: #f5d76e;
  font-size: 1.02em;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08px;
  margin-bottom: 1px;
  line-height: 1.05;
  max-width: 100%;
}
.album-ficha-club span {
  color: #93c5fd;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.92em;
  letter-spacing: 0.2px;
}
.album-hoja .album-grilla .album-slot {
  aspect-ratio: 360 / 504;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  min-width: 0;
  min-height: 0;
  justify-self: center;
  align-self: start;
  box-sizing: border-box;
}
.album-hoja .album-slot {
  background: rgba(255,255,255,0.07);
  border: 1.5px dashed rgba(255,255,255,0.28);
  box-shadow: inset 0 0 18px rgba(7,16,46,0.35);
}
.album-hoja .album-slot .nro { color: rgba(255,255,255,0.42); }
.album-hoja .album-slot.pegada {
  background: transparent;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
.album-hoja .album-slot img {
  object-fit: contain;
}
.album-pag-meta {
  display: none;
}
.album-hoja-esperando {
  visibility: hidden;
}
.album-hoja-volando,
.album-curl {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  transform-style: preserve-3d;
  opacity: 1;
}
.album-curl-strip {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: hidden;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  opacity: 1;
  background: #0a1648;
  box-shadow: 3px 0 8px rgba(0,0,0,0.16);
}
.album-curl.dobla-atras .album-curl-strip {
  box-shadow: -3px 0 8px rgba(0,0,0,0.16);
}
.album-curl-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0.08), rgba(4,10,28,0.28));
  mix-blend-mode: multiply;
  opacity: 0.32;
}
.album-curl.dobla-atras .album-curl-strip::after {
  background: linear-gradient(270deg, rgba(255,255,255,0.08), rgba(4,10,28,0.28));
}
.album-curl-face {
  position: absolute !important;
  top: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: hidden;
  opacity: 1 !important;
  background: linear-gradient(180deg, #163a7a 0%, #0a1648 100%) !important;
}
.album-curl-face.tapa {
  background: #0a1648 !important;
}
.album-curl.dobla-adelante .album-curl-strip {
  transform-origin: calc(var(--i) * -100%) 50%;
  animation: albumCurlFwd 0.52s cubic-bezier(0.32, 0.12, 0.2, 1) both;
  animation-delay: calc((var(--n) - 1 - var(--i)) * 14ms);
}
.album-curl.dobla-atras .album-curl-strip {
  transform-origin: calc((var(--n) - var(--i)) * 100%) 50%;
  animation: albumCurlBack 0.52s cubic-bezier(0.32, 0.12, 0.2, 1) both;
  animation-delay: calc(var(--i) * 14ms);
}
@keyframes albumCurlFwd {
  0%   { transform: rotateY(0deg); }
  22%  { transform: rotateY(-26deg); }
  48%  { transform: rotateY(-80deg); }
  72%  { transform: rotateY(-130deg); }
  90%  { transform: rotateY(-166deg); }
  100% { transform: rotateY(-180deg); }
}
@keyframes albumCurlBack {
  0%   { transform: rotateY(0deg); }
  22%  { transform: rotateY(26deg); }
  48%  { transform: rotateY(80deg); }
  72%  { transform: rotateY(130deg); }
  90%  { transform: rotateY(166deg); }
  100% { transform: rotateY(180deg); }
}
@media (prefers-reduced-motion: reduce) {
  .album-hoja-volando,
  .album-curl { animation: none; display: none; }
  .album-hoja-esperando { visibility: visible; }
}
.album-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  display: none;
}
.album-seccion h3 {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 10px 0 8px;
  padding: 6px 8px;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #93c5fd;
  background: rgba(7, 13, 28, 0.92);
  border-left: 3px solid #f5d76e;
}
.album-grilla {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-items: start;
}
.album-slot {
  aspect-ratio: 360 / 504;
  width: 100%;
  height: auto;
  background: rgba(255,255,255,0.04);
  border: 1.5px dashed rgba(255,255,255,0.28);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}
.album-slot.pegada {
  border: none;
  background: transparent;
}
.album-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.album-slot .nro {
  font-size: 13px;
  font-weight: 900;
  color: #64748b;
}
.album-slot.pegada .nro { display: none; }
.album-slot .extra {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef3b24;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  border-radius: 8px;
  padding: 1px 5px;
}
#album-pack-overlay {
  position: fixed;
  inset: 0;
  z-index: 26000000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.82);
  padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  overflow: hidden;
}
#album-pack-overlay.abierto { display: flex; }
.album-pack-caja {
  width: 100%;
  max-width: 380px;
  max-height: min(92dvh, 720px);
  overflow: visible;
  background: linear-gradient(180deg, #12203a, #0a1224);
  border: 2px solid #d4af37;
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  box-sizing: border-box;
}
.album-pack-caja.pack-listo,
#album-pack-overlay.pack-listo .album-pack-caja {
  overflow-y: auto;
}
.album-pack-caja h3 {
  color: #f5d76e;
  margin: 0 0 8px;
  font-size: 16px;
}
.album-pack-hint {
  font-size: 11px;
  color: #cbd5e1;
  margin: 0;
  min-height: 16px;
}
#album-pack-overlay.abriendo .album-pack-hint {
  opacity: 0.55;
}
#album-pack-overlay.pack-listo .album-pack-hint {
  opacity: 1;
}
.album-pack-escena {
  position: relative;
  margin: 10px 0 12px;
  width: 100%;
}
.album-pack-sobre-wrap {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
#album-pack-overlay.abriendo .album-pack-sobre-wrap {
  z-index: 1;
  pointer-events: none;
}
.album-pack-sobre {
  width: min(72%, 220px);
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(0,0,0,0.65));
  transform-origin: center center;
  animation: albumPackIn 0.48s cubic-bezier(.18,.86,.22,1) both;
}
@keyframes albumPackIn {
  from { transform: scale(0.72) translateY(12px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
#album-pack-overlay.abriendo .album-pack-sobre {
  animation: albumPackOpen 0.72s ease forwards;
}
@keyframes albumPackOpen {
  0% { transform: scale(1) rotate(0deg); opacity: 1; }
  16% { transform: scale(1.12) rotate(-8deg); }
  32% { transform: scale(1.16) rotate(9deg); }
  52% { transform: scale(1.04) rotate(-4deg); }
  100% { transform: scale(0.38) translateY(14px); opacity: 0; }
}
.album-pack-grilla {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  width: 100%;
  position: relative;
  z-index: 2;
}
.album-pack-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
#album-pack-overlay.abriendo .album-pack-item {
  position: relative;
  z-index: 10;
}
.album-pack-foto {
  position: relative;
  width: 100%;
  aspect-ratio: 360 / 504;
  overflow: visible;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1.5px dashed rgba(255,255,255,0.32);
  box-sizing: border-box;
}
.album-pack-item.llegada .album-pack-foto {
  overflow: hidden;
  background: #000;
  border-color: transparent;
}
.album-pack-foto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  opacity: 0;
  z-index: 12;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,0.45));
}
.album-pack-item.llegada img {
  filter: none;
}
.album-pack-item.once .album-pack-foto {
  overflow: hidden;
}
.album-pack-item.once .album-pack-foto img {
  object-fit: cover;
  object-position: center;
}
.album-pack-item.once.llegada .album-pack-foto img {
  transform: rotate(90deg) scale(1.4);
}
.album-pack-item .album-nueva,
.album-pack-item .album-repe {
  opacity: 0;
  transform: translateY(4px);
}
.album-pack-item.llegada .album-nueva,
.album-pack-item.llegada .album-repe {
  opacity: 1;
  transform: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
#btn-album-pack-ok:disabled {
  opacity: 0.38;
  cursor: default;
}
@media (prefers-reduced-motion: reduce) {
  .album-pack-sobre { animation: none; opacity: 0; }
  .album-pack-foto img {
    opacity: 1 !important;
    transform: none !important;
    filter: none;
  }
  .album-pack-item.once .album-pack-foto img {
    transform: rotate(90deg) scale(1.4) !important;
  }
  .album-pack-item .album-nueva,
  .album-pack-item .album-repe { opacity: 1; transform: none; }
}
.album-nueva {
  font-size: 9px;
  font-weight: 900;
  color: #22c55e;
}
.album-repe {
  font-size: 9px;
  font-weight: 900;
  color: #f59e0b;
}
#album-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 27000000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.88);
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}
#album-zoom-overlay.abierto { display: flex; }
.album-zoom-caja {
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.album-zoom-caja img {
  width: 100%;
  aspect-ratio: 360 / 504;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.65);
  background: #0a1224;
}
.album-zoom-caja.apaisada {
  width: min(94vw, 588px);
}
.album-zoom-caja.apaisada img {
  aspect-ratio: 504 / 360;
}
.album-zoom-caja.escudo {
  width: min(92vw, 420px);
}
.album-zoom-caja.escudo img {
  aspect-ratio: 360 / 504;
}
.album-zoom-meta {
  font-size: 13px;
  font-weight: 800;
  color: #f5d76e;
  letter-spacing: 0.6px;
  text-align: center;
}
#album-zoom-overlay .btn-accion {
  margin: 0;
  width: auto;
  min-width: 140px;
  padding: 10px 18px;
}
.album-zoom-trade {
  font-size: 11px;
  font-weight: 800;
  color: #93c5fd;
}
#album-confetti {
  position: fixed;
  inset: 0;
  z-index: 28000000;
  pointer-events: none;
}
#album-celebra {
  position: fixed;
  inset: 0;
  z-index: 28000001;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 20px;
}
.album-celebra-caja {
  text-align: center;
  background: rgba(7, 13, 28, 0.88);
  border: 2px solid #f5d76e;
  border-radius: 16px;
  padding: 18px 20px;
  animation: albumCelebraIn 0.45s ease;
}
.album-celebra-caja h3 {
  margin: 0 0 6px;
  color: #f5d76e;
  font-size: 20px;
  letter-spacing: 1px;
}
.album-celebra-caja p {
  margin: 0;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
}
#album-celebra.album-celebra-total .album-celebra-caja {
  border-width: 3px;
  box-shadow: 0 0 40px rgba(245, 215, 110, 0.55);
  transform: scale(1.05);
}
#album-celebra.album-celebra-total h3 {
  font-size: 24px;
  text-shadow: 0 0 18px rgba(245, 215, 110, 0.8);
}
@keyframes albumCelebraIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  #album-confetti { display: none; }
}
#btn-abrir-album .album-badge-pack {
  background: #ef3b24;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  border-radius: 10px;
  padding: 2px 7px;
  margin-left: 6px;
}
