/* ============================================================
   COLLECTION CARD BROWSER — all 64 cards + preview/zoom
   ============================================================ */

.collection-tile {
  position: relative;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.account-collection[data-collection] {
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.account-collection[data-collection]:hover {
  border-color: rgba(255, 216, 107, .42);
  background: rgba(255, 216, 107, .05);
}
.account-collection[data-collection]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.collection-tile:hover {
  border-color: rgba(255, 216, 107, .45);
  background: rgba(255, 216, 107, .06);
}
.collection-tile:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.tile-open {
  color: var(--gold) !important;
  font-size: 7px !important;
  letter-spacing: .3px !important;
  margin-top: 3px !important;
}
.section-hint {
  float: right;
  color: var(--muted);
  font-size: 7px;
  letter-spacing: .3px;
  font-weight: 400;
  text-transform: none;
}

.cards-box {
  position: relative;
  width: min(1120px, 96vw);
  max-height: min(92dvh, 920px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
}
.cards-modal-shell { padding: 0; }
.cards-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(10, 10, 16, .7);
}
.cards-cover {
  width: 40px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 216, 107, .3);
  flex: 0 0 auto;
  background: #111;
}
.cards-head-copy { flex: 1; min-width: 0; }
.cards-head-copy h2 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cards-head-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .4px;
}
.cards-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 0 0 auto;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.cards-filter {
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .25);
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: .5px;
  cursor: pointer;
}
.cards-filter:hover { color: #ddd; border-color: rgba(255, 255, 255, .25); }
.cards-filter.active {
  color: var(--gold);
  border-color: rgba(255, 216, 107, .5);
  background: rgba(255, 216, 107, .12);
}
.cards-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 14px;
  padding: 12px 14px 14px;
}
.cards-grid {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
  padding-right: 4px;
}
.card-tile {
  position: relative;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  overflow: hidden;
  background: #15151c;
  cursor: pointer;
  aspect-ratio: 2 / 2.9;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.card-tile img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-tile:hover {
  border-color: rgba(255, 216, 107, .55);
  box-shadow: 0 0 0 1px rgba(255, 216, 107, .18), 0 0 14px rgba(255, 216, 107, .12);
}
.card-tile.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(255, 216, 107, .4), 0 0 16px rgba(255, 216, 107, .18);
}
.card-tile-cost {
  position: absolute;
  top: 3px;
  left: 3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff0b0, var(--gold), #b78b1f);
  color: #221a06;
  font-size: 9px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.card-tile-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 4px 3px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .9));
  color: #fff;
  font-size: 6px;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cards-preview {
  border-left: 1px solid rgba(255, 255, 255, .08);
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: zoom-in;
  min-height: 0;
}
.cards-preview img {
  width: 100%;
  max-width: 230px;
  max-height: 52dvh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid rgba(255, 216, 107, .25);
  background-color: #111;
  background-size: cover;
  background-position: center;
}
.cards-preview-copy { text-align: center; max-width: 230px; }
.cards-preview-copy b {
  display: block;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: .5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cards-preview-copy span { display: block; color: var(--muted); font-size: 8px; margin-top: 2px; }
.cards-preview-copy small { display: block; color: rgba(255, 255, 255, .38); font-size: 7px; margin-top: 4px; }

.card-zoom {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(4, 4, 8, .96);
}
.card-zoom-close { position: absolute; top: 10px; right: 10px; }
.card-zoom img {
  max-width: min(360px, 80vw);
  max-height: 64dvh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid rgba(255, 216, 107, .35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .65);
  background-color: #111;
  background-size: cover;
  background-position: center;
}
.card-zoom-info { text-align: center; }
.card-zoom-info b { display: block; color: var(--gold); font-size: 15px; letter-spacing: .5px; }
.card-zoom-info span { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.card-zoom-nav { display: flex; align-items: center; gap: 14px; }
.card-zoom-nav #card-counter { color: var(--muted); font-size: 9px; letter-spacing: .5px; min-width: 54px; text-align: center; }

@media (max-width: 980px) {
  .cards-layout { grid-template-columns: 1fr; }
  .cards-preview { display: none; }
  .cards-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .cards-box {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .cards-head { padding: 10px; }
  .cards-cover { width: 34px; height: 48px; }
  .cards-head-copy h2 { font-size: 13px; }
  .cards-head-copy p { font-size: 7.5px; }
  .cards-filters { padding: 7px 10px; gap: 4px; }
  .cards-filter { padding: 5px 6px; font-size: 7px; }
  .cards-layout { padding: 8px 10px 10px; }
  .cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .card-tile { border-radius: 6px; }
  .card-tile-name { font-size: 5.5px; }
  .card-zoom img { max-width: 86vw; max-height: 60dvh; }
  .card-zoom-info b { font-size: 13px; }
}
