#screen-collection {
  background:
    repeating-linear-gradient(135deg, rgba(243, 189, 202, 0.48) 0 56px, rgba(189, 232, 207, 0.46) 56px 112px, rgba(200, 188, 229, 0.46) 112px 168px, rgba(255, 247, 199, 0.5) 168px 224px),
    linear-gradient(180deg, #fff8ec 0%, #f7dfe9 48%, #dff3ea 100%);
}

.collection-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  min-height: var(--header-height);
}

.collection-header__title {
  flex: 1;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--paper-ink);
}

.collection-header__count {
  font-size: 0.95rem;
  color: var(--paper-ink);
  font-weight: 600;
}

.collection__progress-wrap {
  padding: 0 16px 12px;
}

.collection__shelf {
  flex: 1;
  width: calc(100% - 24px);
  max-width: 390px;
  margin: 0 auto 18px;
  padding: 12px 10px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  background:
    linear-gradient(90deg, rgba(154, 100, 61, 0.32) 0 7px, transparent 7px calc(100% - 7px), rgba(154, 100, 61, 0.32) calc(100% - 7px)),
    rgba(255, 250, 240, 0.55);
  border: 2px solid rgba(154, 100, 61, 0.24);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 12px 26px rgba(111, 73, 93, 0.16);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.shelf-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0 4px 14px;
  padding: 8px 6px 14px;
  border-bottom: 9px solid rgba(132, 83, 48, 0.82);
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.36), transparent 62%, rgba(154, 100, 61, 0.18) 100%);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 7px 0 rgba(196, 154, 98, 0.56), 0 10px 14px rgba(111, 73, 93, 0.1);
}

.collection-slot {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 250, 240, 0.62);
  position: relative;
  transition: transform 0.15s var(--ease-bounce);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.collection-slot.is-touching {
  transform: scale(0.92);
}

.collection-slot--owned {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.72), rgba(243, 227, 198, 0.42) 58%, rgba(154, 100, 61, 0.14));
  border: 1px solid rgba(154, 100, 61, 0.18);
  cursor: pointer;
}

.collection-slot--owned .dumpling--raro,
.collection-slot--owned .dumpling--legendario,
.collection-slot--owned .dumpling--mitico {
  animation-delay: var(--collection-motion-delay, 0s);
}

.collection-slot--owned .dumpling--raro .dumpling__body,
.collection-slot--owned .dumpling--legendario .dumpling__body,
.collection-slot--owned .dumpling--mitico .dumpling__body {
  animation-delay: var(--collection-motion-offset, 0s);
}

.collection-slot--owned:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.18), 0 8px 18px rgba(111, 73, 93, 0.16);
}

.collection-slot--locked {
  background: rgba(255, 255, 255, 0.38);
  border: 1px dashed rgba(154, 100, 61, 0.28);
  cursor: pointer;
}

.collection-slot__question {
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(50, 36, 57, 0.34);
}

.collection-slot--normal {
  box-shadow: inset 0 0 0 1px rgba(243, 227, 198, 0.12);
}

.collection-slot--raro {
  border-color: rgba(19, 242, 208, 0.38);
  box-shadow: inset 0 0 12px rgba(19, 242, 208, 0.12), 0 0 16px rgba(157, 53, 255, 0.16);
}

.collection-slot--legendario {
  border-color: rgba(255, 215, 107, 0.62);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 215, 107, 0.26), rgba(157, 53, 255, 0.12) 54%, rgba(20, 13, 25, 0.38));
  box-shadow: inset 0 0 14px rgba(255, 215, 107, 0.2), 0 0 22px rgba(255, 215, 107, 0.2);
}

.collection-slot--mitico {
  border-color: rgba(255, 107, 157, 0.72);
  background:
    radial-gradient(circle at 50% 36%, rgba(255, 255, 255, 0.42), rgba(19, 242, 208, 0.16) 42%, rgba(157, 53, 255, 0.16) 70%);
  box-shadow: inset 0 0 16px rgba(255, 255, 255, 0.28), 0 0 22px rgba(255, 107, 157, 0.28);
}

.collection-slot--hint-arcoiris {
  background: linear-gradient(135deg, rgba(255, 95, 143, 0.12), rgba(255, 215, 107, 0.12), rgba(19, 242, 208, 0.12), rgba(157, 53, 255, 0.12));
}

.collection-slot--hint-fuego { background: rgba(255, 79, 31, 0.12); }
.collection-slot--hint-transparente { background: rgba(217, 247, 255, 0.16); }

/* Color hints for locked slots */
.collection-slot--hint-rojo { background: rgba(230, 57, 70, 0.08); }
.collection-slot--hint-naranja { background: rgba(247, 127, 0, 0.08); }
.collection-slot--hint-amarillo { background: rgba(255, 214, 10, 0.08); }
.collection-slot--hint-verde { background: rgba(45, 198, 83, 0.08); }
.collection-slot--hint-azul { background: rgba(72, 149, 239, 0.08); }
.collection-slot--hint-morado { background: rgba(155, 93, 229, 0.08); }
.collection-slot--hint-rosa { background: rgba(255, 133, 161, 0.08); }
.collection-slot--hint-blanco { background: rgba(248, 244, 239, 0.06); }
.collection-slot--hint-negro { background: rgba(43, 45, 66, 0.2); }
.collection-slot--hint-dorado { background: rgba(255, 215, 0, 0.1); }

.collection-slot__tooltip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--paper-cream);
  color: var(--paper-ink);
  font-size: 0.65rem;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 5;
}

.collection-message {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 30;
  width: min(320px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 250, 240, 0.96);
  color: var(--paper-ink);
  border: 1px solid rgba(154, 100, 61, 0.22);
  box-shadow: 0 10px 28px rgba(111, 73, 93, 0.2);
  font-weight: 700;
  text-align: center;
}

.collection-slot--owned:hover .collection-slot__tooltip {
  opacity: 1;
}

/* Victory overlay */
.victory-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 215, 107, 0.24), transparent 38%),
    rgba(15, 10, 26, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 24px;
}

.victory-overlay:not(.hidden) {
  display: flex;
  animation: fadeIn 0.4s var(--ease-smooth);
}

.victory__content {
  text-align: center;
  position: relative;
  padding: 32px 24px;
  background:
    linear-gradient(180deg, rgba(243, 227, 198, 0.96), rgba(225, 195, 150, 0.94));
  color: var(--paper-ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  max-width: 320px;
}

.victory__title {
  font-size: 1.5rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffd700, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.victory__text {
  color: rgba(50, 36, 57, 0.78);
  margin-bottom: 24px;
}

@media (max-width: 640px) {
  .collection-header {
    padding-top: calc(10vh + env(safe-area-inset-top, 0px));
    padding-bottom: 12px;
  }

  .collection__back {
    margin-top: 2px;
  }

  .collection-header__title,
  .collection-header__count {
    line-height: 1.1;
  }
}
