/* ─── Collection View ──────────────────────────────────────────────────── */

.collection-layout {
  display: flex;
  min-height: calc(100vh - 76px);
}

/* ── Main content area ── */
.collection-main {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  min-width: 0;
}

.collection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.collection-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.collection-sort-select {
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 6px 28px 6px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  appearance: auto;
  -webkit-appearance: auto;
}
.collection-sort-select option {
  background: #1e2130;
  color: #e2e8f0;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

/* ── Tile ── */
.collection-tile {
  position: relative;
  background: var(--surface-2);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid var(--border-color);
}

.collection-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  border-color: var(--accent);
}

.collection-tile-img {
  width: 100%;
  aspect-ratio: 63 / 88;
  object-fit: cover;
  display: block;
  background: var(--surface-3);
  border-radius: 4.5% / 3.2%;
}

.collection-tile-body {
  padding: 8px 10px 10px;
}

.collection-tile-name {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.collection-tile-price {
  font-size: 0.75rem;
  color: #2dd4bf;
  margin-top: 3px;
  font-weight: 500;
}

.collection-tile-qty {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  z-index: 1;
}

/* Image wrapper — clips shimmer and rounds image corners */
.collection-tile-img-wrap {
  position: relative;
  display: block;
  line-height: 0;
  overflow: hidden;
  border-radius: 4.5% / 3.2%;
}

/* Foil shimmer — soft holographic sweep over card image */
.collection-tile-shimmer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(105deg,
    transparent 0%,
    transparent 35%,
    rgba(255,255,255,0.04) 40%,
    rgba(180,220,255,0.14) 46%,
    rgba(255,200,255,0.12) 52%,
    rgba(180,255,220,0.10) 58%,
    rgba(255,255,255,0.04) 63%,
    transparent 68%,
    transparent 100%);
  background-size: 300% 300%;
  background-position: 150% 50%;
  animation: col-foil 4s ease-in-out infinite;
}
@keyframes col-foil {
  0%, 100% { background-position: 150% 50%; opacity: 0.7; }
  50%       { background-position: -50% 50%; opacity: 1;   }
}

/* Empty state */
.collection-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  color: var(--text-secondary);
}

/* ── Sidebar ── */
.collection-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-color);
  padding: 20px 14px;
  overflow-y: auto;
  background: var(--surface);
}

.collection-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.collection-sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.collection-clear-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}
.collection-clear-btn:hover { text-decoration: underline; }

.csb-section {
  padding: 16px 0;
}
.csb-section + .csb-section {
  border-top: 1px solid var(--border-color);
}

.csb-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.csb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-primary);
  user-select: none;
}
.csb-row:hover { color: var(--accent); }
.csb-check { cursor: pointer; accent-color: var(--accent); }

.csb-rarity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Color buttons */
.csb-color-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.csb-color-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--surface-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  transition: border-color 0.15s, transform 0.1s;
}
.csb-color-btn:hover  { transform: scale(1.1); }
.csb-color-btn.active { border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.35); }

/* Mana symbol colours */
.csb-mana-w { color: #f5f0d8; }
.csb-mana-u { color: #4a90d9; }
.csb-mana-b { color: #b0a0c0; }
.csb-mana-r { color: #e85d3a; }
.csb-mana-g { color: #4caf78; }
.csb-mana-c { color: #9ca3af; }
.csb-mana-m { color: #f59e0b; }
.collection-empty svg { width: 48px; height: 48px; opacity: 0.4; }
