.collection-cards {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.role-card-floating {
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.18), transparent 44%),
    linear-gradient(160deg, rgba(29, 39, 74, 0.78), rgba(14, 18, 33, 0.9));
}

.card-portrait-floating {
  aspect-ratio: 3 / 4;
  border-radius: 16px;
}

.card-portrait,
.card-portrait img {
  width: 100%;
  height: 100%;
}

.card-portrait img {
  object-fit: contain;
}

.image-empty {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 10px, rgba(255, 255, 255, 0.01) 10px 20px);
}

.collection-full-card {
  padding: 20px;
}

.collection-full-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.collection-full-media-panel,
.collection-full-info-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 10px;
}

.collection-full-info-panel .desc {
  line-height: 1.7;
  white-space: pre-wrap;
}

.card-portrait-large {
  aspect-ratio: 3 / 4;
  max-height: min(66vh, 760px);
}

.gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.gallery-photo-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.card-portrait-gallery {
  aspect-ratio: 3 / 4;
  border-radius: 12px;
}

.collection-photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 70;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.collection-photo-viewer.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.photo-viewer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, 0.88);
  backdrop-filter: blur(5px);
}

.photo-viewer-card {
  position: absolute;
  inset: 3vh 4vw;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.96);
  padding: 14px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 12px;
}

.photo-viewer-head,
.photo-viewer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.photo-stage {
  min-height: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #030408;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.photo-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-thumb-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  max-height: 140px;
  overflow: auto;
}

.photo-thumb {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3 / 4;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb.is-active {
  border-color: rgba(140, 164, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(140, 164, 255, 0.4);
}

.media-picker-modal {
  border-radius: 16px;
  padding: 18px;
  gap: 12px;
}

.media-url-panel {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.media-url-label {
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .collection-full-layout {
    grid-template-columns: 1fr;
  }

  .photo-viewer-card {
    inset: 2vh 2vw;
    padding: 10px;
  }

  .photo-viewer-head,
  .photo-viewer-foot {
    flex-direction: column;
    align-items: stretch;
  }
}