/* card-grid.css — Card tile grid, ownership states, playset dots, alt-art grouping */

/* ── Grid ── */
.card-grid {
  display: grid; gap: 10px; padding: 12px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  max-width: 1600px; margin: 0 auto;
}

/* ── Card tile ── */
.card-item {
  position: relative; border-radius: 8px; overflow: visible;
  background: var(--surface2);
  cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.card-item:hover { transform: scale(1.06); z-index: 10; }
.card-item .card-img-wrap {
  position: relative; aspect-ratio: 488 / 680; border-radius: 8px; overflow: hidden;
}
.card-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-info {
  padding: 4px 6px 5px; font-size: 11px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-info .card-name { color: var(--text); font-weight: 500; }
.card-info .card-price { color: var(--muted); font-size: 10px; }

/* ── Ownership states ── */
.card-item.owned { box-shadow: 0 2px 12px rgba(111, 66, 193, .45); }
.card-item.owned:hover { box-shadow: 0 4px 20px rgba(111, 66, 193, .7); }
.card-item.missing { opacity: .3; }
.card-item.missing:hover { opacity: 1; transform: scale(1.06); }

/* ── Alt-art grouping segments ── */
.alt-seg { padding: 6px; border-radius: 8px; }
.alt-seg-first { border-top: 2px solid rgba(180,130,255,0.5); border-left: 2px solid rgba(180,130,255,0.5); border-bottom: 2px solid rgba(180,130,255,0.5); border-radius: 8px 0 0 8px; }
.alt-seg-mid { border-top: 2px solid rgba(180,130,255,0.5); border-bottom: 2px solid rgba(180,130,255,0.5); margin-left: -10px; padding-left: 16px; border-radius: 0; }
.alt-seg-last { border-top: 2px solid rgba(180,130,255,0.5); border-right: 2px solid rgba(180,130,255,0.5); border-bottom: 2px solid rgba(180,130,255,0.5); margin-left: -10px; padding-left: 16px; border-radius: 0 8px 8px 0; }
.alt-seg-first.alt-seg-last { border: 2px solid rgba(180,130,255,0.5); border-radius: 8px; margin-left: 0; padding-left: 6px; }
.alt-seg .card-item { margin: 0; }
.alt-seg .card-item:hover { transform: scale(1.1); z-index: 2; }

/* ── Playset dots ── */
.playset-dots {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 3px; align-items: center;
  background: rgba(0,0,0,.7); border-radius: 10px; padding: 3px 7px;
  backdrop-filter: blur(4px);
}
.playset-dots .dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.35); background: transparent;
}
.playset-dots .dot.filled { background: #fff; border-color: #fff; }
.playset-dots .dot.foil {
  width: 10px; height: 10px;
  background: linear-gradient(135deg, #ff6ec4, #7873f5, #4ade80, #fbbf24, #ff6ec4);
  background-size: 200% 200%; animation: foil-shimmer 2s ease infinite;
  border-color: #fff; box-shadow: 0 0 5px rgba(255,255,255,.7), 0 0 2px rgba(255,110,196,.6);
}
.playset-dots .dot.filled.complete { background: #ffd700; border-color: #ffd700; }
.playset-dots .dot.foil.complete {
  width: 10px; height: 10px;
  background: linear-gradient(135deg, #ffd700, #ff6ec4, #7873f5, #4ade80, #ffd700);
  background-size: 200% 200%; animation: foil-shimmer 2s ease infinite;
  border-color: #ffd700; box-shadow: 0 0 6px rgba(255,215,0,.8), 0 0 2px rgba(255,110,196,.5);
}
.playset-dots .dot.filled.over { background: #b070ff; border-color: #b070ff; }
.playset-dots .dot.foil.over {
  width: 10px; height: 10px;
  background: linear-gradient(135deg, #b070ff, #ff6ec4, #4ade80, #fbbf24, #b070ff);
  background-size: 200% 200%; animation: foil-shimmer 2s ease infinite;
  border-color: #b070ff; box-shadow: 0 0 6px rgba(176,112,255,.8), 0 0 2px rgba(255,110,196,.5);
}
@keyframes foil-shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.playset-dots .plus { font-size: 9px; font-weight: 700; color: #b070ff; margin-left: 2px; }

/* Half dot for basic lands */
.playset-dots .dot.half {
  background: linear-gradient(to right, #fff 50%, transparent 50%);
  border-color: rgba(255,255,255,.6);
}
.playset-dots .dot.half.foil {
  background: linear-gradient(to right, #ff6ec4 0%, #7873f5 50%, transparent 50%);
  border-color: rgba(255,255,255,.8);
  box-shadow: 0 0 3px rgba(255,255,255,.4);
}
.playset-dots .dot.half.complete {
  background: linear-gradient(to right, #ffd700 50%, transparent 50%);
  border-color: rgba(255,215,0,.6);
}
