/* ═══════════════════════════════════════════════════════════════════════════
   SHARED CARD VIEW SYSTEM
   Canonical classes used across Collection, BuyList, WantList, Decks.
   Grid  →  .cv-grid  +  .cv-tile
   Spot  →  .cv-spotlight  +  .cv-spot
   List  →  .cv-list  (table)
   Toggle →  .cv-view-toggle  +  .cv-view-btn
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── View toggle buttons ─────────────────────────────────────────────────── */
.cv-view-toggle {
  display: flex;
  gap: 0.25rem;
}

.cv-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(200,135,42,0.2);
  background: transparent;
  color: var(--color-muted);
  font-size: 0.8rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.cv-view-btn:hover { color: var(--color-accent); border-color: rgba(200,135,42,0.5); }
.cv-view-btn.active,
.cv-view-btn.is-active {
  color: #000;
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   GRID VIEW
   ═══════════════════════════════════════════════════════════════════════════ */

.cv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 1rem;
  align-content: start;
}

/* Card tile */
.cv-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 1px solid rgba(200,135,42,0.15);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: inherit;
  outline: none;
}
.cv-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(200,135,42,0.45);
  box-shadow: 0 6px 22px rgba(0,0,0,0.5);
}
.cv-tile:focus-visible { outline: 2px solid var(--color-accent); }

/* Image */
.cv-tile__img {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
  background: rgba(14,12,10,0.5);
  box-shadow: 0 4px 16px rgba(0,0,0,0.45);
  transition: transform 0.35s ease, box-shadow 0.22s ease;
}
.cv-tile:hover .cv-tile__img {
  transform: scale(1.04);
  box-shadow: 0 10px 32px rgba(0,0,0,0.65);
}
.cv-tile__img--placeholder {
  width: 100%;
  aspect-ratio: 5 / 7;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 1.5rem;
}

/* Info strip */
.cv-tile__info {
  background: var(--color-surface);
  padding: 0.65rem 0.75rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1;
  position: relative;
}
.cv-tile__name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  padding-right: 2.2rem; /* room for badge */
}
.cv-tile__set {
  font-size: 0.67rem;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-tile__price {
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 700;
  margin-top: 0.1rem;
}
.cv-tile__meta {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding-top: 0.2rem;
}
.cv-tile__qty {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* Top-right badge (finish/foil chip) */
.cv-tile__badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  font-size: 0.56rem !important;
  padding: 1px 5px !important;
}

/* Remove button (hover-reveal, top-left over image) */
.cv-tile__remove {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  z-index: 2;
  background: rgba(0,0,0,0.65);
  border-radius: 50%;
  color: rgba(255,255,255,0.6);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  padding: 0;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.cv-tile:hover .cv-tile__remove,
.cv-tile:focus-within .cv-tile__remove { opacity: 1; }
.cv-tile__remove:hover { color: #ef5350; background: rgba(0,0,0,0.85); }

/* ═══════════════════════════════════════════════════════════════════════════
   SPOTLIGHT VIEW
   ═══════════════════════════════════════════════════════════════════════════ */

.cv-spotlight {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cv-spot {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.85rem;
  background: var(--color-surface);
  border: 1px solid rgba(200,135,42,0.18);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.cv-spot:hover {
  border-color: rgba(200,135,42,0.5);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Image */
.cv-spot__img {
  width: 90px;
  flex-shrink: 0;
  border-radius: 7px;
  object-fit: cover;
  aspect-ratio: 5 / 7;
  display: block;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  transition: transform 0.2s ease;
}
.cv-spot:hover .cv-spot__img { transform: scale(1.03); }
.cv-spot__img--placeholder {
  width: 90px;
  aspect-ratio: 5 / 7;
  flex-shrink: 0;
  border-radius: 7px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 1.2rem;
}

/* Body */
.cv-spot__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cv-spot__set {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-spot__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
}
.cv-spot__meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.cv-spot__price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-top: 0.15rem;
}
.cv-spot__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.cv-spot__footer-label {
  font-size: 0.8rem;
  color: var(--color-muted);
}
.cv-spot__footer-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-accent);
  font-family: var(--font-accent);
}

/* Remove button (hover-reveal, top-left) */
.cv-spot__remove {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  z-index: 2;
  background: rgba(0,0,0,0.65);
  border-radius: 50%;
  color: rgba(255,255,255,0.6);
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  padding: 0;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.cv-spot:hover .cv-spot__remove,
.cv-spot:focus-within .cv-spot__remove { opacity: 1; }
.cv-spot__remove:hover { color: #ef5350; background: rgba(0,0,0,0.85); }

/* ═══════════════════════════════════════════════════════════════════════════
   LIST / TABLE VIEW  (mirrors coll-table — reference style)
   ═══════════════════════════════════════════════════════════════════════════ */

.cv-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-family: var(--font-body);
}
.cv-list th {
  font-family: var(--font-accent);
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--color-muted);
  letter-spacing: 0.06em;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}
.cv-list td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--color-text);
  vertical-align: middle;
}
.cv-list tr:hover td { background: rgba(200,135,42,0.03); }
.cv-list .cv-list__row { cursor: pointer; transition: background 0.12s; }
.cv-list .cv-list__row:hover { background: rgba(200,135,42,0.05); }
.cv-list .cv-list__row:active { background: rgba(200,135,42,0.1); }
.cv-list .cv-list__img {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}
.cv-list .cv-list__img--placeholder {
  width: 36px;
  height: 50px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  font-size: 0.85rem;
}
.cv-list .num-col { text-align: right; }
.cv-list .val-col { color: var(--color-accent); font-weight: 600; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .cv-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }
  .cv-tile__info { padding: 0.5rem 0.55rem 0.55rem; }
  .cv-spot__img, .cv-spot__img--placeholder { width: 64px; }
  .cv-spot__name { font-size: 0.88rem; }
  .cv-spot__price { font-size: 0.9rem; }
}
