/* Page layout */
.collection-page {
  padding: 4rem 2rem 8rem;
  flex: 1;
}

/* Header scrolls naturally */
.collection-header {
  max-width: 1200px;
  margin: 0 auto 4rem;
  text-align: center;
}

.collection-header h1 {
  font-size: clamp(2rem, 7vw, 6rem);
}

/* ── Collection Grid ─────────────────────────────────── */

#collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.loading-msg {
  grid-column: 1 / -1;
  text-align: center;
  opacity: 0.6;
  padding: 3rem 0;
}

.loading-msg.error {
  color: #e74c3c;
}
html {
  background: linear-gradient(180deg, #f7fdf6, #e9f7ee) fixed;
  min-height: 100%;
}

/* ── Card ────────────────────────────────────────────── */

.shrek-card {
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  background: #111;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shrek-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.7);
}

.card-img-wrap {
  position: relative;
  overflow: hidden;
  background: #111;
}

.card-img-wrap img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.shrek-card:hover .card-img-wrap img {
  transform: scale(1.04);
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.4rem 0.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.card-id {
  font-family: monospace;
  font-size: 0.7rem;
  color: #aaa;
}

.cond-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  color: #000;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card-label {
  padding: 0.4rem 0.6rem 0.5rem;
  font-size: 0.75rem;
  color: #ccc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Modal ───────────────────────────────────────────── */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  position: relative;
  background: #1c1c1c;
  border-radius: 8px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  animation: modalIn 0.18s ease;
}

@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.1s;
}

.modal-close:hover {
  color: #fff;
}

.modal-img-wrap {
  width: 100%;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 1.2rem;
  background: #111;
}

.modal-img-wrap img {
  width: 100%;
  height: auto;
  max-height: 60vh;
  object-fit: contain;
  display: block;
}

/* ── Detail Table ────────────────────────────────────── */

.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.modal-table tr {
  border-bottom: 1px solid #2a2a2a;
}

.modal-table tr:last-child {
  border-bottom: none;
}

.modal-table th {
  text-align: left;
  padding: 0.45rem 0.6rem 0.45rem 0;
  color: #888;
  font-weight: 500;
  width: 36%;
  vertical-align: top;
}

.modal-table td {
  padding: 0.45rem 0;
  color: #e0e0e0;
  vertical-align: top;
}
/* ── Site info footer ───────────────────────────────── */
.site-info {
  text-align: center;
  padding: 0.6rem 1rem 1.5rem;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.6;
}

.site-info a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.site-info a:hover {
  color: var(--fg);
}

.site-info .sep {
  margin: 0 0.5rem;
  opacity: 0.4;
}

/* Small screens */

/*@media (max-width:768px){
  #collection-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}