/* Collection tab: progress, filters, card grid, locked cards. */

.coll-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: 1.8rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.coll-progress { flex: 1 1 260px; }
.coll-text { margin-bottom: 0.5rem; font-weight: 800; color: var(--muted); }
.coll-shiny { color: #ffd6ee; }
.coll-text b { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; color: var(--ink); }
.progress { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb534, #ff7a3c);
  transition: width 0.4s;
}

.filters { display: flex; gap: 0.25rem; padding: 0.25rem; border-radius: 999px; background: rgba(0, 0, 0, 0.25); }
.filter {
  font: 800 0.85rem var(--font-body);
  padding: 0.4rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.filter:hover { color: var(--ink); }
.filter.active { background: var(--ink); color: var(--bg); }

.coll-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.3rem;
}
.empty { color: var(--muted); font-weight: 800; padding: 3rem 0; }

.link-btn {
  display: block;
  margin: 2.5rem auto 0;
  padding: 0.3rem 0.6rem;
  border: 0;
  background: none;
  font: 700 0.8rem var(--font-body);
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}
.link-btn:hover { color: #ff7a8a; }

/* ---------- Locked (not collected yet) ---------- */
.card.locked { cursor: default; }
.locked-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border-radius: 14px;
  border: 3px dashed color-mix(in srgb, var(--rc) 40%, transparent);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 10px, transparent 10px 20px),
    rgba(10, 8, 30, 0.55);
}
.locked-num  { font-family: var(--font-display); color: var(--muted); }
.locked-q    { font-family: var(--font-display); font-size: 4.2rem; line-height: 1; color: rgba(255, 255, 255, 0.18); }
.locked-face .badge-rarity { opacity: 0.55; background: var(--rc); color: var(--rt); font-family: var(--font-display); font-size: 0.78rem; padding: 5px 9px; border-radius: 999px; }
.locked-odds { font-size: 0.78rem; font-weight: 800; color: var(--muted); }

/* Tiles in the grid can be clicked to inspect */
.card.inspectable { cursor: pointer; }
.card.inspectable:hover .card-tilt { transform: translateY(-6px) scale(1.02); }
.tag-variant { left: 6px; bottom: 6px; display: inline-flex; gap: 0.3em; background: rgba(12, 10, 32, 0.78); color: #fff; letter-spacing: 0; }
/* One colour per variant, matching its own tag (.tag-shiny, .tag-violet, .tag-metallic, .tag-ancient) */
.vi { text-shadow: 0 0 6px currentColor; }
.vi-shiny { color: #ff6fb5; }
.vi-violet { color: #a77bff; }
.vi-metallic { color: #cfd9ea; }
.vi-ancient { color: #f3d98a; }
.tag-only { right: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.6); color: #ffd6ee; }

/* Variants dropdown */
.variant-wrap { position: relative; }
.variant-wrap .caret { font-size: 0.7em; opacity: 0.8; }
.variant-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 15; min-width: 11rem; padding: 0.35rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.variant-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
  padding: 0.5rem 0.75rem; border: 0; border-radius: 8px; background: transparent;
  font: 800 0.9rem var(--font-body); color: var(--ink); cursor: pointer;
}
.variant-item small { font-weight: 700; color: var(--muted); }
.variant-item:hover { background: rgba(255, 255, 255, 0.12); }

/* Card inspector */
.inspect-dialog {
  width: min(52rem, calc(100vw - 2rem)); max-height: 92vh; padding: 0; overflow: auto;
  border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--bg-2);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}
.inspect-dialog::backdrop { background: rgba(10, 8, 30, 0.78); }
.inspect-body { position: relative; padding: 1.6rem 1.4rem 1.4rem; text-align: center; }
.inspect-title { margin: 0; font: 400 1.7rem var(--font-display); }
.inspect-meta { margin: 0.2rem 0 1.4rem; font-weight: 800; font-size: 0.85rem; color: var(--muted); }
.inspect-close {
  position: absolute; top: 0.7rem; right: 0.9rem; width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%;
  font: 400 1.6rem/1 var(--font-body); color: var(--ink); background: rgba(255, 255, 255, 0.1); cursor: pointer;
}
.inspect-close:hover { background: rgba(255, 255, 255, 0.22); }
.inspect-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.8rem; }
.inspect-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.8rem; }
.inspect-fig figcaption { font: 400 1.05rem var(--font-display); }
.inspect-foot { margin: 1.4rem 0 0; font-size: 0.8rem; font-weight: 800; color: var(--muted); }

/* ---------- Performance: tiles outside the screen do no work ----------
   js/ui.js adds "fx-off" to collection tiles that are scrolled out of view.
   Their contents (3D layers, glow, holo shine, sparkles) are switched off
   until they come back into view. The tile keeps its size, so nothing jumps. */
.coll-grid .card.fx-off .card-tilt,
.coll-grid .card.fx-off .locked-face { display: none; }

/* ---------- Search bar ---------- */
.coll-search {
  position: relative; flex: 1 1 220px; max-width: 340px; display: flex; align-items: center;
}
.coll-search-icon { position: absolute; left: 0.8rem; width: 1rem; height: 1rem; color: var(--muted); pointer-events: none; }
.coll-search input {
  width: 100%; padding: 0.55rem 2.2rem 0.55rem 2.3rem;
  font: 700 0.95rem var(--font-body); color: var(--ink);
  border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.15s, background 0.15s;
}
.coll-search input::placeholder { color: var(--muted); font-weight: 700; }
.coll-search input:focus { outline: none; border-color: var(--accent); background: rgba(0, 0, 0, 0.35); }
.coll-search input::-webkit-search-cancel-button { display: none; }
.coll-search-clear {
  position: absolute; right: 0.4rem; width: 1.7rem; height: 1.7rem; border: 0; border-radius: 50%;
  font: 400 1.2rem/1 var(--font-body); color: var(--muted); background: transparent; cursor: pointer;
}
.coll-search-clear:hover { color: var(--ink); background: rgba(255, 255, 255, 0.12); }

/* Featured cards (profile) and the star under each card in the inspector */
.inspect-star { padding: 0.3rem 1rem; font-size: 0.85rem; border-width: 1.5px; }
.inspect-star.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.inspect-note { min-height: 1.2em; margin: 0.8rem 0 0; text-align: center; font-size: 0.9rem; color: var(--muted); }
.featured-row { margin-top: 0.4rem; }
.featured-open { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 14px; }
.featured-open:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
