/* =========================
   Global Card Styles
   ========================= */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  box-shadow: 0 6px 15px rgba(0,0,0,0.35);
  color: var(--color-text);
  min-height: 320px;
  overflow: hidden;
  padding: 10px;
  position: relative;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}

.card:hover {
  transform: scale(1.04);
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
  z-index: 2;
}

.card.selectable { cursor: pointer; }

/* Selected = accent outline */
.card.selected {
  outline: 3px solid var(--color-accent);
  outline-offset: 0;
  box-shadow: 0 0 0 2px rgba(208,40,40,0.35), 0 8px 22px rgba(0,0,0,0.45);
}

/* Card: Rarity Effects (neutralized to fit brand; accent tints only) */
.card.rarity-common {
  background-image: linear-gradient(145deg, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border-color: var(--color-border);
  border: 3px solid #8c8c8c;
  box-shadow: 0 0 8px rgba(140,140,140,0.6);
}

.card.rarity-rare {
  background-image: linear-gradient(145deg, rgba(208,40,40,0.06), rgba(255,255,255,0));
  border-color: rgba(208,40,40,0.45);
  border: 3px solid #007bff;
  box-shadow: 0 0 10px rgba(0,123,255,0.65);
}

.card.rarity-epic {
  background-image: linear-gradient(145deg, rgba(208,40,40,0.10), rgba(255,255,255,0));
  border-color: rgba(208,40,40,0.6);
  border: 3px solid #8e44ad;
  box-shadow: 0 0 12px rgba(142,68,173,0.7);
}

.card.rarity-legendary {
  background-image: linear-gradient(145deg, rgba(208,40,40,0.16), rgba(255,255,255,0));
  border-color: rgba(208,40,40,0.85);
  border: 3px solid #f39c12;
  box-shadow: 0 0 14px rgba(243,156,18,0.75);
}

/* Card: Layout */
.card .card-body {
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.card .card-top {
  align-items: center;
  display: flex;
  height: 3.6rem;
  justify-content: center;
  margin-bottom: 6px;
  padding: 0 8px;
  text-align: center;
}

.card .card-title {
  font-size: 1.2rem;
  color: var(--color-text);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  max-width: 100%;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  white-space: normal;
  word-break: break-word;

  /* 2-line clamp */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card .card-meta {
  align-items: center;
  column-gap: 10px;
  display: grid;
  grid-template-columns: 40px 1fr;
  height: 36px;
  margin-bottom: 8px;
  padding: 0 8px;
  width: 100%;
  color: var(--color-text-muted);
}

.card .flag {
  display: block;
  height: 24px;
  width: 40px;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.card .team-name {
  font-size: 1.05rem;
  color: var(--color-text);
  font-style: italic;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  white-space: nowrap;
}

/* =========================
   Stats List
   ========================= */
.card .stats-list {
  padding: 0;
  list-style: none;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 0;
  text-align: left;
  align-items: flex-start;

  /* Fill remaining space; scroll internally if too long */
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: none;
}
.card .stats-list li {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(240,240,240,0.92);
}
.card .stats-list li span { font-weight: 700; }

/* =========================
   Responsive Tweaks
   ========================= */
@media (max-width: 768px) {
  .card { margin-bottom: 15px; height: auto; }
}
@media (max-width: 576px) {
  .card .card-top { height: 4.2rem; }
  .card .card-meta { height: 40px; }
}