.core-cards {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  min-height: 50px;
  margin-top: 5px;
  overflow: hidden;
}
.card-thumb {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  aspect-ratio: 626 / 457;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background:
    radial-gradient(circle at 50% 30%, rgba(156, 67, 255, .20), transparent 55%),
    var(--surface-3);
  box-shadow: inset 0 1px rgba(255,255,255,.06);
  cursor: default;
}
.card-thumb-compact { width: 46px; }
.card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .16s ease;
}
.card-thumb.is-loaded img { opacity: 1; }
.card-thumb.is-loaded .card-thumb-placeholder { opacity: 0; }
.card-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #b96dff;
  font-size: .47rem;
  font-weight: 950;
  letter-spacing: .04em;
  transition: opacity .16s ease;
}
.card-thumb.is-missing .card-thumb-placeholder {
  color: var(--muted);
  font-size: .72rem;
}
@media (hover: hover) and (pointer: fine) {
  .card-thumb:hover {
    border-color: #b95cff;
    box-shadow: 0 0 0 1px rgba(185,92,255,.32), 0 0 16px rgba(150,54,255,.24);
  }
}
.card-list-row {
  display: grid !important;
  grid-template-columns: 46px 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px !important;
  min-width: 0;
  min-height: 52px;
  padding: 5px 8px !important;
  border-radius: 8px;
  background: rgba(124,44,255,.035);
  break-inside: avoid;
}
.card-quantity {
  color: #c879ff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.card-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reference-decklist {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
  padding: 2px 16px 16px;
  color: var(--text);
  font-size: .82rem;
}
.reference-decklist li { margin: 0; }
.card-hover-preview {
  position: fixed;
  z-index: 1000;
  width: 278px;
  max-height: calc(100vh - 24px);
  overflow: hidden;
  pointer-events: none;
  border: 1px solid rgba(190,94,255,.58);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 94%, #160923 6%);
  box-shadow:
    0 18px 52px rgba(0,0,0,.55),
    0 0 30px rgba(137,48,255,.23),
    inset 0 1px rgba(255,255,255,.06);
}
.card-hover-preview[hidden] { display: none; }
.card-hover-preview > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 94px);
  object-fit: contain;
  background: #05050a;
}
.card-hover-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px 11px;
}
.card-hover-copy strong {
  color: var(--text);
  font-size: .86rem;
  line-height: 1.25;
}
.card-hover-copy span {
  color: var(--muted);
  font-size: .68rem;
  line-height: 1.35;
}
@media (max-width: 980px) {
  .reference-decklist { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .core-cards { min-height: 46px; gap: 4px; }
  .core-cards .card-thumb { width: 42px; }
  .core-cards .card-thumb:nth-child(n+6) { display: none; }
  .card-list-row {
    grid-template-columns: 42px 34px minmax(0, 1fr);
    min-height: 48px;
  }
  .card-thumb-compact { width: 42px; }
  .card-hover-preview { display: none; }
}
