:root {
  --bg-dark: #0d0d1a;
  --bg-card-inner: #1a1a2e;
  --accent-purple: #4a1942;
  --accent-gold: #d4af37;
  --text-primary: #f5e6d3;
  --text-muted: rgba(245, 230, 211, 0.4);
  --text-dim: rgba(245, 230, 211, 0.7);
}

a {
  text-decoration: none;
}

.box-card {
  /* max-width: 800px; */
  background-color: var(--bg-dark);
  border: 1px solid rgba(74, 25, 66, 0.5);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  font-family: system-ui, -apple-system, sans-serif;
}

.box-card:hover {
  border-color: var(--accent-gold);
}

.box-layout {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .box-layout {
    flex-direction: row;
  }
}

/* Image Styles */
.image-wrapper {
  position: relative;
  width: 100%;
  height: 12rem;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .image-wrapper {
    width: 12rem;
    height: auto;
  }
}


.character-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (min-width: 768px) {
  .character-img {
     object-fit: contain;
  }
}

.gradient-overlay-desktop {
  display: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 60%, var(--bg-dark));
}

@media (min-width: 768px) {
  .gradient-overlay-desktop {
    display: block;
  }
}

.gradient-overlay-mobile {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg-dark), transparent 60%);
}

@media (min-width: 768px) {
  .gradient-overlay-mobile {
    display: none;
  }
}

/* Content Styles */
.card-content {
  flex: 1;
  padding: 1.25rem;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.box-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.box-sub {
  color: var(--accent-gold);
  font-size: 0.875rem;
  margin: 0;
}

.origin-text {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Badges & Buttons */
.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.625rem;
  border-radius: 0.375rem;
}

.badge-gold {
  background-color: var(--accent-gold);
  color: #1a1a2e;
}

.expand-btn {
  background: none;
  border: none;
  color: var(--accent-gold);
  cursor: pointer;
  transition: color 0.2s;
}

.expand-btn:hover {
  color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {  
  container-type: inline-size; 
  margin-bottom: 1rem;
  width: 100%;
}

.stats-grid-row {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 0.25rem;  
  margin-bottom: 0.25rem;

  /* ALL text in ALL rows will now use this master size */
  /* Min: 0.65rem, Preferred: 2.2% of table width, Max: 1rem */
  font-size: clamp(0.5rem, 2.2cqw, 1rem);
}

.stats-grid a{
  border: 1px solid;
  border-color: var(--bg-card-inner);
  border-radius: 0.5rem;
  background-color: var(--bg-card-inner);
}
.stats-grid a:hover{
  border: 1px solid;
  border-color: var(--accent-gold);
  border-radius: 0.5rem;
  background-color: var(--accent-purple);
}

.stat-box {
  text-align: center;
  /* padding: 0.5rem; */  
  border-radius: 0.5rem;
}

.stat-val {
  font-size: 1.125em;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap; /* Prevents price from wrapping to two lines */
}


.stat-label {
  font-size: 0.75em;
  color: var(--text-muted);
  margin: 0;
}
.stat-price {
  font-size: 0.75em;
  color: var(--text-muted);
  margin: 0;
}
/* Ability Tags */
.abilities-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ability-tag {
  font-size: 0.75rem;
  padding: 0.125rem 0.625rem;
  border-radius: 0.375rem;
  border: 1px solid var(--accent-purple);
  color: var(--text-dim);
  font-weight: 600;
}

/* Icon Colors */
.icon { margin-bottom: 0.25rem; }
.icon-red { color: #f87171; }
.icon-blue { color: #60a5fa; }
.icon-pink { color: #f472b6; }
.icon-purple { color: #c084fc; }
.icon-yellow { color: #facc15; }